xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-4.15] x86/mem_sharing: copy parent VM's hostp2m's max_mapped_pfn during forking
@ 2021-03-18 21:36 Tamas K Lengyel
  2021-03-19 10:23 ` Jan Beulich
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Tamas K Lengyel @ 2021-03-18 21:36 UTC (permalink / raw)
  To: xen-devel
  Cc: Tamas K Lengyel, Tamas K Lengyel, Jan Beulich, Andrew Cooper,
	George Dunlap, Roger Pau Monné,
	Wei Liu

When creating a VM fork copy the parent VM's hostp2m max_mapped_pfn value. Some
toolstack relies on the XENMEM_maximum_gpfn value to establish the maximum
addressable physical memory in the VM and for forks that have not yet been
unpaused that value is not going to reflect the correct max gpfn that's
possible to populate into the p2m. This patch fixes the issue.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>
---
 xen/arch/x86/mm/mem_sharing.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 00ada05c10..98b14f7b0a 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1761,6 +1761,7 @@ static int copy_settings(struct domain *cd, struct domain *d)
         return rc;
 
     copy_tsc(cd, d);
+    p2m_get_hostp2m(cd)->max_mapped_pfn = p2m_get_hostp2m(d)->max_mapped_pfn;
 
     return rc;
 }
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-03-26 15:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18 21:36 [PATCH for-4.15] x86/mem_sharing: copy parent VM's hostp2m's max_mapped_pfn during forking Tamas K Lengyel
2021-03-19 10:23 ` Jan Beulich
2021-03-19 11:06   ` Tamas K Lengyel
2021-03-19 11:25     ` Jan Beulich
2021-03-19 12:17       ` Tamas K Lengyel
2021-03-19 12:31 ` Tamas K Lengyel
2021-03-24 11:42   ` Tamas K Lengyel
2021-03-26 11:36   ` Ian Jackson
2021-03-26 12:14     ` Tamas K Lengyel
2021-03-26 12:31       ` Ian Jackson
2021-03-26 15:04 ` Andrew Cooper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).