x86/speculation/l1tf: Add KConfig for setting the L1D cache flush mode
Subsystems (4)
PATCH v5 1/1 x86/speculation/l1tf: Add KConfig for setting the L1D cache flush mode
This change adds a new kernel configuration that sets the l1d cache flush setting at compile time rather than at run time.
The reasons for this change are as follows -
- Kernel command line arguments are getting unwieldy. These parameters are not a scalable way to set the kernel config. They're intended as a super limited way for the bootloader to pass info to the kernel and also as a way for end users who are not compiling the kernel themselves to tweak the kernel behavior.
- Also, if a user wants this setting from the start. It's a definite smell that it deserves to be a compile time thing rather than adding extra code plus whatever miniscule time at runtime to pass an extra argument.
- Finally, it doesn't preclude the runtime / kernel command line way. Users are free to use those as well.
---
Changes in v5:
- Fix indentation of the help text in the KConfig.
Changes in v4:
- Add motivation for the change in the commit message.
Changes in v3:
- Change depends on to only x86_64.
- Remove copy paste errors at the end of the KConfig.
Changes in v2:
- Fix typo in the help of the new KConfig.
arch/x86/kernel/cpu/bugs.c | 8 ++++++++ arch/x86/kvm/Kconfig | 13 +++++++++++++ 2 files changed, 21 insertions(+)
arch/x86/kernel/cpu/bugs.c +8 -0
@@ -1406,7 +1406,15 @@ enum l1tf_mitigations l1tf_mitigation __ro_after_init = L1TF_MITIGATION_FLUSH;#if IS_ENABLED (CONFIG_KVM_INTEL )EXPORT_SYMBOL_GPL (l1tf_mitigation);#endif +#if (CONFIG_KVM_VMENTRY_L1D_FLUSH ==1 ) +enum vmx_l1d_flush_state l1tf_vmx_mitigation =VMENTER_L1D_FLUSH_NEVER ; +#elif (CONFIG_KVM_VMENTRY_L1D_FLUSH ==2 ) +enum vmx_l1d_flush_state l1tf_vmx_mitigation =VMENTER_L1D_FLUSH_COND ; +#elif (CONFIG_KVM_VMENTRY_L1D_FLUSH ==3 ) +enum vmx_l1d_flush_state l1tf_vmx_mitigation =VMENTER_L1D_FLUSH_ALWAYS ; +#else enum vmx_l1d_flush_state l1tf_vmx_mitigation =VMENTER_L1D_FLUSH_AUTO ; +#endif EXPORT_SYMBOL_GPL (l1tf_vmx_mitigation);/*
arch/x86/kvm/Kconfig +13 -0
@@ -107,4 +107,17 @@ config KVM_MMU_AUDIT This option adds a R/W kVM module parameter 'mmu_audit', which allows auditing of KVM MMU events at runtime. +config KVM_VMENTRY_L1D_FLUSH + int "L1D cache flush settings (1-3)" + range 1 3 + default "2" + depends on KVM && X86_64 + help + This setting determines the L1D cache flush behavior before a VMENTER. + This is similar to setting the option / parameter to + kvm-intel.vmentry_l1d_flush. + 1 - Never flush. + 2 - Conditionally flush. + 3 - Always flush. + endif # VIRTUALIZATION
Signature · 1 line
2.27.0.383.g050319c2ae-goog
Quoted 11 lines · Abhishek Bhardwaj
This change adds a new kernel configuration that sets the l1d cache flush setting at compile time rather than at run time.
The reasons for this change are as follows -
- Kernel command line arguments are getting unwieldy. These parameters are not a scalable way to set the kernel config. They're intended as a super limited way for the bootloader to pass info to the kernel and also as a way for end users who are not compiling the kernel themselves to tweak the kernel behavior.
Quoted 7 lines
- Also, if a user wants this setting from the start. It's a definite smell that it deserves to be a compile time thing rather than adding extra code plus whatever miniscule time at runtime to pass an extra argument.
- Finally, it doesn't preclude the runtime / kernel command line way. Users are free to use those as well.
TBH, I don't see why this is a good idea.
1) I'm not following your argumentation that the command line option is a poor Kconfig replacement. The L1TF mode is a boot time (module load time) decision and the command line parameter is there to override the carefully chosen and sensible default behaviour.
2) You can add the desired mode to the compiled in (partial) kernel command line today.
3) Boot loaders are well capable of handling large kernel command lines and the extra time spend for reading the parameter does not matter at all.
4) It's just a tiny part of the whole speculation maze. If we go there for L1TF then we open the flood gates for a gazillion other config options.
5) It's completely useless for distro kernels.
6) The implementation is horrible. We have proper choice selectors which allow to add parseable information instead of random numbers and a help text.
Sorry, you need to find better arguments than 'unwieldy and smell' to make this palatable.
Thanks,
tglx
Hi,
Quoted 21 lines · Thomas Gleixner
Quoted 11 lines · Abhishek Bhardwaj
This change adds a new kernel configuration that sets the l1d cache flush setting at compile time rather than at run time.
The reasons for this change are as follows -
- Kernel command line arguments are getting unwieldy. These parameters are not a scalable way to set the kernel config. They're intended as a super limited way for the bootloader to pass info to the kernel and also as a way for end users who are not compiling the kernel themselves to tweak the kernel behavior.
Quoted 7 lines
- Also, if a user wants this setting from the start. It's a definite smell that it deserves to be a compile time thing rather than adding extra code plus whatever miniscule time at runtime to pass an extra argument.
- Finally, it doesn't preclude the runtime / kernel command line way. Users are free to use those as well.
Quoted 6 lines
TBH, I don't see why this is a good idea.
1) I'm not following your argumentation that the command line option is a poor
Kconfigreplacement. The L1TF mode is a boot time (module load time) decision and the command line parameter is there to override the carefully chosen and sensible default behaviour.
When you say that the default behavior is carefully chosen and sensible, are you saying that (in your opinion) there would never be a good reason for someone distributing a kernel to others to change the default? Certainly I agree that having the kernel command line parameter is nice to allow someone to override whatever the person building the kernel chose, but IMO it's not a good way to change the default built-in to the kernel.
The current plan (as I understand it) is that we'd like to ship Chromebook kernels with this option changed from the default that's there now. In your opinion, is that a sane thing to do?
Quoted 2 lines
2) You can add the desired mode to the compiled in (partial) kernel command line today.
This might be easier on x86 than it is on ARM. ARM (and ARM64) kernels only have two modes: kernel provides cmdline and bootloader provides cmdline. There are out-of-mainline ANDROID patches to address this but nothing in mainline.
The patch we're discussing now is x86-only so it's not such a huge deal, but the fact that combining the kernel and bootloader commandline never landed in mainline for arm/arm64 means that this isn't a super common/expected thing to do.
Quoted 3 lines
3) Boot loaders are well capable of handling large kernel command lines and the extra time spend for reading the parameter does not matter at all.
Long command lines can still be a bit of a chore for humans to deal with. Many times I've needed to look at "/proc/cmdline" and make sense of it. The longer the command line is and the more cruft stuffed into it the more of a chore it is. Yes, this is just one thing to put in the command line, but if 10 different drivers all have their "one thing" to put there it gets really long. If 100 different drivers all want their one config option there it gets really really long. IMO the command line should be a last resort place to put things and should just contain:
1. Legacy things that _have_ to be in the command line because they've always been there.
2. Things that the bootloader/BIOS needs to communicate to the kernel and has no better way to communicate.
3. Cases where the person running the kernel needs to override a default set by the person compiling the kernel.
Quoted 3 lines
4) It's just a tiny part of the whole speculation maze. If we go there for L1TF then we open the flood gates for a gazillion other config options.
It seems like the only options that we'd need CONFIG option for would be the ones where it would be sane to change the default compiled into the kernel. Hopefully that's not too many things?
Quoted 5 lines
5) It's completely useless for distro kernels.
6) The implementation is horrible. We have proper choice selectors which allow to add parseable information instead of random numbers and a help text.
If my other arguments make sense and Abhishek could just fix #6, would that work?
Obviously, like many design choices, the above is all subjective. It's really your call and if these arguments don't convince you it sounds like the way forward is just to use "CONFIG_CMDLINE" and take advantage of the fact that on x86 this will get merged with the bootloader's command line.
-Doug
Quoted 62 lines · Doug Anderson
Hi,
Quoted 21 lines · Thomas Gleixner
Quoted 11 lines · Abhishek Bhardwaj
This change adds a new kernel configuration that sets the l1d cache flush setting at compile time rather than at run time.
The reasons for this change are as follows -
- Kernel command line arguments are getting unwieldy. These parameters are not a scalable way to set the kernel config. They're intended as a super limited way for the bootloader to pass info to the kernel and also as a way for end users who are not compiling the kernel themselves to tweak the kernel behavior.
Quoted 7 lines
- Also, if a user wants this setting from the start. It's a definite smell that it deserves to be a compile time thing rather than adding extra code plus whatever miniscule time at runtime to pass an extra argument.
- Finally, it doesn't preclude the runtime / kernel command line way. Users are free to use those as well.
Quoted 6 lines
TBH, I don't see why this is a good idea.
1) I'm not following your argumentation that the command line option is a poor
Kconfigreplacement. The L1TF mode is a boot time (module load time) decision and the command line parameter is there to override the carefully chosen and sensible default behaviour.When you say that the default behavior is carefully chosen and sensible, are you saying that (in your opinion) there would never be a good reason for someone distributing a kernel to others to change the default? Certainly I agree that having the kernel command line parameter is nice to allow someone to override whatever the person building the kernel chose, but IMO it's not a good way to change the default built-in to the kernel.
The current plan (as I understand it) is that we'd like to ship Chromebook kernels with this option changed from the default that's there now. In your opinion, is that a sane thing to do?
Quoted 2 lines
2) You can add the desired mode to the compiled in (partial) kernel command line today.
This might be easier on x86 than it is on ARM. ARM (and ARM64) kernels only have two modes: kernel provides cmdline and bootloader provides cmdline. There are out-of-mainline ANDROID patches to address this but nothing in mainline.
The patch we're discussing now is x86-only so it's not such a huge deal, but the fact that combining the kernel and bootloader commandline never landed in mainline for arm/arm64 means that this isn't a super common/expected thing to do.
Quoted 3 lines
3) Boot loaders are well capable of handling large kernel command lines and the extra time spend for reading the parameter does not matter at all.
Quoted 9 lines
Long command lines can still be a bit of a chore for humans to deal with. Many times I've needed to look at "
/proc/cmdline" and make sense of it. The longer the command line is and the more cruft stuffed into it the more of a chore it is. Yes, this is just one thing to put in the command line, but if 10 different drivers all have their "one thing" to put there it gets really long. If 100 different drivers all want their one config option there it gets really really long. IMO the command line should be a last resort place to put things and should just contain:
This takes me back to my years doing android kernel work for Intel, I'm glad those are over. Yes, the android kernel command lines got hideous, I think we even had patches to make the cmdline buffer bigger than the default was.
From a practical point of view the command line was part of the boot image and cryptography protected so it was a handy way to securely communicate parameters from the platform to the kernel, drivers and even just user mode. It got pretty ugly but, it worked (mostly).
What I don't get is why pick on l1tf in isolation? There are a bunch of command line parameters similar to l1tf. Would a more general option make sense?
Anyway, I think there is a higher level issue you are poking at that might be better addressed by talking about it directly.
--mark
A message that is not in the archive (sent off-list or not yet received): CA+noqojC3z_o8+_Ek=17XxjVC+efoLHsUh08cbcTDrgxMcEGNQ@mail.gmail.com
Hi,
Quoted 82 lines · Abhishek Bhardwaj
Quoted 78 lines · mark gross
Quoted 62 lines · Doug Anderson
Hi,
Quoted 21 lines · Thomas Gleixner
Quoted 11 lines · Abhishek Bhardwaj
This change adds a new kernel configuration that sets the l1d cache flush setting at compile time rather than at run time.
The reasons for this change are as follows -
- Kernel command line arguments are getting unwieldy. These parameters are not a scalable way to set the kernel config. They're intended as a super limited way for the bootloader to pass info to the kernel and also as a way for end users who are not compiling the kernel themselves to tweak the kernel behavior.
Quoted 7 lines
- Also, if a user wants this setting from the start. It's a definite smell that it deserves to be a compile time thing rather than adding extra code plus whatever miniscule time at runtime to pass an extra argument.
- Finally, it doesn't preclude the runtime / kernel command line way. Users are free to use those as well.
Quoted 6 lines
TBH, I don't see why this is a good idea.
1) I'm not following your argumentation that the command line option is a poor
Kconfigreplacement. The L1TF mode is a boot time (module load time) decision and the command line parameter is there to override the carefully chosen and sensible default behaviour.When you say that the default behavior is carefully chosen and sensible, are you saying that (in your opinion) there would never be a good reason for someone distributing a kernel to others to change the default? Certainly I agree that having the kernel command line parameter is nice to allow someone to override whatever the person building the kernel chose, but IMO it's not a good way to change the default built-in to the kernel.
The current plan (as I understand it) is that we'd like to ship Chromebook kernels with this option changed from the default that's there now. In your opinion, is that a sane thing to do?
Quoted 2 lines
2) You can add the desired mode to the compiled in (partial) kernel command line today.
This might be easier on x86 than it is on ARM. ARM (and ARM64) kernels only have two modes: kernel provides cmdline and bootloader provides cmdline. There are out-of-mainline ANDROID patches to address this but nothing in mainline.
The patch we're discussing now is x86-only so it's not such a huge deal, but the fact that combining the kernel and bootloader commandline never landed in mainline for arm/arm64 means that this isn't a super common/expected thing to do.
Quoted 3 lines
3) Boot loaders are well capable of handling large kernel command lines and the extra time spend for reading the parameter does not matter at all.
Quoted 9 lines
Long command lines can still be a bit of a chore for humans to deal with. Many times I've needed to look at "
/proc/cmdline" and make sense of it. The longer the command line is and the more cruft stuffed into it the more of a chore it is. Yes, this is just one thing to put in the command line, but if 10 different drivers all have their "one thing" to put there it gets really long. If 100 different drivers all want their one config option there it gets really really long. IMO the command line should be a last resort place to put things and should just contain:This takes me back to my years doing android kernel work for Intel, I'm glad those are over. Yes, the android kernel command lines got hideous, I think we even had patches to make the cmdline buffer bigger than the default was.
Quoted 8 lines
Quoted 6 lines
From a practical point of view the command line was part of the boot image and cryptography protected so it was a handy way to securely communicate parameters from the platform to the kernel, drivers and even just user mode. It got pretty ugly but, it worked (mostly).
What I don't get is why pick on l1tf in isolation?
Because this is what we needed given the state of our projects.
Right. Basically the flow is:
1. Someone comes up with a tweak that they think some people might want to try out but it's not expected to be the default for anyone:
add a module parameter.
2. Someone comes around and says: I think it's sensible to change the default for a whole class of devices, but another class of devices can still use the old default: add a config option in addition to the kernel parameter.
If #2 never happens then it can stay a module parameter forever. If #2 happens that's fine--it doesn't really hurt to add a config option for it.
Quoted 8 lines
Quoted 3 lines
There are a bunch of
command line parameters similar to l1tf. Would a more general option make sense?Maybe. Given how much resistance this CONFIG has met, I can only imagine the resistance upon introducing a more reaching configuration. I also think there's a fine line between YAGNI (You Ain't Gonna Need It) vs planning for the future. I don't want to introduce a big CONFIG that won't be used for anything else. I'd rather we cross that bridge when someone else feels the same way about other options.
What are you envisioning? I guess the "generic" solution is to add cmdline extension (being able to combine kernel and bootloader cmdline) to all platforms in a somewhat uniform way without breaking any backward compatibility. You'd still end up with a really ugly "/proc/cmdline" if you had too many options there, but I guess it wouldn't be the end of the world.
Getting this done on all platforms doesn't seem like it'd be an easy task, though.
Quoted 17 lines
Quoted 2 lines
Anyway, I think there is a higher level issue you are poking at that might be better addressed by talking about it directly.
I am new to this process. I don't know who to "convince" or talk about these issues. Who is the final authority on this ?. I don't think appeasing every concern is going to be productive for anyone. I've offered to change the implementation, if that is what's required. However, if the final authority is against a CONFIG, I don't really know how to proceed.
Quoted 5 lines
--mark
--
Abhishek
Doug,
Quoted 8 lines · Doug Anderson
Quoted 6 lines · Thomas Gleixner
TBH, I don't see why this is a good idea.
1) I'm not following your argumentation that the command line option is a poor
Kconfigreplacement. The L1TF mode is a boot time (module load time) decision and the command line parameter is there to override the carefully chosen and sensible default behaviour.
Quoted 7 lines
When you say that the default behavior is carefully chosen and sensible, are you saying that (in your opinion) there would never be a good reason for someone distributing a kernel to others to change the default? Certainly I agree that having the kernel command line parameter is nice to allow someone to override whatever the person building the kernel chose, but IMO it's not a good way to change the default built-in to the kernel.
The problem is that you have to be careful about what you stick into Kconfig. It's L1TF on x86 today and tomorrow it's MDS and whatever and then you do the same thing on the other architectures as well. And we still need the command line options so that generic builds can be customized at boot time.
Quoted 3 lines
The current plan (as I understand it) is that we'd like to ship Chromebook kernels with this option changed from the default that's there now. In your opinion, is that a sane thing to do?
If it's sane for you folks, then feel free to do so. Distros & al patch the kernel do death anyway, but that does not mean that mainline has to have everything these people chose to do.
Quoted 8 lines
Quoted 2 lines
2) You can add the desired mode to the compiled in (partial) kernel command line today.
This might be easier on x86 than it is on ARM. ARM (and ARM64) kernels only have two modes: kernel provides cmdline and bootloader provides cmdline. There are out-of-mainline ANDROID patches to address this but nothing in mainline.
Quoted 4 lines
The patch we're discussing now is x86-only so it's not such a huge deal, but the fact that combining the kernel and bootloader commandline never landed in mainline for arm/arm64 means that this isn't a super common/expected thing to do.
Did you try to get that merged for arm/arm64?
Quoted 4 lines
Quoted 3 lines
3) Boot loaders are well capable of handling large kernel command lines and the extra time spend for reading the parameter does not matter at all.
Quoted 8 lines
Long command lines can still be a bit of a chore for humans to deal with. Many times I've needed to look at "
/proc/cmdline" and make sense of it. The longer the command line is and the more cruft stuffed into it the more of a chore it is. Yes, this is just one thing to put in the command line, but if 10 different drivers all have their "one thing" to put there it gets really long. If 100 different drivers all want their one config option there it gets really really long.
This will not go away when you want to support a gazillion of systems which need tweaks left and right due to creative hardware/BIOS with a generic kernel. And come on, parsing a long command line is not rocket science and it's not something you do every two minutes.
Quoted 11 lines
IMO the command line should be a last resort place to put things and should just contain:
1. Legacy things that _have_ to be in the command line because they've always been there.
2. Things that the bootloader/BIOS needs to communicate to the kernel and has no better way to communicate.
3. Cases where the person running the kernel needs to override a default set by the person compiling the kernel.
Which is the case for a lot of things and it's widely used exactly for that reason.
Quoted 7 lines
Quoted 3 lines
4) It's just a tiny part of the whole speculation maze. If we go there for L1TF then we open the flood gates for a gazillion other config options.
It seems like the only options that we'd need CONFIG option for would be the ones where it would be sane to change the default compiled into the kernel. Hopefully that's not too many things?
That's what _you_ need. But accepting this we set a precedence and how do I argue that L1TF makes sense, but other things not? This stuff is horrible enough already, no need to add more ifdefs and options and whatever to it.
Quoted 5 lines
Obviously, like many design choices, the above is all subjective. It's really your call and if these arguments don't convince you it sounds like the way forward is just to use "
CONFIG_CMDLINE" and take advantage of the fact that on x86 this will get merged with the bootloader's command line.
I rather see the support for command line merging extended to arm/arm64 because that's of general usefulness beyond the problem at hand.
Thanks,
tglx
Hi,
Quoted 26 lines · Thomas Gleixner
Doug,
Quoted 8 lines · Doug Anderson
Quoted 6 lines · Thomas Gleixner
TBH, I don't see why this is a good idea.
1) I'm not following your argumentation that the command line option is a poor
Kconfigreplacement. The L1TF mode is a boot time (module load time) decision and the command line parameter is there to override the carefully chosen and sensible default behaviour.Quoted 7 lines
When you say that the default behavior is carefully chosen and sensible, are you saying that (in your opinion) there would never be a good reason for someone distributing a kernel to others to change the default? Certainly I agree that having the kernel command line parameter is nice to allow someone to override whatever the person building the kernel chose, but IMO it's not a good way to change the default built-in to the kernel.
The problem is that you have to be careful about what you stick into
Kconfig. It's L1TF on x86 today and tomorrow it's MDS and whatever and then you do the same thing on the other architectures as well. And we still need the command line options so that generic builds can be customized at boot time.
Quoted 7 lines
Quoted 3 lines
The current plan (as I understand it) is that we'd like to ship Chromebook kernels with this option changed from the default that's there now. In your opinion, is that a sane thing to do?
If it's sane for you folks, then feel free to do so. Distros & al patch the kernel do death anyway, but that does not mean that mainline has to have everything these people chose to do.
Sure, we could carry a local patch. ...but Chrome OS tries not to be like all other distros. We try very hard (and keep trying harder each year) to _not_ carry local patches. Sure, we fail sometimes, but we will still try. In general it seems like the upstream Linux community pushes distros and other Linux users to be upstream first so it's a little discouraging to hear the advice of "just carry a local patch".
In this case, though, I should close the loop. Abhishek can correct me if I'm wrong, but I think the answer here was that it _wasn't_ sane for us to change this option via KConfig or even via kernel command line. I believe that Abhishek found that it was better to (in userspace) look at the sysfs nodes and configure things how he wanted it at runtime.
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
2) You can add the desired mode to the compiled in (partial) kernel command line today.
This might be easier on x86 than it is on ARM. ARM (and ARM64) kernels only have two modes: kernel provides cmdline and bootloader provides cmdline. There are out-of-mainline ANDROID patches to address this but nothing in mainline.
Quoted 6 lines
Quoted 4 lines
The patch we're discussing now is x86-only so it's not such a huge deal, but the fact that combining the kernel and bootloader commandline never landed in mainline for arm/arm64 means that this isn't a super common/expected thing to do.
Did you try to get that merged for arm/arm64?
Yes, years ago. References:
https://lore.kernel.org/r/[email protected]
https://lore.kernel.org/r/[email protected]
I didn't keep poking it because I got advice (not on the mailing list) that it was better to add a KConfig option rather than extending the command line. ;-) At the time it seemed a reasonable argument to me so I didn't keep pushing that patch.
Quoted 13 lines
Quoted 4 lines
Quoted 3 lines
3) Boot loaders are well capable of handling large kernel command lines and the extra time spend for reading the parameter does not matter at all.
Quoted 8 lines
Long command lines can still be a bit of a chore for humans to deal with. Many times I've needed to look at "
/proc/cmdline" and make sense of it. The longer the command line is and the more cruft stuffed into it the more of a chore it is. Yes, this is just one thing to put in the command line, but if 10 different drivers all have their "one thing" to put there it gets really long. If 100 different drivers all want their one config option there it gets really really long.
Quoted 4 lines
This will not go away when you want to support a gazillion of systems which need tweaks left and right due to creative hardware/BIOS with a generic kernel. And come on, parsing a long command line is not rocket science and it's not something you do every two minutes.
It's funny. Your argument is the same as mine but the opposite. I
say: "but so much crap will be in the command line and it will be crazy" and you say "but so much crap will be in the KConfig and it will be crazy". ;-) I guess it depends on where you want to dump your trash.
Quoted 6 lines
Quoted 6 lines
IMO the command line should be a last resort place to put things and should just contain:
1. Legacy things that _have_ to be in the command line because they've always been there.
Quoted 8 lines
Quoted 5 lines
2. Things that the bootloader/BIOS needs to communicate to the kernel and has no better way to communicate.
3. Cases where the person running the kernel needs to override a default set by the person compiling the kernel.
Which is the case for a lot of things and it's widely used exactly for that reason.
Right. To be clear, I definitely wasn't suggesting the option be _removed_ from the command line.
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
4) It's just a tiny part of the whole speculation maze. If we go there for L1TF then we open the flood gates for a gazillion other config options.
Quoted 8 lines
Quoted 3 lines
It seems like the only options that we'd need CONFIG option for would be the ones where it would be sane to change the default compiled into the kernel. Hopefully that's not too many things?
That's what _you_ need. But accepting this we set a precedence and how do I argue that L1TF makes sense, but other things not? This stuff is horrible enough already, no need to add more ifdefs and options and whatever to it.
Again, I think it gets into a matter of opinion. I'm also objecting to setting a precedence, but in the opposite direction. Today in Chrome OS we don't need to use the command line extending for this type of thing at all and (IMO) it's really nice. Your config options are in one place, not mixed halfway between the command line and the KConfig. Allowing this one config option to be configured in the command line opens the flood gates for having two places to look for the base config. ;-)
In any case, it doesn't sound like I'm going to convince you. Also, since Abhishek has found another way to move forward it sounds like the right thing is to consider his patch abandoned anyway.
Quoted 8 lines
Quoted 5 lines
Obviously, like many design choices, the above is all subjective. It's really your call and if these arguments don't convince you it sounds like the way forward is just to use "
CONFIG_CMDLINE" and take advantage of the fact that on x86 this will get merged with the bootloader's command line.I rather see the support for command line merging extended to arm/arm64 because that's of general usefulness beyond the problem at hand.
I have no objections to someone upstreaming those patches, for sure. Maybe one day the Android team will do it since they seem to have been carrying it as a local patch forever. If nothing else, it gives us more flexibility.
-Doug
Borislav Petkov
maintainer+ Masami.
Quoted 27 lines · Thomas Gleixner
Quoted 11 lines · Abhishek Bhardwaj
This change adds a new kernel configuration that sets the l1d cache flush setting at compile time rather than at run time.
The reasons for this change are as follows -
- Kernel command line arguments are getting unwieldy. These parameters are not a scalable way to set the kernel config. They're intended as a super limited way for the bootloader to pass info to the kernel and also as a way for end users who are not compiling the kernel themselves to tweak the kernel behavior.
Quoted 7 lines
- Also, if a user wants this setting from the start. It's a definite smell that it deserves to be a compile time thing rather than adding extra code plus whatever miniscule time at runtime to pass an extra argument.
- Finally, it doesn't preclude the runtime / kernel command line way. Users are free to use those as well.
TBH, I don't see why this is a good idea.
1) I'm not following your argumentation that the command line option is a poor
Kconfigreplacement. The L1TF mode is a boot time (module load time) decision and the command line parameter is there to override the carefully chosen and sensible default behaviour.
Quoted 6 lines
2) You can add the desired mode to the compiled in (partial) kernel command line today.
3) Boot loaders are well capable of handling large kernel command lines and the extra time spend for reading the parameter does not matter at all.
Also, there's Documentation/admin-guide/bootconfig.rst which extends cmdline options handling even more and allows for passing options in a file. Maybe that'll help in this case too.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette