xen/xen.sles11sp1.bug684297.xen_oldmem_pfn_is_ram.patch
Charles Arnold 8547e28bd5 - Upstream patches from Jan
23233-hvm-cr-access.patch
  23234-svm-decode-assist-base.patch
  23235-svm-decode-assist-crs.patch
  23236-svm-decode-assist-invlpg.patch
  23238-svm-decode-assist-insn-fetch.patch
  23303-cpufreq-misc.patch
  23304-amd-oprofile-strings.patch
  23305-amd-fam15-xenoprof.patch
  23306-amd-fam15-vpmu.patch
  23334-amd-fam12+14-vpmu.patch
  23338-vtd-force-intremap.patch

- fate#310957 - Update to Xen 4.1.1-rc1 c/s 23064 

- xentrace: dynamic tracebuffer allocation
  xen-unstable.xentrace.dynamic_tbuf.patch
  xen-unstable.xentrace.empty_t_info_pages.patch
  xen-unstable.xentrace.verbose.patch
  xen-unstable.xentrace.no_gdprintk.patch
  xen-unstable.xentrace.comments.patch
  xen-unstable.xentrace.printk_prefix.patch
  xen-unstable.xentrace.remove_debug_printk.patch
  xen-unstable.xentrace.t_info_pages-formula.patch
  xen-unstable.xentrace.register_cpu_notifier-boot_time.patch
  xen-unstable.xentrace.t_info_page-overflow.patch
  xen-unstable.xentrace.t_info_first_offset.patch
  xen-unstable.xentrace.data_size__read_mostly.patch
  xen-unstable.xentrace.__insert_record-dst-type.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=124
2011-05-31 17:35:29 +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.1-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
===================================================================
--- xen-4.1.1-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
+++ xen-4.1.1-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);