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 155743 Details for
Bug 240454
RHEL4 Kernel crash when specifying mem= or highmem= kernel parameter
[?]
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]
Another version of the mem= patch for RHEL-4; I forgot a #include for x86_64
linux-2.6.9-xen-fix-mem-parm3.patch (text/plain), 4.17 KB, created by
Chris Lalancette
on 2007-05-30 20:06:05 UTC
(
hide
)
Description:
Another version of the mem= patch for RHEL-4; I forgot a #include for x86_64
Filename:
MIME Type:
Creator:
Chris Lalancette
Created:
2007-05-30 20:06:05 UTC
Size:
4.17 KB
patch
obsolete
>diff -urp linux-2.6.9.orig/arch/i386/kernel/setup-xen.c linux-2.6.9/arch/i386/kernel/setup-xen.c >--- linux-2.6.9.orig/arch/i386/kernel/setup-xen.c 2007-05-30 16:00:07.000000000 -0400 >+++ linux-2.6.9/arch/i386/kernel/setup-xen.c 2007-05-30 16:02:56.000000000 -0400 >@@ -1476,6 +1476,7 @@ void __init setup_arch(char **cmdline_p) > int i, j, k, fpp; > struct physdev_set_iopl set_iopl; > unsigned long max_low_pfn; >+ unsigned long p2m_pages; > > /* Force a quick death if the kernel panics (not domain 0). */ > extern int panic_timeout; >@@ -1592,6 +1593,32 @@ void __init setup_arch(char **cmdline_p) > find_smp_config(); > #endif > >+ p2m_pages = max_pfn; >+ if (xen_start_info->nr_pages > max_pfn) { >+ /* >+ * the max_pfn was shrunk (probably by mem= or highmem= >+ * kernel parameter); shrink reservation with the HV >+ */ >+ struct xen_memory_reservation reservation = { >+ .address_bits = 0, >+ .extent_order = 0, >+ .domid = DOMID_SELF >+ }; >+ unsigned int difference; >+ int ret; >+ >+ difference = xen_start_info->nr_pages - max_pfn; >+ >+ set_xen_guest_handle(reservation.extent_start, >+ ((unsigned long *)xen_start_info->mfn_list) + max_pfn); >+ reservation.nr_extents = difference; >+ ret = HYPERVISOR_memory_op(XENMEM_decrease_reservation, >+ &reservation); >+ BUG_ON (ret != difference); >+ } >+ else if (max_pfn > xen_start_info->nr_pages) >+ p2m_pages = xen_start_info->nr_pages; >+ > /* Make sure we have a correctly sized P->M table. */ > if (!xen_feature(XENFEAT_auto_translated_physmap)) { > phys_to_machine_mapping = alloc_bootmem_low_pages( >@@ -1600,7 +1627,7 @@ void __init setup_arch(char **cmdline_p) > max_pfn * sizeof(unsigned long)); > memcpy(phys_to_machine_mapping, > (unsigned long *)xen_start_info->mfn_list, >- xen_start_info->nr_pages * sizeof(unsigned long)); >+ p2m_pages * sizeof(unsigned long)); > free_bootmem( > __pa(xen_start_info->mfn_list), > PFN_PHYS(PFN_UP(xen_start_info->nr_pages * >diff -urp linux-2.6.9.orig/arch/x86_64/kernel/setup-xen.c linux-2.6.9/arch/x86_64/kernel/setup-xen.c >--- linux-2.6.9.orig/arch/x86_64/kernel/setup-xen.c 2007-05-30 15:59:18.000000000 -0400 >+++ linux-2.6.9/arch/x86_64/kernel/setup-xen.c 2007-05-30 16:03:25.000000000 -0400 >@@ -68,6 +68,7 @@ > #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) > #define PFN_PHYS(x) ((x) << PAGE_SHIFT) > #include <asm/mach-xen/setup_arch_post.h> >+#include <xen/interface/memory.h> > > #include <xen/evtchn.h> > #include <xen/interface/io/console.h> /* P3 */ >@@ -822,6 +823,8 @@ void __init setup_arch(char **cmdline_p) > { > int i, j, k, fpp; > unsigned long va; >+ unsigned long p2m_pages; >+ > /* 'Initial mapping' of initrd must be destroyed. */ > for (va = xen_start_info->mod_start; > va < (xen_start_info->mod_start+xen_start_info->mod_len); >@@ -829,6 +832,32 @@ void __init setup_arch(char **cmdline_p) > HYPERVISOR_update_va_mapping(va, __pte_ma(0), 0); > } > >+ p2m_pages = end_pfn; >+ if (xen_start_info->nr_pages > end_pfn) { >+ /* >+ * the end_pfn was shrunk (probably by mem= or highmem= >+ * kernel parameter); shrink reservation with the HV >+ */ >+ struct xen_memory_reservation reservation = { >+ .address_bits = 0, >+ .extent_order = 0, >+ .domid = DOMID_SELF >+ }; >+ unsigned int difference; >+ int ret; >+ >+ difference = xen_start_info->nr_pages - end_pfn; >+ >+ set_xen_guest_handle(reservation.extent_start, >+ ((unsigned long *)xen_start_info->mfn_list) + end_pfn); >+ reservation.nr_extents = difference; >+ ret = HYPERVISOR_memory_op(XENMEM_decrease_reservation, >+ &reservation); >+ BUG_ON (ret != difference); >+ } >+ else if (end_pfn > xen_start_info->nr_pages) >+ p2m_pages = xen_start_info->nr_pages; >+ > if (!xen_feature(XENFEAT_auto_translated_physmap)) { > /* Make sure we have a large enough P->M table. */ > phys_to_machine_mapping = alloc_bootmem( >@@ -837,7 +866,7 @@ void __init setup_arch(char **cmdline_p) > end_pfn * sizeof(unsigned long)); > memcpy(phys_to_machine_mapping, > (unsigned long *)xen_start_info->mfn_list, >- xen_start_info->nr_pages * sizeof(unsigned long)); >+ p2m_pages * sizeof(unsigned long)); > free_bootmem( > __pa(xen_start_info->mfn_list), > PFN_PHYS(PFN_UP(xen_start_info->nr_pages *
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 240454
:
154937
|
154963
| 155743