x86/Kconfig: Allow CONFIG_X86_MPPARSE disable for OF platforms
Subsystems (3)
PATCH 2/2 Drivers: hv: Kconfig: Add HYPERV_VTL_MODE dependencies
In reply to Saurabh SengarMTRRs are not per-VTL and are controlled by VTL0, make sure it is disabled for all other VTLs.
X86_MPPARSE scans low memory for MP tables, which is not required for Hyper-V VTL platforms.
--- drivers/hv/Kconfig | 2 ++ 1 file changed, 2 insertions(+)
drivers/hv/Kconfig +2 -0
@@ -16,6 +16,8 @@ config HYPERV config HYPERV_VTL_MODE bool "Enable Linux to boot in VTL context" depends on X86_64 && HYPERV + depends on !MTRR + depends on !X86_MPPARSE default n help Virtual Secure Mode (VSM) is a set of hypervisor capabilities and
Signature · 1 line
2.34.1
PATCH 1/2 x86/Kconfig: Allow CONFIG_X86_MPPARSE disable for OF platforms
X86_MPPARSE is only selectable when ACPI is enabled. However, on Devicetree platforms where ACPI is disabled, it is always enabled. Allow X86_MPPARSE to be selected by OF platforms as well.
--- arch/x86/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/Kconfig +1 -1
@@ -469,7 +469,7 @@ config X86_X2APIC If you don't know what to do here, say N. config X86_MPPARSE - bool "Enable MPS table" if ACPI + bool "Enable MPS table" if ACPI || OF default y depends on X86_LOCAL_APIC help
Signature · 1 line
2.34.1
From: Saurabh Sengar <[email protected]> Sent: Thursday, May 11, 2023 7:55 AM
Quoted 25 lines
X86_MPPARSEis only selectable when ACPI is enabled. However, on Devicetree platforms where ACPI is disabled, it is always enabled. AllowX86_MPPARSEto be selected by OF platforms as well.Signed-off-by Saurabh Sengar <[email protected]>--- arch/x86/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/Kconfig +1
-2@@ -469,7 +469,7 @@ config X86_X2APIC If you don't know what to do here, say N. config X86_MPPARSE - bool "Enable MPS table" if ACPI + bool "Enable MPS table" if ACPI || OF default y depends on X86_LOCAL_APIC help --
Quoted 1 line
2.34.1
RE: [PATCH 2/2] Drivers: hv: Kconfig: Add HYPERV_VTL_MODE dependencies
In reply to Saurabh SengarFrom: Saurabh Sengar <[email protected]>
Quoted 3 lines
MTRRs are not per-VTL and are controlled by VTL0, make sure it is disabled for all other VTLs.
Clarifying the wording a bit:
MTRRs are not per-VTL, but are always controlled by VTL0. Allow
building for VTLs other than VTL0 only when MTRR functionality is disabled.
Quoted 3 lines
X86_MPPARSEscans low memory for MP tables, which is not required for Hyper-V VTL platforms.
Is the above statement saying that MP tables aren't required, so remove the code to save space? Or is there a problem/failure if MP table code
runs and scans low memory? *Requiring* that it be disabled, and the
reference to scanning low memory makes me think it might be the latter, in which case I'd suggest this more forceful wording:
The MP table code scans low memory, which causes failures in VTLs
other than VTL0. Allow building for VTLs other than VTL0 only when
MP table functionality is disabled.
If you can give slightly more detail about "causes failures" (a panic? some other problem?) that would be good too.
Michael
Quoted 21 lines
Signed-off-by Saurabh Sengar <[email protected]>--- drivers/hv/Kconfig | 2 ++ 1 file changed, 2 insertions(+)drivers/hv/Kconfig +2
-1@@ -16,6 +16,8 @@ config HYPERV config HYPERV_VTL_MODE bool "Enable Linux to boot in VTL context" depends on X86_64 && HYPERV + depends on !MTRR + depends on !X86_MPPARSE default n help Virtual Secure Mode (VSM) is a set of hypervisor capabilities and --2.34.1
Quoted 4 lines · Saurabh Sengar
X86_MPPARSEis only selectable when ACPI is enabled. However, on Devicetree platforms where ACPI is disabled, it is always enabled. AllowX86_MPPARSEto be selected by OF platforms as well.
I'm finding this changelog really hard to read.
In Kconfig, you can "select FOO". But in this changelog, it means something different. I think "selectable" here means that there's a user prompt for the option.
Could you please rephrase this to be less confusing?
This is also one of those patches where I wonder: Why do _you_ care about this? Are you just trying to be nice? Is this intended as some kind of cleanup?
RE: [PATCH 2/2] Drivers: hv: Kconfig: Add HYPERV_VTL_MODE dependencies
In reply to Michael Kelley (LINUX)Quoted 17 lines
-----Original Message-----
From: Michael Kelley (LINUX) <[email protected]>
Sent: Saturday, May 20, 2023 10:20 PM
To: Saurabh Sengar <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; [email protected]; Dexuan Cui <[email protected]>; [email protected]; linux- [email protected]
Cc: Saurabh Singh Sengar <[email protected]>
Subject: [EXTERNAL] RE: [PATCH 2/2] Drivers: hv:Kconfig: AddHYPERV_VTL_MODEdependenciesFrom: Saurabh Sengar <[email protected]>
Quoted 1 line
Quoted 7 lines
Quoted 2 lines
MTRRs are not per-VTL and are controlled by VTL0, make sure it is disabled for all other VTLs.
Clarifying the wording a bit:
MTRRs are not per-VTL, but are always controlled by VTL0. Allow
building for VTLs other than VTL0 only when MTRR functionality is disabled.
Ok
Quoted 11 lines
Quoted 4 lines
X86_MPPARSEscans low memory for MP tables, which is not required for Hyper-V VTL platforms.Is the above statement saying that MP tables aren't required, so remove the code to save space? Or is there a problem/failure if MP table code
runs and scans low memory? *Requiring* that it be disabled, and the
reference to scanning low memory makes me think it might be the latter, in which case I'd suggest this more forceful wording:
Quoted 3 lines
The MP table code scans low memory, which causes failures in VTLs
other than VTL0. Allow building for VTLs other than VTL0 only when
MP table functionality is disabled.
Ok
Quoted 3 lines
If you can give slightly more detail about "causes failures" (a panic? some other problem?) that would be good too.
When CONFIG_X86_MPPARSE is enabled, the kernel will scan low memory, looking for MP tables. In Hyper-V VBS setup, lower memory is assigned to VTL0. This lower memory may contain the actual MPPARSE table for VTL0, which can confuse the VTLx kernel and cause issues. (x > 0)
Quoted 24 lines
Michael
Quoted 21 lines
Signed-off-by Saurabh Sengar <[email protected]>--- drivers/hv/Kconfig | 2 ++ 1 file changed, 2 insertions(+)drivers/hv/Kconfig index renamed from drivers/hv/Kconfig +0
-0
00242107d62e..c8d443886b9d100644drivers/hv/Kconfig +2
-1@@ -16,6 +16,8 @@ config HYPERV config HYPERV_VTL_MODE bool "Enable Linux to boot in VTL context" depends on X86_64 && HYPERV + depends on !MTRR + depends on !X86_MPPARSE default n help Virtual Secure Mode (VSM) is a set of hypervisor capabilities and --2.34.1
Quoted 20 lines
-----Original Message-----
From: Dave Hansen <[email protected]>
Sent: Tuesday, May 23, 2023 11:23 PM
To: Saurabh Sengar <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; [email protected]; Dexuan Cui <[email protected]>; Michael Kelley (LINUX) <[email protected]>; [email protected]; [email protected]
Cc: Saurabh Singh Sengar <[email protected]>
Subject: [EXTERNAL] Re: [PATCH 1/2] x86/Kconfig: AllowCONFIG_X86_MPPARSEdisable for OF platformsQuoted 3 lines · Saurabh Sengar
X86_MPPARSEis only selectable when ACPI is enabled. However, on Devicetree platforms where ACPI is disabled, it is always enabled. AllowX86_MPPARSEto be selected by OF platforms as well.
Quoted 7 lines
I'm finding this changelog really hard to read.
In
Kconfig, you can "select FOO". But in this changelog, it means something different. I think "selectable" here means that there's a user prompt for the option.Could you please rephrase this to be less confusing?
Thanks for your review. Currently, in the absence of ACPI, it is impossible to disable X86_MPPARSE. In the case of ACPI being enabled, one has the option to either enable or disable X86_MPARSE. My intention is to permit X86_MPPARSE=n for OF platforms where ACPI=n. To describe the capability of choosing any desired value for MPPARSE, I used the term 'selectable.' Perhaps 'configurable' would be a more appropriate word in this context? I can fix this and include it in V2.
Quoted 3 lines
This is also one of those patches where I wonder: Why do _you_ care about this? Are you just trying to be nice? Is this intended as some kind of cleanup?
It solves an issue for Hyper-V VBS setup, please refer to the 2/2 of this patch series.
Regards,
Saurabh
Quoted 9 lines · Saurabh Singh Sengar
Quoted 1 line
Could you please rephrase this to be less confusing?
Thanks for your review. Currently, in the absence of ACPI, it is impossible to disable
X86_MPPARSE. In the case of ACPI being enabled, one has the option to either enable or disableX86_MPARSE. My intention is to permit X86_MPPARSE=n for OF platforms where ACPI=n. To describe the capability of choosing any desired value for MPPARSE, I used the term 'selectable.' Perhaps 'configurable' would be a more appropriate word in this context? I can fix this and include it in V2.
OK, so this particular Hyper-V setup doesn't run normal normal distro kernels? It requires a very specialized kernel? Or it's just _better_ that the kernel is configured this way?
Quoted 5 lines
Quoted 2 lines
This is also one of those patches where I wonder: Why do _you_ care about this? Are you just trying to be nice? Is this intended as some kind of cleanup?
It solves an issue for Hyper-V VBS setup, please refer to the 2/2 of this patch series.
Heh, that changelog is even more confusing than _this_ one. It doesn't say that there's a problem, only that it removes "not required" code.
I'm still confused by this whole thing.
Quoted 23 lines
-----Original Message-----
From: Dave Hansen <[email protected]>
Sent: Wednesday, May 24, 2023 11:33 PM
To: Saurabh Singh Sengar <[email protected]>; Saurabh Sengar <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; [email protected]; Dexuan Cui <[email protected]>; Michael Kelley (LINUX) <[email protected]>; [email protected]; [email protected]
Subject: Re: [EXTERNAL] Re: [PATCH 1/2] x86/Kconfig: AllowCONFIG_X86_MPPARSEdisable for OF platformsQuoted 7 lines · Saurabh Singh Sengar
Quoted 1 line
Could you please rephrase this to be less confusing?
Thanks for your review. Currently, in the absence of ACPI, it is impossible to disable
X86_MPPARSE. In the case of ACPI being enabled, one has the option to either enable or disableX86_MPARSE. My intention is to permit X86_MPPARSE=n for OF platforms where ACPI=n. To describe the capability of choosing any desired value for MPPARSE, I used
Quoted 7 lines
the term 'selectable.'
Quoted 2 lines
Perhaps 'configurable' would be a more appropriate word in this context? I can fix this and include it in V2.
OK, so this particular Hyper-V setup doesn't run normal normal distro kernels? It requires a very specialized kernel? Or it's just _better_ that the kernel is configured this way?
This is a system where we provide isolation through VTL. More information
About VTL is here: https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/tlfs/vsm#virtual-trust-level-vtl
In the context of VTL0, the system runs the normal kernel. However, for higher VTLs, we enable the kernel with HYPERV_VTL_MODE. It's important to note that the lower memory of the system is not included in the higher VTLs
It runs the normal kernel as part of VTL0 but for higher VTLs we run the kernel with HYPERV_VTL_MODE enable. VTL0 is assigned to lower memory of system, the lower memory not part of higher VTLs. However, MPARSE option disregard this and try to scan VTL0 memory which causes issue. This will enable any system which doesn't want lower memory to be scanned for MPPARSE for whatever reason.
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
This is also one of those patches where I wonder: Why do _you_ care about this? Are you just trying to be nice? Is this intended as some kind of
cleanup?
Quoted 1 line
Quoted 7 lines
Quoted 2 lines
It solves an issue for Hyper-V VBS setup, please refer to the 2/2 of this patch series.
Heh, that changelog is even more confusing than _this_ one. It doesn't say that there's a problem, only that it removes "not required" code.
I'm still confused by this whole thing.
I agree the commit message could be better. And I commented below in that thread to clarify. Hope it clarifies, please let me know if any more information is required:
When CONFIG_X86_MPPARSE is enabled, the kernel will scan low memory, looking for MP tables. In Hyper-V VBS setup, lower memory is assigned to VTL0. This lower memory may contain the actual MPPARSE table for VTL0, which can confuse the VTLx kernel and cause issues. (x > 0)
Quoted 4 lines · Saurabh Singh Sengar
When
CONFIG_X86_MPPARSEis enabled, the kernel will scan low memory, looking for MP tables. In Hyper-V VBS setup, lower memory is assigned to VTL0. This lower memory may contain the actual MPPARSE table for VTL0, which can confuse the VTLx kernel and cause issues. (x > 0)
This still just seems wrong.
If an action crashes the kernel because of changes, we don't just compile it out and move on. We add enumeration for the new feature that's causing it and turn off the action at runtime.
Quoted 19 lines
-----Original Message-----
From: Dave Hansen <[email protected]>
Sent: Thursday, May 25, 2023 7:26 PM
To: Saurabh Singh Sengar <[email protected]>; Saurabh Sengar <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; [email protected]; Dexuan Cui <[email protected]>; Michael Kelley (LINUX) <[email protected]>; [email protected]; [email protected]
Subject: Re: [EXTERNAL] Re: [PATCH 1/2] x86/Kconfig: AllowCONFIG_X86_MPPARSEdisable for OF platformsQuoted 2 lines · Saurabh Singh Sengar
When
CONFIG_X86_MPPARSEis enabled, the kernel will scan low memory, looking for MP tables. In Hyper-V VBS setup, lower memory is assigned toVTL0.
Quoted 9 lines
Quoted 2 lines
This lower memory may contain the actual MPPARSE table for VTL0, which can confuse the VTLx kernel and cause issues. (x > 0)
This still just seems wrong.
If an action crashes the kernel because of changes, we don't just compile it out and move on. We add enumeration for the new feature that's causing it and turn off the action at runtime.
Thanks, I greatly appreciate your suggestion and wanted to let you know that I am actively working on upstreaming the new fix for the VTL driver to bypass the need for the MP table scan.
Furthermore, I would like to learn about the rationale behind disallowing the disablement of CONFIG_X86_MPPARSE when MP tables are not in use. Considering that we compile out the features we don't support, wouldn't it be acceptable to allow users to customize their configurations in this manner? Allowing the disablement of CONFIG_X86_MPPARSE would provide greater flexibility and efficiency for those who do not utilize MP tables.
Quoted 6 lines · Saurabh Singh Sengar
Furthermore, I would like to learn about the rationale behind disallowing the disablement of
CONFIG_X86_MPPARSEwhen MP tables are not in use. Considering that we compile out the features we don't support, wouldn't it be acceptable to allow users to customize their configurations in this manner? Allowing the disablement ofCONFIG_X86_MPPARSEwould provide greater flexibility and efficiency for those who do not utilize MP tables.
If someone sent a patch, I'd certainly look and figure out what "flexibility" and "efficiency" it would provide. But, honestly, it would just just be noise if it doesn't solve an _actual_ problem.
Would anyone care or notice the "flexibility" and "efficiency" it would provide?
Quoted 22 lines
-----Original Message-----
From: Dave Hansen <[email protected]>
Sent: Friday, June 2, 2023 7:54 PM
To: Saurabh Singh Sengar <[email protected]>; Saurabh Sengar <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; [email protected]; Dexuan Cui <[email protected]>; Michael Kelley (LINUX) <[email protected]>; [email protected]; [email protected]
Subject: [EXTERNAL] Re: [PATCH 1/2] x86/Kconfig: AllowCONFIG_X86_MPPARSEdisable for OF platformsQuoted 6 lines · Saurabh Singh Sengar
Furthermore, I would like to learn about the rationale behind disallowing the disablement of
CONFIG_X86_MPPARSEwhen MP tables are not in use. Considering that we compile out the features we don't support, wouldn't it be acceptable to allow users to customize their configurations in this manner? Allowing the disablement ofCONFIG_X86_MPPARSEwould provide greater flexibility and efficiency for
Quoted 8 lines
those who do not utilize MP tables.
If someone sent a patch, I'd certainly look and figure out what "flexibility" and "efficiency" it would provide. But, honestly, it would just just be noise if it doesn't solve an _actual_ problem.
Would anyone care or notice the "flexibility" and "efficiency" it would provide?
After the new approach we have opted, I agree it's not blocking us from any functional problem. Although one of the things we are trying to achieve is the minimal kernel where we want to remove all the unnecessary options. Our system is not dependent MPPARSE and we just don't want this code in our minimal kernel, and this config option is preventing us from removing it.
Also, in past kernel has provided this flexibility for other options, which made me think it is fine do it for OF as well.
https://lkml.indiana.edu/hypermail/linux/kernel/1210.3/01987.html
Happy to know your opinion and learn.