1. 25 Jul, 2016 5 commits
    • Vitaly Kuznetsov's avatar
      x86/xen: use xen_vcpu_id mapping for HYPERVISOR_vcpu_op · ad5475f9
      Vitaly Kuznetsov authored
      HYPERVISOR_vcpu_op() passes Linux's idea of vCPU id as a parameter
      while Xen's idea is expected. In some cases these ideas diverge so we
      need to do remapping.
      
      Convert all callers of HYPERVISOR_vcpu_op() to use xen_vcpu_nr().
      
      Leave xen_fill_possible_map() and xen_filter_cpu_maps() intact as
      they're only being called by PV guests before perpu areas are
      initialized. While the issue could be solved by switching to
      early_percpu for xen_vcpu_id I think it's not worth it: PV guests will
      probably never get to the point where their idea of vCPU id diverges
      from Xen's.
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      ad5475f9
    • Vitaly Kuznetsov's avatar
      xen: introduce xen_vcpu_id mapping · 88e957d6
      Vitaly Kuznetsov authored
      It may happen that Xen's and Linux's ideas of vCPU id diverge. In
      particular, when we crash on a secondary vCPU we may want to do kdump
      and unlike plain kexec where we do migrate_to_reboot_cpu() we try
      booting on the vCPU which crashed. This doesn't work very well for
      PVHVM guests as we have a number of hypercalls where we pass vCPU id
      as a parameter. These hypercalls either fail or do something
      unexpected.
      
      To solve the issue introduce percpu xen_vcpu_id mapping. ARM and PV
      guests get direct mapping for now. Boot CPU for PVHVM guest gets its
      id from CPUID. With secondary CPUs it is a bit more
      trickier. Currently, we initialize IPI vectors before these CPUs boot
      so we can't use CPUID. Use ACPI ids from MADT instead.
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      88e957d6
    • Vitaly Kuznetsov's avatar
      x86/acpi: store ACPI ids from MADT for future usage · 3e9e57fa
      Vitaly Kuznetsov authored
      Currently we don't save ACPI ids (unlike LAPIC ids which go to
      x86_cpu_to_apicid) from MADT and we may need this information later.
      Particularly, ACPI ids is the only existent way for a PVHVM Xen guest
      to figure out Xen's idea of its vCPUs ids before these CPUs boot and
      in some cases these ids diverge from Linux's cpu ids.
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      3e9e57fa
    • Vitaly Kuznetsov's avatar
      x86/xen: update cpuid.h from Xen-4.7 · de2f5537
      Vitaly Kuznetsov authored
      Update cpuid.h header from xen hypervisor tree to get
      XEN_HVM_CPUID_VCPU_ID_PRESENT definition.
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      de2f5537
    • David Vrabel's avatar
      xen/evtchn: add IOCTL_EVTCHN_RESTRICT · fbc872c3
      David Vrabel authored
      IOCTL_EVTCHN_RESTRICT limits the file descriptor to being able to bind
      to interdomain event channels from a specific domain.  Event channels
      that are already bound continue to work for sending and receiving
      notifications.
      
      This is useful as part of deprivileging a user space PV backend or
      device model (QEMU).  e.g., Once the device model as bound to the
      ioreq server event channels it can restrict the file handle so an
      exploited DM cannot use it to create or bind to arbitrary event
      channels.
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      fbc872c3
  2. 22 Jul, 2016 4 commits
  3. 06 Jul, 2016 31 commits