[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/hvm: Add Kconfig option to disable nested virtualization


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • Date: Mon, 16 Feb 2026 12:28:49 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xG06cDwLBlADx0I4RZreAJkO9JY3Quht6dCqz6LPxF0=; b=WIjrpvI4rxFO/5LTVeXYRYDgoWV1vK62ilffQd5eQNaO/X86CVHMlq1v4UQ3kAA86xIzCqumvhKN22PUQV2smQtTRT96dYrOYzv3xIlYctKCawtkc3IGn8Xc4CHL06+r36uVumw7bqojwoLhd6bB0MEmVgPgm9+AvDyQiut0Sllyj9RPFxsekTzr9qnCAkIJizcspdWRQVhyCV8YebquHD7CiLZ6mDwOEeAa+pvtaJ7MKEJMHMtxT5+eGJelOuHO5vEx7UxSWEXDhB46+IiqdMbzHH7suUKrV2EVRdGxXtBpcD3o0BbQMZX4eQ5ubHVyjA6JeheOclN9YnWipUGbig==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=X/zUOt7jqVkG07Ucst04BU58N9suBc24Xu3FVoDp17BHsOGFSezr5JE3AyapWpzOrYX7V5ujIU8Bfn2XrgDlNOMS9B13Vo/v5ghtljuPi1tIj9BAv8l+OEPx72q19EQ/wKJuEsvEe76IeNwAxsJJ7Wzi9eMslLdPbgl+qAFQOgZYvFwFxFbmmvD6iPKTej98AFzwRmSw0axNVEpkqMYmD5tzRp7fXUjHWqtTuJ3D9zUm50RGRdYUMkbZOiz1M6kke2FX2W9o9pFsbLR3h20qKOshYrKLvGPrsTv9US5xdenS3wm6q9yHfVO677xcIhr8nZBYcoQ3XMQee+ylujQn1g==
  • Cc: <roger.pau@xxxxxxxxxx>, <andrew.cooper3@xxxxxxxxxx>, <jason.andryuk@xxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 16 Feb 2026 11:29:06 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon Feb 16, 2026 at 12:01 PM CET, Jan Beulich wrote:
>>> --- a/xen/arch/x86/mm/hap/Makefile
>>> +++ b/xen/arch/x86/mm/hap/Makefile
>>> @@ -2,5 +2,6 @@ obj-y += hap.o
>>>  obj-y += guest_walk_2.o
>>>  obj-y += guest_walk_3.o
>>>  obj-y += guest_walk_4.o
>>> -obj-y += nested_hap.o
>>> -obj-$(CONFIG_INTEL_VMX) += nested_ept.o
>>> +nested-y := nested_hap.o
>>> +nested-$(CONFIG_INTEL_VMX) += nested_ept.o
>>> +obj-$(CONFIG_NESTED_VIRT) += $(nested-y)
>> 
>> Why not use plain filter?
>> 
>>      -obj-y += nested_hap.o
>>      +obj-$(CONFIG_NESTED_VIRT) += nested_hap.o
>>      -obj-$(CONFIG_INTEL_VMX) += nested_ept.o
>>      +obj-$(filter $(CONFIG_NESTED_VIRT),$(CONFIG_INTEL_VMX)) += nested_ept.o
>
> It may have been like this in v1. Problem being that this leads to long lines,
> which doesn't scale very well (and is - imo - harder to read). Especially when
> you consider what happens when it's more than two settings that need checking.
> The list approach easily scales to about anything (by using as many separate
> lists as you need).
>
> Jan

I'd agree should we need more than 2 settings, long config parameter names
or long filenames, but none of that applies here. It fits neatly in within 80
columns and the extra indirection bumps the cognitive load (subjectively
speaking) way more than the single line does. Plus, it takes more vertical
space.

Even then, I'd rather have ifeq on the 3rd and/or 4th parameters and filter
inside, which makes the group stand out much better and doesn't pollute the
global namespace with even more names.

And there's the matter of "filter" being in use very prevalently elsewhere.

My .02, anyway. They are functionally equivalent, after all.

Cheers,
Alejandro



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.