xen/xen.sles11sp1.bug684297.xen_oldmem_pfn_is_ram.patch
Charles Arnold 800917b5a2 - bnc#717650 - Unable to start VM
- Update to Xen 4.1.2_rc2 c/s 23152

- bnc#716695 - domUs using tap devices will not start
  updated multi-xvdp.patch

- Upstream patches from Jan
  23803-intel-pmu-models.patch
  23800-x86_64-guest-addr-range.patch
  23795-intel-ich10-quirk.patch
  23804-x86-IPI-counts.patch 

- bnc#706106 - Inconsistent reporting of VM names during migration
  xend-migration-domname-fix.patch

- bnc#712823 - L3:Xen guest does not start reliable when rebooted
  xend-vcpu-affinity-fix.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=143
2011-09-15 21:43:21 +00:00

66 lines
1.7 KiB
Diff

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/system.h>
#include <asm/io.h>
#include <asm/irq.h>
@@ -359,6 +360,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)
{
@@ -427,6 +454,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);