* Re: [PATCH] x86/speculation/l1tf: suggest what to do on systems with too much RAM
2018-08-23 14:28 ` [PATCH] x86/speculation/l1tf: suggest what to do on systems with " Vlastimil Babka
@ 2018-08-23 15:46 ` Andi Kleen
2018-08-23 19:25 ` Michal Hocko
2018-08-23 19:03 ` kbuild test robot
` (2 subsequent siblings)
3 siblings, 1 reply; 20+ messages in thread
From: Andi Kleen @ 2018-08-23 15:46 UTC (permalink / raw)
To: Vlastimil Babka
Cc: Thomas Gleixner, Ingo Molnar, H . Peter Anvin, x86, linux-kernel,
Linus Torvalds, Dave Hansen, Michal Hocko, stable, Michal Hocko
On Thu, Aug 23, 2018 at 04:28:12PM +0200, Vlastimil Babka wrote:
> Two users have reported [1] that they have an "extremely unlikely" system
> with more than MAX_PA/2 memory and L1TF mitigation is not effective. Let's
> make the warning more helpful by suggesting the proper mem=X kernel boot param,
> a rough calculation of how much RAM can be lost (not precise if there's holes
> between MAX_PA/2 and max_pfn in the e820 map) and a link to the L1TF document
> to help decide if the mitigation is worth the unusable RAM.
I'm not sure anyone would really do that. After all you probably prefer
your memory. And if it's really a non ECC client part they are are
already used to to live very dangerously because their undetected RAM bit error
rate will be significant. L1TF is probably one of your smaller problems
in this case...
-Andi
^ permalink raw reply [flat|nested] 20+ messages in thread* Re: [PATCH] x86/speculation/l1tf: suggest what to do on systems with too much RAM
2018-08-23 15:46 ` Andi Kleen
@ 2018-08-23 19:25 ` Michal Hocko
2018-08-23 19:38 ` Andi Kleen
0 siblings, 1 reply; 20+ messages in thread
From: Michal Hocko @ 2018-08-23 19:25 UTC (permalink / raw)
To: Andi Kleen
Cc: Vlastimil Babka, Thomas Gleixner, Ingo Molnar, H . Peter Anvin,
x86, linux-kernel, Linus Torvalds, Dave Hansen, stable
On Thu 23-08-18 08:46:48, Andi Kleen wrote:
> On Thu, Aug 23, 2018 at 04:28:12PM +0200, Vlastimil Babka wrote:
> > Two users have reported [1] that they have an "extremely unlikely" system
> > with more than MAX_PA/2 memory and L1TF mitigation is not effective. Let's
> > make the warning more helpful by suggesting the proper mem=X kernel boot param,
> > a rough calculation of how much RAM can be lost (not precise if there's holes
> > between MAX_PA/2 and max_pfn in the e820 map) and a link to the L1TF document
> > to help decide if the mitigation is worth the unusable RAM.
>
> I'm not sure anyone would really do that. After all you probably prefer
> your memory. And if it's really a non ECC client part they are are
> already used to to live very dangerously because their undetected RAM bit error
> rate will be significant. L1TF is probably one of your smaller problems
> in this case...
There are people who care about L1TF mitigations. I am not going to
question their motivation. In any case a hint how to make the mitigation
active again sounds more useful than something that sounds as scary as
"you are vulnerable".
--
Michal Hocko
SUSE Labs
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] x86/speculation/l1tf: suggest what to do on systems with too much RAM
2018-08-23 19:25 ` Michal Hocko
@ 2018-08-23 19:38 ` Andi Kleen
2018-08-23 20:05 ` Michal Hocko
0 siblings, 1 reply; 20+ messages in thread
From: Andi Kleen @ 2018-08-23 19:38 UTC (permalink / raw)
To: Michal Hocko
Cc: Vlastimil Babka, Thomas Gleixner, Ingo Molnar, H . Peter Anvin,
x86, linux-kernel, Linus Torvalds, Dave Hansen, stable
> There are people who care about L1TF mitigations. I am not going to
> question their motivation. In any case a hint how to make the mitigation
> active again sounds more useful than something that sounds as scary as
> "you are vulnerable".
FWIW an early version of these patches automatically limited the available
memory, but Linus pointed out that people likely prefer their memory.
I still think his reasoning was right, and likely applies to your
message too.
-Andi
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] x86/speculation/l1tf: suggest what to do on systems with too much RAM
2018-08-23 19:38 ` Andi Kleen
@ 2018-08-23 20:05 ` Michal Hocko
2018-08-23 22:07 ` Andi Kleen
0 siblings, 1 reply; 20+ messages in thread
From: Michal Hocko @ 2018-08-23 20:05 UTC (permalink / raw)
To: Andi Kleen
Cc: Vlastimil Babka, Thomas Gleixner, Ingo Molnar, H . Peter Anvin,
x86, linux-kernel, Linus Torvalds, Dave Hansen, stable
On Thu 23-08-18 12:38:33, Andi Kleen wrote:
> > There are people who care about L1TF mitigations. I am not going to
> > question their motivation. In any case a hint how to make the mitigation
> > active again sounds more useful than something that sounds as scary as
> > "you are vulnerable".
>
> FWIW an early version of these patches automatically limited the available
> memory, but Linus pointed out that people likely prefer their memory.
Nobody is questioning that. The point is to give them a hint on how to
make the mitigation active again without going to call for help. The
message does tell them how to _enable_ it and point them to the
documentation on how to _decide_.
--
Michal Hocko
SUSE Labs
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] x86/speculation/l1tf: suggest what to do on systems with too much RAM
2018-08-23 20:05 ` Michal Hocko
@ 2018-08-23 22:07 ` Andi Kleen
0 siblings, 0 replies; 20+ messages in thread
From: Andi Kleen @ 2018-08-23 22:07 UTC (permalink / raw)
To: Michal Hocko
Cc: Vlastimil Babka, Thomas Gleixner, Ingo Molnar, H . Peter Anvin,
x86, linux-kernel, Linus Torvalds, Dave Hansen, stable
On Thu, Aug 23, 2018 at 10:05:20PM +0200, Michal Hocko wrote:
> On Thu 23-08-18 12:38:33, Andi Kleen wrote:
> > > There are people who care about L1TF mitigations. I am not going to
> > > question their motivation. In any case a hint how to make the mitigation
> > > active again sounds more useful than something that sounds as scary as
> > > "you are vulnerable".
> >
> > FWIW an early version of these patches automatically limited the available
> > memory, but Linus pointed out that people likely prefer their memory.
>
> Nobody is questioning that. The point is to give them a hint on how to
> make the mitigation active again without going to call for help. The
> message does tell them how to _enable_ it and point them to the
> documentation on how to _decide_.
On the message I guess there are two cases:
- either it's very little memory that is lost like in the 32GB + memory
hole case. In this case maybe it's better if we just limit automatically
if the overlap is small enough (<2GB perhaps?)
- Or it's a lot of memory then people are unlikely to want to lose their
memory and I don't think we really need the message either.
Also I checked the bug again and it looks like the reporter has an IvyBridge.
There is actually a better solution for those (anything Nehalem and newer)
because they internally have at least 44 bits in the cache, which
is good enough for the mitigation. Just need a quirk to override
the bit width in this case (will submit a patch)
-Andi
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] x86/speculation/l1tf: suggest what to do on systems with too much RAM
2018-08-23 14:28 ` [PATCH] x86/speculation/l1tf: suggest what to do on systems with " Vlastimil Babka
2018-08-23 15:46 ` Andi Kleen
@ 2018-08-23 19:03 ` kbuild test robot
2018-08-23 19:23 ` kbuild test robot
2018-08-23 19:27 ` Michal Hocko
3 siblings, 0 replies; 20+ messages in thread
From: kbuild test robot @ 2018-08-23 19:03 UTC (permalink / raw)
To: Vlastimil Babka
Cc: kbuild-all, Thomas Gleixner, Ingo Molnar, H . Peter Anvin, x86,
linux-kernel, Linus Torvalds, Andi Kleen, Dave Hansen,
Michal Hocko, Vlastimil Babka, stable, Michal Hocko
[-- Attachment #1: Type: text/plain, Size: 2835 bytes --]
Hi Vlastimil,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on tip/auto-latest]
[also build test ERROR on next-20180822]
[cannot apply to v4.18]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Vlastimil-Babka/x86-speculation-l1tf-suggest-what-to-do-on-systems-with-too-much-RAM/20180824-013859
config: i386-randconfig-x077-201833 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All errors (new ones prefixed by >>):
In file included from include/linux/kernel.h:14:0,
from arch/x86/include/asm/percpu.h:45,
from arch/x86/include/asm/current.h:6,
from include/linux/sched.h:12,
from include/linux/utsname.h:6,
from arch/x86/kernel/cpu/bugs.c:12:
arch/x86/kernel/cpu/bugs.c: In function 'l1tf_select_mitigation':
>> arch/x86/kernel/cpu/bugs.c:709:12: error: 'max_pfn' undeclared (first use in this function); did you mean 'pgd_pfn'?
((u64) max_pfn << PAGE_SHIFT) - half_pa);
^
include/linux/printk.h:311:34: note: in definition of macro 'pr_info'
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~
arch/x86/kernel/cpu/bugs.c:709:12: note: each undeclared identifier is reported only once for each function it appears in
((u64) max_pfn << PAGE_SHIFT) - half_pa);
^
include/linux/printk.h:311:34: note: in definition of macro 'pr_info'
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~
vim +709 arch/x86/kernel/cpu/bugs.c
697
698 /*
699 * This is extremely unlikely to happen because almost all
700 * systems have far more MAX_PA/2 than RAM can be fit into
701 * DIMM slots.
702 */
703 half_pa = (u64)l1tf_pfn_limit() << PAGE_SHIFT;
704 if (e820__mapped_any(half_pa, ULLONG_MAX - half_pa, E820_TYPE_RAM)) {
705 pr_warn("System has more than MAX_PA/2 memory. L1TF mitigation not effective.\n");
706 pr_info("You may make it effective by booting the kernel with mem=%llu parameter.\n",
707 half_pa);
708 pr_info("However, doing so will make up to %llu bytes of RAM unusable.\n",
> 709 ((u64) max_pfn << PAGE_SHIFT) - half_pa);
710 pr_info("Reading Documentation/admin-guide/l1tf.rst might help you decide.");
711 return;
712 }
713
714 setup_force_cpu_cap(X86_FEATURE_L1TF_PTEINV);
715 }
716
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 32575 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread* Re: [PATCH] x86/speculation/l1tf: suggest what to do on systems with too much RAM
2018-08-23 14:28 ` [PATCH] x86/speculation/l1tf: suggest what to do on systems with " Vlastimil Babka
2018-08-23 15:46 ` Andi Kleen
2018-08-23 19:03 ` kbuild test robot
@ 2018-08-23 19:23 ` kbuild test robot
2018-08-23 19:27 ` Michal Hocko
3 siblings, 0 replies; 20+ messages in thread
From: kbuild test robot @ 2018-08-23 19:23 UTC (permalink / raw)
To: Vlastimil Babka
Cc: kbuild-all, Thomas Gleixner, Ingo Molnar, H . Peter Anvin, x86,
linux-kernel, Linus Torvalds, Andi Kleen, Dave Hansen,
Michal Hocko, Vlastimil Babka, stable, Michal Hocko
[-- Attachment #1: Type: text/plain, Size: 2804 bytes --]
Hi Vlastimil,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on tip/auto-latest]
[also build test ERROR on next-20180822]
[cannot apply to v4.18]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Vlastimil-Babka/x86-speculation-l1tf-suggest-what-to-do-on-systems-with-too-much-RAM/20180824-013859
config: i386-randconfig-a1-201833 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All errors (new ones prefixed by >>):
In file included from include/linux/kernel.h:14:0,
from arch/x86/include/asm/percpu.h:45,
from arch/x86/include/asm/current.h:6,
from include/linux/sched.h:12,
from include/linux/utsname.h:6,
from arch/x86//kernel/cpu/bugs.c:12:
arch/x86//kernel/cpu/bugs.c: In function 'l1tf_select_mitigation':
>> arch/x86//kernel/cpu/bugs.c:709:12: error: 'max_pfn' undeclared (first use in this function)
((u64) max_pfn << PAGE_SHIFT) - half_pa);
^
include/linux/printk.h:311:34: note: in definition of macro 'pr_info'
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
arch/x86//kernel/cpu/bugs.c:709:12: note: each undeclared identifier is reported only once for each function it appears in
((u64) max_pfn << PAGE_SHIFT) - half_pa);
^
include/linux/printk.h:311:34: note: in definition of macro 'pr_info'
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
vim +/max_pfn +709 arch/x86//kernel/cpu/bugs.c
697
698 /*
699 * This is extremely unlikely to happen because almost all
700 * systems have far more MAX_PA/2 than RAM can be fit into
701 * DIMM slots.
702 */
703 half_pa = (u64)l1tf_pfn_limit() << PAGE_SHIFT;
704 if (e820__mapped_any(half_pa, ULLONG_MAX - half_pa, E820_TYPE_RAM)) {
705 pr_warn("System has more than MAX_PA/2 memory. L1TF mitigation not effective.\n");
706 pr_info("You may make it effective by booting the kernel with mem=%llu parameter.\n",
707 half_pa);
708 pr_info("However, doing so will make up to %llu bytes of RAM unusable.\n",
> 709 ((u64) max_pfn << PAGE_SHIFT) - half_pa);
710 pr_info("Reading Documentation/admin-guide/l1tf.rst might help you decide.");
711 return;
712 }
713
714 setup_force_cpu_cap(X86_FEATURE_L1TF_PTEINV);
715 }
716
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 23873 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread* Re: [PATCH] x86/speculation/l1tf: suggest what to do on systems with too much RAM
2018-08-23 14:28 ` [PATCH] x86/speculation/l1tf: suggest what to do on systems with " Vlastimil Babka
` (2 preceding siblings ...)
2018-08-23 19:23 ` kbuild test robot
@ 2018-08-23 19:27 ` Michal Hocko
2018-08-24 7:32 ` Vlastimil Babka
3 siblings, 1 reply; 20+ messages in thread
From: Michal Hocko @ 2018-08-23 19:27 UTC (permalink / raw)
To: Vlastimil Babka
Cc: Thomas Gleixner, Ingo Molnar, H . Peter Anvin, x86, linux-kernel,
Linus Torvalds, Andi Kleen, Dave Hansen, stable
On Thu 23-08-18 16:28:12, Vlastimil Babka wrote:
> Two users have reported [1] that they have an "extremely unlikely" system
> with more than MAX_PA/2 memory and L1TF mitigation is not effective. Let's
> make the warning more helpful by suggesting the proper mem=X kernel boot param,
> a rough calculation of how much RAM can be lost (not precise if there's holes
> between MAX_PA/2 and max_pfn in the e820 map) and a link to the L1TF document
> to help decide if the mitigation is worth the unusable RAM.
>
> [1] https://bugzilla.suse.com/show_bug.cgi?id=1105536
>
> Suggested-by: Michal Hocko <mhocko@suse.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
I wouldn't bother with max_pfn-half_pa part but other than that this is
much more useful than the original message.
Acked-by: Michal Hocko <mhocko@suse.com>
> ---
> arch/x86/kernel/cpu/bugs.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
> index cb4a16292aa7..4b820bb6c504 100644
> --- a/arch/x86/kernel/cpu/bugs.c
> +++ b/arch/x86/kernel/cpu/bugs.c
> @@ -702,6 +702,11 @@ static void __init l1tf_select_mitigation(void)
> half_pa = (u64)l1tf_pfn_limit() << PAGE_SHIFT;
> if (e820__mapped_any(half_pa, ULLONG_MAX - half_pa, E820_TYPE_RAM)) {
> pr_warn("System has more than MAX_PA/2 memory. L1TF mitigation not effective.\n");
> + pr_info("You may make it effective by booting the kernel with mem=%llu parameter.\n",
> + half_pa);
> + pr_info("However, doing so will make up to %llu bytes of RAM unusable.\n",
> + ((u64) max_pfn << PAGE_SHIFT) - half_pa);
> + pr_info("Reading Documentation/admin-guide/l1tf.rst might help you decide.");
> return;
> }
>
> --
> 2.18.0
--
Michal Hocko
SUSE Labs
^ permalink raw reply [flat|nested] 20+ messages in thread* Re: [PATCH] x86/speculation/l1tf: suggest what to do on systems with too much RAM
2018-08-23 19:27 ` Michal Hocko
@ 2018-08-24 7:32 ` Vlastimil Babka
2018-08-24 10:36 ` Vlastimil Babka
0 siblings, 1 reply; 20+ messages in thread
From: Vlastimil Babka @ 2018-08-24 7:32 UTC (permalink / raw)
To: Michal Hocko
Cc: Thomas Gleixner, Ingo Molnar, H . Peter Anvin, x86, linux-kernel,
Linus Torvalds, Andi Kleen, Dave Hansen, stable
On 08/23/2018 09:27 PM, Michal Hocko wrote:
> On Thu 23-08-18 16:28:12, Vlastimil Babka wrote:
>> Two users have reported [1] that they have an "extremely unlikely" system
>> with more than MAX_PA/2 memory and L1TF mitigation is not effective. Let's
>> make the warning more helpful by suggesting the proper mem=X kernel boot param,
>> a rough calculation of how much RAM can be lost (not precise if there's holes
>> between MAX_PA/2 and max_pfn in the e820 map) and a link to the L1TF document
>> to help decide if the mitigation is worth the unusable RAM.
>>
>> [1] https://bugzilla.suse.com/show_bug.cgi?id=1105536
>>
>> Suggested-by: Michal Hocko <mhocko@suse.com>
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
>
> I wouldn't bother with max_pfn-half_pa part but other than that this is
> much more useful than the original message.
Right, and it causes build failures on some configs.
> Acked-by: Michal Hocko <mhocko@suse.com>
Thanks! Here's a v2:
----8<----
>From 977c5db27fe35a84807850b947bc5678c4d467b3 Mon Sep 17 00:00:00 2001
From: Vlastimil Babka <vbabka@suse.cz>
Date: Thu, 23 Aug 2018 16:21:29 +0200
Subject: [PATCH] x86/speculation/l1tf: suggest what to do on systems with too
much RAM
Two users have reported [1] that they have an "extremely unlikely" system
with more than MAX_PA/2 memory and L1TF mitigation is not effective. Let's
make the warning more helpful by suggesting the proper mem=X kernel boot param
to make it effective and a link to the L1TF document to help decide if the
mitigation is worth the unusable RAM.
[1] https://bugzilla.suse.com/show_bug.cgi?id=1105536
Suggested-by: Michal Hocko <mhocko@suse.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
---
arch/x86/kernel/cpu/bugs.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index cb4a16292aa7..5c32b5006738 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -702,6 +702,10 @@ static void __init l1tf_select_mitigation(void)
half_pa = (u64)l1tf_pfn_limit() << PAGE_SHIFT;
if (e820__mapped_any(half_pa, ULLONG_MAX - half_pa, E820_TYPE_RAM)) {
pr_warn("System has more than MAX_PA/2 memory. L1TF mitigation not effective.\n");
+ pr_info("You may make it effective by booting the kernel with mem=%llu parameter.\n",
+ half_pa);
+ pr_info("However, doing so will make a part of your RAM unusable.\n");
+ pr_info("Reading Documentation/admin-guide/l1tf.rst might help you decide.\n");
return;
}
--
2.18.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH] x86/speculation/l1tf: suggest what to do on systems with too much RAM
2018-08-24 7:32 ` Vlastimil Babka
@ 2018-08-24 10:36 ` Vlastimil Babka
2018-08-24 12:10 ` Vlastimil Babka
0 siblings, 1 reply; 20+ messages in thread
From: Vlastimil Babka @ 2018-08-24 10:36 UTC (permalink / raw)
To: Michal Hocko
Cc: Thomas Gleixner, Ingo Molnar, H . Peter Anvin, x86, linux-kernel,
Linus Torvalds, Andi Kleen, Dave Hansen, stable
On 08/24/2018 09:32 AM, Vlastimil Babka wrote:
> On 08/23/2018 09:27 PM, Michal Hocko wrote:
>> On Thu 23-08-18 16:28:12, Vlastimil Babka wrote:
>>> Two users have reported [1] that they have an "extremely unlikely" system
>>> with more than MAX_PA/2 memory and L1TF mitigation is not effective. Let's
>>> make the warning more helpful by suggesting the proper mem=X kernel boot param,
>>> a rough calculation of how much RAM can be lost (not precise if there's holes
>>> between MAX_PA/2 and max_pfn in the e820 map) and a link to the L1TF document
>>> to help decide if the mitigation is worth the unusable RAM.
>>>
>>> [1] https://bugzilla.suse.com/show_bug.cgi?id=1105536
>>>
>>> Suggested-by: Michal Hocko <mhocko@suse.com>
>>> Cc: stable@vger.kernel.org
>>> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
>>
>> I wouldn't bother with max_pfn-half_pa part but other than that this is
>> much more useful than the original message.
>
> Right, and it causes build failures on some configs.
>
>> Acked-by: Michal Hocko <mhocko@suse.com>
>
> Thanks! Here's a v2:
Just realized that kvm printk's refer to the online version at
https://www.kernel.org/doc/html/latest/admin-guide/l1tf.html
which should be easier for the users of distro kernels, should I change
that?
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] x86/speculation/l1tf: suggest what to do on systems with too much RAM
2018-08-24 10:36 ` Vlastimil Babka
@ 2018-08-24 12:10 ` Vlastimil Babka
2018-08-24 12:20 ` Michal Hocko
0 siblings, 1 reply; 20+ messages in thread
From: Vlastimil Babka @ 2018-08-24 12:10 UTC (permalink / raw)
To: Michal Hocko
Cc: Thomas Gleixner, Ingo Molnar, H . Peter Anvin, x86, linux-kernel,
Linus Torvalds, Andi Kleen, Dave Hansen, stable
On 08/24/2018 12:36 PM, Vlastimil Babka wrote:
> On 08/24/2018 09:32 AM, Vlastimil Babka wrote:
>> On 08/23/2018 09:27 PM, Michal Hocko wrote:
>>> On Thu 23-08-18 16:28:12, Vlastimil Babka wrote:
>>>> Two users have reported [1] that they have an "extremely unlikely" system
>>>> with more than MAX_PA/2 memory and L1TF mitigation is not effective. Let's
>>>> make the warning more helpful by suggesting the proper mem=X kernel boot param,
>>>> a rough calculation of how much RAM can be lost (not precise if there's holes
>>>> between MAX_PA/2 and max_pfn in the e820 map) and a link to the L1TF document
>>>> to help decide if the mitigation is worth the unusable RAM.
>>>>
>>>> [1] https://bugzilla.suse.com/show_bug.cgi?id=1105536
>>>>
>>>> Suggested-by: Michal Hocko <mhocko@suse.com>
>>>> Cc: stable@vger.kernel.org
>>>> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
>>>
>>> I wouldn't bother with max_pfn-half_pa part but other than that this is
>>> much more useful than the original message.
>>
>> Right, and it causes build failures on some configs.
>>
>>> Acked-by: Michal Hocko <mhocko@suse.com>
>>
>> Thanks! Here's a v2:
>
> Just realized that kvm printk's refer to the online version at
> https://www.kernel.org/doc/html/latest/admin-guide/l1tf.html
> which should be easier for the users of distro kernels, should I change
> that?
FWIW, if it's not possible to amend anymore...
----8<----
>From a650e6a4b989c6e029ac1ab4e0a68553e074ba7a Mon Sep 17 00:00:00 2001
From: Vlastimil Babka <vbabka@suse.cz>
Date: Fri, 24 Aug 2018 14:05:45 +0200
Subject: [PATCH] x86/speculation/l1tf: replace Documentation path with
kernel.org URL
The URL might be easier to reach for users of distro kernels without unpacked
source, and be more up-to-date. It's also used in KVM warnings related to L1TF.
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
---
arch/x86/kernel/cpu/bugs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 5c32b5006738..4c2313d0b9ca 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -705,7 +705,7 @@ static void __init l1tf_select_mitigation(void)
pr_info("You may make it effective by booting the kernel with mem=%llu parameter.\n",
half_pa);
pr_info("However, doing so will make a part of your RAM unusable.\n");
- pr_info("Reading Documentation/admin-guide/l1tf.rst might help you decide.\n");
+ pr_info("Reading https://www.kernel.org/doc/html/latest/admin-guide/l1tf.html might help you decide.\n");
return;
}
--
2.18.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH] x86/speculation/l1tf: suggest what to do on systems with too much RAM
2018-08-24 12:10 ` Vlastimil Babka
@ 2018-08-24 12:20 ` Michal Hocko
0 siblings, 0 replies; 20+ messages in thread
From: Michal Hocko @ 2018-08-24 12:20 UTC (permalink / raw)
To: Vlastimil Babka
Cc: Thomas Gleixner, Ingo Molnar, H . Peter Anvin, x86, linux-kernel,
Linus Torvalds, Andi Kleen, Dave Hansen, stable
On Fri 24-08-18 14:10:54, Vlastimil Babka wrote:
> On 08/24/2018 12:36 PM, Vlastimil Babka wrote:
> > On 08/24/2018 09:32 AM, Vlastimil Babka wrote:
> >> On 08/23/2018 09:27 PM, Michal Hocko wrote:
> >>> On Thu 23-08-18 16:28:12, Vlastimil Babka wrote:
> >>>> Two users have reported [1] that they have an "extremely unlikely" system
> >>>> with more than MAX_PA/2 memory and L1TF mitigation is not effective. Let's
> >>>> make the warning more helpful by suggesting the proper mem=X kernel boot param,
> >>>> a rough calculation of how much RAM can be lost (not precise if there's holes
> >>>> between MAX_PA/2 and max_pfn in the e820 map) and a link to the L1TF document
> >>>> to help decide if the mitigation is worth the unusable RAM.
> >>>>
> >>>> [1] https://bugzilla.suse.com/show_bug.cgi?id=1105536
> >>>>
> >>>> Suggested-by: Michal Hocko <mhocko@suse.com>
> >>>> Cc: stable@vger.kernel.org
> >>>> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
> >>>
> >>> I wouldn't bother with max_pfn-half_pa part but other than that this is
> >>> much more useful than the original message.
> >>
> >> Right, and it causes build failures on some configs.
> >>
> >>> Acked-by: Michal Hocko <mhocko@suse.com>
> >>
> >> Thanks! Here's a v2:
> >
> > Just realized that kvm printk's refer to the online version at
> > https://www.kernel.org/doc/html/latest/admin-guide/l1tf.html
> > which should be easier for the users of distro kernels, should I change
> > that?
>
> FWIW, if it's not possible to amend anymore...
> ----8<----
> >From a650e6a4b989c6e029ac1ab4e0a68553e074ba7a Mon Sep 17 00:00:00 2001
> From: Vlastimil Babka <vbabka@suse.cz>
> Date: Fri, 24 Aug 2018 14:05:45 +0200
> Subject: [PATCH] x86/speculation/l1tf: replace Documentation path with
> kernel.org URL
>
> The URL might be easier to reach for users of distro kernels without unpacked
> source, and be more up-to-date. It's also used in KVM warnings related to L1TF.
Yes, URL is much more convenient than a reference to the kernel source
documentation. If the link below is meant to be long lived then sure.
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Michal Hocko <mhocko@suse.com>
> ---
> arch/x86/kernel/cpu/bugs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
> index 5c32b5006738..4c2313d0b9ca 100644
> --- a/arch/x86/kernel/cpu/bugs.c
> +++ b/arch/x86/kernel/cpu/bugs.c
> @@ -705,7 +705,7 @@ static void __init l1tf_select_mitigation(void)
> pr_info("You may make it effective by booting the kernel with mem=%llu parameter.\n",
> half_pa);
> pr_info("However, doing so will make a part of your RAM unusable.\n");
> - pr_info("Reading Documentation/admin-guide/l1tf.rst might help you decide.\n");
> + pr_info("Reading https://www.kernel.org/doc/html/latest/admin-guide/l1tf.html might help you decide.\n");
> return;
> }
>
> --
> 2.18.0
>
>
>
--
Michal Hocko
SUSE Labs
^ permalink raw reply [flat|nested] 20+ messages in thread