- Update to 3.4-rc7.
authorJeff Mahoney <jeffm@suse.com>
Mon, 14 May 2012 01:37:58 +0000 (21:37 -0400)
committerJeff Mahoney <jeffm@suse.com>
Mon, 14 May 2012 01:37:58 +0000 (21:37 -0400)
  - Eliminated 1 patch.

suse-commit: 4cd9e9b3221cc59ad85ef541c4ef65008045ecd1

1  2 
Makefile
arch/x86/kernel/setup_percpu.c
arch/x86/kvm/x86.c
arch/x86/xen/enlighten.c
drivers/md/dm-mpath.c
drivers/net/ethernet/ibm/ehea/ehea_main.c
drivers/xen/Kconfig
mm/page_alloc.c

diff --combined Makefile
+++ b/Makefile
@@@ -1,7 -1,7 +1,7 @@@
  VERSION = 3
  PATCHLEVEL = 4
  SUBLEVEL = 0
- EXTRAVERSION = -rc6
+ EXTRAVERSION = -rc7
  NAME = Saber-toothed Squirrel
  
  # *DOCUMENTATION*
@@@ -65,20 -65,6 +65,20 @@@ ifndef KBUILD_CHECKSR
    KBUILD_CHECKSRC = 0
  endif
  
 +# Call message checker as part of the C compilation
 +#
 +# Use 'make D=1' to enable checking
 +# Use 'make D=2' to create the message catalog
 +
 +ifdef D
 +  ifeq ("$(origin D)", "command line")
 +    KBUILD_KMSG_CHECK = $(D)
 +  endif
 +endif
 +ifndef KBUILD_KMSG_CHECK
 +  KBUILD_KMSG_CHECK = 0
 +endif
 +
  # Use make M=dir to specify directory of external module to build
  # Old syntax make ... SUBDIRS=$PWD is still supported
  # Setting the environment variable KBUILD_EXTMOD take precedence
@@@ -361,7 -347,6 +361,7 @@@ CHECK              = spars
  
  CHECKFLAGS     := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
                  -Wbitwise -Wno-return-void $(CF)
 +KMSG_CHECK    = $(srctree)/scripts/kmsg-doc
  CFLAGS_MODULE   =
  AFLAGS_MODULE   =
  LDFLAGS_MODULE  =
@@@ -391,11 -376,6 +391,11 @@@ KBUILD_AFLAGS_MODULE  := -DMODUL
  KBUILD_CFLAGS_MODULE  := -DMODULE
  KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
  
 +# Warn about unsupported modules in kernels built inside Autobuild
 +ifneq ($(wildcard /.buildenv),)
 +CFLAGS                += -DUNSUPPORTED_MODULES=2
 +endif
 +
  # Read KERNELRELEASE from include/config/kernel.release (if it exists)
  KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
  KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
@@@ -412,7 -392,6 +412,7 @@@ export KBUILD_AFLAGS AFLAGS_KERNEL AFLA
  export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
  export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
  export KBUILD_ARFLAGS
 +export KBUILD_KMSG_CHECK KMSG_CHECK
  
  # When compiling out-of-tree modules, put MODVERDIR in the module
  # tree rather than in the kernel tree. The kernel tree might
@@@ -613,11 -592,6 +613,11 @@@ KBUILD_CFLAGS    += -fomit-frame-pointe
  endif
  endif
  
 +ifdef CONFIG_UNWIND_INFO
 +KBUILD_CFLAGS += -fasynchronous-unwind-tables
 +LDFLAGS_vmlinux       += --eh-frame-hdr
 +endif
 +
  ifdef CONFIG_DEBUG_INFO
  KBUILD_CFLAGS += -g
  KBUILD_AFLAGS += -gdwarf-2
@@@ -1053,7 -1027,7 +1053,7 @@@ depend dep
  
  # ---------------------------------------------------------------------------
  # Firmware install
 -INSTALL_FW_PATH=$(INSTALL_MOD_PATH)/lib/firmware
 +INSTALL_FW_PATH=$(INSTALL_MOD_PATH)/lib/firmware/$(KERNELRELEASE)
  export INSTALL_FW_PATH
  
  PHONY += firmware_install
@@@ -185,10 -185,22 +185,22 @@@ void __init setup_per_cpu_areas(void
  #endif
        rc = -EINVAL;
        if (pcpu_chosen_fc != PCPU_FC_PAGE) {
-               const size_t atom_size = cpu_has_pse ? PMD_SIZE : PAGE_SIZE;
                const size_t dyn_size = PERCPU_MODULE_RESERVE +
                        PERCPU_DYNAMIC_RESERVE - PERCPU_FIRST_CHUNK_RESERVE;
+               size_t atom_size;
+               /*
+                * On 64bit, use PMD_SIZE for atom_size so that embedded
+                * percpu areas are aligned to PMD.  This, in the future,
+                * can also allow using PMD mappings in vmalloc area.  Use
+                * PAGE_SIZE on 32bit as vmalloc space is highly contended
+                * and large vmalloc area allocs can easily fail.
+                */
+ #ifdef CONFIG_X86_64
+               atom_size = PMD_SIZE;
+ #else
+               atom_size = PAGE_SIZE;
+ #endif
                rc = pcpu_embed_first_chunk(PERCPU_FIRST_CHUNK_RESERVE,
                                            dyn_size, atom_size,
                                            pcpu_cpu_distance,
                 * are zeroed indicating that the static arrays are
                 * gone.
                 */
 +#ifndef CONFIG_XEN
  #ifdef CONFIG_X86_LOCAL_APIC
                per_cpu(x86_cpu_to_apicid, cpu) =
                        early_per_cpu_map(x86_cpu_to_apicid, cpu);
                per_cpu(x86_cpu_to_logical_apicid, cpu) =
                        early_per_cpu_map(x86_cpu_to_logical_apicid, cpu);
  #endif
 +#endif
  #ifdef CONFIG_X86_64
                per_cpu(irq_stack_ptr, cpu) =
                        per_cpu(irq_stack_union.irq_stack, cpu) +
        }
  
        /* indicate the early static arrays will soon be gone */
 +#ifndef CONFIG_XEN
  #ifdef CONFIG_X86_LOCAL_APIC
        early_per_cpu_ptr(x86_cpu_to_apicid) = NULL;
        early_per_cpu_ptr(x86_bios_cpu_apicid) = NULL;
  #ifdef CONFIG_X86_32
        early_per_cpu_ptr(x86_cpu_to_logical_apicid) = NULL;
  #endif
 +#endif
  #ifdef CONFIG_NUMA
        early_per_cpu_ptr(x86_cpu_to_node_map) = NULL;
  #endif
diff --combined arch/x86/kvm/x86.c
@@@ -1582,7 -1582,6 +1582,7 @@@ int kvm_set_msr_common(struct kvm_vcpu 
        case MSR_VM_HSAVE_PA:
        case MSR_AMD64_PATCH_LOADER:
                break;
 +      case MSR_NHM_SNB_PKG_CST_CFG_CTL: /* 0xe2 */
        case 0x200 ... 0x2ff:
                return set_msr_mtrr(vcpu, msr, data);
        case MSR_IA32_APICBASE:
@@@ -1905,7 -1904,6 +1905,7 @@@ int kvm_get_msr_common(struct kvm_vcpu 
        case MSR_K8_INT_PENDING_MSG:
        case MSR_AMD64_NB_CFG:
        case MSR_FAM10H_MMIO_CONF_BASE:
 +      case MSR_NHM_SNB_PKG_CST_CFG_CTL: /* 0xe2 */
                data = 0;
                break;
        case MSR_P6_PERFCTR0:
@@@ -6583,6 -6581,7 +6583,7 @@@ void kvm_arch_async_page_present(struc
                kvm_inject_page_fault(vcpu, &fault);
        }
        vcpu->arch.apf.halted = false;
+       vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
  }
  
  bool kvm_arch_can_inject_async_page_present(struct kvm_vcpu *vcpu)
diff --combined arch/x86/xen/enlighten.c
@@@ -63,6 -63,7 +63,7 @@@
  #include <asm/stackprotector.h>
  #include <asm/hypervisor.h>
  #include <asm/mwait.h>
+ #include <asm/pci_x86.h>
  
  #ifdef CONFIG_ACPI
  #include <linux/acpi.h>
@@@ -124,8 -125,8 +125,8 @@@ static int have_vcpu_info_placement = 1
  static void clamp_max_cpus(void)
  {
  #ifdef CONFIG_SMP
 -      if (setup_max_cpus > MAX_VIRT_CPUS)
 -              setup_max_cpus = MAX_VIRT_CPUS;
 +      if (setup_max_cpus > XEN_LEGACY_MAX_VCPUS)
 +              setup_max_cpus = XEN_LEGACY_MAX_VCPUS;
  #endif
  }
  
@@@ -137,11 -138,11 +138,11 @@@ static void xen_vcpu_setup(int cpu
  
        BUG_ON(HYPERVISOR_shared_info == &xen_dummy_shared_info);
  
 -      if (cpu < MAX_VIRT_CPUS)
 +      if (cpu < XEN_LEGACY_MAX_VCPUS)
                per_cpu(xen_vcpu,cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu];
  
        if (!have_vcpu_info_placement) {
 -              if (cpu >= MAX_VIRT_CPUS)
 +              if (cpu >= XEN_LEGACY_MAX_VCPUS)
                        clamp_max_cpus();
                return;
        }
@@@ -809,9 -810,40 +810,40 @@@ static void xen_io_delay(void
  }
  
  #ifdef CONFIG_X86_LOCAL_APIC
+ static unsigned long xen_set_apic_id(unsigned int x)
+ {
+       WARN_ON(1);
+       return x;
+ }
+ static unsigned int xen_get_apic_id(unsigned long x)
+ {
+       return ((x)>>24) & 0xFFu;
+ }
  static u32 xen_apic_read(u32 reg)
  {
-       return 0;
+       struct xen_platform_op op = {
+               .cmd = XENPF_get_cpuinfo,
+               .interface_version = XENPF_INTERFACE_VERSION,
+               .u.pcpu_info.xen_cpuid = 0,
+       };
+       int ret = 0;
+       /* Shouldn't need this as APIC is turned off for PV, and we only
+        * get called on the bootup processor. But just in case. */
+       if (!xen_initial_domain() || smp_processor_id())
+               return 0;
+       if (reg == APIC_LVR)
+               return 0x10;
+       if (reg != APIC_ID)
+               return 0;
+       ret = HYPERVISOR_dom0_op(&op);
+       if (ret)
+               return 0;
+       return op.u.pcpu_info.apic_id << 24;
  }
  
  static void xen_apic_write(u32 reg, u32 val)
@@@ -849,6 -881,8 +881,8 @@@ static void set_xen_basic_apic_ops(void
        apic->icr_write = xen_apic_icr_write;
        apic->wait_icr_idle = xen_apic_wait_icr_idle;
        apic->safe_wait_icr_idle = xen_safe_apic_wait_icr_idle;
+       apic->set_apic_id = xen_set_apic_id;
+       apic->get_apic_id = xen_get_apic_id;
  }
  
  #endif
@@@ -1365,8 -1399,10 +1399,10 @@@ asmlinkage void __init xen_start_kernel
                /* Make sure ACS will be enabled */
                pci_request_acs();
        }
-               
+ #ifdef CONFIG_PCI
+       /* PCI BIOS service won't work from a PV guest. */
+       pci_probe &= ~PCI_PROBE_BIOS;
+ #endif
        xen_raw_console_write("about to get started...\n");
  
        xen_setup_runstate_info(0);
diff --combined drivers/md/dm-mpath.c
@@@ -56,8 -56,6 +56,8 @@@ struct priority_group 
        struct list_head pgpaths;
  };
  
 +#define FEATURE_NO_PARTITIONS 1
 +
  /* Multipath context */
  struct multipath {
        struct list_head list;
@@@ -89,7 -87,6 +89,7 @@@
        unsigned pg_init_retries;       /* Number of times to retry pg_init */
        unsigned pg_init_count;         /* Number of times pg_init called */
        unsigned pg_init_delay_msecs;   /* Number of msecs before pg_init retry */
 +      unsigned features;              /* Additional selected features */
  
        struct work_struct process_queued_ios;
        struct list_head queued_ios;
@@@ -162,9 -159,12 +162,9 @@@ static struct priority_group *alloc_pri
  static void free_pgpaths(struct list_head *pgpaths, struct dm_target *ti)
  {
        struct pgpath *pgpath, *tmp;
  
        list_for_each_entry_safe(pgpath, tmp, pgpaths, list) {
                list_del(&pgpath->list);
 -              if (m->hw_handler_name)
 -                      scsi_dh_detach(bdev_get_queue(pgpath->path.dev->bdev));
                dm_put_device(ti, pgpath->path.dev);
                free_pgpath(pgpath);
        }
@@@ -299,11 -299,6 +299,11 @@@ static int __choose_path_in_pg(struct m
  
        m->current_pgpath = path_to_pgpath(path);
  
 +      if (!m->current_pgpath->path.dev) {
 +              m->current_pgpath = NULL;
 +              return -ENODEV;
 +      }
 +
        if (m->current_pg != pg)
                __switch_pg(m, m->current_pgpath);
  
@@@ -570,7 -565,6 +570,7 @@@ static struct pgpath *parse_path(struc
  {
        int r;
        struct pgpath *p;
 +      char *path;
        struct multipath *m = ti->private;
  
        /* we need at least a path arg */
        if (!p)
                return ERR_PTR(-ENOMEM);
  
 -      r = dm_get_device(ti, dm_shift_arg(as), dm_table_get_mode(ti->table),
 +      path = dm_shift_arg(as);
 +      r = dm_get_device(ti, path, dm_table_get_mode(ti->table),
                          &p->path.dev);
        if (r) {
 -              ti->error = "error getting device";
 -              goto bad;
 +              unsigned major, minor;
 +
 +              /* Try to add a failed device */
 +              if (r == -ENXIO && sscanf(path, "%u:%u", &major, &minor) == 2) {
 +                      dev_t dev;
 +
 +                      /* Extract the major/minor numbers */
 +                      dev = MKDEV(major, minor);
 +                      if (MAJOR(dev) != major || MINOR(dev) != minor) {
 +                              /* Nice try, didn't work */
 +                              DMWARN("Invalid device path %s", path);
 +                              ti->error = "error converting devnum";
 +                              goto bad;
 +                      }
 +                      DMWARN("adding disabled device %d:%d", major, minor);
 +                      p->path.dev = NULL;
 +                      format_dev_t(p->path.pdev, dev);
 +                      p->is_active = 0;
 +              } else {
 +                      ti->error = "error getting device";
 +                      goto bad;
 +              }
 +      } else {
 +              memcpy(p->path.pdev, p->path.dev->name, 16);
        }
  
 -      if (m->hw_handler_name) {
 +      if (p->path.dev) {
                struct request_queue *q = bdev_get_queue(p->path.dev->bdev);
  
 -              r = scsi_dh_attach(q, m->hw_handler_name);
 -              if (r == -EBUSY) {
 -                      /*
 -                       * Already attached to different hw_handler,
 -                       * try to reattach with correct one.
 -                       */
 -                      scsi_dh_detach(q);
 +              if (m->hw_handler_name) {
                        r = scsi_dh_attach(q, m->hw_handler_name);
 -              }
 -
 -              if (r < 0) {
 -                      ti->error = "error attaching hardware handler";
 -                      dm_put_device(ti, p->path.dev);
 -                      goto bad;
 +                      if (r == -EBUSY) {
 +                              /*
 +                               * Already attached to different hw_handler,
 +                               * try to reattach with correct one.
 +                               */
 +                              scsi_dh_detach(q);
 +                              r = scsi_dh_attach(q, m->hw_handler_name);
 +                      }
 +                      if (r < 0) {
 +                              ti->error = "error attaching hardware handler";
 +                              dm_put_device(ti, p->path.dev);
 +                              goto bad;
 +                      }
 +              } else {
 +                      /* Play safe and detach hardware handler */
 +                      scsi_dh_detach(q);
                }
  
                if (m->hw_handler_params) {
                goto bad;
        }
  
 +      if (!p->is_active) {
 +              ps->type->fail_path(ps, &p->path);
 +              p->fail_count++;
 +              m->nr_valid_paths--;
 +      }
        return p;
  
   bad:
@@@ -756,8 -718,8 +756,8 @@@ static int parse_hw_handler(struct dm_a
                return 0;
  
        m->hw_handler_name = kstrdup(dm_shift_arg(as), GFP_KERNEL);
-       request_module("scsi_dh_%s", m->hw_handler_name);
-       if (scsi_dh_handler_exist(m->hw_handler_name) == 0) {
+       if (!try_then_request_module(scsi_dh_handler_exist(m->hw_handler_name),
+                                    "scsi_dh_%s", m->hw_handler_name)) {
                ti->error = "unknown hardware handler type";
                ret = -EINVAL;
                goto fail;
@@@ -817,10 -779,6 +817,10 @@@ static int parse_features(struct dm_arg
                        continue;
                }
  
 +              if (!strcasecmp(arg_name, "no_partitions")) {
 +                      m->features |= FEATURE_NO_PARTITIONS;
 +                      continue;
 +              }
                if (!strcasecmp(arg_name, "pg_init_retries") &&
                    (argc >= 1)) {
                        r = dm_read_arg(_args + 1, as, &m->pg_init_retries, &ti->error);
@@@ -997,7 -955,7 +997,7 @@@ static int fail_path(struct pgpath *pgp
        if (!pgpath->is_active)
                goto out;
  
 -      DMWARN("Failing path %s.", pgpath->path.dev->name);
 +      DMWARN("Failing path %s.", pgpath->path.pdev);
  
        pgpath->pg->ps.type->fail_path(&pgpath->pg->ps, &pgpath->path);
        pgpath->is_active = 0;
                m->current_pgpath = NULL;
  
        dm_path_uevent(DM_UEVENT_PATH_FAILED, m->ti,
 -                    pgpath->path.dev->name, m->nr_valid_paths);
 +                     pgpath->path.pdev, m->nr_valid_paths);
  
        schedule_work(&m->trigger_event);
  
@@@ -1033,12 -991,6 +1033,12 @@@ static int reinstate_path(struct pgpat
        if (pgpath->is_active)
                goto out;
  
 +      if (!pgpath->path.dev) {
 +              DMWARN("Cannot reinstate disabled path %s", pgpath->path.pdev);
 +              r = -ENODEV;
 +              goto out;
 +      }
 +
        if (!pgpath->pg->ps.type->reinstate_path) {
                DMWARN("Reinstate path not supported by path selector %s",
                       pgpath->pg->ps.type->name);
        }
  
        dm_path_uevent(DM_UEVENT_PATH_REINSTATED, m->ti,
 -                    pgpath->path.dev->name, m->nr_valid_paths);
 +                     pgpath->path.pdev, m->nr_valid_paths);
  
        schedule_work(&m->trigger_event);
  
@@@ -1081,9 -1033,6 +1081,9 @@@ static int action_dev(struct multipath 
        struct pgpath *pgpath;
        struct priority_group *pg;
  
 +      if (!dev)
 +              return 0;
 +
        list_for_each_entry(pg, &m->priority_groups, list) {
                list_for_each_entry(pgpath, &pg->pgpaths, list) {
                        if (pgpath->path.dev == dev)
@@@ -1207,9 -1156,8 +1207,9 @@@ static void pg_init_done(void *data, in
                        errors = 0;
                        break;
                }
 -              DMERR("Could not failover the device: Handler scsi_dh_%s "
 -                    "Error %d.", m->hw_handler_name, errors);
 +              DMERR("Count not failover device %s: Handler scsi_dh_%s "
 +                    "was not loaded.", pgpath->path.dev->name,
 +                    m->hw_handler_name);
                /*
                 * Fail path for now, so we do not ping pong
                 */
                 */
                bypass_pg(m, pg, 1);
                break;
 +      case SCSI_DH_DEV_OFFLINED:
 +              DMWARN("Device %s offlined.", pgpath->path.dev->name);
 +              errors = 0;
 +              break;
        case SCSI_DH_RETRY:
                /* Wait before retrying. */
                delay_retry = 1;
        spin_lock_irqsave(&m->lock, flags);
        if (errors) {
                if (pgpath == m->current_pgpath) {
 -                      DMERR("Could not failover device. Error %d.", errors);
 +                      DMERR("Could not failover device %s, error %d.",
 +                            pgpath->path.dev->name, errors);
                        m->current_pgpath = NULL;
                        m->current_pg = NULL;
                }
@@@ -1279,9 -1222,8 +1279,9 @@@ static void activate_path(struct work_s
        struct pgpath *pgpath =
                container_of(work, struct pgpath, activate_path.work);
  
 -      scsi_dh_activate(bdev_get_queue(pgpath->path.dev->bdev),
 -                              pg_init_done, pgpath);
 +      if (pgpath->path.dev)
 +              scsi_dh_activate(bdev_get_queue(pgpath->path.dev->bdev),
 +                               pg_init_done, pgpath);
  }
  
  /*
@@@ -1420,14 -1362,11 +1420,14 @@@ static int multipath_status(struct dm_t
        else {
                DMEMIT("%u ", m->queue_if_no_path +
                              (m->pg_init_retries > 0) * 2 +
 -                            (m->pg_init_delay_msecs != DM_PG_INIT_DELAY_DEFAULT) * 2);
 +                            (m->pg_init_delay_msecs != DM_PG_INIT_DELAY_DEFAULT) * 2 +
 +                            (m->features & FEATURE_NO_PARTITIONS));
                if (m->queue_if_no_path)
                        DMEMIT("queue_if_no_path ");
                if (m->pg_init_retries)
                        DMEMIT("pg_init_retries %u ", m->pg_init_retries);
 +              if (m->features & FEATURE_NO_PARTITIONS)
 +                      DMEMIT("no_partitions ");
                if (m->pg_init_delay_msecs != DM_PG_INIT_DELAY_DEFAULT)
                        DMEMIT("pg_init_delay_msecs %u ", m->pg_init_delay_msecs);
        }
                               pg->ps.type->info_args);
  
                        list_for_each_entry(p, &pg->pgpaths, list) {
 -                              DMEMIT("%s %s %u ", p->path.dev->name,
 +                              DMEMIT("%s %s %u ", p->path.pdev,
                                       p->is_active ? "A" : "F",
                                       p->fail_count);
                                if (pg->ps.type->status)
                               pg->ps.type->table_args);
  
                        list_for_each_entry(p, &pg->pgpaths, list) {
 -                              DMEMIT("%s ", p->path.dev->name);
 +                              DMEMIT("%s ", p->path.pdev);
                                if (pg->ps.type->status)
                                        sz += pg->ps.type->status(&pg->ps,
                                              &p->path, type, result + sz,
@@@ -1589,7 -1528,7 +1589,7 @@@ static int multipath_ioctl(struct dm_ta
        if (!m->current_pgpath)
                __choose_pgpath(m, 0);
  
 -      if (m->current_pgpath) {
 +      if (m->current_pgpath && m->current_pgpath->path.dev) {
                bdev = m->current_pgpath->path.dev->bdev;
                mode = m->current_pgpath->path.dev->mode;
        }
@@@ -103,19 -103,6 +103,19 @@@ static int __devinit ehea_probe_adapter
  
  static int __devexit ehea_remove(struct platform_device *dev);
  
 +static struct of_device_id ehea_module_device_table[] = {
 +      {
 +              .name = "lhea",
 +              .compatible = "IBM,lhea",
 +      },
 +      {
 +              .type = "network",
 +              .compatible = "IBM,lhea-ethernet",
 +      },
 +      {},
 +};
 +MODULE_DEVICE_TABLE(of, ehea_module_device_table);
 +
  static struct of_device_id ehea_device_table[] = {
        {
                .name = "lhea",
        },
        {},
  };
 -MODULE_DEVICE_TABLE(of, ehea_device_table);
  
  static struct of_platform_driver ehea_driver = {
        .driver = {
@@@ -3347,6 -3335,8 +3347,8 @@@ static int __devinit ehea_probe_adapter
                goto out_shutdown_ports;
        }
  
+       /* Handle any events that might be pending. */
+       tasklet_hi_schedule(&adapter->neq_tasklet);
  
        ret = 0;
        goto out;
diff --combined drivers/xen/Kconfig
 +#
 +# This Kconfig describe xen options
 +#
 +
 +config XEN
 +      bool
 +
 +if XEN
 +config XEN_INTERFACE_VERSION
 +      hex
 +      default 0x00030207
 +
 +menu "XEN"
 +
 +config XEN_PRIVILEGED_GUEST
 +      bool "Privileged Guest (domain 0)"
 +      help
 +        Support for privileged operation (domain 0)
 +
 +config XEN_UNPRIVILEGED_GUEST
 +      def_bool y
 +      depends on !XEN_PRIVILEGED_GUEST
 +      select PM
 +      select SUSPEND
 +
 +config XEN_DOMCTL
 +      tristate
 +
 +config XEN_XENBUS_DEV
 +      def_bool y
 +      depends on PROC_FS
 +
 +config XEN_NETDEV_ACCEL_SFC_UTIL
 +      depends on X86
 +      tristate
 +
 +config XEN_BACKEND
 +        tristate "Backend driver support"
 +        default XEN_PRIVILEGED_GUEST
 +        help
 +          Support for backend device drivers that provide I/O services
 +          to other virtual machines.
 +
 +config XEN_BLKDEV_BACKEND
 +      tristate "Block-device backend driver"
 +      depends on BLOCK && XEN_BACKEND
 +      default XEN_BACKEND
 +      select XEN_DOMCTL
 +      help
 +        The block-device backend driver allows the kernel to export its
 +        block devices to other guests via a high-performance shared-memory
 +        interface.
 +
 +config XEN_BLKDEV_TAP
 +      tristate "Block-device tap backend driver"
 +      depends on BLOCK && XEN_BACKEND
 +      default XEN_BACKEND
 +      select XEN_DOMCTL
 +      help
 +        The block tap driver is an alternative to the block back driver
 +        and allows VM block requests to be redirected to userspace through
 +        a device interface.  The tap allows user-space development of
 +        high-performance block backends, where disk images may be implemented
 +        as files, in memory, or on other hosts across the network.  This
 +        driver can safely coexist with the existing blockback driver.
 +
 +config XEN_BLKDEV_TAP2
 +      tristate "Block-device tap backend driver 2"
 +      depends on BLOCK && XEN_BACKEND
 +      default XEN_BACKEND
 +      help
 +        The block tap driver is an alternative to the block back driver
 +        and allows VM block requests to be redirected to userspace through
 +        a device interface.  The tap allows user-space development of
 +        high-performance block backends, where disk images may be implemented
 +        as files, in memory, or on other hosts across the network.  This
 +        driver can safely coexist with the existing blockback driver.
 +
 +choice
 +      prompt "Select blktap2 driver"
 +      depends on XEN_BLKDEV_TAP2=y
 +
 +config XEN_BLKDEV_TAP2_LEGACY
 +      bool "legacy"
 +
 +config XEN_BLKDEV_TAP2_NEW
 +      bool "'new'"
 +
 +endchoice
 +
 +config XEN_NR_TAP2_DEVICES
 +      int "Number of devices the version 2 tap backend driver can handle"
 +      range 2 1048575
 +      default 1024 if 64BIT
 +      default 256
 +      depends on XEN_BLKDEV_TAP2
 +      help
 +        This sets the number of backend devices the v2 tap backend driver
 +        will be able to handle simultaneously. Note that device 0 is the
 +        control device and hence not available to service guests.
 +
 +config XEN_BLKBACK_PAGEMAP
 +      tristate
 +      depends on XEN_BLKDEV_BACKEND != n && XEN_BLKDEV_TAP2 != n
 +      default XEN_BLKDEV_BACKEND || XEN_BLKDEV_TAP2
 +
 +config XEN_NETDEV_BACKEND
 +      tristate "Network-device backend driver"
 +        depends on XEN_BACKEND && NET
 +      default XEN_BACKEND
 +      help
 +        The network-device backend driver allows the kernel to export its
 +        network devices to other guests via a high-performance shared-memory
 +        interface.
 +
 +config XEN_NETDEV_TX_SHIFT
 +      int "Maximum simultaneous transmit requests (as a power of 2)"
 +      depends on XEN_NETDEV_BACKEND
 +      range 5 15
 +      default 8
 +      help
 +        The maximum number transmits the driver can hold pending, expressed
 +        as the exponent of a power of 2.
 +
 +config XEN_NETDEV_PIPELINED_TRANSMITTER
 +      bool "Pipelined transmitter (DANGEROUS)"
 +      depends on XEN_NETDEV_BACKEND
 +      help
 +        If the net backend is a dumb domain, such as a transparent Ethernet
 +        bridge with no local IP interface, it is safe to say Y here to get
 +        slightly lower network overhead.
 +        If the backend has a local IP interface; or may be doing smart things
 +        like reassembling packets to perform firewall filtering; or if you
 +        are unsure; or if you experience network hangs when this option is
 +        enabled; then you must say N here.
 +
 +config XEN_NETDEV_ACCEL_SFC_BACKEND
 +      tristate "Network-device backend driver acceleration for Solarflare NICs"
 +      depends on XEN_NETDEV_BACKEND && SFC && SFC_RESOURCE && X86
 +      select XEN_NETDEV_ACCEL_SFC_UTIL
 +      default m
 +
 +config XEN_NETDEV_LOOPBACK
 +      tristate "Network-device loopback driver"
 +      depends on XEN_NETDEV_BACKEND
 +      help
 +        A two-interface loopback device to emulate a local netfront-netback
 +        connection. If unsure, it is probably safe to say N here.
 +
 +config XEN_TPMDEV_BACKEND
 +      tristate "TPM-device backend driver"
 +        depends on XEN_BACKEND
 +      help
 +        The TPM-device backend driver
 +
 +config XEN_SCSI_BACKEND
 +      tristate "SCSI backend driver"
 +      depends on SCSI && XEN_BACKEND
 +      default m
 +      help
 +        The SCSI backend driver allows the kernel to export its SCSI Devices
 +        to other guests via a high-performance shared-memory interface.
 +
 +config XEN_USB_BACKEND
 +      tristate "USB backend driver"
 +      depends on USB && XEN_BACKEND
 +      default m
 +      help
 +        The USB backend driver allows the kernel to export its USB Devices
 +        to other guests.
 +
 +config XEN_BLKDEV_FRONTEND
 +      tristate "Block-device frontend driver"
 +      default y
 +      help
 +        The block-device frontend driver allows the kernel to access block
 +        devices mounted within another guest OS. Unless you are building a
 +        dedicated device-driver domain, or your master control domain
 +        (domain 0), then you almost certainly want to say Y here.
 +
 +config XEN_NETDEV_FRONTEND
 +      tristate "Network-device frontend driver"
 +      depends on NET
 +      default y
 +      help
 +        The network-device frontend driver allows the kernel to access
 +        network interfaces within another guest OS. Unless you are building a
 +        dedicated device-driver domain, or your master control domain
 +        (domain 0), then you almost certainly want to say Y here.
 +
 +config XEN_NETDEV_ACCEL_SFC_FRONTEND
 +      tristate "Network-device frontend driver acceleration for Solarflare NICs"
 +      depends on XEN_NETDEV_FRONTEND && X86
 +      select XEN_NETDEV_ACCEL_SFC_UTIL
 +      default m
 +
 +config XEN_SCSI_FRONTEND
 +      tristate "SCSI frontend driver"
 +      depends on SCSI
 +      default m
 +      help
 +        The SCSI frontend driver allows the kernel to access SCSI Devices
 +        within another guest OS.
 +
 +config XEN_USB_FRONTEND
 +      tristate "USB frontend driver"
 +      depends on USB
 +      default m
 +      help
 +        The USB frontend driver allows the kernel to access USB Devices
 +        within another guest OS.
 +
 +config XEN_USB_FRONTEND_HCD_STATS
 +      bool "Taking the HCD statistics (for debug)"
 +      depends on XEN_USB_FRONTEND
 +      default y
 +      help
 +        Count the transferred urb status and the RING_FULL occurrence.
 +
 +config XEN_USB_FRONTEND_HCD_PM
 +      bool "HCD suspend/resume support (DO NOT USE)"
 +      depends on XEN_USB_FRONTEND
 +      default n
 +      help
 +        Experimental bus suspend/resume feature support.
 +
 +config XEN_GRANT_DEV
 +      tristate "User-space granted page access driver"
 +      depends on XEN_BACKEND != n
 +      default XEN_PRIVILEGED_GUEST
 +      help
 +        Device for accessing (in user-space) pages that have been granted
 +        by other domains.
 +
 +config XEN_FRAMEBUFFER
 +      tristate "Framebuffer-device frontend driver"
 +      depends on FB
 +      select FB_CFB_FILLRECT
 +      select FB_CFB_COPYAREA
 +      select FB_CFB_IMAGEBLIT
 +      default y
 +      help
 +        The framebuffer-device frontend drivers allows the kernel to create a
 +        virtual framebuffer.  This framebuffer can be viewed in another
 +        domain.  Unless this domain has access to a real video card, you
 +        probably want to say Y here.
 +
 +config XEN_KEYBOARD
 +      tristate "Keyboard-device frontend driver"
 +      depends on XEN_FRAMEBUFFER && INPUT
 +      default y
 +      help
 +        The keyboard-device frontend driver allows the kernel to create a
 +        virtual keyboard.  This keyboard can then be driven by another
 +        domain.  If you've said Y to CONFIG_XEN_FRAMEBUFFER, you probably
 +        want to say Y here.
 +
 +config XEN_DISABLE_SERIAL
 +      bool "Disable serial port drivers"
 +      default y
 +      help
 +        Disable serial port drivers, allowing the Xen console driver
 +        to provide a serial console at ttyS0.
 +
 +config XEN_NR_GUEST_DEVICES
 +      int "Number of guest devices"
 +      range 0 4032 if 64BIT
 +      range 0 960
 +      default 256 if XEN_BACKEND
 +      default 16
 +      help
 +        Specify the total number of virtual devices (i.e. both frontend
 +        and backend) that you want the kernel to be able to service.
 +
 +choice
 +      prompt "Xen version compatibility"
 +      default XEN_COMPAT_030002_AND_LATER
 +
 +      config XEN_COMPAT_030002_AND_LATER
 +              bool "3.0.2 and later"
 +
 +      config XEN_COMPAT_030004_AND_LATER
 +              bool "3.0.4 and later"
 +
 +      config XEN_COMPAT_030100_AND_LATER
 +              bool "3.1.0 and later"
 +
 +      config XEN_COMPAT_030200_AND_LATER
 +              bool "3.2.0 and later"
 +
 +      config XEN_COMPAT_030300_AND_LATER
 +              bool "3.3.0 and later"
 +
 +      config XEN_COMPAT_030400_AND_LATER
 +              bool "3.4.0 and later"
 +
 +      config XEN_COMPAT_040000_AND_LATER
 +              bool "4.0.0 and later"
 +
 +      config XEN_COMPAT_040100_AND_LATER
 +              bool "4.1.0 and later"
 +
 +      config XEN_COMPAT_LATEST_ONLY
 +              bool "no compatibility code"
 +
 +endchoice
 +
 +config XEN_COMPAT
 +      hex
 +      default 0xffffff if XEN_COMPAT_LATEST_ONLY
 +      default 0x040100 if XEN_COMPAT_040100_AND_LATER
 +      default 0x040000 if XEN_COMPAT_040000_AND_LATER
 +      default 0x030400 if XEN_COMPAT_030400_AND_LATER
 +      default 0x030300 if XEN_COMPAT_030300_AND_LATER
 +      default 0x030200 if XEN_COMPAT_030200_AND_LATER
 +      default 0x030100 if XEN_COMPAT_030100_AND_LATER
 +      default 0x030004 if XEN_COMPAT_030004_AND_LATER
 +      default 0x030002 if XEN_COMPAT_030002_AND_LATER
 +      default 0
 +
 +config XEN_VCPU_INFO_PLACEMENT
 +      bool "Place shared vCPU info in per-CPU storage"
 +#     depends on X86 && (XEN_COMPAT >= 0x00030101)
 +      depends on X86
 +      depends on !XEN_COMPAT_030002_AND_LATER
 +      depends on !XEN_COMPAT_030004_AND_LATER
 +      depends on !XEN_COMPAT_030100_AND_LATER
 +      default SMP
 +      ---help---
 +        This allows faster access to the per-vCPU shared info
 +        structure.
 +
 +endmenu
 +
 +config HAVE_IRQ_IGNORE_UNHANDLED
 +      def_bool y
 +
 +config ARCH_HAS_WALK_MEMORY
 +      def_bool y
 +      depends on X86
 +
 +config XEN_SMPBOOT
 +      def_bool y
 +      depends on SMP && !PPC_XEN
 +
 +config XEN_SPINLOCK_ACQUIRE_NESTING
 +      int "maximum nesting level for acquiring spin locks"
 +      depends on SMP
 +      # Xen versions prior to 3.2.x have a race condition with HYPERVISOR_poll().
 +      depends on !XEN_COMPAT_030002_AND_LATER
 +      depends on !XEN_COMPAT_030004_AND_LATER
 +      depends on !XEN_COMPAT_030100_AND_LATER
 +      range 0 3 if EXPERIMENTAL
 +      range 0 1
 +      default 0
 +      help
 +        IRQ-safe spin lock acquire operations can re-enable interrupts
 +        before entering polling mode, to reduce interrupt latencies.
 +        This option specifies how many times this can be done for each
 +        individual spin lock (0 disables this behavior).
 +
 +config XEN_DEVMEM
 +      def_bool y
 +
 +endif
 +
  menu "Xen driver support"
 -      depends on XEN
 +      depends on XEN || PARAVIRT_XEN
  
  config XEN_BALLOON
 -      bool "Xen memory balloon driver"
 +      bool "Xen memory balloon driver" if PARAVIRT_XEN
 +      depends on PARAVIRT_XEN || !PPC_XEN
        default y
        help
          The balloon driver allows the Xen domain to request more memory from
  
  config XEN_SELFBALLOONING
        bool "Dynamically self-balloon kernel memory to target"
 -      depends on XEN && XEN_BALLOON && CLEANCACHE && SWAP && XEN_TMEM
 -      default n
 +      depends on XEN_BALLOON && CLEANCACHE && SWAP && XEN_TMEM
        help
          Self-ballooning dynamically balloons available kernel memory driven
          by the current usage of anonymous memory ("committed AS") and
  config XEN_BALLOON_MEMORY_HOTPLUG
        bool "Memory hotplug support for Xen balloon driver"
        default n
 -      depends on XEN_BALLOON && MEMORY_HOTPLUG
 +      depends on PARAVIRT_XEN && XEN_BALLOON && MEMORY_HOTPLUG
        help
          Memory hotplug support for Xen balloon driver allows expanding memory
          available for the system above limit declared at system startup.
          In that case step 3 should be omitted.
  
  config XEN_SCRUB_PAGES
 -      bool "Scrub pages before returning them to system"
 -      depends on XEN_BALLOON
 +      bool "Scrub memory before freeing it to Xen"
 +      depends on XEN || XEN_BALLOON
        default y
        help
 -        Scrub pages before returning them to the system for reuse by
 -        other domains.  This makes sure that any confidential data
 -        is not accidentally visible to other domains.  Is it more
 -        secure, but slightly less efficient.
 +        Erase memory contents before freeing it back to Xen's global
 +        pool. This ensures that any secrets contained within that
 +        memory (e.g., private keys) cannot be found by other guests that
 +        may be running on the machine. Most people will want to say Y here.
 +        If security is not a concern then you may increase performance by
 +        saying N.
          If in doubt, say yes.
  
  config XEN_DEV_EVTCHN
        tristate "Xen /dev/xen/evtchn device"
 -      default y
 +      default PARAVIRT_XEN || XEN_PRIVILEGED_GUEST || m
        help
          The evtchn driver allows a userspace process to triger event
          channels and to receive notification of an event channel
          firing.
          If in doubt, say yes.
  
 -config XEN_BACKEND
 +config PARAVIRT_XEN_BACKEND
        bool "Backend driver support"
        depends on XEN_DOM0
        default y
  
  config XENFS
        tristate "Xen filesystem"
 +      depends on PARAVIRT_XEN
        select XEN_PRIVCMD
        default y
        help
@@@ -492,7 -123,7 +492,7 @@@ config XEN_XENBUS_FRONTEN
  
  config XEN_GNTDEV
        tristate "userspace grant access device driver"
 -      depends on XEN
 +      depends on PARAVIRT_XEN
        default m
        select MMU_NOTIFIER
        help
  
  config XEN_GRANT_DEV_ALLOC
        tristate "User-space grant reference allocator driver"
 -      depends on XEN
 +      depends on PARAVIRT_XEN
        default m
        help
          Allows userspace processes to create pages with access granted
  
  config SWIOTLB_XEN
        def_bool y
 -      depends on PCI
 +      depends on PARAVIRT_XEN && PCI
        select SWIOTLB
  
 +config XEN_XENCOMM
 +      bool
 +
  config XEN_TMEM
        bool
        default y if (CLEANCACHE || FRONTSWAP)
  
  config XEN_PCIDEV_BACKEND
        tristate "Xen PCI-device backend driver"
 -      depends on PCI && X86 && XEN
 -      depends on XEN_BACKEND
 +      depends on PCI && ((X86 && PARAVIRT_XEN_BACKEND) || (XEN_PRIVILEGED_GUEST && XEN_BACKEND))
 +      default XEN_BACKEND if XEN
        default m
        help
          The PCI device backend driver allows the kernel to export arbitrary
          will need to make sure no other driver has bound to the device(s)
          you want to make visible to other guests.
  
 -        The parameter "passthrough" allows you specify how you want the PCI
 -        devices to appear in the guest. You can choose the default (0) where
 -        PCI topology starts at 00.00.0, or (1) for passthrough if you want
 -        the PCI devices topology appear the same as in the host.
 -
          The "hide" parameter (only applicable if backend driver is compiled
          into the kernel) allows you to bind the PCI devices to this module
          from the default device drivers. The argument is the list of PCI BDFs:
  
          If in doubt, say m.
  
 +menu "PCI Backend Mode"
 +      depends on XEN_PCIDEV_BACKEND
 +
 +choice
 +      prompt "Default PCI backend mode"
 +      default XEN_PCIDEV_BACKEND_DEFAULT_CONTROLLER if IA64
 +      default XEN_PCIDEV_BACKEND_DEFAULT_VPCI
 +
 +config XEN_PCIDEV_BACKEND_DEFAULT_VPCI
 +      bool "Virtual PCI"
 +      select XEN_PCIDEV_BACKEND_VPCI
 +
 +config XEN_PCIDEV_BACKEND_DEFAULT_PASSTHROUGH
 +      bool "Passthrough"
 +      select XEN_PCIDEV_BACKEND_PASSTHROUGH
 +
 +config XEN_PCIDEV_BACKEND_DEFAULT_SLOT
 +      bool "Slot"
 +      select XEN_PCIDEV_BACKEND_SLOT
 +
 +config XEN_PCIDEV_BACKEND_DEFAULT_CONTROLLER
 +      bool "Controller"
 +      depends on IA64
 +      select XEN_PCIDEV_BACKEND_CONTROLLER
 +
 +endchoice
 +
 +config XEN_PCIDEV_BACKEND_DEFAULT
 +      string
 +      default "vpci" if XEN_PCIDEV_BACKEND_DEFAULT_VPCI
 +      default "passthrough" if XEN_PCIDEV_BACKEND_DEFAULT_PASSTHROUGH
 +      default "slot" if XEN_PCIDEV_BACKEND_DEFAULT_SLOT
 +      default "controller" if XEN_PCIDEV_BACKEND_DEFAULT_CONTROLLER
 +
 +config XEN_PCIDEV_BACKEND_VPCI
 +      bool "Virtual PCI"
 +      default X86
 +      ---help---
 +        This PCI Backend hides the true PCI topology and makes the frontend
 +        think there is a single PCI bus with only the exported devices on it.
 +        For example, a device at 03:05.0 will be re-assigned to 00:00.0. A
 +        second device at 02:1a.1 will be re-assigned to 00:01.1.
 +
 +        If not the default, the parameter "mode=vpci" allows you to use this
 +        mode.
 +
 +config XEN_PCIDEV_BACKEND_PASSTHROUGH
 +      bool "Passthrough"
 +      ---help---
 +        This PCI Backend provides a real view of the PCI topology to the
 +        frontend (for example, a device at 06:01.b will still appear at
 +        06:01.b to the frontend). This is similar to how Xen 2.0.x exposed
 +        PCI devices to its driver domains. This may be required for drivers
 +        which depend on finding their hardward in certain bus/slot
 +        locations.
 +
 +        If not the default, the parameter "mode=passthrough" allows you to
 +        use this mode.
 +
 +config XEN_PCIDEV_BACKEND_SLOT
 +      bool "Slot"
 +      ---help---
 +        This PCI Backend hides the true PCI topology and makes the frontend
 +        think there is a single PCI bus with only the exported devices on it.
 +        Contrary to the virtual PCI backend, a function becomes a new slot.
 +        For example, a device at 03:05.2 will be re-assigned to 00:00.0. A
 +        second device at 02:1a.1 will be re-assigned to 00:01.0.
 +
 +        If not the default, the parameter "mode=slot" allows you to use this
 +        mode.
 +
 +config XEN_PCIDEV_BACKEND_CONTROLLER
 +      bool "Controller"
 +      depends on IA64
 +      ---help---
 +        This PCI backend virtualizes the PCI bus topology by providing a
 +        virtual bus per PCI root device.  Devices which are physically under
 +        the same root bus will appear on the same virtual bus.  For systems
 +        with complex I/O addressing, this is the only backend which supports
 +        extended I/O port spaces and MMIO translation offsets.  This backend
 +        also supports slot virtualization.  For example, a device at
 +        0000:01:02.1 will be re-assigned to 0000:00:00.0.  A second device
 +        at 0000:02:05.0 (behind a P2P bridge on bus 0000:01) will be
 +        re-assigned to 0000:00:01.0.  A third device at 0000:16:05.0 (under
 +        a different PCI root bus) will be re-assigned to 0000:01:00.0.
 +
 +        If not the default, the parameter "mode=controller" allows you to
 +        use this mode.
 +
 +endmenu
 +
  config XEN_PRIVCMD
        tristate
 -      depends on XEN
 +      depends on PARAVIRT_XEN || (XEN && PROC_FS)
 +      default y if XEN
        default m
  
  config XEN_ACPI_PROCESSOR
        tristate "Xen ACPI processor"
 -      depends on XEN && X86 && ACPI_PROCESSOR && CPU_FREQ
 +      depends on PARAVIRT_XEN && X86 && ACPI_PROCESSOR && CPU_FREQ
        default m
        help
-           This ACPI processor uploads Power Management information to the Xen hypervisor.
-         To do that the driver parses the Power Management data and uploads said
-         information to the Xen hypervisor. Then the Xen hypervisor can select the
-           proper Cx and Pxx states. It also registers itslef as the SMM so that
-           other drivers (such as ACPI cpufreq scaling driver) will not load.
-           To compile this driver as a module, choose M here: the
-           module will be called xen_acpi_processor  If you do not know what to choose,
-           select M here. If the CPUFREQ drivers are built in, select Y here.
+           This ACPI processor uploads Power Management information to the Xen
+         hypervisor.
+         To do that the driver parses the Power Management data and uploads
+         said information to the Xen hypervisor. Then the Xen hypervisor can
+         select the proper Cx and Pxx states. It also registers itslef as the
+         SMM so that other drivers (such as ACPI cpufreq scaling driver) will
+         not load.
+           To compile this driver as a module, choose M here: the module will be
+         called xen_acpi_processor  If you do not know what to choose, select
+         M here. If the CPUFREQ drivers are built in, select Y here.
  
  endmenu
diff --combined mm/page_alloc.c
@@@ -692,13 -692,6 +692,13 @@@ static bool free_pages_prepare(struct p
        int i;
        int bad = 0;
  
 +#ifdef CONFIG_XEN
 +      if (PageForeign(page)) {
 +              PageForeignDestructor(page, order);
 +              return false;
 +      }
 +#endif
 +
        trace_mm_page_free(page, order);
        kmemcheck_free_shadow(page, order);
  
@@@ -725,9 -718,6 +725,9 @@@ static void __free_pages_ok(struct pag
        unsigned long flags;
        int wasMlocked = __TestClearPageMlocked(page);
  
 +#ifdef CONFIG_XEN
 +      WARN_ON(PageForeign(page) && wasMlocked);
 +#endif
        if (!free_pages_prepare(page, order))
                return;
  
@@@ -1262,9 -1252,6 +1262,9 @@@ void free_hot_cold_page(struct page *pa
        int migratetype;
        int wasMlocked = __TestClearPageMlocked(page);
  
 +#ifdef CONFIG_XEN
 +      WARN_ON(PageForeign(page) && wasMlocked);
 +#endif
        if (!free_pages_prepare(page, 0))
                return;
  
@@@ -1923,13 -1910,7 +1923,13 @@@ void warn_alloc_failed(gfp_t gfp_mask, 
                va_end(args);
        }
  
 -      pr_warn("%s: page allocation failure: order:%d, mode:0x%x\n",
 +      if (!(gfp_mask & __GFP_WAIT)) {
 +              pr_info("The following is only an harmless informational message.\n");
 +              pr_info("Unless you get a _continuous_flood_ of these messages it means\n");
 +              pr_info("everything is working fine. Allocations from irqs cannot be\n");
 +              pr_info("perfectly reliable and the kernel is designed to handle that.\n");
 +      }
 +      pr_info("%s: page allocation failure. order:%d, mode:0x%x\n",
                current->comm, order, gfp_mask);
  
        dump_stack();
@@@ -5053,22 -5034,6 +5053,22 @@@ void setup_per_zone_wmarks(void
                spin_unlock_irqrestore(&zone->lock, flags);
        }
  
 +#ifdef CONFIG_XEN
 +      for_each_populated_zone(zone) {
 +              unsigned int cpu;
 +
 +              for_each_online_cpu(cpu) {
 +                      unsigned long high;
 +
 +                      high = percpu_pagelist_fraction
 +                             ? zone->present_pages / percpu_pagelist_fraction
 +                             : 5 * zone_batchsize(zone);
 +                      setup_pagelist_highmark(
 +                              per_cpu_ptr(zone->pageset, cpu), high);
 +              }
 +      }
 +#endif
 +
        /* update totalreserve_pages */
        calculate_totalreserve_pages();
  }
@@@ -5238,7 -5203,7 +5238,7 @@@ int percpu_pagelist_fraction_sysctl_han
        int ret;
  
        ret = proc_dointvec_minmax(table, write, buffer, length, ppos);
-       if (!write || (ret == -EINVAL))
+       if (!write || (ret < 0))
                return ret;
        for_each_populated_zone(zone) {
                for_each_possible_cpu(cpu) {