Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2:ARM
xen
xen.sles11sp1.bug684297.xen_oldmem_pfn_is_ram.p...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xen.sles11sp1.bug684297.xen_oldmem_pfn_is_ram.patch of Package xen
Use new Xen HVMOP_get_mem_type hvmop hypercall option and new Linux kernel register_oldmem_pfn_is_ram interface. Signed-off-by: Olaf Hering <olaf@aepfle.de> --- unmodified_drivers/linux-2.6/platform-pci/platform-pci.c | 31 +++++++++++++++ 1 file changed, 31 insertions(+) Index: xen-4.1.2-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c =================================================================== --- xen-4.1.2-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +++ xen-4.1.2-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c @@ -30,6 +30,7 @@ #include <linux/interrupt.h> #include <linux/vmalloc.h> #include <linux/mm.h> +#include <linux/crash_dump.h> #include <asm/io.h> #include <asm/irq.h> #include <asm/uaccess.h> @@ -358,6 +359,32 @@ static int check_platform_magic(struct d return -ENODEV; } +#if defined(HAVE_OLDMEM_PFN_IS_RAM) && defined(HVMOP_get_mem_type) +static int xen_oldmem_pfn_is_ram(unsigned long pfn) +{ + struct xen_hvm_get_mem_type a; + int ram; + + a.domid = DOMID_SELF; + a.pfn = pfn; + if (HYPERVISOR_hvm_op(HVMOP_get_mem_type, &a)) + return -ENXIO; + + switch (a.mem_type) { + case HVMMEM_mmio_dm: + ram = 0; + break; + case HVMMEM_ram_rw: + case HVMMEM_ram_ro: + default: + ram = 1; + break; + } + + return ram; +} +#endif + static int __devinit platform_pci_init(struct pci_dev *pdev, const struct pci_device_id *ent) { @@ -426,6 +453,10 @@ static int __devinit platform_pci_init(s if ((ret = xen_panic_handler_init())) goto out; +#if defined(HAVE_OLDMEM_PFN_IS_RAM) && defined(HVMOP_get_mem_type) + register_oldmem_pfn_is_ram(&xen_oldmem_pfn_is_ram); +#endif + out: if (ret) { pci_release_region(pdev, 0);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor