linux-stable/arch/x86/xen
David Vrabel d8c98a1d14 x86/paravirt: Prevent rtc_cmos platform device init on PV guests
Adding the rtc platform device in non-privileged Xen PV guests causes
an IRQ conflict because these guests do not have legacy PIC and may
allocate irqs in the legacy range.

In a single VCPU Xen PV guest we should have:

/proc/interrupts:
           CPU0
  0:       4934  xen-percpu-virq      timer0
  1:          0  xen-percpu-ipi       spinlock0
  2:          0  xen-percpu-ipi       resched0
  3:          0  xen-percpu-ipi       callfunc0
  4:          0  xen-percpu-virq      debug0
  5:          0  xen-percpu-ipi       callfuncsingle0
  6:          0  xen-percpu-ipi       irqwork0
  7:        321   xen-dyn-event     xenbus
  8:         90   xen-dyn-event     hvc_console
  ...

But hvc_console cannot get its interrupt because it is already in use
by rtc0 and the console does not work.

  genirq: Flags mismatch irq 8. 00000000 (hvc_console) vs. 00000000 (rtc0)

We can avoid this problem by realizing that unprivileged PV guests (both
Xen and lguests) are not supposed to have rtc_cmos device and so
adding it is not necessary.

Privileged guests (i.e. Xen's dom0) do use it but they should not have
irq conflicts since they allocate irqs above legacy range (above
gsi_top, in fact).

Instead of explicitly testing whether the guest is privileged we can
extend pv_info structure to include information about guest's RTC
support.

Reported-and-tested-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: vkuznets@redhat.com
Cc: xen-devel@lists.xenproject.org
Cc: konrad.wilk@oracle.com
Cc: stable@vger.kernel.org # 4.2+
Link: http://lkml.kernel.org/r/1449842873-2613-1-git-send-email-boris.ostrovsky@oracle.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2015-12-19 21:35:13 +01:00
..
apic.c xen/PMU: Intercept PMU-related MSR and APIC accesses 2015-08-20 12:25:25 +01:00
debugfs.c debugfs: Add support to print u32 array in debugfs 2012-04-17 00:18:36 -04:00
debugfs.h debugfs: Add support to print u32 array in debugfs 2012-04-17 00:18:36 -04:00
efi.c xen/efi: Directly include needed headers 2014-09-23 13:36:20 +00:00
enlighten.c x86/paravirt: Prevent rtc_cmos platform device init on PV guests 2015-12-19 21:35:13 +01:00
grant-table.c xen/balloon: make alloc_xenballoon_pages() always allocate low pages 2015-10-23 14:20:05 +01:00
irq.c asmlinkage, x86: Add explicit __visible to arch/x86/* 2014-05-05 16:07:44 -07:00
Kconfig xen: features and fixes for 4.3-rc0 2015-09-08 11:46:48 -07:00
Makefile xen/PMU: Initialization code for Xen PMU 2015-08-20 12:25:20 +01:00
mmu.c x86/xen: add reschedule point when mapping foreign GFNs 2015-10-28 13:46:27 +00:00
mmu.h xen: make a pile of mmu pvop functions static 2011-05-20 14:25:24 -07:00
multicalls.c x86: Replace __get_cpu_var uses 2014-08-26 13:45:49 -04:00
multicalls.h xen: use this_cpu_xxx replace percpu_xxx funcs 2012-01-24 12:20:24 -05:00
p2m.c x86/xen: export xen_alloc_p2m_entry() 2015-10-23 14:20:28 +01:00
pci-swiotlb-xen.c pci-swiotlb-xen: call pci_request_acs only ifdef CONFIG_PCI 2013-11-08 15:21:44 -05:00
platform-pci-unplug.c x86/xen: fix non-ANSI declaration of xen_has_pv_devices() 2015-08-20 12:24:13 +01:00
pmu.c xen/PMU: PMU emulation code 2015-08-20 12:25:26 +01:00
pmu.h xen/PMU: Intercept PMU-related MSR and APIC accesses 2015-08-20 12:25:25 +01:00
setup.c xen: features for 4.4-rc0 2015-11-04 17:32:42 -08:00
smp.c xen: Use correctly the Xen memory terminologies 2015-09-08 18:03:49 +01:00
smp.h x86/xen: Set EFER.NX and EFER.SCE in PVH guests 2014-10-06 10:27:47 +01:00
spinlock.c locking/pvqspinlock: Rename QUEUED_SPINLOCK to QUEUED_SPINLOCKS 2015-05-11 09:52:09 +02:00
suspend.c xen/PMU: Initialization code for Xen PMU 2015-08-20 12:25:20 +01:00
time.c x86/xen/time: Migrate to new set-state interface 2015-07-30 21:25:38 +02:00
trace.c xen: use generated hypervisor symbols in arch/x86/xen/trace.c 2015-03-16 14:49:13 +00:00
vdso.h
vga.c xen/vga: add the xen EFI video mode support 2012-09-24 09:28:57 -04:00
xen-asm.h xen: make direct versions of irq_enable/disable/save/restore to common code 2009-02-04 16:59:04 -08:00
xen-asm.S xen: correctly check for pending events when restoring irq flags 2012-04-27 16:04:21 -04:00
xen-asm_32.S x86/xen: Fix 32-bit PV guests's usage of kernel_stack 2014-04-15 15:00:14 +01:00
xen-asm_64.S x86/asm/entry: Untangle 'system_call' into two entry points: entry_SYSCALL_64 and entry_INT80_32 2015-06-08 09:14:21 +02:00
xen-head.S xen: eliminate scalability issues from initial mapping setup 2015-08-20 12:24:18 +01:00
xen-ops.h xen: move p2m list if conflicting with e820 map 2015-08-20 12:24:24 +01:00