]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Merge tag 'for-linus-4.9-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 25 Oct 2016 02:52:24 +0000 (19:52 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 25 Oct 2016 02:52:24 +0000 (19:52 -0700)
Pull xen fixes from David Vrabel:

 - advertise control feature flags in xenstore

 - fix x86 build when XEN_PVHVM is disabled

* tag 'for-linus-4.9-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
  xenbus: check return value of xenbus_scanf()
  xenbus: prefer list_for_each()
  x86: xen: move cpu_up functions out of ifdef
  xenbus: advertise control feature flags

1  2 
arch/x86/xen/enlighten.c
drivers/xen/xenbus/xenbus_dev_frontend.c

diff --combined arch/x86/xen/enlighten.c
index c0fdd57da7aad477534b5e4d019ebe4e06e2df07,a637f902f59ed66ab802e840616bf730da722661..bdd85568540382ebe3b5683534fb2ab7144e39a3
@@@ -118,7 -118,7 +118,7 @@@ DEFINE_PER_CPU(struct vcpu_info *, xen_
  DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);
  
  /* Linux <-> Xen vCPU id mapping */
 -DEFINE_PER_CPU(int, xen_vcpu_id) = -1;
 +DEFINE_PER_CPU(uint32_t, xen_vcpu_id);
  EXPORT_PER_CPU_SYMBOL(xen_vcpu_id);
  
  enum xen_domain_type xen_domain_type = XEN_NATIVE;
@@@ -1239,6 -1239,7 +1239,6 @@@ static const struct pv_cpu_ops xen_cpu_
        .write_cr0 = xen_write_cr0,
  
        .read_cr4 = native_read_cr4,
 -      .read_cr4_safe = native_read_cr4_safe,
        .write_cr4 = xen_write_cr4,
  
  #ifdef CONFIG_X86_64
@@@ -1837,6 -1838,7 +1837,7 @@@ static void __init init_hvm_pv_info(voi
  
        xen_domain_type = XEN_HVM_DOMAIN;
  }
+ #endif
  
  static int xen_cpu_up_prepare(unsigned int cpu)
  {
@@@ -1887,6 -1889,7 +1888,7 @@@ static int xen_cpu_up_online(unsigned i
        return 0;
  }
  
+ #ifdef CONFIG_XEN_PVHVM
  #ifdef CONFIG_KEXEC_CORE
  static void xen_hvm_shutdown(void)
  {
@@@ -1966,45 -1969,6 +1968,45 @@@ static void xen_set_cpu_features(struc
        }
  }
  
 +static void xen_pin_vcpu(int cpu)
 +{
 +      static bool disable_pinning;
 +      struct sched_pin_override pin_override;
 +      int ret;
 +
 +      if (disable_pinning)
 +              return;
 +
 +      pin_override.pcpu = cpu;
 +      ret = HYPERVISOR_sched_op(SCHEDOP_pin_override, &pin_override);
 +
 +      /* Ignore errors when removing override. */
 +      if (cpu < 0)
 +              return;
 +
 +      switch (ret) {
 +      case -ENOSYS:
 +              pr_warn("Unable to pin on physical cpu %d. In case of problems consider vcpu pinning.\n",
 +                      cpu);
 +              disable_pinning = true;
 +              break;
 +      case -EPERM:
 +              WARN(1, "Trying to pin vcpu without having privilege to do so\n");
 +              disable_pinning = true;
 +              break;
 +      case -EINVAL:
 +      case -EBUSY:
 +              pr_warn("Physical cpu %d not available for pinning. Check Xen cpu configuration.\n",
 +                      cpu);
 +              break;
 +      case 0:
 +              break;
 +      default:
 +              WARN(1, "rc %d while trying to pin vcpu\n", ret);
 +              disable_pinning = true;
 +      }
 +}
 +
  const struct hypervisor_x86 x86_hyper_xen = {
        .name                   = "Xen",
        .detect                 = xen_platform,
  #endif
        .x2apic_available       = xen_x2apic_para_available,
        .set_cpu_features       = xen_set_cpu_features,
 +      .pin_vcpu               = xen_pin_vcpu,
  };
  EXPORT_SYMBOL(x86_hyper_xen);
  
index c1010f018bd857985b5bf0ada1f5286f0f68b2bf,fe60b12de92043575a0893b5c139e850472efdda..1e8be12ebb559880fa5d10f05a2782ad46c36be3
@@@ -316,7 -316,7 +316,7 @@@ static int xenbus_write_transaction(uns
                        rc = -ENOMEM;
                        goto out;
                }
 -      } else {
 +      } else if (msg_type == XS_TRANSACTION_END) {
                list_for_each_entry(trans, &u->transactions, list)
                        if (trans->handle.id == u->u.msg.tx_id)
                                break;
@@@ -364,7 -364,7 +364,7 @@@ out
  
  static int xenbus_write_watch(unsigned msg_type, struct xenbus_file_priv *u)
  {
-       struct watch_adapter *watch, *tmp_watch;
+       struct watch_adapter *watch;
        char *path, *token;
        int err, rc;
        LIST_HEAD(staging_q);
                }
                list_add(&watch->list, &u->watches);
        } else {
-               list_for_each_entry_safe(watch, tmp_watch, &u->watches, list) {
+               list_for_each_entry(watch, &u->watches, list) {
                        if (!strcmp(watch->token, token) &&
                            !strcmp(watch->watch.node, path)) {
                                unregister_xenbus_watch(&watch->watch);