xcp-1.6-updates/xen-4.1.hg

changeset 23294:0c84b48831c8

unmodified drivers: add pfn_is_ram helper for kdump

Register pfn_is_ram helper speed up reading /proc/vmcore in the kdump
kernel. It is compiled only if the kernel source is recent enough to
have the pfn_is_ram helper (v3.0-rc1, commit
997c136f518c5debd63847e78e2a8694f56dcf90).

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset: 25068:e4460795ee66
xen-unstable date: Fri Mar 16 11:34:41 2012 +0100
author Olaf Hering <olaf@aepfle.de>
date Mon May 14 16:50:21 2012 +0100 (2012-05-14)
parents a427ff3fee5f
children bb1ab1475ce8
files unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
line diff
     1.1 --- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c	Mon May 14 16:50:03 2012 +0100
     1.2 +++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c	Mon May 14 16:50:21 2012 +0100
     1.3 @@ -351,6 +351,32 @@ static int check_platform_magic(struct d
     1.4  	return -ENODEV;
     1.5  }
     1.6  
     1.7 +#ifdef HAVE_OLDMEM_PFN_IS_RAM
     1.8 +static int xen_oldmem_pfn_is_ram(unsigned long pfn)
     1.9 +{
    1.10 +	struct xen_hvm_get_mem_type a;
    1.11 +	int ret;
    1.12 +
    1.13 +	a.domid = DOMID_SELF;
    1.14 +	a.pfn = pfn;
    1.15 +	if (HYPERVISOR_hvm_op(HVMOP_get_mem_type, &a))
    1.16 +		return -ENXIO;
    1.17 +
    1.18 +	switch (a.mem_type) {
    1.19 +		case HVMMEM_mmio_dm:
    1.20 +			ret = 0;
    1.21 +			break;
    1.22 +		case HVMMEM_ram_rw:
    1.23 +		case HVMMEM_ram_ro:
    1.24 +		default:
    1.25 +			ret = 1;
    1.26 +			break;
    1.27 +	}
    1.28 +
    1.29 +	return ret;
    1.30 +}
    1.31 +#endif
    1.32 +
    1.33  static int __devinit platform_pci_init(struct pci_dev *pdev,
    1.34  				       const struct pci_device_id *ent)
    1.35  {
    1.36 @@ -419,6 +445,9 @@ static int __devinit platform_pci_init(s
    1.37  	if ((ret = xen_panic_handler_init()))
    1.38  		goto out;
    1.39  
    1.40 +#ifdef HAVE_OLDMEM_PFN_IS_RAM
    1.41 +	register_oldmem_pfn_is_ram(&xen_oldmem_pfn_is_ram);
    1.42 +#endif
    1.43   out:
    1.44  	if (ret) {
    1.45  		pci_release_region(pdev, 0);