l1tf: drop the swap storage limit restriction when l1tf=off
Subsystems (5)
PATCH 1/1 l1tf: drop the swap storage limit restriction when l1tf=off
From: Michal Hocko <[email protected]>
Swap storage is restricted to max_swapfile_size (~16TB on x86_64) whenever the system is deemed affected by L1TF vulnerability. Even though the limit is quite high for most deployments it seems to be too restrictive for deployments which are willing to live with the mitigation disabled.
We have a customer to deploy 8x 6,4TB PCIe/NVMe SSD swap devices which is clearly out of the limit.
Drop the swap restriction when l1tf=off is specified. It also doesn't make much sense to warn about too much memory for the l1tf mitigation when it is forcefully disabled by the administrator.
--- Documentation/admin-guide/kernel-parameters.txt | 2 ++ Documentation/admin-guide/l1tf.rst | 5 ++++- arch/x86/kernel/cpu/bugs.c | 3 ++- arch/x86/mm/init.c | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +2 -0
@@ -2095,6 +2095,8 @@ off Disables hypervisor mitigations and doesn't emit any warnings. + It also drops the swap size and available + RAM limit restriction. Default is 'flush'.
Documentation/admin-guide/l1tf.rst +4 -1
@@ -405,6 +405,8 @@ The kernel command line allows to control the L1TF mitigations at boot off Disables hypervisor mitigations and doesn't emit any warnings. + It also drops the swap size and available RAM limit restrictions. + ============ ============================================================= The default is 'flush'. For details about L1D flushing see :ref:`l1d_flush`.
@@ -576,7 +578,8 @@ Default mitigations The kernel default mitigations for vulnerable processors are: - PTE inversion to protect against malicious user space. This is done - unconditionally and cannot be controlled. + unconditionally and cannot be controlled. The swap storage is limited + to ~16TB. - L1D conditional flushing on VMENTER when EPT is enabled for a guest.
arch/x86/kernel/cpu/bugs.c +2 -1
@@ -779,7 +779,8 @@ static void __init l1tf_select_mitigation(void)#endif half_pa = (u64 )l1tf_pfn_limit () <<PAGE_SHIFT ; -if (e820__mapped_any (half_pa,ULLONG_MAX - half_pa,E820_TYPE_RAM )) { +if (l1tf_mitigation !=L1TF_MITIGATION_OFF && +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);
arch/x86/mm/init.c +1 -1
@@ -931,7 +931,7 @@ unsigned long max_swapfile_size(void) pages =generic_max_swapfile_size (); -if (boot_cpu_has_bug (X86_BUG_L1TF )) { +if (boot_cpu_has_bug (X86_BUG_L1TF ) && l1tf_mitigation !=L1TF_MITIGATION_OFF ) {/* Limit the swap file size to MAX_PA/2 for L1TF workaround */ unsigned long long l1tf_limit =l1tf_pfn_limit ();/*
Signature · 1 line
2.19.1
Quoted 8 lines · Michal Hocko
From: Michal Hocko <[email protected]>
Swap storage is restricted to
max_swapfile_size(~16TB onx86_64) whenever the system is deemed affected by L1TF vulnerability. Even though the limit is quite high for most deployments it seems to be too restrictive for deployments which are willing to live with the mitigation disabled.
Quoted 8 lines
We have a customer to deploy 8x 6,4TB PCIe/NVMe SSD swap devices which is clearly out of the limit.
Drop the swap restriction when l1tf=off is specified. It also doesn't make much sense to warn about too much memory for the l1tf mitigation when it is forcefully disabled by the administrator.
Signed-off-by Michal Hocko <[email protected]>
Quoted 28 lines · Michal Hocko
From: Michal Hocko <[email protected]>
Swap storage is restricted to
max_swapfile_size(~16TB onx86_64) whenever the system is deemed affected by L1TF vulnerability. Even though the limit is quite high for most deployments it seems to be too restrictive for deployments which are willing to live with the mitigation disabled.We have a customer to deploy 8x 6,4TB PCIe/NVMe SSD swap devices which is clearly out of the limit.
Drop the swap restriction when l1tf=off is specified. It also doesn't make much sense to warn about too much memory for the l1tf mitigation when it is forcefully disabled by the administrator.
Signed-off-by Michal Hocko <[email protected]>--- Documentation/admin-guide/kernel-parameters.txt | 2 ++ Documentation/admin-guide/l1tf.rst | 5 ++++- arch/x86/kernel/cpu/bugs.c | 3 ++- arch/x86/mm/init.c | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-)Documentation/admin-guide/kernel-parameters.txt +0
-0
Documentation/admin-guide/kernel-parameters.txt line 2099
Quoted 5 lines
Documentation/admin-guide/kernel-parameters.txt +2
-0@@ -2095,6 +2095,8 @@ off Disables hypervisor mitigations and doesn't emit any warnings. + It also drops the swap size and available + RAM limit restriction.
Minor nit: I think this should explicitly mention that those two things are related to bare metal mitigation, to avoid any confusion (as otherwise the l1tf cmdline parameter is purely about hypervisor mitigations).
With that
Thanks,
Signature · 2 lines
Jiri Kosina SUSE Labs
Quoted 25 lines · Jiri Kosina
Quoted 23 lines · Michal Hocko
From: Michal Hocko <[email protected]>
Swap storage is restricted to
max_swapfile_size(~16TB onx86_64) whenever the system is deemed affected by L1TF vulnerability. Even though the limit is quite high for most deployments it seems to be too restrictive for deployments which are willing to live with the mitigation disabled.We have a customer to deploy 8x 6,4TB PCIe/NVMe SSD swap devices which is clearly out of the limit.
Drop the swap restriction when l1tf=off is specified. It also doesn't make much sense to warn about too much memory for the l1tf mitigation when it is forcefully disabled by the administrator.
Signed-off-by Michal Hocko <[email protected]>--- Documentation/admin-guide/kernel-parameters.txt | 2 ++ Documentation/admin-guide/l1tf.rst | 5 ++++- arch/x86/kernel/cpu/bugs.c | 3 ++- arch/x86/mm/init.c | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-)
Quoted 14 lines
Documentation/admin-guide/kernel-parameters.txt line 2099
Quoted 10 lines
Documentation/admin-guide/kernel-parameters.txt +2
-0@@ -2095,6 +2095,8 @@ off Disables hypervisor mitigations and doesn't emit any warnings. + It also drops the swap size and available + RAM limit restriction.Minor nit: I think this should explicitly mention that those two things are related to bare metal mitigation, to avoid any confusion (as otherwise the l1tf cmdline parameter is purely about hypervisor mitigations).
Do you have any specific wording in mind?
It also drops the swap size and available RAM limit restrictions on both hypervisor and bare metal.
Sounds better?
Quoted 3 lines
With that
Acked-by Jiri Kosina <[email protected]>
Thanks!
Signature · 2 lines
Michal Hocko SUSE Labs
Quoted 12 lines · Michal Hocko
Quoted 6 lines
Documentation/admin-guide/kernel-parameters.txt line 2099
Quoted 2 lines
Documentation/admin-guide/kernel-parameters.txt +2
-0+ It also drops the swap size and available + RAM limit restriction.Minor nit: I think this should explicitly mention that those two things are related to bare metal mitigation, to avoid any confusion (as otherwise the l1tf cmdline parameter is purely about hypervisor mitigations).
Do you have any specific wording in mind?
It also drops the swap size and available RAM limit restrictions on both hypervisor and bare metal.
Quoted 7 lines
Sounds better?
Quoted 3 lines
With that
Acked-by Jiri Kosina <[email protected]>Thanks!
Yes, I think that makes it absolutely clear. Thanks,
Signature · 2 lines
Jiri Kosina SUSE Labs
Quoted 16 lines · Jiri Kosina
Quoted 14 lines · Michal Hocko
Quoted 6 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ It also drops the swap size and available + RAM limit restriction.Minor nit: I think this should explicitly mention that those two things are related to bare metal mitigation, to avoid any confusion (as otherwise the l1tf cmdline parameter is purely about hypervisor mitigations).
Do you have any specific wording in mind?
It also drops the swap size and available RAM limit restrictions on both hypervisor and bare metal.
Sounds better?
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
With that
Acked-by Jiri Kosina <[email protected]>Thanks!
Yes, I think that makes it absolutely clear. Thanks,
OK. Here is the incremental diff on top of the patch. I will fold and repost later this week. I assume people are still catching up after LPC and I do not want to spam them even more.
Documentation/admin-guide/kernel-parameters.txt +2 -1
@@ -2096,7 +2096,8 @@ Disables hypervisor mitigations and doesn't emit any warnings. It also drops the swap size and available - RAM limit restriction. + RAM limit restriction on both hypervisor and + bare metal. Default is 'flush'.
Documentation/admin-guide/l1tf.rst +2 -1
@@ -405,7 +405,8 @@ The kernel command line allows to control the L1TF mitigations at boot off Disables hypervisor mitigations and doesn't emit any warnings. - It also drops the swap size and available RAM limit restrictions. + It also drops the swap size and available RAM limit restrictions + on both hypervisor and bare metal. ============ =============================================================
Signature · 2 lines
Michal Hocko SUSE Labs
Quoted 18 lines · Michal Hocko
Quoted 18 lines
Quoted 18 lines
Quoted 6 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ It also drops the swap size and available + RAM limit restriction.Minor nit: I think this should explicitly mention that those two things are related to bare metal mitigation, to avoid any confusion (as otherwise the l1tf cmdline parameter is purely about hypervisor mitigations).
Do you have any specific wording in mind?
It also drops the swap size and available RAM limit restrictions on both hypervisor and bare metal.
Sounds better?
Quoted 3 lines
With that
Acked-by Jiri Kosina <[email protected]>
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Thanks!
Yes, I think that makes it absolutely clear. Thanks,
OK. Here is the incremental diff on top of the patch. I will fold and repost later this week. I assume people are still catching up after LPC and I do not want to spam them even more.
Is this queued anywhere in the meantime please?
Thanks,
Signature · 2 lines
Jiri Kosina SUSE Labs
Quoted 22 lines · Jiri Kosina
Quoted 20 lines · Michal Hocko
Quoted 20 lines
Quoted 19 lines
Quoted 6 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ It also drops the swap size and available + RAM limit restriction.Minor nit: I think this should explicitly mention that those two things are related to bare metal mitigation, to avoid any confusion (as otherwise the l1tf cmdline parameter is purely about hypervisor mitigations).
Do you have any specific wording in mind?
It also drops the swap size and available RAM limit restrictions on both hypervisor and bare metal.
Sounds better?
Quoted 3 lines
With that
Acked-by Jiri Kosina <[email protected]>Thanks!
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Yes, I think that makes it absolutely clear. Thanks,
OK. Here is the incremental diff on top of the patch. I will fold and repost later this week. I assume people are still catching up after LPC and I do not want to spam them even more.
Is this queued anywhere in the meantime please?
Not yet. Thanks for the reminder. It completely fall of my radar.
Thomas, do you want me to resubmit or there are some other changes you would like to see?
Signature · 2 lines
Michal Hocko SUSE Labs
Quoted 8 lines · Michal Hocko
From: Michal Hocko <[email protected]>
Swap storage is restricted to
max_swapfile_size(~16TB onx86_64) whenever the system is deemed affected by L1TF vulnerability. Even though the limit is quite high for most deployments it seems to be too restrictive for deployments which are willing to live with the mitigation disabled.
Quoted 6 lines
We have a customer to deploy 8x 6,4TB PCIe/NVMe SSD swap devices which is clearly out of the limit.
Drop the swap restriction when l1tf=off is specified. It also doesn't make much sense to warn about too much memory for the l1tf mitigation when it is forcefully disabled by the administrator.
-Andi
tip-bot for Michal Hocko
merge bot[tip:x86/pti] x86/speculation/l1tf: Drop the swap storage limit restriction when l1tf=off
In reply to Michal Hockox86/speculation/l1tf: Drop the swap storage limit restriction when l1tf=off
Commit-ID: f4abaa98c4575cc06ea5e1a593e3bc2c8de8ef48 Gitweb: https://git.kernel.org/tip/f4abaa98c4575cc06ea5e1a593e3bc2c8de8ef48 Author: Michal Hocko <[email protected]> AuthorDate: Tue, 13 Nov 2018 19:49:10 +0100 Committer: Thomas Gleixner <[email protected]> CommitDate: Mon, 10 Dec 2018 22:07:02 +0100
x86/speculation/l1tf: Drop the swap storage limit restriction when l1tf=off
Swap storage is restricted to max_swapfile_size (~16TB on x86_64) whenever the system is deemed affected by L1TF vulnerability. Even though the limit is quite high for most deployments it seems to be too restrictive for deployments which are willing to live with the mitigation disabled.
We have a customer to deploy 8x 6,4TB PCIe/NVMe SSD swap devices which is clearly out of the limit.
Drop the swap restriction when l1tf=off is specified. It also doesn't make much sense to warn about too much memory for the l1tf mitigation when it is forcefully disabled by the administrator.
[ tglx: Folded the documentation delta change ]
--- Documentation/admin-guide/kernel-parameters.txt | 3 +++ Documentation/admin-guide/l1tf.rst | 6 +++++- arch/x86/kernel/cpu/bugs.c | 3 ++- arch/x86/mm/init.c | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +3 -0
@@ -2095,6 +2095,9 @@ off Disables hypervisor mitigations and doesn't emit any warnings. + It also drops the swap size and available + RAM limit restriction on both hypervisor and + bare metal. Default is 'flush'.
Documentation/admin-guide/l1tf.rst +5 -1
@@ -405,6 +405,9 @@ time with the option "l1tf=". The valid arguments for this option are: off Disables hypervisor mitigations and doesn't emit any warnings. + It also drops the swap size and available RAM limit restrictions + on both hypervisor and bare metal. + ============ ============================================================= The default is 'flush'. For details about L1D flushing see :ref:`l1d_flush`.
@@ -576,7 +579,8 @@ Default mitigations The kernel default mitigations for vulnerable processors are: - PTE inversion to protect against malicious user space. This is done - unconditionally and cannot be controlled. + unconditionally and cannot be controlled. The swap storage is limited + to ~16TB. - L1D conditional flushing on VMENTER when EPT is enabled for a guest.
arch/x86/kernel/cpu/bugs.c +2 -1
@@ -1002,7 +1002,8 @@ static void __init l1tf_select_mitigation(void)#endif half_pa = (u64 )l1tf_pfn_limit () <<PAGE_SHIFT ; -if (e820__mapped_any (half_pa,ULLONG_MAX - half_pa,E820_TYPE_RAM )) { +if (l1tf_mitigation !=L1TF_MITIGATION_OFF && +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);
arch/x86/mm/init.c +1 -1
@@ -931,7 +931,7 @@ unsigned long max_swapfile_size(void) pages =generic_max_swapfile_size (); -if (boot_cpu_has_bug (X86_BUG_L1TF )) { +if (boot_cpu_has_bug (X86_BUG_L1TF ) && l1tf_mitigation !=L1TF_MITIGATION_OFF ) {/* Limit the swap file size to MAX_PA/2 for L1TF workaround */ unsigned long long l1tf_limit =l1tf_pfn_limit ();/*
Re: [tip:x86/pti] x86/speculation/l1tf: Drop the swap storage limit restriction when l1tf=off
Quoted 29 lines · tip-bot for Michal Hocko
Commit-ID: f4abaa98c4575cc06ea5e1a593e3bc2c8de8ef48 Gitweb: https://git.kernel.org/tip/f4abaa98c4575cc06ea5e1a593e3bc2c8de8ef48 Author: Michal Hocko <[email protected]> AuthorDate: Tue, 13 Nov 2018 19:49:10 +0100 Committer: Thomas Gleixner <[email protected]> CommitDate: Mon, 10 Dec 2018 22:07:02 +0100x86/speculation/l1tf: Drop the swap storage limit restriction when l1tf=off
[ tglx: Folded the documentation delta change ]
Documentation/admin-guide/kernel-parameters.txt +3
-0@@ -2095,6 +2095,9 @@ off Disables hypervisor mitigations and doesn't emit any warnings. + It also drops the swap size and available + RAM limit restriction on both hypervisor and + bare metal. Default is 'flush'.Documentation/admin-guide/l1tf.rst +0
-0
Documentation/admin-guide/l1tf.rst time with the option "l1tf=". The valid arguments for this option are: · line 410
Quoted 6 lines
Documentation/admin-guide/l1tf.rst +3
-0@@ -405,6 +405,9 @@ time with the option "l1tf=". The valid arguments for this option are: off Disables hypervisor mitigations and doesn't emit any warnings. + It also drops the swap size and available RAM limit restrictions + on both hypervisor and bare metal. +
Note tha there's also some whitespace damage here: all other similar lines in this RST file start with two tabs, this one starts with 8 spaces.
Thanks,
Ingo
Re: [tip:x86/pti] x86/speculation/l1tf: Drop the swap storage limit restriction when l1tf=off
Quoted 9 lines · Ingo Molnar
Documentation/admin-guide/l1tf.rst time with the option "l1tf=". The valid arguments for this option are: · line 410
Quoted 5 lines
off Disables hypervisor mitigations and doesn't emit any
Documentation/admin-guide/l1tf.rst +3
-0warnings. + It also drops the swap size and available RAM limit restrictions + on both hypervisor and bare metal. +Note tha there's also some whitespace damage here: all other similar lines in this RST file start with two tabs, this one starts with 8 spaces.
Fixed...
Re: [tip:x86/pti] x86/speculation/l1tf: Drop the swap storage limit restriction when l1tf=off
Quoted 11 lines · Thomas Gleixner
Quoted 9 lines · Ingo Molnar
Documentation/admin-guide/l1tf.rst time with the option "l1tf=". The valid arguments for this option are: · line 410
Quoted 5 lines
off Disables hypervisor mitigations and doesn't emit any
Documentation/admin-guide/l1tf.rst +3
-0warnings. + It also drops the swap size and available RAM limit restrictions + on both hypervisor and bare metal. +Note tha there's also some whitespace damage here: all other similar lines in this RST file start with two tabs, this one starts with 8 spaces.
Quoted 1 line
Fixed...
Thanks Thomas! I haven't noticed a different whitespaces and relied on whatever vim decided to do.
Signature · 2 lines
Michal Hocko SUSE Labs
tip-bot for Michal Hocko
merge bot[tip:x86/pti] x86/speculation/l1tf: Drop the swap storage limit restriction when l1tf=off
In reply to Michal Hockox86/speculation/l1tf: Drop the swap storage limit restriction when l1tf=off
Commit-ID: d7409e79dbec2d2834fb6ccca53664197ab65505 Gitweb: https://git.kernel.org/tip/d7409e79dbec2d2834fb6ccca53664197ab65505 Author: Michal Hocko <[email protected]> AuthorDate: Tue, 13 Nov 2018 19:49:10 +0100 Committer: Thomas Gleixner <[email protected]> CommitDate: Tue, 11 Dec 2018 11:13:32 +0100
x86/speculation/l1tf: Drop the swap storage limit restriction when l1tf=off
Swap storage is restricted to max_swapfile_size (~16TB on x86_64) whenever the system is deemed affected by L1TF vulnerability. Even though the limit is quite high for most deployments it seems to be too restrictive for deployments which are willing to live with the mitigation disabled.
We have a customer to deploy 8x 6,4TB PCIe/NVMe SSD swap devices which is clearly out of the limit.
Drop the swap restriction when l1tf=off is specified. It also doesn't make much sense to warn about too much memory for the l1tf mitigation when it is forcefully disabled by the administrator.
[ tglx: Folded the documentation delta change ]
--- Documentation/admin-guide/kernel-parameters.txt | 3 +++ Documentation/admin-guide/l1tf.rst | 6 +++++- arch/x86/kernel/cpu/bugs.c | 3 ++- arch/x86/mm/init.c | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +3 -0
@@ -2095,6 +2095,9 @@ off Disables hypervisor mitigations and doesn't emit any warnings. + It also drops the swap size and available + RAM limit restriction on both hypervisor and + bare metal. Default is 'flush'.
Documentation/admin-guide/l1tf.rst +5 -1
@@ -405,6 +405,9 @@ time with the option "l1tf=". The valid arguments for this option are: off Disables hypervisor mitigations and doesn't emit any warnings. + It also drops the swap size and available RAM limit restrictions + on both hypervisor and bare metal. + ============ ============================================================= The default is 'flush'. For details about L1D flushing see :ref:`l1d_flush`.
@@ -576,7 +579,8 @@ Default mitigations The kernel default mitigations for vulnerable processors are: - PTE inversion to protect against malicious user space. This is done - unconditionally and cannot be controlled. + unconditionally and cannot be controlled. The swap storage is limited + to ~16TB. - L1D conditional flushing on VMENTER when EPT is enabled for a guest.
arch/x86/kernel/cpu/bugs.c +2 -1
@@ -1002,7 +1002,8 @@ static void __init l1tf_select_mitigation(void)#endif half_pa = (u64 )l1tf_pfn_limit () <<PAGE_SHIFT ; -if (e820__mapped_any (half_pa,ULLONG_MAX - half_pa,E820_TYPE_RAM )) { +if (l1tf_mitigation !=L1TF_MITIGATION_OFF && +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);
arch/x86/mm/init.c +1 -1
@@ -931,7 +931,7 @@ unsigned long max_swapfile_size(void) pages =generic_max_swapfile_size (); -if (boot_cpu_has_bug (X86_BUG_L1TF )) { +if (boot_cpu_has_bug (X86_BUG_L1TF ) && l1tf_mitigation !=L1TF_MITIGATION_OFF ) {/* Limit the swap file size to MAX_PA/2 for L1TF workaround */ unsigned long long l1tf_limit =l1tf_pfn_limit ();/*
tip-bot for Michal Hocko
merge bot[tip:x86/pti] x86/speculation/l1tf: Drop the swap storage limit restriction when l1tf=off
In reply to Michal Hockox86/speculation/l1tf: Drop the swap storage limit restriction when l1tf=off
Commit-ID: 5b5e4d623ec8a34689df98e42d038a3b594d2ff9 Gitweb: https://git.kernel.org/tip/5b5e4d623ec8a34689df98e42d038a3b594d2ff9 Author: Michal Hocko <[email protected]> AuthorDate: Tue, 13 Nov 2018 19:49:10 +0100 Committer: Thomas Gleixner <[email protected]> CommitDate: Tue, 11 Dec 2018 11:46:13 +0100
x86/speculation/l1tf: Drop the swap storage limit restriction when l1tf=off
Swap storage is restricted to max_swapfile_size (~16TB on x86_64) whenever the system is deemed affected by L1TF vulnerability. Even though the limit is quite high for most deployments it seems to be too restrictive for deployments which are willing to live with the mitigation disabled.
We have a customer to deploy 8x 6,4TB PCIe/NVMe SSD swap devices which is clearly out of the limit.
Drop the swap restriction when l1tf=off is specified. It also doesn't make much sense to warn about too much memory for the l1tf mitigation when it is forcefully disabled by the administrator.
[ tglx: Folded the documentation delta change ]
--- Documentation/admin-guide/kernel-parameters.txt | 3 +++ Documentation/admin-guide/l1tf.rst | 6 +++++- arch/x86/kernel/cpu/bugs.c | 3 ++- arch/x86/mm/init.c | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +3 -0
@@ -2095,6 +2095,9 @@ off Disables hypervisor mitigations and doesn't emit any warnings. + It also drops the swap size and available + RAM limit restriction on both hypervisor and + bare metal. Default is 'flush'.
Documentation/admin-guide/l1tf.rst +5 -1
@@ -405,6 +405,9 @@ time with the option "l1tf=". The valid arguments for this option are: off Disables hypervisor mitigations and doesn't emit any warnings. + It also drops the swap size and available RAM limit restrictions + on both hypervisor and bare metal. + ============ ============================================================= The default is 'flush'. For details about L1D flushing see :ref:`l1d_flush`.
@@ -576,7 +579,8 @@ Default mitigations The kernel default mitigations for vulnerable processors are: - PTE inversion to protect against malicious user space. This is done - unconditionally and cannot be controlled. + unconditionally and cannot be controlled. The swap storage is limited + to ~16TB. - L1D conditional flushing on VMENTER when EPT is enabled for a guest.
arch/x86/kernel/cpu/bugs.c +2 -1
@@ -1002,7 +1002,8 @@ static void __init l1tf_select_mitigation(void)#endif half_pa = (u64 )l1tf_pfn_limit () <<PAGE_SHIFT ; -if (e820__mapped_any (half_pa,ULLONG_MAX - half_pa,E820_TYPE_RAM )) { +if (l1tf_mitigation !=L1TF_MITIGATION_OFF && +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);
arch/x86/mm/init.c +1 -1
@@ -931,7 +931,7 @@ unsigned long max_swapfile_size(void) pages =generic_max_swapfile_size (); -if (boot_cpu_has_bug (X86_BUG_L1TF )) { +if (boot_cpu_has_bug (X86_BUG_L1TF ) && l1tf_mitigation !=L1TF_MITIGATION_OFF ) {/* Limit the swap file size to MAX_PA/2 for L1TF workaround */ unsigned long long l1tf_limit =l1tf_pfn_limit ();/*