p***@xen.org
2018-11-20 14:57:29 UTC
commit 0864dd81814f6f07957d85a1e9c9443e06bb7ee2
Author: Andrew Cooper <***@citrix.com>
AuthorDate: Tue Nov 20 15:51:36 2018 +0100
Commit: Jan Beulich <***@suse.com>
CommitDate: Tue Nov 20 15:51:36 2018 +0100
x86/dom0: Avoid using 1G superpages if shadowing may be necessary
The shadow code doesn't support 1G superpages, and will hand #PF[RSVD] back to
guests.
For dom0's with 512GB of RAM or more (and subject to the P2M alignment), Xen's
domain builder might use 1G superpages.
Avoid using 1G superpages (falling back to 2M superpages instead) if there is
a reasonable chance that we may have to shadow dom0. This assumes that there
are no circumstances where we will activate logdirty mode on dom0.
Signed-off-by: Andrew Cooper <***@citrix.com>
Reviewed-by: Jan Beulich <***@suse.com>
master commit: 96f6ee15ad7ca96472779fc5c083b4149495c584
master date: 2018-11-12 11:26:04 +0000
---
xen/arch/x86/pv/dom0_build.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index efb918ee0a..6588c0bd95 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -147,7 +147,14 @@ static __init void setup_pv_physmap(struct domain *d, unsigned long pgtbl_pfn,
pl3e += l3_table_offset(vphysmap_start);
if ( !l3e_get_intpte(*pl3e) )
{
- if ( cpu_has_page1gb &&
+ /*
+ * 1G superpages aren't supported by the shadow code. Avoid using
+ * them if we are liable to need to start shadowing dom0. This
+ * assumes that there are no circumstances where we will activate
+ * logdirty mode on dom0.
+ */
+ if ( (!IS_ENABLED(CONFIG_SHADOW_PAGING) ||
+ !d->arch.pv_domain.check_l1tf) && cpu_has_page1gb &&
!(vphysmap_start & ((1UL << L3_PAGETABLE_SHIFT) - 1)) &&
vphysmap_end >= vphysmap_start + (1UL << L3_PAGETABLE_SHIFT) &&
(page = alloc_domheap_pages(d,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.9
Author: Andrew Cooper <***@citrix.com>
AuthorDate: Tue Nov 20 15:51:36 2018 +0100
Commit: Jan Beulich <***@suse.com>
CommitDate: Tue Nov 20 15:51:36 2018 +0100
x86/dom0: Avoid using 1G superpages if shadowing may be necessary
The shadow code doesn't support 1G superpages, and will hand #PF[RSVD] back to
guests.
For dom0's with 512GB of RAM or more (and subject to the P2M alignment), Xen's
domain builder might use 1G superpages.
Avoid using 1G superpages (falling back to 2M superpages instead) if there is
a reasonable chance that we may have to shadow dom0. This assumes that there
are no circumstances where we will activate logdirty mode on dom0.
Signed-off-by: Andrew Cooper <***@citrix.com>
Reviewed-by: Jan Beulich <***@suse.com>
master commit: 96f6ee15ad7ca96472779fc5c083b4149495c584
master date: 2018-11-12 11:26:04 +0000
---
xen/arch/x86/pv/dom0_build.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index efb918ee0a..6588c0bd95 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -147,7 +147,14 @@ static __init void setup_pv_physmap(struct domain *d, unsigned long pgtbl_pfn,
pl3e += l3_table_offset(vphysmap_start);
if ( !l3e_get_intpte(*pl3e) )
{
- if ( cpu_has_page1gb &&
+ /*
+ * 1G superpages aren't supported by the shadow code. Avoid using
+ * them if we are liable to need to start shadowing dom0. This
+ * assumes that there are no circumstances where we will activate
+ * logdirty mode on dom0.
+ */
+ if ( (!IS_ENABLED(CONFIG_SHADOW_PAGING) ||
+ !d->arch.pv_domain.check_l1tf) && cpu_has_page1gb &&
!(vphysmap_start & ((1UL << L3_PAGETABLE_SHIFT) - 1)) &&
vphysmap_end >= vphysmap_start + (1UL << L3_PAGETABLE_SHIFT) &&
(page = alloc_domheap_pages(d,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.9