Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 278811 Details for
Bug 316371
32-bit PAE HV hardware limitation > 4GB memory
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Fail attempts to add pages to guest pseudophys memory map above 4GB when running with AMD NPT on PAE host
Fix4GBPAEGuestMemory.patch (text/plain), 6.12 KB, created by
Bhavna Sarathy
on 2007-12-05 21:30:47 UTC
(
hide
)
Description:
Fail attempts to add pages to guest pseudophys memory map above 4GB when running with AMD NPT on PAE host
Filename:
MIME Type:
Creator:
Bhavna Sarathy
Created:
2007-12-05 21:30:47 UTC
Size:
6.12 KB
patch
obsolete
># HG changeset patch ># User Keir Fraser <keir@xensource.com> ># Date 1193825262 0 ># Node ID 2717128cbdd11da80c5276aaa7b1a4992cfbf6f2 ># Parent c7d5d229f19122a8aad10dac178a4f86f39d73f0 >hvm: Fail attempts to add pages to guest pseudophys memory map above >4GB when running with AMD NPT on PAE host. >From: Wei Huang <Wei.Huang2@amd.com> >Signed-off-by: Keir Fraser <keir@xensource.com> > >diff -r c7d5d229f191 -r 2717128cbdd1 xen/arch/x86/hvm/hvm.c >--- a/xen/arch/x86/hvm/hvm.c Wed Oct 31 09:36:45 2007 +0000 >+++ b/xen/arch/x86/hvm/hvm.c Wed Oct 31 10:07:42 2007 +0000 >@@ -53,10 +53,11 @@ > /* > * Xen command-line option to allow/disallow hardware-assisted paging. > * Since the phys-to-machine table of AMD NPT is in host format, 32-bit Xen >- * could only support guests using NPT with up to a 4GB memory map. Therefore >- * we only allow HAP by default on 64-bit Xen. >+ * can only support guests using NPT with up to a 4GB memory map. Therefore >+ * we disallow HAP by default on PAE Xen (by default we want to support an >+ * 8GB pseudophysical memory map for HVM guests on a PAE host). > */ >-static int opt_hap_permitted = (BITS_PER_LONG == 8); >+static int opt_hap_permitted = (CONFIG_PAGING_LEVELS != 3); > boolean_param("hap", opt_hap_permitted); > > int hvm_enabled __read_mostly; >diff -r c7d5d229f191 -r 2717128cbdd1 xen/arch/x86/mm/p2m.c >--- a/xen/arch/x86/mm/p2m.c Wed Oct 31 09:36:45 2007 +0000 >+++ b/xen/arch/x86/mm/p2m.c Wed Oct 31 10:07:42 2007 +0000 >@@ -219,15 +219,17 @@ set_p2m_entry(struct domain *d, unsigned > goto out; > #endif > #if CONFIG_PAGING_LEVELS >= 3 >- // When using PAE Xen, we only allow 33 bits of pseudo-physical >- // address in translated guests (i.e. 8 GBytes). This restriction >- // comes from wanting to map the P2M table into the 16MB RO_MPT hole >- // in Xen's address space for translated PV guests. >- // >+ /* >+ * When using PAE Xen, we only allow 33 bits of pseudo-physical >+ * address in translated guests (i.e. 8 GBytes). This restriction >+ * comes from wanting to map the P2M table into the 16MB RO_MPT hole >+ * in Xen's address space for translated PV guests. >+ * When using AMD's NPT on PAE Xen, we are restricted to 4GB. >+ */ > if ( !p2m_next_level(d, &table_mfn, &table, &gfn_remainder, gfn, > L3_PAGETABLE_SHIFT - PAGE_SHIFT, >- (CONFIG_PAGING_LEVELS == 3 >- ? 8 >+ ((CONFIG_PAGING_LEVELS == 3) >+ ? (hvm_funcs.hap_supported ? 4 : 8) > : L3_PAGETABLE_ENTRIES), > PGT_l2_page_table) ) > goto out; >@@ -686,16 +688,26 @@ guest_physmap_remove_page(struct domain > p2m_unlock(d); > } > >-void >+int > guest_physmap_add_entry(struct domain *d, unsigned long gfn, > unsigned long mfn, p2m_type_t t) > { > unsigned long ogfn; > p2m_type_t ot; > mfn_t omfn; >+ int rc = 0; > > if ( !paging_mode_translate(d) ) >- return; >+ return -EINVAL; >+ >+#if CONFIG_PAGING_LEVELS == 3 >+ /* 32bit PAE nested paging does not support over 4GB guest due to >+ * hardware translation limit. This limitation is checked by comparing >+ * gfn with 0xfffffUL. >+ */ >+ if ( paging_mode_hap(d) && (gfn > 0xfffffUL) ) >+ return -EINVAL; >+#endif > > p2m_lock(d); > audit_p2m(d); >@@ -735,18 +747,22 @@ guest_physmap_add_entry(struct domain *d > > if ( mfn_valid(_mfn(mfn)) ) > { >- set_p2m_entry(d, gfn, _mfn(mfn), t); >+ if ( !set_p2m_entry(d, gfn, _mfn(mfn), t) ) >+ rc = -EINVAL; > set_gpfn_from_mfn(mfn, gfn); > } > else > { > gdprintk(XENLOG_WARNING, "Adding bad mfn to p2m map (%#lx -> %#lx)\n", > gfn, mfn); >- set_p2m_entry(d, gfn, _mfn(INVALID_MFN), p2m_invalid); >+ if ( !set_p2m_entry(d, gfn, _mfn(INVALID_MFN), p2m_invalid) ) >+ rc = -EINVAL; > } > > audit_p2m(d); > p2m_unlock(d); >+ >+ return rc; > } > > /* Walk the whole p2m table, changing any entries of the old type >diff -r c7d5d229f191 -r 2717128cbdd1 xen/common/memory.c >--- a/xen/common/memory.c Wed Oct 31 09:36:45 2007 +0000 >+++ b/xen/common/memory.c Wed Oct 31 10:07:42 2007 +0000 >@@ -131,7 +131,8 @@ static void populate_physmap(struct memo > if ( unlikely(paging_mode_translate(d)) ) > { > for ( j = 0; j < (1 << a->extent_order); j++ ) >- guest_physmap_add_page(d, gpfn + j, mfn + j); >+ if ( guest_physmap_add_page(d, gpfn + j, mfn + j) ) >+ goto out; > } > else > { >@@ -445,8 +446,9 @@ static long memory_exchange(XEN_GUEST_HA > mfn = page_to_mfn(page); > if ( unlikely(paging_mode_translate(d)) ) > { >+ /* Ignore failure here. There's nothing we can do. */ > for ( k = 0; k < (1UL << exch.out.extent_order); k++ ) >- guest_physmap_add_page(d, gpfn + k, mfn + k); >+ (void)guest_physmap_add_page(d, gpfn + k, mfn + k); > } > else > { >diff -r c7d5d229f191 -r 2717128cbdd1 xen/include/asm-x86/p2m.h >--- a/xen/include/asm-x86/p2m.h Wed Oct 31 09:36:45 2007 +0000 >+++ b/xen/include/asm-x86/p2m.h Wed Oct 31 10:07:42 2007 +0000 >@@ -201,14 +201,17 @@ void p2m_teardown(struct domain *d); > void p2m_teardown(struct domain *d); > > /* Add a page to a domain's p2m table */ >-void guest_physmap_add_entry(struct domain *d, unsigned long gfn, >+int guest_physmap_add_entry(struct domain *d, unsigned long gfn, > unsigned long mfn, p2m_type_t t); > >-/* Untyped version for RAM only, for compatibility */ >-static inline void guest_physmap_add_page(struct domain *d, unsigned long gfn, >- unsigned long mfn) >+/* Untyped version for RAM only, for compatibility >+ * >+ * Return 0 for success >+ */ >+static inline int guest_physmap_add_page(struct domain *d, unsigned long gfn, >+ unsigned long mfn) > { >- guest_physmap_add_entry(d, gfn, mfn, p2m_ram_rw); >+ return guest_physmap_add_entry(d, gfn, mfn, p2m_ram_rw); > } > > /* Remove a page from a domain's p2m table */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 316371
:
237931
|
239131
| 278811