All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [BUG] pci-passthrough generates "xen:events: Failed to obtain physical IRQ" for some devices
       [not found] <CANQMFx4YULqKctKZqeESesTQjLQun7rQ0ZjGzq96TXTtUw6VWA@mail.gmail.com>
@ 2016-01-27 18:30 ` Konrad Rzeszutek Wilk
  2016-01-30  2:13   ` Marek Marczykowski-Górecki
  2016-01-30 13:18   ` Tommi Airikka
  0 siblings, 2 replies; 15+ messages in thread
From: Konrad Rzeszutek Wilk @ 2016-01-27 18:30 UTC (permalink / raw)
  To: Tommi Airikka; +Cc: 810379, xen-devel

On Sat, Jan 23, 2016 at 05:12:04PM +0100, Tommi Airikka wrote:
> Xen developers,
> 
> After an upgrade of my Debian Jessie dom0 and domUs, my passthroughed
> NIC stopped working.
> This bug was probably introduced in Debian Jessie sometime
> between 2015-12-30 and 2016-01-08 as 2015-12-30 as 2015-12-30 was the
> last time I upgraded without any problems according to my dpkg.log.

This upgrade looks to only have upgraded the hypervisor?

As in I see:

domU "bug" "uname -a":
Linux bug 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2 (2016-01-02)
x86_64 GNU/Linux

domU "working" "uname -a":
Linux working 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2
(2016-01-02) x86_64 GNU/Linux

So same version? What was the earlier version of the hypervisor?

The Xen version you have says:
> (XEN) I/O virtualisation disabled

Which is not very healthy for PCI passthrough. Albeit you can do
it with PV without IOMMU. Did the previous version of Xen have the same
message?

Looking at the code (in Linux) I see:
 516         /* NB. We are happy to share unless we are probing. */
 517         bind_pirq.flags = info->u.pirq.flags & PIRQ_SHAREABLE ?
 518                                         BIND_PIRQ__WILL_SHARE : 0;
 519         rc = HYPERVISOR_event_channel_op(EVTCHNOP_bind_pirq, &bind_pirq);
 520         if (rc != 0) {
 521                 pr_warn("Failed to obtain physical IRQ %d\n", irq);
 522                 return 0;
 523         }

It would be nice if I we had included the return code :-(

Anyhow for PV guests in the hypervisor there is a check:
 414     if ( !is_hvm_domain(d) && !pirq_access_permitted(d, pirq) )
 415         return -EPERM;
 416 

And I wonder if the XEN_DOMCTL_irq_permission aka, xc_domain_irq_permission
had been called. I remember that at some point we missed it for Xend..

Could you enable Xend debugging (if you are using that):

export XEND_DEBUG=1
/etc/init.d/xend start

And try starting the guest. Then grep in /var/log/xen/xend.log for
"pci: enabling irq "

You should see 18, 17 and 21.

Also if you do 'xl debug-keys i && xl dmesg'

You should see that the IRQ 17, 18, 21 are assigned to the domain.
?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [BUG] pci-passthrough generates "xen:events: Failed to obtain physical IRQ" for some devices
  2016-01-27 18:30 ` [BUG] pci-passthrough generates "xen:events: Failed to obtain physical IRQ" for some devices Konrad Rzeszutek Wilk
@ 2016-01-30  2:13   ` Marek Marczykowski-Górecki
  2016-01-30 13:18   ` Tommi Airikka
  1 sibling, 0 replies; 15+ messages in thread
From: Marek Marczykowski-Górecki @ 2016-01-30  2:13 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: Tommi Airikka, 810379, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 4776 bytes --]

On Wed, Jan 27, 2016 at 01:30:05PM -0500, Konrad Rzeszutek Wilk wrote:
> On Sat, Jan 23, 2016 at 05:12:04PM +0100, Tommi Airikka wrote:
> > Xen developers,
> > 
> > After an upgrade of my Debian Jessie dom0 and domUs, my passthroughed
> > NIC stopped working.

I have very similar (the same?) problem with USB 3.0 controller. But on
different software versions.

> > This bug was probably introduced in Debian Jessie sometime
> > between 2015-12-30 and 2016-01-08 as 2015-12-30 as 2015-12-30 was the
> > last time I upgraded without any problems according to my dpkg.log.
> 
> This upgrade looks to only have upgraded the hypervisor?
> 
> As in I see:
> 
> domU "bug" "uname -a":
> Linux bug 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2 (2016-01-02)
> x86_64 GNU/Linux
> 
> domU "working" "uname -a":
> Linux working 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2
> (2016-01-02) x86_64 GNU/Linux
> 
> So same version? What was the earlier version of the hypervisor?

In my case, domU Linux version is 4.1.13, Xen is 4.6.0. On this versions
problem occurs. Not sure what was working version, but I guess it was
Xen 4.4.3 and Linux 3.18.something.

> The Xen version you have says:
> > (XEN) I/O virtualisation disabled
> 
> Which is not very healthy for PCI passthrough. Albeit you can do
> it with PV without IOMMU. Did the previous version of Xen have the same
> message?

In my case IOMMU is enabled.

> Looking at the code (in Linux) I see:
>  516         /* NB. We are happy to share unless we are probing. */
>  517         bind_pirq.flags = info->u.pirq.flags & PIRQ_SHAREABLE ?
>  518                                         BIND_PIRQ__WILL_SHARE : 0;
>  519         rc = HYPERVISOR_event_channel_op(EVTCHNOP_bind_pirq, &bind_pirq);
>  520         if (rc != 0) {
>  521                 pr_warn("Failed to obtain physical IRQ %d\n", irq);
>  522                 return 0;
>  523         }
> 
> It would be nice if I we had included the return code :-(

I've added a logging here and got -22 (EINVAL). Exact messages are:
[    2.656966] pcifront pci-0: Installing PCI frontend
[    2.662274] pcifront pci-0: Creating PCI Frontend Bus 0000:00
[    2.662348] pcifront pci-0: PCI host bridge to bus 0000:00
[    2.662359] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
[    2.662366] pci_bus 0000:00: root bus resource [mem
0x00000000-0xfffffffff]
[    2.662374] pci_bus 0000:00: root bus resource [bus 00-ff]
[    2.662917] pci 0000:00:00.0: [1912:0015] type 00 class 0x0c0330
[    2.663769] pci 0000:00:00.0: reg 0x10: [mem 0xe2200000-0xe2201fff
64bit]
[    2.688410] pcifront pci-0: claiming resource 0000:00:00.0/0
[    2.688731] pci 0000:00:00.0: Xen PCI mapped GSI18 to IRQ51
[    2.768482] alg: No test for crc32 (crc32-pclmul)
[    2.824225] xen:events: xen_bind_pirq_gsi_to_irq: returning irq 51
for gsi 18
[    2.824241] xhci_hcd 0000:00:00.0: Xen PCI mapped GSI18 to IRQ51
[    2.824713] xhci_hcd 0000:00:00.0: xHCI Host Controller
[    2.825508] xhci_hcd 0000:00:00.0: new USB bus registered, assigned
bus number 2
[    2.832356] xhci_hcd 0000:00:00.0: hcc params 0x014051cf hci version
0x100 quirks 0x00000090
[    2.836735] xen:events: Failed to obtain physical IRQ 57 (error -22)
[    2.836758] xen:events: Failed to obtain physical IRQ 58 (error -22)
[    2.836769] xen:events: Failed to obtain physical IRQ 59 (error -22)
[    2.836780] xen:events: Failed to obtain physical IRQ 60 (error -22)
[    2.836793] xen:events: Failed to obtain physical IRQ 61 (error -22)

There is a check:
 463     if ( (pirq < 0) || (pirq >= d->nr_pirqs) )
 464         return -EINVAL;

But there is also a call to pirq_guest_bind, which could return EINVAL.

> Anyhow for PV guests in the hypervisor there is a check:
>  414     if ( !is_hvm_domain(d) && !pirq_access_permitted(d, pirq) )
>  415         return -EPERM;
>  416 
> 
> And I wonder if the XEN_DOMCTL_irq_permission aka, xc_domain_irq_permission
> had been called. I remember that at some point we missed it for Xend..
> 
> Could you enable Xend debugging (if you are using that):
> 
> export XEND_DEBUG=1
> /etc/init.d/xend start
> 
> And try starting the guest. Then grep in /var/log/xen/xend.log for
> "pci: enabling irq "
> 
> You should see 18, 17 and 21.
> 
> Also if you do 'xl debug-keys i && xl dmesg'
> 
> You should see that the IRQ 17, 18, 21 are assigned to the domain.
> ?

I can't see anything like that there. The highest IRQ there is 36. Does
it mean it is some bug in xhci driver?

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [BUG] pci-passthrough generates "xen:events: Failed to obtain physical IRQ" for some devices
  2016-01-27 18:30 ` [BUG] pci-passthrough generates "xen:events: Failed to obtain physical IRQ" for some devices Konrad Rzeszutek Wilk
  2016-01-30  2:13   ` Marek Marczykowski-Górecki
@ 2016-01-30 13:18   ` Tommi Airikka
  2016-02-01 10:43     ` Ian Campbell
  2016-02-03 20:28     ` Konrad Rzeszutek Wilk
  1 sibling, 2 replies; 15+ messages in thread
From: Tommi Airikka @ 2016-01-30 13:18 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: 810379, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 30044 bytes --]

On Wed, Jan 27, 2016 at 7:30 PM, Konrad Rzeszutek Wilk <
konrad.wilk@oracle.com> wrote:

> On Sat, Jan 23, 2016 at 05:12:04PM +0100, Tommi Airikka wrote:
> > Xen developers,
> >
> > After an upgrade of my Debian Jessie dom0 and domUs, my passthroughed
> > NIC stopped working.
> > This bug was probably introduced in Debian Jessie sometime
> > between 2015-12-30 and 2016-01-08 as 2015-12-30 as 2015-12-30 was the
> > last time I upgraded without any problems according to my dpkg.log.
>
> This upgrade looks to only have upgraded the hypervisor?
>
> As in I see:
>
> domU "bug" "uname -a":
> Linux bug 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2 (2016-01-02)
> x86_64 GNU/Linux
>
> domU "working" "uname -a":
> Linux working 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2
> (2016-01-02) x86_64 GNU/Linux
>
> So same version? What was the earlier version of the hypervisor?
>

I forgot to mention that I use apt-dater to upgrade both dom0 and domUs at
the same time. domU "bug" was created for debugging purposes just a couple
of hours after I used apt-dater and realized that there's something wrong
with the pci passthrough. domU "bug" and domU "working" should have
relatively similar software state.

According to dom0 dpkg.log, the xen-hypervisor-4.4-amd64 (version
"4.4.1-9+deb8u3") has been untouched since 2015-12-21.
linux-image-3.16.0-4-amd64 was upgraded from "3.16.7-ckt20-1+deb8u1" to
"3.16.7-ckt20-1+deb8u2" at the point of time when pci passthrough stopped
working.


>
> The Xen version you have says:
> > (XEN) I/O virtualisation disabled
>
> Which is not very healthy for PCI passthrough. Albeit you can do
> it with PV without IOMMU. Did the previous version of Xen have the same
> message?
>

I downgraded linux-image on dom0:
dpkg -i linux-image-3.16.0-4-amd64_3.16.7-ckt20-1+deb8u1_amd64.deb

and now the pci passthrough seems to work!

dom0 'uname -a':
Linux dom0 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u1 (2015-12-14)
x86_64 GNU/Linux

domU bug 'uname -a':
Linux bug 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2 (2016-01-02)
x86_64 GNU/Linux

But I still have the "(XEN) I/O virtualisation disabled".
dom0 'xl dmesg':

(XEN) Xen version 4.4.1 (Debian 4.4.1-9+deb8u3) (ultrotter@debian.org) (gcc
(Debian 4.9.2-10) 4.9.2) debug=n Wed Nov 25 15:46:22 EET 2015
(XEN) Bootloader: GRUB 2.02~beta2-22+deb8u1
(XEN) Command line: placeholder dom0_mem=1024M,max:1024M
(XEN) Video information:
(XEN)  VGA is text mode 80x25, font 8x16
(XEN)  VBE/DDC methods: none; EDID transfer time: 0 seconds
(XEN)  EDID info not retrieved because no DDC retrieval method detected
(XEN) Disc information:
(XEN)  Found 4 MBR signatures
(XEN)  Found 2 EDD information structures
(XEN) Xen-e820 RAM map:
(XEN)  0000000000000000 - 0000000000099800 (usable)
(XEN)  0000000000099800 - 0000000000099c00 (reserved)
(XEN)  000000000009e000 - 00000000000a0000 (reserved)
(XEN)  00000000000f0000 - 0000000000100000 (reserved)
(XEN)  0000000000100000 - 00000000f1de4000 (usable)
(XEN)  00000000f1de4000 - 00000000f1dee000 (ACPI data)
(XEN)  00000000f1dee000 - 00000000f8000000 (reserved)
(XEN)  00000000fec00000 - 00000000fee10000 (reserved)
(XEN)  00000000ff800000 - 0000000100000000 (reserved)
(XEN)  0000000100000000 - 000000028bfff000 (usable)
(XEN) ACPI: RSDP 000F4F00, 0024 (r2 HP    )
(XEN) ACPI: XSDT F1DE6400, 00B4 (r1 HP     ProLiant        2   �     162E)
(XEN) ACPI: FACP F1DE6540, 00F4 (r3 HP     ProLiant        2   �     162E)
(XEN) ACPI: DSDT F1DE6640, 1C1A (r1 HP         DSDT        1 INTL 20030228)
(XEN) ACPI: FACS F1DE4140, 0040
(XEN) ACPI: SPCR F1DE4180, 0050 (r1 HP     SPCRRBSU        1   �     162E)
(XEN) ACPI: MCFG F1DE4200, 003C (r1 HP     ProLiant        1             0)
(XEN) ACPI: HPET F1DE4240, 0038 (r1 HP     ProLiant        2   �     162E)
(XEN) ACPI: FFFF F1DE4280, 0064 (r2 HP     ProLiant        2   �     162E)
(XEN) ACPI: SPMI F1DE4300, 0040 (r5 HP     ProLiant        1   �     162E)
(XEN) ACPI: ERST F1DE4340, 0230 (r1 HP     ProLiant        1   �     162E)
(XEN) ACPI: APIC F1DE4580, 0252 (r1 HP     ProLiant        2             0)
(XEN) ACPI: FFFF F1DE4800, 0176 (r1 HP     ProLiant        1   �     162E)
(XEN) ACPI: BERT F1DE4980, 0030 (r1 HP     ProLiant        1   �     162E)
(XEN) ACPI: HEST F1DE49C0, 00BC (r1 HP     ProLiant        1   �     162E)
(XEN) ACPI: FFFF F1DE4A80, 1914 (r1 HP     ProLiant        1   �     162E)
(XEN) ACPI: FFFF F1DE63C0, 002D (r1 HP     ProLiant        1             0)
(XEN) ACPI: SSDT F1DE8280, 0137 (r3     HP  CRSPCI0        2   HP        1)
(XEN) ACPI: SSDT F1DE83C0, 0177 (r3     HP   riser0        2 INTL 20030228)
(XEN) ACPI: SSDT F1DE8540, 01E1 (r1     HP      pcc        1 INTL 20090625)
(XEN) ACPI: SSDT F1DE8740, 0377 (r1     HP     pmab        1 INTL 20090625)
(XEN) ACPI: SSDT F1DE8AC0, 0504 (r1 INTEL  PPM RCM  80000001 INTL 20061109)
(XEN) System RAM: 10205MB (10450416kB)
(XEN) Domain heap initialised
(XEN) Processor #0 7:10 APIC version 21
(XEN) Processor #2 7:10 APIC version 21
(XEN) IOAPIC[0]: apic_id 8, version 32, address 0xfec00000, GSI 0-23
(XEN) Enabling APIC mode:  Flat.  Using 1 I/O APICs
(XEN) Using scheduler: SMP Credit Scheduler (credit)
(XEN) Detected 2294.859 MHz processor.
(XEN) Initing memory sharing.
(XEN) xstate_init: using cntxt_size: 0x240 and states: 0x3
(XEN) I/O virtualisation disabled
(XEN) Enabled directed EOI with ioapic_ack_old on!
(XEN) ENABLING IO-APIC IRQs
(XEN)  -> Using old ACK method
(XEN) Platform timer is 14.318MHz HPET
(XEN) Allocated console ring of 16 KiB.
(XEN) VMX: Supported advanced features:
(XEN)  - APIC MMIO access virtualisation
(XEN)  - APIC TPR shadow
(XEN)  - Extended Page Tables (EPT)
(XEN)  - Virtual-Processor Identifiers (VPID)
(XEN)  - Virtual NMI
(XEN)  - MSR direct-access bitmap
(XEN)  - Unrestricted Guest
(XEN) HVM: ASIDs enabled.
(XEN) HVM: VMX enabled
(XEN) HVM: Hardware Assisted Paging (HAP) detected
(XEN) HVM: HAP page sizes: 4kB, 2MB
(XEN) Brought up 2 CPUs
(XEN) *** LOADING DOMAIN 0 ***
(XEN)  Xen  kernel: 64-bit, lsb, compat32
(XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x1f18000
(XEN) PHYSICAL MEMORY ARRANGEMENT:
(XEN)  Dom0 alloc.:   000000023c000000->0000000240000000 (241836 pages to
be allocated)
(XEN)  Init. ramdisk: 000000028aeac000->000000028bdff9af
(XEN) VIRTUAL MEMORY ARRANGEMENT:
(XEN)  Loaded kernel: ffffffff81000000->ffffffff81f18000
(XEN)  Init. ramdisk: ffffffff81f18000->ffffffff82e6b9af
(XEN)  Phys-Mach map: ffffffff82e6c000->ffffffff8306c000
(XEN)  Start info:    ffffffff8306c000->ffffffff8306c4b4
(XEN)  Page tables:   ffffffff8306d000->ffffffff8308a000
(XEN)  Boot stack:    ffffffff8308a000->ffffffff8308b000
(XEN)  TOTAL:         ffffffff80000000->ffffffff83400000
(XEN)  ENTRY ADDRESS: ffffffff819021f0
(XEN) Dom0 has maximum 2 VCPUs
(XEN) Scrubbing Free RAM:
..........................................................................................done.
(XEN) Initial low memory virq threshold set at 0x4000 pages.
(XEN) Std. Loglevel: Errors and warnings
(XEN) Guest Loglevel: Nothing (Rate-limited: Errors and warnings)
(XEN) Xen is relinquishing VGA console.
(XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input
to Xen)
(XEN) Freed 284kB init memory.
(XEN) mm.c:812: d13: Forcing read-only access to MFN fbff1
(XEN) mm.c:812: d13: Forcing read-only access to MFN fbff1
(XEN) mm.c:812: d13: Forcing read-only access to MFN fbff1
(XEN) mm.c:812: d0: Forcing read-only access to MFN fbff1
(XEN) mm.c:812: d13: Forcing read-only access to MFN faba0
(XEN) mm.c:812: d0: Forcing read-only access to MFN faba0

domU "bug" 'dmesg':

[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.16.0-4-amd64 (debian-kernel@lists.debian.org)
(gcc version 4.8.4 (Debian 4.8.4-1) ) #1 SMP Debian 3.16.7-ckt20-1+deb8u2
(2016-01-02)
[    0.000000] Command line: root=/dev/xvda2 ro elevator=noop
root=/dev/xvda2 ro
[    0.000000] ACPI in unprivileged domain disabled
[    0.000000] 1-1 mapping on 8000->100000
[    0.000000] Set 1015808 page(s) to 1-1 mapping
[    0.000000] 1-1 mapping on 100000->8000000
[    0.000000] e820: BIOS-provided physical RAM map:
[    0.000000] Xen: [mem 0x0000000000000000-0x000000000009ffff] usable
[    0.000000] Xen: [mem 0x00000000000a0000-0x00000000000fffff] reserved
[    0.000000] Xen: [mem 0x0000000000100000-0x0000000007ffffff] usable
[    0.000000] Xen: [mem 0x0000000008000000-0x00000000f1de3fff] unusable
[    0.000000] Xen: [mem 0x00000000f1de4000-0x00000000f1dedfff] ACPI data
[    0.000000] Xen: [mem 0x00000000f1dee000-0x00000000f7ffffff] reserved
[    0.000000] Xen: [mem 0x00000000fec00000-0x00000000feefffff] reserved
[    0.000000] Xen: [mem 0x00000000ff800000-0x00000000ffffffff] reserved
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] DMI not present or invalid.
[    0.000000] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[    0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable
[    0.000000] AGP: No AGP bridge found
[    0.000000] e820: last_pfn = 0x8000 max_arch_pfn = 0x400000000
[    0.000000] Base memory trampoline at [ffff88000009a000] 9a000 size 24576
[    0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff]
[    0.000000]  [mem 0x00000000-0x000fffff] page 4k
[    0.000000] init_memory_mapping: [mem 0x07e00000-0x07ffffff]
[    0.000000]  [mem 0x07e00000-0x07ffffff] page 4k
[    0.000000] BRK [0x01b02000, 0x01b02fff] PGTABLE
[    0.000000] init_memory_mapping: [mem 0x04000000-0x07dfffff]
[    0.000000]  [mem 0x04000000-0x07dfffff] page 4k
[    0.000000] BRK [0x01b03000, 0x01b03fff] PGTABLE
[    0.000000] BRK [0x01b04000, 0x01b04fff] PGTABLE
[    0.000000] BRK [0x01b05000, 0x01b05fff] PGTABLE
[    0.000000] BRK [0x01b06000, 0x01b06fff] PGTABLE
[    0.000000] BRK [0x01b07000, 0x01b07fff] PGTABLE
[    0.000000] init_memory_mapping: [mem 0x00100000-0x03ffffff]
[    0.000000]  [mem 0x00100000-0x03ffffff] page 4k
[    0.000000] RAMDISK: [mem 0x01f18000-0x049bffff]
[    0.000000] NUMA turned off
[    0.000000] Faking a node at [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x00000000-0x07ffffff]
[    0.000000]   NODE_DATA [mem 0x07fe7000-0x07febfff]
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x00001000-0x00ffffff]
[    0.000000]   DMA32    [mem 0x01000000-0xffffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00001000-0x0009ffff]
[    0.000000]   node   0: [mem 0x00100000-0x07ffffff]
[    0.000000] On node 0 totalpages: 32671
[    0.000000]   DMA zone: 56 pages used for memmap
[    0.000000]   DMA zone: 21 pages reserved
[    0.000000]   DMA zone: 3999 pages, LIFO batch:0
[    0.000000]   DMA32 zone: 392 pages used for memmap
[    0.000000]   DMA32 zone: 28672 pages, LIFO batch:7
[    0.000000] SFI: Simple Firmware Interface v0.81
http://simplefirmware.org
[    0.000000] smpboot: Allowing 1 CPUs, 0 hotplug CPUs
[    0.000000] nr_irqs_gsi: 16
[    0.000000] PM: Registered nosave memory: [mem 0x000a0000-0x000fffff]
[    0.000000] e820: [mem 0xf8000000-0xfebfffff] available for PCI devices
[    0.000000] Booting paravirtualized kernel on Xen
[    0.000000] Xen version: 4.4.1 (preserve-AD)
[    0.000000] setup_percpu: NR_CPUS:512 nr_cpumask_bits:512 nr_cpu_ids:1
nr_node_ids:1
[    0.000000] PERCPU: Embedded 27 pages/cpu @ffff880007c00000 s80896 r8192
d21504 u2097152
[    0.000000] pcpu-alloc: s80896 r8192 d21504 u2097152 alloc=1*2097152
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists in Node order, mobility grouping on.
Total pages: 32202
[    0.000000] Policy zone: DMA32
[    0.000000] Kernel command line: root=/dev/xvda2 ro elevator=noop
root=/dev/xvda2 ro
[    0.000000] PID hash table entries: 512 (order: 0, 4096 bytes)
[    0.000000] xsave: enabled xstate_bv 0x3, cntxt size 0x240
[    0.000000] AGP: Checking aperture...
[    0.000000] AGP: No AGP bridge found
[    0.000000] Calgary: detecting Calgary via BIOS EBDA area
[    0.000000] Calgary: Unable to locate Rio Grande table in EBDA - bailing!
[    0.000000] Memory: 72968K/130684K available (5219K kernel code, 947K
rwdata, 1836K rodata, 1204K init, 840K bss, 57716K reserved)
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU dyntick-idle grace-period acceleration is enabled.
[    0.000000]  RCU restricting CPUs from NR_CPUS=512 to nr_cpu_ids=1.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS:33024 nr_irqs:256 16
[    0.000000] xen:events: Using FIFO-based ABI
[    0.000000] Console: colour dummy device 80x25
[    0.000000] console [tty0] enabled
[    0.000000] console [hvc0] enabled
[    0.000000] Xen: using vcpuop timer interface
[    0.000000] installing Xen timer for CPU 0
[    0.000000] tsc: Detected 2294.858 MHz processor
[    0.004000] Calibrating delay loop (skipped), value calculated using
timer frequency.. 4589.71 BogoMIPS (lpj=9179432)
[    0.004000] pid_max: default: 32768 minimum: 301
[    0.004000] Security Framework initialized
[    0.004000] AppArmor: AppArmor disabled by boot time parameter
[    0.004000] Yama: disabled by default; enable with sysctl kernel.yama.*
[    0.004000] Dentry cache hash table entries: 16384 (order: 5, 131072
bytes)
[    0.004000] Inode-cache hash table entries: 8192 (order: 4, 65536 bytes)
[    0.004000] Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
[    0.004000] Mountpoint-cache hash table entries: 512 (order: 0, 4096
bytes)
[    0.004000] Initializing cgroup subsys memory
[    0.004000] Initializing cgroup subsys devices
[    0.004000] Initializing cgroup subsys freezer
[    0.004000] Initializing cgroup subsys net_cls
[    0.004000] Initializing cgroup subsys blkio
[    0.004000] Initializing cgroup subsys perf_event
[    0.004000] Initializing cgroup subsys net_prio
[    0.004000] ENERGY_PERF_BIAS: Set to 'normal', was 'performance'
ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)
[    0.004000] CPU: Physical Processor ID: 0
[    0.004000] CPU: Processor Core ID: 1
[    0.004000] Last level iTLB entries: 4KB 512, 2MB 8, 4MB 8
Last level dTLB entries: 4KB 512, 2MB 32, 4MB 32, 1GB 0
tlb_flushall_shift: 2
[    0.025772] Freeing SMP alternatives memory: 20K (ffffffff81a1b000 -
ffffffff81a20000)
[    0.028385] ftrace: allocating 21679 entries in 85 pages
[    0.036140] Performance Events: unsupported p6 CPU model 58 no PMU
driver, software events only.
[    0.037591] x86: Booted up 1 node, 1 CPUs
[    0.037647] NMI watchdog: disabled (cpu0): hardware events not enabled
[    0.037724] devtmpfs: initialized
[    0.041230] pinctrl core: initialized pinctrl subsystem
[    0.041317] NET: Registered protocol family 16
[    0.041334] xen:grant_table: Grant tables using version 1 layout
[    0.041353] Grant table initialized
[    0.041615] PCI: setting up Xen PCI frontend stub
[    0.041615] PCI: pci_cache_line_size set to 64 bytes
[    0.041615] ACPI: Interpreter disabled.
[    0.041615] xen:balloon: Initialising balloon driver
[    0.044041] xen_balloon: Initialising balloon driver
[    0.044067] vgaarb: loaded
[    0.044134] PCI: System does not support PCI
[    0.044138] PCI: System does not support PCI
[    0.044274] Switched to clocksource xen
[    0.049387] pnp: PnP ACPI: disabled
[    0.053177] NET: Registered protocol family 2
[    0.053357] TCP established hash table entries: 1024 (order: 1, 8192
bytes)
[    0.053368] TCP bind hash table entries: 1024 (order: 2, 16384 bytes)
[    0.053373] TCP: Hash tables configured (established 1024 bind 1024)
[    0.053389] TCP: reno registered
[    0.053394] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.053402] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.053439] NET: Registered protocol family 1
[    0.053454] PCI: CLS 0 bytes, default 64
[    0.053501] Unpacking initramfs...
[    0.091622] Freeing initrd memory: 43680K (ffff880001f18000 -
ffff8800049c0000)
[    0.093485] platform rtc_cmos: registered platform RTC device (no PNP
device found)
[    0.093788] RAPL PMU detected, hw unit 2^-16 Joules, API unit is 2^-32
Joules, 3 fixed counters 163840 ms ovfl timer
[    0.093845] microcode: CPU0 sig=0x306a9, pf=0x2, revision=0x19
[    0.093925] microcode: Microcode Update Driver: v2.00 <
tigran@aivazian.fsnet.co.uk>, Peter Oruba
[    0.094168] futex hash table entries: 256 (order: 2, 16384 bytes)
[    0.094197] audit: initializing netlink subsys (disabled)
[    0.094217] audit: type=2000 audit(1454158364.375:1): initialized
[    0.094532] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[    0.094557] zbud: loaded
[    0.094700] VFS: Disk quotas dquot_6.5.2
[    0.094714] Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.094771] msgmni has been set to 227
[    0.095221] alg: No test for stdrng (krng)
[    0.095249] Block layer SCSI generic (bsg) driver version 0.4 loaded
(major 252)
[    0.095292] io scheduler noop registered (default)
[    0.095297] io scheduler deadline registered
[    0.095324] io scheduler cfq registered
[    0.095389] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
[    0.095407] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
[    0.095437] intel_idle: does not run on family 6 model 58
[    0.095735] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.095989] Linux agpgart interface v0.103
[    0.096104] i8042: PNP: No PS/2 controller found. Probing ports directly.
[    1.270619] i8042: No controller found
[    1.270793] mousedev: PS/2 mouse device common for all mice
[    1.348656] rtc_cmos rtc_cmos: rtc core: registered rtc_cmos as rtc0
[    1.348710] rtc_cmos: probe of rtc_cmos failed with error -38
[    1.348741] ledtrig-cpu: registered to indicate activity on CPUs
[    1.348760] AMD IOMMUv2 driver by Joerg Roedel <joerg.roedel@amd.com>
[    1.348763] AMD IOMMUv2 functionality not available on this system
[    1.348859] TCP: cubic registered
[    1.348876] NET: Registered protocol family 10
[    1.349056] mip6: Mobile IPv6
[    1.349064] NET: Registered protocol family 17
[    1.349073] mpls_gso: MPLS GSO support
[    1.349080] mce: Unable to init device /dev/mcelog (rc: -5)
[    1.349225] registered taskstats version 1
[    1.349283] xenbus_probe_frontend: Device with no driver:
device/vbd/51714
[    1.349288] xenbus_probe_frontend: Device with no driver:
device/vbd/51713
[    1.349291] xenbus_probe_frontend: Device with no driver: device/vif/0
[    1.349294] xenbus_probe_frontend: Device with no driver: device/pci/0
[    1.349331] rtc_hctosys: unable to open rtc device (rtc0)
[    1.349380] PM: Hibernation image not present or could not be loaded.
[    1.349896] Freeing unused kernel memory: 1204K (ffffffff818ee000 -
ffffffff81a1b000)
[    1.349907] Write protecting the kernel read-only data: 8192k
[    1.352430] Freeing unused kernel memory: 912K (ffff88000151c000 -
ffff880001600000)
[    1.352541] Freeing unused kernel memory: 212K (ffff8800017cb000 -
ffff880001800000)
[    1.372341] systemd-udevd[58]: starting version 215
[    1.372888] random: systemd-udevd urandom read with 3 bits of entropy
available
[    1.395569] xen_netfront: Initialising Xen virtual ethernet driver
[    1.443740] blkfront: xvda2: flush diskcache: enabled; persistent
grants: enabled; indirect descriptors: enabled;
[    1.445979] blkfront: xvda1: flush diskcache: enabled; persistent
grants: enabled; indirect descriptors: enabled;
[    8.862010] EXT4-fs (xvda2): mounted filesystem with ordered data mode.
Opts: (null)
[    9.351477] random: nonblocking pool is initialized
[   10.447043] systemd[1]: systemd 215 running in system mode. (+PAM +AUDIT
+SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
[   10.447128] systemd[1]: Detected virtualization 'xen'.
[   10.447139] systemd[1]: Detected architecture 'x86-64'.
[   10.912912] systemd[1]: Inserted module 'autofs4'
[   10.971682] systemd[1]: Set hostname to <bug>.
[   15.114090] systemd[1]: Cannot add dependency job for unit dbus.socket,
ignoring: Unit dbus.socket failed to load: No such file or directory.
[   15.114125] systemd[1]: Cannot add dependency job for unit
display-manager.service, ignoring: Unit display-manager.service failed to
load: No such file or directory.
[   15.114652] systemd[1]: Starting Forward Password Requests to Wall
Directory Watch.
[   15.114803] systemd[1]: Started Forward Password Requests to Wall
Directory Watch.
[   15.114834] systemd[1]: Expecting device dev-hvc0.device...
[   15.115023] systemd[1]: Starting Remote File Systems (Pre).
[   15.115131] systemd[1]: Reached target Remote File Systems (Pre).
[   15.115185] systemd[1]: Starting Arbitrary Executable File Formats File
System Automount Point.
[   15.115422] systemd[1]: Set up automount Arbitrary Executable File
Formats File System Automount Point.
[   15.115463] systemd[1]: Starting Dispatch Password Requests to Console
Directory Watch.
[   15.115547] systemd[1]: Started Dispatch Password Requests to Console
Directory Watch.
[   15.115571] systemd[1]: Starting Paths.
[   15.115669] systemd[1]: Reached target Paths.
[   15.115692] systemd[1]: Starting Encrypted Volumes.
[   15.115785] systemd[1]: Reached target Encrypted Volumes.
[   15.115808] systemd[1]: Expecting device dev-xvda1.device...
[   15.115899] systemd[1]: Starting Root Slice.
[   15.116040] systemd[1]: Created slice Root Slice.
[   15.116064] systemd[1]: Starting User and Session Slice.
[   15.116207] systemd[1]: Created slice User and Session Slice.
[   15.116231] systemd[1]: Starting Delayed Shutdown Socket.
[   15.116365] systemd[1]: Listening on Delayed Shutdown Socket.
[   15.116389] systemd[1]: Starting /dev/initctl Compatibility Named Pipe.
[   15.116524] systemd[1]: Listening on /dev/initctl Compatibility Named
Pipe.
[   15.116548] systemd[1]: Starting Journal Socket (/dev/log).
[   15.116688] systemd[1]: Listening on Journal Socket (/dev/log).
[   15.116721] systemd[1]: Starting udev Kernel Socket.
[   15.116829] systemd[1]: Listening on udev Kernel Socket.
[   15.116859] systemd[1]: Starting udev Control Socket.
[   15.116970] systemd[1]: Listening on udev Control Socket.
[   15.116997] systemd[1]: Starting Journal Socket.
[   15.117135] systemd[1]: Listening on Journal Socket.
[   15.117170] systemd[1]: Starting System Slice.
[   15.117300] systemd[1]: Created slice System Slice.
[   15.117341] systemd[1]: Starting File System Check on Root Device...
[   15.118784] systemd[1]: Starting system-getty.slice.
[   15.118980] systemd[1]: Created slice system-getty.slice.
[   15.119005] systemd[1]: Starting system-serial\x2dgetty.slice.
[   15.119146] systemd[1]: Created slice system-serial\x2dgetty.slice.
[   15.119224] systemd[1]: Starting Increase datagram queue length...
[   15.120664] systemd[1]: Mounting POSIX Message Queue File System...
[   15.315723] systemd[1]: Mounting Debug File System...
[   15.376731] systemd[1]: Started Set Up Additional Binary Formats.
[   15.376795] systemd[1]: Mounting Huge Pages File System...
[   15.378081] systemd[1]: Starting Create list of required static device
nodes for the current kernel...
[   15.422179] systemd[1]: Starting Load Kernel Modules...
[   15.423348] systemd[1]: Starting udev Coldplug all Devices...
[   15.424454] systemd[1]: Starting Slices.
[   15.424548] systemd[1]: Reached target Slices.
[   15.425330] systemd[1]: Started Increase datagram queue length.
[   15.426545] systemd[1]: Starting Syslog Socket.
[   15.426671] systemd[1]: Listening on Syslog Socket.
[   15.426694] systemd[1]: Starting Sockets.
[   15.426763] systemd[1]: Reached target Sockets.
[   15.426783] systemd[1]: Starting Journal Service...
[   15.429296] systemd[1]: Started Journal Service.
[   16.279394] systemd-udevd[137]: starting version 215
[   16.420090] EXT4-fs (xvda2): re-mounted. Opts: errors=remount-ro
[   16.640700] systemd-journald[123]: Received request to flush runtime
journal from PID 1
[   17.378097] input: PC Speaker as /devices/platform/pcspkr/input/input0
[   17.384721] pcifront pci-0: Installing PCI frontend
[   17.384741] xen:swiotlb_xen: Warning: only able to allocate 4 MB for
software IO TLB
[   17.387512] software IO TLB [mem 0x02400000-0x02800000] (4MB) mapped at
[ffff880002400000-ffff8800027fffff]
[   17.388459] pcifront pci-0: Creating PCI Frontend Bus 0000:00
[   17.388562] pcifront pci-0: PCI host bridge to bus 0000:00
[   17.388569] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
[   17.388573] pci_bus 0000:00: root bus resource [mem
0x00000000-0xfffffffff]
[   17.388578] pci_bus 0000:00: root bus resource [bus 00-ff]
[   17.401449] pci 0000:00:01.0: [1912:0014] type 00 class 0x0c0330
[   17.401911] pci 0000:00:01.0: reg 0x10: [mem 0xfbff0000-0xfbff1fff 64bit]
[   17.431844] alg: No test for crc32 (crc32-pclmul)
[   17.435526] pci 0000:00:00.1: [14e4:165f] type 00 class 0x020000
[   17.435907] pci 0000:00:00.1: reg 0x10: [mem 0xfabc0000-0xfabcffff 64bit
pref]
[   17.436227] pci 0000:00:00.1: reg 0x18: [mem 0xfabb0000-0xfabbffff 64bit
pref]
[   17.436481] pci 0000:00:00.1: reg 0x20: [mem 0xfaba0000-0xfabaffff 64bit
pref]
[   17.437994] pcifront pci-0: New device on 0000:00:00.1 found.
[   17.439770] pcifront pci-0: claiming resource 0000:00:01.0/0
[   17.439778] pcifront pci-0: claiming resource 0000:00:00.1/0
[   17.439782] pcifront pci-0: claiming resource 0000:00:00.1/2
[   17.439785] pcifront pci-0: claiming resource 0000:00:00.1/4
[   17.439875] pci 0000:00:01.0: Xen PCI mapped GSI18 to IRQ29
[   17.742850] intel_rapl: Found RAPL domain package
[   17.742864] intel_rapl: Found RAPL domain core
[   18.330425] pps_core: LinuxPPS API ver. 1 registered
[   18.330438] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo
Giometti <giometti@linux.it>
[   18.335293] PTP clock support registered
[   18.382328] tg3.c:v3.137 (May 11, 2014)
[   18.383508] tg3 0000:00:00.1: Xen PCI mapped GSI17 to IRQ30
[   18.394807] usbcore: registered new interface driver usbfs
[   18.395074] usbcore: registered new interface driver hub
[   18.395796] usbcore: registered new device driver usb
[   18.413270] tg3 0000:00:00.1 eth1: Tigon3 [partno(N/A) rev 5720000] (PCI
Express) MAC address 34:64:a9:9a:a8:b1
[   18.413288] tg3 0000:00:00.1 eth1: attached PHY is 5720C
(10/100/1000Base-T Ethernet) (WireSpeed[1], EEE[1])
[   18.413297] tg3 0000:00:00.1 eth1: RXcsums[1] LinkChgREG[0] MIirq[0]
ASF[1] TSOcap[1]
[   18.413304] tg3 0000:00:00.1 eth1: dma_rwctrl[00000001] dma_mask[64-bit]
[   18.430176] xen:events: xen_bind_pirq_gsi_to_irq: returning irq 29 for
gsi 18
[   18.430192] xhci_hcd 0000:00:01.0: Xen PCI mapped GSI18 to IRQ29
[   18.434698] xhci_hcd 0000:00:01.0: xHCI Host Controller
[   18.434723] xhci_hcd 0000:00:01.0: new USB bus registered, assigned bus
number 1
[   18.445842] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[   18.445856] usb usb1: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[   18.445862] usb usb1: Product: xHCI Host Controller
[   18.445867] usb usb1: Manufacturer: Linux 3.16.0-4-amd64 xhci_hcd
[   18.445872] usb usb1: SerialNumber: 0000:00:01.0
[   18.449363] hub 1-0:1.0: USB hub found
[   18.449392] hub 1-0:1.0: 2 ports detected
[   18.449530] xhci_hcd 0000:00:01.0: xHCI Host Controller
[   18.449540] xhci_hcd 0000:00:01.0: new USB bus registered, assigned bus
number 2
[   18.450543] usb usb2: We don't know the algorithms for LPM for this
host, disabling LPM.
[   18.450584] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003
[   18.450591] usb usb2: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[   18.450596] usb usb2: Product: xHCI Host Controller
[   18.450602] usb usb2: Manufacturer: Linux 3.16.0-4-amd64 xhci_hcd
[   18.450606] usb usb2: SerialNumber: 0000:00:01.0
[   18.450904] hub 2-0:1.0: USB hub found
[   18.450925] hub 2-0:1.0: 2 ports detected
[   18.532710] Adding 262140k swap on /dev/xvda1.  Priority:-1 extents:1
across:262140k SSFS


> Looking at the code (in Linux) I see:
>  516         /* NB. We are happy to share unless we are probing. */
>  517         bind_pirq.flags = info->u.pirq.flags & PIRQ_SHAREABLE ?
>  518                                         BIND_PIRQ__WILL_SHARE : 0;
>  519         rc = HYPERVISOR_event_channel_op(EVTCHNOP_bind_pirq,
> &bind_pirq);
>  520         if (rc != 0) {
>  521                 pr_warn("Failed to obtain physical IRQ %d\n", irq);
>  522                 return 0;
>  523         }
>
> It would be nice if I we had included the return code :-(
>
> Anyhow for PV guests in the hypervisor there is a check:
>  414     if ( !is_hvm_domain(d) && !pirq_access_permitted(d, pirq) )
>  415         return -EPERM;
>  416
>
> And I wonder if the XEN_DOMCTL_irq_permission aka, xc_domain_irq_permission
> had been called. I remember that at some point we missed it for Xend..
>
> Could you enable Xend debugging (if you are using that):
>

I'm using xl. Is there a similar setting for that?


>
> export XEND_DEBUG=1
> /etc/init.d/xend start
>
> And try starting the guest. Then grep in /var/log/xen/xend.log for
> "pci: enabling irq "
>
> You should see 18, 17 and 21.
>
> Also if you do 'xl debug-keys i && xl dmesg'
>
> You should see that the IRQ 17, 18, 21 are assigned to the domain.
> ?
>

Br,
Tommi Airikka

[-- Attachment #1.2: Type: text/html, Size: 34029 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [BUG] pci-passthrough generates "xen:events: Failed to obtain physical IRQ" for some devices
  2016-01-30 13:18   ` Tommi Airikka
@ 2016-02-01 10:43     ` Ian Campbell
  2016-02-01 14:50       ` Konrad Rzeszutek Wilk
  2016-02-03 20:28     ` Konrad Rzeszutek Wilk
  1 sibling, 1 reply; 15+ messages in thread
From: Ian Campbell @ 2016-02-01 10:43 UTC (permalink / raw)
  To: Tommi Airikka, Konrad Rzeszutek Wilk; +Cc: 810379, xen-devel

[-- Attachment #1: Type: text/plain, Size: 5312 bytes --]

On Sat, 2016-01-30 at 14:18 +0100, Tommi Airikka wrote:
> 
> 
> On Wed, Jan 27, 2016 at 7:30 PM, Konrad Rzeszutek Wilk <konrad.wilk@oracl
> e.com> wrote:
> > On Sat, Jan 23, 2016 at 05:12:04PM +0100, Tommi Airikka wrote:
> > > Xen developers,
> > >
> > > After an upgrade of my Debian Jessie dom0 and domUs, my passthroughed
> > > NIC stopped working.
> > > This bug was probably introduced in Debian Jessie sometime
> > > between 2015-12-30 and 2016-01-08 as 2015-12-30 as 2015-12-30 was the
> > > last time I upgraded without any problems according to my dpkg.log.
> > 
> > This upgrade looks to only have upgraded the hypervisor?
> > 
> > As in I see:
> > 
> > domU "bug" "uname -a":
> > Linux bug 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2 (2016-01-
> > 02)
> > x86_64 GNU/Linux
> > 
> > domU "working" "uname -a":
> > Linux working 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2
> > (2016-01-02) x86_64 GNU/Linux
> > 
> > So same version? What was the earlier version of the hypervisor?
> I forgot to mention that I use apt-dater to upgrade both dom0 and domUs
> at the same time. domU "bug" was created for debugging purposes just a
> couple of hours after I used apt-dater and realized that there's
> something wrong with the pci passthrough. domU "bug" and domU "working"
> should have relatively similar software state.
> 
> According to dom0 dpkg.log, the xen-hypervisor-4.4-amd64 (version "4.4.1-
> 9+deb8u3") has been untouched since 2015-12-21.
> linux-image-3.16.0-4-amd64 was upgraded from "3.16.7-ckt20-1+deb8u1" to
> "3.16.7-ckt20-1+deb8u2" at the point of time when pci passthrough stopped
> working.
>  
> >  
> > The Xen version you have says:
> > > (XEN) I/O virtualisation disabled
> > 
> > Which is not very healthy for PCI passthrough. Albeit you can do
> > it with PV without IOMMU. Did the previous version of Xen have the same
> > message?
> I downgraded linux-image on dom0:
> dpkg -i linux-image-3.16.0-4-amd64_3.16.7-ckt20-1+deb8u1_amd64.deb
> 
> and now the pci passthrough seems to work!

The Debian changelog entry for the update says:

linux (3.16.7-ckt20-1+deb8u2) jessie-security; urgency=medium

  * [xen] Fix race conditions in back-end drivers (CVE-2015-8550, XSA-155)
  * [xen] pciback: Fix state validation in MSI control operations
    (CVE-2015-8551, CVE-2015-8852, XSA-157)
  * pptp: verify sockaddr_len in pptp_bind() and pptp_connect() (CVE-2015-8569)
  * bluetooth: Validate socket address length in sco_sock_bind() (CVE-2015-8575)
  * ptrace: being capable wrt a process requires mapped uids/gids
    (CVE-2015-8709)
  * KEYS: Fix race between read and revoke (CVE-2015-7550)
  * [x86] KVM: Reload pit counters for all channels when restoring state
    (CVE-2015-7513)
  * udp: properly support MSG_PEEK with truncated buffers
    (Closes: #808293, regression in 3.16.7-ckt17)
  * Revert "xhci: don't finish a TD if we get a short transfer event mid TD"
    (Closes: #808602, #808953, regression in 3.16.7-ckt20)

The second bullet looks at first pretty interesting from this PoV,
see http://xenbits.xen.org/xsa/advisory-157.html for info on the XSA and
the various patches. Konrad is on the CC already so hopefully he has some
ideas.

I've attached the full Debian package diff from deb8u1 to u2, which has the
backported patches in it. Most of them (and all the Xen ones) have an
Origin header pointing to the upstream commit, looks like all of XSA-157
was applied and all but one (scsiback, not in this kernel) of XSA-155:

+Subject: [1/7] xen: Add RING_COPY_REQUEST()
+Origin: https://git.kernel.org/linus/454d5d882c7e412b840e3c99010fe81a9862f6fb
+Subject: [2/7] xen-netback: don't use last request to determine minimum Tx
+Origin: https://git.kernel.org/linus/0f589967a73f1f30ab4ac4dd9ce0bb399b4d6357
+Subject: [3/7] xen-netback: use RING_COPY_REQUEST() throughout
+Origin: https://git.kernel.org/linus/68a33bfd8403e4e22847165d149823a2e0e67c9c
+Subject: [4/7] xen-blkback: only read request operation from shared ring once
+Origin: https://git.kernel.org/linus/1f13d75ccb806260079e0679d55d9253e370ec8a
+Subject: [5/7] xen-blkback: read from indirect descriptors only once
+Origin: https://git.kernel.org/linus/18779149101c0dd43ded43669ae2a92d21b6f9cb
+Subject: [7/7] xen/pciback: Save xen_pci_op commands before processing it
+Origin: https://git.kernel.org/linus/8135cf8b092723dbfcc611fe6fdcb3a36c9951c5

+Subject: [1/5] xen/pciback: Return error on XEN_PCI_OP_enable_msi when device
+Origin: https://git.kernel.org/linus/56441f3c8e5bd45aab10dd9f8c505dd4bec03b0d
+Subject: [2/5] xen/pciback: Return error on XEN_PCI_OP_enable_msix when device
+Origin: https://git.kernel.org/linus/5e0ce1455c09dd61d029b8ad45d82e1ac0b6c4c9
+Subject: [3/5] xen/pciback: Do not install an IRQ handler for MSI interrupts.
+Origin: https://git.kernel.org/linus/a396f3a210c3a61e94d6b87ec05a75d0be2a60d0
+Subject: [4/5] xen/pciback: For XEN_PCI_OP_disable_msi[|x] only disable if
+Origin: https://git.kernel.org/linus/7cfb905b9638982862f0331b36ccaaca5d383b49
+Subject: [5/5] xen/pciback: Don't allow MSI-X ops if PCI_COMMAND_MEMORY is not
+Origin: https://git.kernel.org/linus/408fb0e5aa7fda0059db282ff58c3b2a4278baa0

Ian.

[-- Attachment #2: 3.16.7-ckt20-1+deb8u1-to-3.16.7-ckt20-1+deb8u2.diff --]
[-- Type: text/x-patch, Size: 56983 bytes --]

diff --git a/debian/changelog b/debian/changelog
index 045f42b..effb94b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,22 @@
+linux (3.16.7-ckt20-1+deb8u2) jessie-security; urgency=medium
+
+  * [xen] Fix race conditions in back-end drivers (CVE-2015-8550, XSA-155)
+  * [xen] pciback: Fix state validation in MSI control operations
+    (CVE-2015-8551, CVE-2015-8852, XSA-157)
+  * pptp: verify sockaddr_len in pptp_bind() and pptp_connect() (CVE-2015-8569)
+  * bluetooth: Validate socket address length in sco_sock_bind() (CVE-2015-8575)
+  * ptrace: being capable wrt a process requires mapped uids/gids
+    (CVE-2015-8709)
+  * KEYS: Fix race between read and revoke (CVE-2015-7550)
+  * [x86] KVM: Reload pit counters for all channels when restoring state
+    (CVE-2015-7513)
+  * udp: properly support MSG_PEEK with truncated buffers
+    (Closes: #808293, regression in 3.16.7-ckt17)
+  * Revert "xhci: don't finish a TD if we get a short transfer event mid TD"
+    (Closes: #808602, #808953, regression in 3.16.7-ckt20)
+
+ -- Ben Hutchings <ben@decadent.org.uk>  Sat, 02 Jan 2016 03:31:39 +0000
+
 linux (3.16.7-ckt20-1+deb8u1) jessie-security; urgency=medium
 
   [ Salvatore Bonaccorso ]
diff --git a/debian/patches/bugfix/all/bluetooth-validate-socket-address-length-in-sco_sock.patch b/debian/patches/bugfix/all/bluetooth-validate-socket-address-length-in-sco_sock.patch
new file mode 100644
index 0000000..5d83efc
--- /dev/null
+++ b/debian/patches/bugfix/all/bluetooth-validate-socket-address-length-in-sco_sock.patch
@@ -0,0 +1,22 @@
+From: "David S. Miller" <davem@davemloft.net>
+Date: Tue, 15 Dec 2015 15:39:08 -0500
+Subject: bluetooth: Validate socket address length in sco_sock_bind().
+Origin: https://git.kernel.org/linus/5233252fce714053f0151680933571a2da9cbfb4
+
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ net/bluetooth/sco.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/net/bluetooth/sco.c
++++ b/net/bluetooth/sco.c
+@@ -459,6 +459,9 @@ static int sco_sock_bind(struct socket *
+ 	if (!addr || addr->sa_family != AF_BLUETOOTH)
+ 		return -EINVAL;
+ 
++	if (addr_len < sizeof(struct sockaddr_sco))
++		return -EINVAL;
++
+ 	lock_sock(sk);
+ 
+ 	if (sk->sk_state != BT_OPEN) {
diff --git a/debian/patches/bugfix/all/keys-fix-race-between-read-and-revoke.patch b/debian/patches/bugfix/all/keys-fix-race-between-read-and-revoke.patch
new file mode 100644
index 0000000..87fe522
--- /dev/null
+++ b/debian/patches/bugfix/all/keys-fix-race-between-read-and-revoke.patch
@@ -0,0 +1,110 @@
+From: David Howells <dhowells@redhat.com>
+Date: Fri, 18 Dec 2015 01:34:26 +0000
+Subject: KEYS: Fix race between read and revoke
+Origin: https://git.kernel.org/linus/b4a1b4f5047e4f54e194681125c74c0aa64d637d
+
+This fixes CVE-2015-7550.
+
+There's a race between keyctl_read() and keyctl_revoke().  If the revoke
+happens between keyctl_read() checking the validity of a key and the key's
+semaphore being taken, then the key type read method will see a revoked key.
+
+This causes a problem for the user-defined key type because it assumes in
+its read method that there will always be a payload in a non-revoked key
+and doesn't check for a NULL pointer.
+
+Fix this by making keyctl_read() check the validity of a key after taking
+semaphore instead of before.
+
+I think the bug was introduced with the original keyrings code.
+
+This was discovered by a multithreaded test program generated by syzkaller
+(http://github.com/google/syzkaller).  Here's a cleaned up version:
+
+	#include <sys/types.h>
+	#include <keyutils.h>
+	#include <pthread.h>
+	void *thr0(void *arg)
+	{
+		key_serial_t key = (unsigned long)arg;
+		keyctl_revoke(key);
+		return 0;
+	}
+	void *thr1(void *arg)
+	{
+		key_serial_t key = (unsigned long)arg;
+		char buffer[16];
+		keyctl_read(key, buffer, 16);
+		return 0;
+	}
+	int main()
+	{
+		key_serial_t key = add_key("user", "%", "foo", 3, KEY_SPEC_USER_KEYRING);
+		pthread_t th[5];
+		pthread_create(&th[0], 0, thr0, (void *)(unsigned long)key);
+		pthread_create(&th[1], 0, thr1, (void *)(unsigned long)key);
+		pthread_create(&th[2], 0, thr0, (void *)(unsigned long)key);
+		pthread_create(&th[3], 0, thr1, (void *)(unsigned long)key);
+		pthread_join(th[0], 0);
+		pthread_join(th[1], 0);
+		pthread_join(th[2], 0);
+		pthread_join(th[3], 0);
+		return 0;
+	}
+
+Build as:
+
+	cc -o keyctl-race keyctl-race.c -lkeyutils -lpthread
+
+Run as:
+
+	while keyctl-race; do :; done
+
+as it may need several iterations to crash the kernel.  The crash can be
+summarised as:
+
+	BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
+	IP: [<ffffffff81279b08>] user_read+0x56/0xa3
+	...
+	Call Trace:
+	 [<ffffffff81276aa9>] keyctl_read_key+0xb6/0xd7
+	 [<ffffffff81277815>] SyS_keyctl+0x83/0xe0
+	 [<ffffffff815dbb97>] entry_SYSCALL_64_fastpath+0x12/0x6f
+
+Reported-by: Dmitry Vyukov <dvyukov@google.com>
+Signed-off-by: David Howells <dhowells@redhat.com>
+Tested-by: Dmitry Vyukov <dvyukov@google.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: James Morris <james.l.morris@oracle.com>
+---
+ security/keys/keyctl.c | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+--- a/security/keys/keyctl.c
++++ b/security/keys/keyctl.c
+@@ -744,16 +744,16 @@ long keyctl_read_key(key_serial_t keyid,
+ 
+ 	/* the key is probably readable - now try to read it */
+ can_read_key:
+-	ret = key_validate(key);
+-	if (ret == 0) {
+-		ret = -EOPNOTSUPP;
+-		if (key->type->read) {
+-			/* read the data with the semaphore held (since we
+-			 * might sleep) */
+-			down_read(&key->sem);
++	ret = -EOPNOTSUPP;
++	if (key->type->read) {
++		/* Read the data with the semaphore held (since we might sleep)
++		 * to protect against the key being updated or revoked.
++		 */
++		down_read(&key->sem);
++		ret = key_validate(key);
++		if (ret == 0)
+ 			ret = key->type->read(key, buffer, buflen);
+-			up_read(&key->sem);
+-		}
++		up_read(&key->sem);
+ 	}
+ 
+ error2:
diff --git a/debian/patches/bugfix/all/pptp-verify-sockaddr_len-in-pptp_bind-and-pptp_conne.patch b/debian/patches/bugfix/all/pptp-verify-sockaddr_len-in-pptp_bind-and-pptp_conne.patch
new file mode 100644
index 0000000..3c8b7bf
--- /dev/null
+++ b/debian/patches/bugfix/all/pptp-verify-sockaddr_len-in-pptp_bind-and-pptp_conne.patch
@@ -0,0 +1,34 @@
+From: WANG Cong <xiyou.wangcong@gmail.com>
+Date: Mon, 14 Dec 2015 13:48:36 -0800
+Subject: pptp: verify sockaddr_len in pptp_bind() and pptp_connect()
+Origin: https://git.kernel.org/linus/09ccfd238e5a0e670d8178cf50180ea81ae09ae1
+
+Reported-by: Dmitry Vyukov <dvyukov@gmail.com>
+Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/ppp/pptp.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/net/ppp/pptp.c
++++ b/drivers/net/ppp/pptp.c
+@@ -420,6 +420,9 @@ static int pptp_bind(struct socket *sock
+ 	struct pptp_opt *opt = &po->proto.pptp;
+ 	int error = 0;
+ 
++	if (sockaddr_len < sizeof(struct sockaddr_pppox))
++		return -EINVAL;
++
+ 	lock_sock(sk);
+ 
+ 	opt->src_addr = sp->sa_addr.pptp;
+@@ -441,6 +444,9 @@ static int pptp_connect(struct socket *s
+ 	struct flowi4 fl4;
+ 	int error = 0;
+ 
++	if (sockaddr_len < sizeof(struct sockaddr_pppox))
++		return -EINVAL;
++
+ 	if (sp->sa_protocol != PX_PROTO_PPTP)
+ 		return -EINVAL;
+ 
diff --git a/debian/patches/bugfix/all/ptrace-being-capable-wrt-a-process-requires-mapped-uids-gids.patch b/debian/patches/bugfix/all/ptrace-being-capable-wrt-a-process-requires-mapped-uids-gids.patch
new file mode 100644
index 0000000..f9c9c92
--- /dev/null
+++ b/debian/patches/bugfix/all/ptrace-being-capable-wrt-a-process-requires-mapped-uids-gids.patch
@@ -0,0 +1,102 @@
+From: Jann Horn <jann@thejh.net>
+Subject: ptrace: being capable wrt a process requires mapped uids/gids
+Date: Sat, 26 Dec 2015 03:52:31 +0100
+Origin: https://lkml.org/lkml/2015/12/25/71
+
+ptrace_has_cap() checks whether the current process should be
+treated as having a certain capability for ptrace checks
+against another process. Until now, this was equivalent to
+has_ns_capability(current, target_ns, CAP_SYS_PTRACE).
+
+However, if a root-owned process wants to enter a user
+namespace for some reason without knowing who owns it and
+therefore can't change to the namespace owner's uid and gid
+before entering, as soon as it has entered the namespace,
+the namespace owner can attach to it via ptrace and thereby
+gain access to its uid and gid.
+
+While it is possible for the entering process to switch to
+the uid of a claimed namespace owner before entering,
+causing the attempt to enter to fail if the claimed uid is
+wrong, this doesn't solve the problem of determining an
+appropriate gid.
+
+With this change, the entering process can first enter the
+namespace and then safely inspect the namespace's
+properties, e.g. through /proc/self/{uid_map,gid_map},
+assuming that the namespace owner doesn't have access to
+uid 0.
+Changed in v2: The caller needs to be capable in the
+namespace into which tcred's uids/gids can be mapped.
+
+Signed-off-by: Jann Horn <jann@thejh.net>
+---
+ kernel/ptrace.c | 33 ++++++++++++++++++++++++++++-----
+ 1 file changed, 28 insertions(+), 5 deletions(-)
+
+--- a/kernel/ptrace.c
++++ b/kernel/ptrace.c
+@@ -20,6 +20,7 @@
+ #include <linux/uio.h>
+ #include <linux/audit.h>
+ #include <linux/pid_namespace.h>
++#include <linux/user_namespace.h>
+ #include <linux/syscalls.h>
+ #include <linux/uaccess.h>
+ #include <linux/regset.h>
+@@ -213,12 +214,34 @@ static int ptrace_check_attach(struct ta
+ 	return ret;
+ }
+ 
+-static int ptrace_has_cap(struct user_namespace *ns, unsigned int mode)
++static bool ptrace_has_cap(const struct cred *tcred, unsigned int mode)
+ {
++	struct user_namespace *tns = tcred->user_ns;
++
++	/* When a root-owned process enters a user namespace created by a
++	 * malicious user, the user shouldn't be able to execute code under
++	 * uid 0 by attaching to the root-owned process via ptrace.
++	 * Therefore, similar to the capable_wrt_inode_uidgid() check,
++	 * verify that all the uids and gids of the target process are
++	 * mapped into a namespace below the current one in which the caller
++	 * is capable.
++	 * No fsuid/fsgid check because __ptrace_may_access doesn't do it
++	 * either.
++	 */
++	while (
++	    !kuid_has_mapping(tns, tcred->euid) ||
++	    !kuid_has_mapping(tns, tcred->suid) ||
++	    !kuid_has_mapping(tns, tcred->uid)  ||
++	    !kgid_has_mapping(tns, tcred->egid) ||
++	    !kgid_has_mapping(tns, tcred->sgid) ||
++	    !kgid_has_mapping(tns, tcred->gid)) {
++		tns = tns->parent;
++	}
++
+ 	if (mode & PTRACE_MODE_NOAUDIT)
+-		return has_ns_capability_noaudit(current, ns, CAP_SYS_PTRACE);
++		return has_ns_capability_noaudit(current, tns, CAP_SYS_PTRACE);
+ 	else
+-		return has_ns_capability(current, ns, CAP_SYS_PTRACE);
++		return has_ns_capability(current, tns, CAP_SYS_PTRACE);
+ }
+ 
+ /* Returns 0 on success, -errno on denial. */
+@@ -247,7 +270,7 @@ static int __ptrace_may_access(struct ta
+ 	    gid_eq(cred->gid, tcred->sgid) &&
+ 	    gid_eq(cred->gid, tcred->gid))
+ 		goto ok;
+-	if (ptrace_has_cap(tcred->user_ns, mode))
++	if (ptrace_has_cap(tcred, mode))
+ 		goto ok;
+ 	rcu_read_unlock();
+ 	return -EPERM;
+@@ -258,7 +281,7 @@ ok:
+ 		dumpable = get_dumpable(task->mm);
+ 	rcu_read_lock();
+ 	if (dumpable != SUID_DUMP_USER &&
+-	    !ptrace_has_cap(__task_cred(task)->user_ns, mode)) {
++	    !ptrace_has_cap(__task_cred(task), mode)) {
+ 		rcu_read_unlock();
+ 		return -EPERM;
+ 	}
diff --git a/debian/patches/bugfix/all/revert-net-add-length-argument-to-skb_copy_and_csum_datagram_iovec.patch b/debian/patches/bugfix/all/revert-net-add-length-argument-to-skb_copy_and_csum_datagram_iovec.patch
new file mode 100644
index 0000000..25d1a64
--- /dev/null
+++ b/debian/patches/bugfix/all/revert-net-add-length-argument-to-skb_copy_and_csum_datagram_iovec.patch
@@ -0,0 +1,95 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Sat, 02 Jan 2016 01:11:55 +0000
+Subject: Revert "net: add length argument to skb_copy_and_csum_datagram_iovec"
+Bug-Debian: https://bugs.debian.org/808293
+
+This reverts commit fa89ae5548ed282f0ceb4660b3b93e4e2ee875f3.  That fixed
+the problem of buffer over-reads introduced by backporting commit
+89c22d8c3b27 ("net: Fix skb csum races when peeking"), but resulted in
+incorrect checksumming for short reads.  It will be replaced with a
+complete fix.
+
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+---
+--- a/include/linux/skbuff.h
++++ b/include/linux/skbuff.h
+@@ -2525,7 +2525,7 @@
+ int skb_copy_datagram_iovec(const struct sk_buff *from, int offset,
+ 			    struct iovec *to, int size);
+ int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, int hlen,
+-				     struct iovec *iov, int len);
++				     struct iovec *iov);
+ int skb_copy_datagram_from_iovec(struct sk_buff *skb, int offset,
+ 				 const struct iovec *from, int from_offset,
+ 				 int len);
+--- a/net/core/datagram.c
++++ b/net/core/datagram.c
+@@ -818,7 +818,6 @@
+  *	@skb: skbuff
+  *	@hlen: hardware length
+  *	@iov: io vector
+- *	@len: amount of data to copy from skb to iov
+  *
+  *	Caller _must_ check that skb will fit to this iovec.
+  *
+@@ -828,14 +827,11 @@
+  *			   can be modified!
+  */
+ int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
+-				     int hlen, struct iovec *iov, int len)
++				     int hlen, struct iovec *iov)
+ {
+ 	__wsum csum;
+ 	int chunk = skb->len - hlen;
+ 
+-	if (chunk > len)
+-		chunk = len;
+-
+ 	if (!chunk)
+ 		return 0;
+ 
+--- a/net/ipv4/tcp_input.c
++++ b/net/ipv4/tcp_input.c
+@@ -4906,7 +4906,7 @@
+ 		err = skb_copy_datagram_iovec(skb, hlen, tp->ucopy.iov, chunk);
+ 	else
+ 		err = skb_copy_and_csum_datagram_iovec(skb, hlen,
+-						       tp->ucopy.iov, chunk);
++						       tp->ucopy.iov);
+ 
+ 	if (!err) {
+ 		tp->ucopy.len -= chunk;
+--- a/net/ipv4/udp.c
++++ b/net/ipv4/udp.c
+@@ -1307,7 +1307,7 @@
+ 	else {
+ 		err = skb_copy_and_csum_datagram_iovec(skb,
+ 						       sizeof(struct udphdr),
+-						       msg->msg_iov, copied);
++						       msg->msg_iov);
+ 
+ 		if (err == -EINVAL)
+ 			goto csum_copy_err;
+--- a/net/ipv6/raw.c
++++ b/net/ipv6/raw.c
+@@ -492,7 +492,7 @@
+ 			goto csum_copy_err;
+ 		err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
+ 	} else {
+-		err = skb_copy_and_csum_datagram_iovec(skb, 0, msg->msg_iov, copied);
++		err = skb_copy_and_csum_datagram_iovec(skb, 0, msg->msg_iov);
+ 		if (err == -EINVAL)
+ 			goto csum_copy_err;
+ 	}
+--- a/net/ipv6/udp.c
++++ b/net/ipv6/udp.c
+@@ -428,8 +428,7 @@
+ 		err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr),
+ 					      msg->msg_iov, copied);
+ 	else {
+-		err = skb_copy_and_csum_datagram_iovec(skb, sizeof(struct udphdr),
+-						       msg->msg_iov, copied);
++		err = skb_copy_and_csum_datagram_iovec(skb, sizeof(struct udphdr), msg->msg_iov);
+ 		if (err == -EINVAL)
+ 			goto csum_copy_err;
+ 	}
diff --git a/debian/patches/bugfix/all/revert-xhci-don-t-finish-a-td-if-we-get-a-short-transfer.patch b/debian/patches/bugfix/all/revert-xhci-don-t-finish-a-td-if-we-get-a-short-transfer.patch
new file mode 100644
index 0000000..a0fe6ae
--- /dev/null
+++ b/debian/patches/bugfix/all/revert-xhci-don-t-finish-a-td-if-we-get-a-short-transfer.patch
@@ -0,0 +1,37 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Sat, 02 Jan 2016 03:03:27 +0000
+Subject: Revert "xhci: don't finish a TD if we get a short transfer event mid TD"
+Bug-Debian: https://bugs.debian.org/808602
+Bug-Debian: https://bugs.debian.org/808953
+
+This reverts commit dbd81f75b991c972970764ba75287cbbc8f066be, which
+was commit e210c422b6fdd2dc123bedc588f399aefd8bf9de upstream.  It
+caused serious regressions as referenced above.
+
+---
+--- a/drivers/usb/host/xhci-ring.c
++++ b/drivers/usb/host/xhci-ring.c
+@@ -2191,10 +2191,6 @@ static int process_bulk_intr_td(struct x
+ 				EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)));
+ 	/* Fast path - was this the last TRB in the TD for this URB? */
+ 	if (event_trb == td->last_trb) {
+-		if (td->urb_length_set && trb_comp_code == COMP_SHORT_TX)
+-			return finish_td(xhci, td, event_trb, event, ep,
+-					 status, false);
+-
+ 		if (EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) != 0) {
+ 			td->urb->actual_length =
+ 				td->urb->transfer_buffer_length -
+@@ -2246,12 +2242,6 @@ static int process_bulk_intr_td(struct x
+ 			td->urb->actual_length +=
+ 				TRB_LEN(le32_to_cpu(cur_trb->generic.field[2])) -
+ 				EVENT_TRB_LEN(le32_to_cpu(event->transfer_len));
+-
+-		if (trb_comp_code == COMP_SHORT_TX) {
+-			xhci_dbg(xhci, "mid bulk/intr SP, wait for last TRB event\n");
+-			td->urb_length_set = true;
+-			return 0;
+-		}
+ 	}
+ 
+ 	return finish_td(xhci, td, event_trb, event, ep, status, false);
diff --git a/debian/patches/bugfix/all/udp-properly-support-msg_peek-with-truncated-buffers.patch b/debian/patches/bugfix/all/udp-properly-support-msg_peek-with-truncated-buffers.patch
new file mode 100644
index 0000000..f74d86f
--- /dev/null
+++ b/debian/patches/bugfix/all/udp-properly-support-msg_peek-with-truncated-buffers.patch
@@ -0,0 +1,88 @@
+From: Eric Dumazet <edumazet@google.com>
+Date: Wed, 30 Dec 2015 08:51:12 -0500
+Subject: udp: properly support MSG_PEEK with truncated  buffers
+Bug-Debian: https://bugs.debian.org/808293
+Origin: http://article.gmane.org/gmane.linux.kernel.stable/159132
+
+Backport of this upstream commit into stable kernels :
+89c22d8c3b27 ("net: Fix skb csum races when peeking")
+exposed a bug in udp stack vs MSG_PEEK support, when user provides
+a buffer smaller than skb payload.
+    
+In this case,
+skb_copy_and_csum_datagram_iovec(skb, sizeof(struct udphdr),
+                                 msg->msg_iov);
+returns -EFAULT.
+    
+This bug does not happen in upstream kernels since Al Viro did a great
+job to replace this into :
+skb_copy_and_csum_datagram_msg(skb, sizeof(struct udphdr), msg);
+This variant is safe vs short buffers.
+    
+For the time being, instead reverting Herbert Xu patch and add back
+skb->ip_summed invalid changes, simply store the result of
+udp_lib_checksum_complete() so that we avoid computing the checksum a
+second time, and avoid the problematic
+skb_copy_and_csum_datagram_iovec() call.
+
+This patch can be applied on recent kernels as it avoids a double
+checksumming, then backported to stable kernels as a bug fix.
+
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+[bwh: Backported to 3.16: adjust context]
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+---
+ net/ipv4/udp.c |    6 ++++--
+ net/ipv6/udp.c |    6 ++++--
+ 2 files changed, 8 insertions(+), 4 deletions(-)
+
+--- a/net/ipv4/udp.c
++++ b/net/ipv4/udp.c
+@@ -1274,6 +1274,7 @@ int udp_recvmsg(struct kiocb *iocb, stru
+ 	int peeked, off = 0;
+ 	int err;
+ 	int is_udplite = IS_UDPLITE(sk);
++	bool checksum_valid = false;
+ 	bool slow;
+ 
+ 	if (flags & MSG_ERRQUEUE)
+@@ -1299,11 +1300,12 @@ try_again:
+ 	 */
+ 
+ 	if (copied < ulen || UDP_SKB_CB(skb)->partial_cov) {
+-		if (udp_lib_checksum_complete(skb))
++		checksum_valid = !udp_lib_checksum_complete(skb);
++		if (!checksum_valid)
+ 			goto csum_copy_err;
+ 	}
+ 
+-	if (skb_csum_unnecessary(skb))
++	if (checksum_valid || skb_csum_unnecessary(skb))
+ 		err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr),
+ 					      msg->msg_iov, copied);
+ 	else {
+--- a/net/ipv6/udp.c
++++ b/net/ipv6/udp.c
+@@ -389,6 +389,7 @@ int udpv6_recvmsg(struct kiocb *iocb, st
+ 	int peeked, off = 0;
+ 	int err;
+ 	int is_udplite = IS_UDPLITE(sk);
++	bool checksum_valid = false;
+ 	int is_udp4;
+ 	bool slow;
+ 
+@@ -420,11 +421,12 @@ try_again:
+ 	 */
+ 
+ 	if (copied < ulen || UDP_SKB_CB(skb)->partial_cov) {
+-		if (udp_lib_checksum_complete(skb))
++		checksum_valid = !udp_lib_checksum_complete(skb);
++		if (!checksum_valid)
+ 			goto csum_copy_err;
+ 	}
+ 
+-	if (skb_csum_unnecessary(skb))
++	if (checksum_valid || skb_csum_unnecessary(skb))
+ 		err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr),
+ 					      msg->msg_iov, copied);
+ 	else {
diff --git a/debian/patches/bugfix/all/xen-add-ring_copy_request.patch b/debian/patches/bugfix/all/xen-add-ring_copy_request.patch
new file mode 100644
index 0000000..51e9546
--- /dev/null
+++ b/debian/patches/bugfix/all/xen-add-ring_copy_request.patch
@@ -0,0 +1,52 @@
+From: David Vrabel <david.vrabel@citrix.com>
+Date: Fri, 30 Oct 2015 14:58:08 +0000
+Subject: [1/7] xen: Add RING_COPY_REQUEST()
+Origin: https://git.kernel.org/linus/454d5d882c7e412b840e3c99010fe81a9862f6fb
+
+Using RING_GET_REQUEST() on a shared ring is easy to use incorrectly
+(i.e., by not considering that the other end may alter the data in the
+shared ring while it is being inspected).  Safe usage of a request
+generally requires taking a local copy.
+
+Provide a RING_COPY_REQUEST() macro to use instead of
+RING_GET_REQUEST() and an open-coded memcpy().  This takes care of
+ensuring that the copy is done correctly regardless of any possible
+compiler optimizations.
+
+Use a volatile source to prevent the compiler from reordering or
+omitting the copy.
+
+This is part of XSA155.
+
+CC: stable@vger.kernel.org
+Signed-off-by: David Vrabel <david.vrabel@citrix.com>
+Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+---
+ include/xen/interface/io/ring.h | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/include/xen/interface/io/ring.h b/include/xen/interface/io/ring.h
+index 7d28aff..7dc685b4 100644
+--- a/include/xen/interface/io/ring.h
++++ b/include/xen/interface/io/ring.h
+@@ -181,6 +181,20 @@ struct __name##_back_ring {						\
+ #define RING_GET_REQUEST(_r, _idx)					\
+     (&((_r)->sring->ring[((_idx) & (RING_SIZE(_r) - 1))].req))
+ 
++/*
++ * Get a local copy of a request.
++ *
++ * Use this in preference to RING_GET_REQUEST() so all processing is
++ * done on a local copy that cannot be modified by the other end.
++ *
++ * Note that https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145 may cause this
++ * to be ineffective where _req is a struct which consists of only bitfields.
++ */
++#define RING_COPY_REQUEST(_r, _idx, _req) do {				\
++	/* Use volatile to force the copy into _req. */			\
++	*(_req) = *(volatile typeof(_req))RING_GET_REQUEST(_r, _idx);	\
++} while (0)
++
+ #define RING_GET_RESPONSE(_r, _idx)					\
+     (&((_r)->sring->ring[((_idx) & (RING_SIZE(_r) - 1))].rsp))
+ 
diff --git a/debian/patches/bugfix/all/xen-blkback-only-read-request-operation-from-shared-.patch b/debian/patches/bugfix/all/xen-blkback-only-read-request-operation-from-shared-.patch
new file mode 100644
index 0000000..c7b12ce
--- /dev/null
+++ b/debian/patches/bugfix/all/xen-blkback-only-read-request-operation-from-shared-.patch
@@ -0,0 +1,48 @@
+From: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
+Date: Tue, 3 Nov 2015 16:34:09 +0000
+Subject: [4/7] xen-blkback: only read request operation from shared ring once
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+Origin: https://git.kernel.org/linus/1f13d75ccb806260079e0679d55d9253e370ec8a
+
+A compiler may load a switch statement value multiple times, which could
+be bad when the value is in memory shared with the frontend.
+
+When converting a non-native request to a native one, ensure that
+src->operation is only loaded once by using READ_ONCE().
+
+This is part of XSA155.
+
+CC: stable@vger.kernel.org
+Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
+Signed-off-by: David Vrabel <david.vrabel@citrix.com>
+Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+---
+ drivers/block/xen-blkback/common.h | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/block/xen-blkback/common.h
++++ b/drivers/block/xen-blkback/common.h
+@@ -391,8 +391,8 @@ static inline void blkif_get_x86_32_req(
+ 					struct blkif_x86_32_request *src)
+ {
+ 	int i, n = BLKIF_MAX_SEGMENTS_PER_REQUEST, j;
+-	dst->operation = src->operation;
+-	switch (src->operation) {
++	dst->operation = READ_ONCE(src->operation);
++	switch (dst->operation) {
+ 	case BLKIF_OP_READ:
+ 	case BLKIF_OP_WRITE:
+ 	case BLKIF_OP_WRITE_BARRIER:
+@@ -439,8 +439,8 @@ static inline void blkif_get_x86_64_req(
+ 					struct blkif_x86_64_request *src)
+ {
+ 	int i, n = BLKIF_MAX_SEGMENTS_PER_REQUEST, j;
+-	dst->operation = src->operation;
+-	switch (src->operation) {
++	dst->operation = READ_ONCE(src->operation);
++	switch (dst->operation) {
+ 	case BLKIF_OP_READ:
+ 	case BLKIF_OP_WRITE:
+ 	case BLKIF_OP_WRITE_BARRIER:
diff --git a/debian/patches/bugfix/all/xen-blkback-read-from-indirect-descriptors-only-once.patch b/debian/patches/bugfix/all/xen-blkback-read-from-indirect-descriptors-only-once.patch
new file mode 100644
index 0000000..de74707
--- /dev/null
+++ b/debian/patches/bugfix/all/xen-blkback-read-from-indirect-descriptors-only-once.patch
@@ -0,0 +1,63 @@
+From: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
+Date: Tue, 3 Nov 2015 16:40:43 +0000
+Subject: [5/7] xen-blkback: read from indirect descriptors only once
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+Origin: https://git.kernel.org/linus/18779149101c0dd43ded43669ae2a92d21b6f9cb
+
+Since indirect descriptors are in memory shared with the frontend, the
+frontend could alter the first_sect and last_sect values after they have
+been validated but before they are recorded in the request.  This may
+result in I/O requests that overflow the foreign page, possibly
+overwriting local pages when the I/O request is executed.
+
+When parsing indirect descriptors, only read first_sect and last_sect
+once.
+
+This is part of XSA155.
+
+CC: stable@vger.kernel.org
+Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
+Signed-off-by: David Vrabel <david.vrabel@citrix.com>
+Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+[bwh: For 4.3, s/XEN_PAGE_SIZE/PAGE_SIZE/]
+---
+ drivers/block/xen-blkback/blkback.c | 15 ++++++++++-----
+ 1 file changed, 10 insertions(+), 5 deletions(-)
+
+--- a/drivers/block/xen-blkback/blkback.c
++++ b/drivers/block/xen-blkback/blkback.c
+@@ -861,6 +861,8 @@ static int xen_blkbk_parse_indirect(stru
+ 		goto unmap;
+ 
+ 	for (n = 0, i = 0; n < nseg; n++) {
++		uint8_t first_sect, last_sect;
++
+ 		if ((n % SEGS_PER_INDIRECT_FRAME) == 0) {
+ 			/* Map indirect segments */
+ 			if (segments)
+@@ -868,15 +870,18 @@ static int xen_blkbk_parse_indirect(stru
+ 			segments = kmap_atomic(pages[n/SEGS_PER_INDIRECT_FRAME]->page);
+ 		}
+ 		i = n % SEGS_PER_INDIRECT_FRAME;
++
+ 		pending_req->segments[n]->gref = segments[i].gref;
+-		seg[n].nsec = segments[i].last_sect -
+-			segments[i].first_sect + 1;
+-		seg[n].offset = (segments[i].first_sect << 9);
+-		if ((segments[i].last_sect >= (PAGE_SIZE >> 9)) ||
+-		    (segments[i].last_sect < segments[i].first_sect)) {
++
++		first_sect = READ_ONCE(segments[i].first_sect);
++		last_sect = READ_ONCE(segments[i].last_sect);
++		if (last_sect >= (PAGE_SIZE >> 9) || last_sect < first_sect) {
+ 			rc = -EINVAL;
+ 			goto unmap;
+ 		}
++
++		seg[n].nsec = last_sect - first_sect + 1;
++		seg[n].offset = first_sect << 9;
+ 		preq->nr_sects += seg[n].nsec;
+ 	}
+ 
diff --git a/debian/patches/bugfix/all/xen-netback-don-t-use-last-request-to-determine-mini.patch b/debian/patches/bugfix/all/xen-netback-don-t-use-last-request-to-determine-mini.patch
new file mode 100644
index 0000000..4322399
--- /dev/null
+++ b/debian/patches/bugfix/all/xen-netback-don-t-use-last-request-to-determine-mini.patch
@@ -0,0 +1,35 @@
+From: David Vrabel <david.vrabel@citrix.com>
+Date: Fri, 30 Oct 2015 15:16:01 +0000
+Subject: [2/7] xen-netback: don't use last request to determine minimum Tx
+ credit
+Origin: https://git.kernel.org/linus/0f589967a73f1f30ab4ac4dd9ce0bb399b4d6357
+
+The last from guest transmitted request gives no indication about the
+minimum amount of credit that the guest might need to send a packet
+since the last packet might have been a small one.
+
+Instead allow for the worst case 128 KiB packet.
+
+This is part of XSA155.
+
+CC: stable@vger.kernel.org
+Reviewed-by: Wei Liu <wei.liu2@citrix.com>
+Signed-off-by: David Vrabel <david.vrabel@citrix.com>
+Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+---
+ drivers/net/xen-netback/netback.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+--- a/drivers/net/xen-netback/netback.c
++++ b/drivers/net/xen-netback/netback.c
+@@ -809,9 +809,7 @@ static void tx_add_credit(struct xenvif_
+ 	 * Allow a burst big enough to transmit a jumbo packet of up to 128kB.
+ 	 * Otherwise the interface can seize up due to insufficient credit.
+ 	 */
+-	max_burst = RING_GET_REQUEST(&queue->tx, queue->tx.req_cons)->size;
+-	max_burst = min(max_burst, 131072UL);
+-	max_burst = max(max_burst, queue->credit_bytes);
++	max_burst = max(131072UL, queue->credit_bytes);
+ 
+ 	/* Take care that adding a new chunk of credit doesn't wrap to zero. */
+ 	max_credit = queue->remaining_credit + queue->credit_bytes;
diff --git a/debian/patches/bugfix/all/xen-netback-use-ring_copy_request-throughout.patch b/debian/patches/bugfix/all/xen-netback-use-ring_copy_request-throughout.patch
new file mode 100644
index 0000000..d4bb7e1
--- /dev/null
+++ b/debian/patches/bugfix/all/xen-netback-use-ring_copy_request-throughout.patch
@@ -0,0 +1,126 @@
+From: David Vrabel <david.vrabel@citrix.com>
+Date: Fri, 30 Oct 2015 15:17:06 +0000
+Subject: [3/7] xen-netback: use RING_COPY_REQUEST() throughout
+Origin: https://git.kernel.org/linus/68a33bfd8403e4e22847165d149823a2e0e67c9c
+
+Instead of open-coding memcpy()s and directly accessing Tx and Rx
+requests, use the new RING_COPY_REQUEST() that ensures the local copy
+is correct.
+
+This is more than is strictly necessary for guest Rx requests since
+only the id and gref fields are used and it is harmless if the
+frontend modifies these.
+
+This is part of XSA155.
+
+CC: stable@vger.kernel.org
+Reviewed-by: Wei Liu <wei.liu2@citrix.com>
+Signed-off-by: David Vrabel <david.vrabel@citrix.com>
+Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+---
+ drivers/net/xen-netback/netback.c | 30 ++++++++++++++----------------
+ 1 file changed, 14 insertions(+), 16 deletions(-)
+
+--- a/drivers/net/xen-netback/netback.c
++++ b/drivers/net/xen-netback/netback.c
+@@ -288,18 +288,18 @@ static struct xenvif_rx_meta *get_next_r
+ 						 struct netrx_pending_operations *npo)
+ {
+ 	struct xenvif_rx_meta *meta;
+-	struct xen_netif_rx_request *req;
++	struct xen_netif_rx_request req;
+ 
+-	req = RING_GET_REQUEST(&queue->rx, queue->rx.req_cons++);
++	RING_COPY_REQUEST(&queue->rx, queue->rx.req_cons++, &req);
+ 
+ 	meta = npo->meta + npo->meta_prod++;
+ 	meta->gso_type = XEN_NETIF_GSO_TYPE_NONE;
+ 	meta->gso_size = 0;
+ 	meta->size = 0;
+-	meta->id = req->id;
++	meta->id = req.id;
+ 
+ 	npo->copy_off = 0;
+-	npo->copy_gref = req->gref;
++	npo->copy_gref = req.gref;
+ 
+ 	return meta;
+ }
+@@ -450,7 +450,7 @@ static int xenvif_gop_skb(struct sk_buff
+ 	struct xenvif *vif = netdev_priv(skb->dev);
+ 	int nr_frags = skb_shinfo(skb)->nr_frags;
+ 	int i;
+-	struct xen_netif_rx_request *req;
++	struct xen_netif_rx_request req;
+ 	struct xenvif_rx_meta *meta;
+ 	unsigned char *data;
+ 	int head = 1;
+@@ -471,15 +471,15 @@ static int xenvif_gop_skb(struct sk_buff
+ 
+ 	/* Set up a GSO prefix descriptor, if necessary */
+ 	if ((1 << gso_type) & vif->gso_prefix_mask) {
+-		req = RING_GET_REQUEST(&queue->rx, queue->rx.req_cons++);
++		RING_COPY_REQUEST(&queue->rx, queue->rx.req_cons++, &req);
+ 		meta = npo->meta + npo->meta_prod++;
+ 		meta->gso_type = gso_type;
+ 		meta->gso_size = skb_shinfo(skb)->gso_size;
+ 		meta->size = 0;
+-		meta->id = req->id;
++		meta->id = req.id;
+ 	}
+ 
+-	req = RING_GET_REQUEST(&queue->rx, queue->rx.req_cons++);
++	RING_COPY_REQUEST(&queue->rx, queue->rx.req_cons++, &req);
+ 	meta = npo->meta + npo->meta_prod++;
+ 
+ 	if ((1 << gso_type) & vif->gso_mask) {
+@@ -491,9 +491,9 @@ static int xenvif_gop_skb(struct sk_buff
+ 	}
+ 
+ 	meta->size = 0;
+-	meta->id = req->id;
++	meta->id = req.id;
+ 	npo->copy_off = 0;
+-	npo->copy_gref = req->gref;
++	npo->copy_gref = req.gref;
+ 
+ 	data = skb->data;
+ 	while (data < skb_tail_pointer(skb)) {
+@@ -838,7 +838,7 @@ static void xenvif_tx_err(struct xenvif_
+ 		spin_unlock_irqrestore(&queue->response_lock, flags);
+ 		if (cons == end)
+ 			break;
+-		txp = RING_GET_REQUEST(&queue->tx, cons++);
++		RING_COPY_REQUEST(&queue->tx, cons++, txp);
+ 	} while (1);
+ 	queue->tx.req_cons = cons;
+ }
+@@ -905,8 +905,7 @@ static int xenvif_count_requests(struct
+ 		if (drop_err)
+ 			txp = &dropped_tx;
+ 
+-		memcpy(txp, RING_GET_REQUEST(&queue->tx, cons + slots),
+-		       sizeof(*txp));
++		RING_COPY_REQUEST(&queue->tx, cons + slots, txp);
+ 
+ 		/* If the guest submitted a frame >= 64 KiB then
+ 		 * first->size overflowed and following slots will
+@@ -1258,8 +1257,7 @@ static int xenvif_get_extras(struct xenv
+ 			return -EBADR;
+ 		}
+ 
+-		memcpy(&extra, RING_GET_REQUEST(&queue->tx, cons),
+-		       sizeof(extra));
++		RING_COPY_REQUEST(&queue->tx, cons, &extra);
+ 		if (unlikely(!extra.type ||
+ 			     extra.type >= XEN_NETIF_EXTRA_TYPE_MAX)) {
+ 			queue->tx.req_cons = ++cons;
+@@ -1395,7 +1393,7 @@ static void xenvif_tx_build_gops(struct
+ 
+ 		idx = queue->tx.req_cons;
+ 		rmb(); /* Ensure that we see the request before we copy it. */
+-		memcpy(&txreq, RING_GET_REQUEST(&queue->tx, idx), sizeof(txreq));
++		RING_COPY_REQUEST(&queue->tx, idx, &txreq);
+ 
+ 		/* Credit-based scheduling. */
+ 		if (txreq.size > queue->remaining_credit &&
diff --git a/debian/patches/bugfix/all/xen-pciback-do-not-install-an-irq-handler-for-msi-in.patch b/debian/patches/bugfix/all/xen-pciback-do-not-install-an-irq-handler-for-msi-in.patch
new file mode 100644
index 0000000..de93cfa
--- /dev/null
+++ b/debian/patches/bugfix/all/xen-pciback-do-not-install-an-irq-handler-for-msi-in.patch
@@ -0,0 +1,77 @@
+From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+Date: Mon, 2 Nov 2015 17:24:08 -0500
+Subject: [3/5] xen/pciback: Do not install an IRQ handler for MSI interrupts.
+Origin: https://git.kernel.org/linus/a396f3a210c3a61e94d6b87ec05a75d0be2a60d0
+
+Otherwise an guest can subvert the generic MSI code to trigger
+an BUG_ON condition during MSI interrupt freeing:
+
+ for (i = 0; i < entry->nvec_used; i++)
+        BUG_ON(irq_has_action(entry->irq + i));
+
+Xen PCI backed installs an IRQ handler (request_irq) for
+the dev->irq whenever the guest writes PCI_COMMAND_MEMORY
+(or PCI_COMMAND_IO) to the PCI_COMMAND register. This is
+done in case the device has legacy interrupts the GSI line
+is shared by the backend devices.
+
+To subvert the backend the guest needs to make the backend
+to change the dev->irq from the GSI to the MSI interrupt line,
+make the backend allocate an interrupt handler, and then command
+the backend to free the MSI interrupt and hit the BUG_ON.
+
+Since the backend only calls 'request_irq' when the guest
+writes to the PCI_COMMAND register the guest needs to call
+XEN_PCI_OP_enable_msi before any other operation. This will
+cause the generic MSI code to setup an MSI entry and
+populate dev->irq with the new PIRQ value.
+
+Then the guest can write to PCI_COMMAND PCI_COMMAND_MEMORY
+and cause the backend to setup an IRQ handler for dev->irq
+(which instead of the GSI value has the MSI pirq). See
+'xen_pcibk_control_isr'.
+
+Then the guest disables the MSI: XEN_PCI_OP_disable_msi
+which ends up triggering the BUG_ON condition in 'free_msi_irqs'
+as there is an IRQ handler for the entry->irq (dev->irq).
+
+Note that this cannot be done using MSI-X as the generic
+code does not over-write dev->irq with the MSI-X PIRQ values.
+
+The patch inhibits setting up the IRQ handler if MSI or
+MSI-X (for symmetry reasons) code had been called successfully.
+
+P.S.
+Xen PCIBack when it sets up the device for the guest consumption
+ends up writting 0 to the PCI_COMMAND (see xen_pcibk_reset_device).
+XSA-120 addendum patch removed that - however when upstreaming said
+addendum we found that it caused issues with qemu upstream. That
+has now been fixed in qemu upstream.
+
+This is part of XSA-157
+
+CC: stable@vger.kernel.org
+Reviewed-by: David Vrabel <david.vrabel@citrix.com>
+Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+---
+ drivers/xen/xen-pciback/pciback_ops.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
+index 029f33d..d0696ce 100644
+--- a/drivers/xen/xen-pciback/pciback_ops.c
++++ b/drivers/xen/xen-pciback/pciback_ops.c
+@@ -70,6 +70,13 @@ static void xen_pcibk_control_isr(struct pci_dev *dev, int reset)
+ 		enable ? "enable" : "disable");
+ 
+ 	if (enable) {
++		/*
++		 * The MSI or MSI-X should not have an IRQ handler. Otherwise
++		 * if the guest terminates we BUG_ON in free_msi_irqs.
++		 */
++		if (dev->msi_enabled || dev->msix_enabled)
++			goto out;
++
+ 		rc = request_irq(dev_data->irq,
+ 				xen_pcibk_guest_interrupt, IRQF_SHARED,
+ 				dev_data->irq_name, dev);
diff --git a/debian/patches/bugfix/all/xen-pciback-don-t-allow-msi-x-ops-if-pci_command_mem.patch b/debian/patches/bugfix/all/xen-pciback-don-t-allow-msi-x-ops-if-pci_command_mem.patch
new file mode 100644
index 0000000..e6792b9
--- /dev/null
+++ b/debian/patches/bugfix/all/xen-pciback-don-t-allow-msi-x-ops-if-pci_command_mem.patch
@@ -0,0 +1,61 @@
+From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+Date: Mon, 2 Nov 2015 18:13:27 -0500
+Subject: [5/5] xen/pciback: Don't allow MSI-X ops if PCI_COMMAND_MEMORY is not
+ set.
+Origin: https://git.kernel.org/linus/408fb0e5aa7fda0059db282ff58c3b2a4278baa0
+
+commit f598282f51 ("PCI: Fix the NIU MSI-X problem in a better way")
+teaches us that dealing with MSI-X can be troublesome.
+
+Further checks in the MSI-X architecture shows that if the
+PCI_COMMAND_MEMORY bit is turned of in the PCI_COMMAND we
+may not be able to access the BAR (since they are memory regions).
+
+Since the MSI-X tables are located in there.. that can lead
+to us causing PCIe errors. Inhibit us performing any
+operation on the MSI-X unless the MEMORY bit is set.
+
+Note that Xen hypervisor with:
+"x86/MSI-X: access MSI-X table only after having enabled MSI-X"
+will return:
+xen_pciback: 0000:0a:00.1: error -6 enabling MSI-X for guest 3!
+
+When the generic MSI code tries to setup the PIRQ without
+MEMORY bit set. Which means with later versions of Xen
+(4.6) this patch is not neccessary.
+
+This is part of XSA-157
+
+CC: stable@vger.kernel.org
+Reviewed-by: Jan Beulich <jbeulich@suse.com>
+Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+---
+ drivers/xen/xen-pciback/pciback_ops.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
+index 4ee5fc0..73dafdc 100644
+--- a/drivers/xen/xen-pciback/pciback_ops.c
++++ b/drivers/xen/xen-pciback/pciback_ops.c
+@@ -212,6 +212,7 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev,
+ 	struct xen_pcibk_dev_data *dev_data;
+ 	int i, result;
+ 	struct msix_entry *entries;
++	u16 cmd;
+ 
+ 	if (unlikely(verbose_request))
+ 		printk(KERN_DEBUG DRV_NAME ": %s: enable MSI-X\n",
+@@ -223,7 +224,12 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev,
+ 	if (dev->msix_enabled)
+ 		return -EALREADY;
+ 
+-	if (dev->msi_enabled)
++	/*
++	 * PCI_COMMAND_MEMORY must be enabled, otherwise we may not be able
++	 * to access the BARs where the MSI-X entries reside.
++	 */
++	pci_read_config_word(dev, PCI_COMMAND, &cmd);
++	if (dev->msi_enabled || !(cmd & PCI_COMMAND_MEMORY))
+ 		return -ENXIO;
+ 
+ 	entries = kmalloc(op->value * sizeof(*entries), GFP_KERNEL);
diff --git a/debian/patches/bugfix/all/xen-pciback-for-xen_pci_op_disable_msi-x-only-disabl.patch b/debian/patches/bugfix/all/xen-pciback-for-xen_pci_op_disable_msi-x-only-disabl.patch
new file mode 100644
index 0000000..7b051d1
--- /dev/null
+++ b/debian/patches/bugfix/all/xen-pciback-for-xen_pci_op_disable_msi-x-only-disabl.patch
@@ -0,0 +1,102 @@
+From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+Date: Wed, 1 Apr 2015 10:49:47 -0400
+Subject: [4/5] xen/pciback: For XEN_PCI_OP_disable_msi[|x] only disable if
+ device has MSI(X) enabled.
+Origin: https://git.kernel.org/linus/7cfb905b9638982862f0331b36ccaaca5d383b49
+
+Otherwise just continue on, returning the same values as
+previously (return of 0, and op->result has the PIRQ value).
+
+This does not change the behavior of XEN_PCI_OP_disable_msi[|x].
+
+The pci_disable_msi or pci_disable_msix have the checks for
+msi_enabled or msix_enabled so they will error out immediately.
+
+However the guest can still call these operations and cause
+us to disable the 'ack_intr'. That means the backend IRQ handler
+for the legacy interrupt will not respond to interrupts anymore.
+
+This will lead to (if the device is causing an interrupt storm)
+for the Linux generic code to disable the interrupt line.
+
+Naturally this will only happen if the device in question
+is plugged in on the motherboard on shared level interrupt GSI.
+
+This is part of XSA-157
+
+CC: stable@vger.kernel.org
+Reviewed-by: David Vrabel <david.vrabel@citrix.com>
+Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+---
+ drivers/xen/xen-pciback/pciback_ops.c | 33 ++++++++++++++++++++-------------
+ 1 file changed, 20 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
+index d0696ce..4ee5fc0 100644
+--- a/drivers/xen/xen-pciback/pciback_ops.c
++++ b/drivers/xen/xen-pciback/pciback_ops.c
+@@ -185,20 +185,23 @@ static
+ int xen_pcibk_disable_msi(struct xen_pcibk_device *pdev,
+ 			  struct pci_dev *dev, struct xen_pci_op *op)
+ {
+-	struct xen_pcibk_dev_data *dev_data;
+-
+ 	if (unlikely(verbose_request))
+ 		printk(KERN_DEBUG DRV_NAME ": %s: disable MSI\n",
+ 		       pci_name(dev));
+-	pci_disable_msi(dev);
+ 
++	if (dev->msi_enabled) {
++		struct xen_pcibk_dev_data *dev_data;
++
++		pci_disable_msi(dev);
++
++		dev_data = pci_get_drvdata(dev);
++		if (dev_data)
++			dev_data->ack_intr = 1;
++	}
+ 	op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0;
+ 	if (unlikely(verbose_request))
+ 		printk(KERN_DEBUG DRV_NAME ": %s: MSI: %d\n", pci_name(dev),
+ 			op->value);
+-	dev_data = pci_get_drvdata(dev);
+-	if (dev_data)
+-		dev_data->ack_intr = 1;
+ 	return 0;
+ }
+ 
+@@ -264,23 +267,27 @@ static
+ int xen_pcibk_disable_msix(struct xen_pcibk_device *pdev,
+ 			   struct pci_dev *dev, struct xen_pci_op *op)
+ {
+-	struct xen_pcibk_dev_data *dev_data;
+ 	if (unlikely(verbose_request))
+ 		printk(KERN_DEBUG DRV_NAME ": %s: disable MSI-X\n",
+ 			pci_name(dev));
+-	pci_disable_msix(dev);
+ 
++	if (dev->msix_enabled) {
++		struct xen_pcibk_dev_data *dev_data;
++
++		pci_disable_msix(dev);
++
++		dev_data = pci_get_drvdata(dev);
++		if (dev_data)
++			dev_data->ack_intr = 1;
++	}
+ 	/*
+ 	 * SR-IOV devices (which don't have any legacy IRQ) have
+ 	 * an undefined IRQ value of zero.
+ 	 */
+ 	op->value = dev->irq ? xen_pirq_from_irq(dev->irq) : 0;
+ 	if (unlikely(verbose_request))
+-		printk(KERN_DEBUG DRV_NAME ": %s: MSI-X: %d\n", pci_name(dev),
+-			op->value);
+-	dev_data = pci_get_drvdata(dev);
+-	if (dev_data)
+-		dev_data->ack_intr = 1;
++		printk(KERN_DEBUG DRV_NAME ": %s: MSI-X: %d\n",
++		       pci_name(dev), op->value);
+ 	return 0;
+ }
+ #endif
diff --git a/debian/patches/bugfix/all/xen-pciback-return-error-on-xen_pci_op_enable_msi-wh.patch b/debian/patches/bugfix/all/xen-pciback-return-error-on-xen_pci_op_enable_msi-wh.patch
new file mode 100644
index 0000000..67cb747
--- /dev/null
+++ b/debian/patches/bugfix/all/xen-pciback-return-error-on-xen_pci_op_enable_msi-wh.patch
@@ -0,0 +1,58 @@
+From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+Date: Fri, 3 Apr 2015 11:08:22 -0400
+Subject: [1/5] xen/pciback: Return error on XEN_PCI_OP_enable_msi when device
+ has MSI or MSI-X enabled
+Origin: https://git.kernel.org/linus/56441f3c8e5bd45aab10dd9f8c505dd4bec03b0d
+
+The guest sequence of:
+
+ a) XEN_PCI_OP_enable_msi
+ b) XEN_PCI_OP_enable_msi
+ c) XEN_PCI_OP_disable_msi
+
+results in hitting an BUG_ON condition in the msi.c code.
+
+The MSI code uses an dev->msi_list to which it adds MSI entries.
+Under the above conditions an BUG_ON() can be hit. The device
+passed in the guest MUST have MSI capability.
+
+The a) adds the entry to the dev->msi_list and sets msi_enabled.
+The b) adds a second entry but adding in to SysFS fails (duplicate entry)
+and deletes all of the entries from msi_list and returns (with msi_enabled
+is still set).  c) pci_disable_msi passes the msi_enabled checks and hits:
+
+BUG_ON(list_empty(dev_to_msi_list(&dev->dev)));
+
+and blows up.
+
+The patch adds a simple check in the XEN_PCI_OP_enable_msi to guard
+against that. The check for msix_enabled is not stricly neccessary.
+
+This is part of XSA-157.
+
+CC: stable@vger.kernel.org
+Reviewed-by: David Vrabel <david.vrabel@citrix.com>
+Reviewed-by: Jan Beulich <jbeulich@suse.com>
+Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+---
+ drivers/xen/xen-pciback/pciback_ops.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
+index a0e0e3e..8bfb87c 100644
+--- a/drivers/xen/xen-pciback/pciback_ops.c
++++ b/drivers/xen/xen-pciback/pciback_ops.c
+@@ -144,7 +144,12 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev,
+ 	if (unlikely(verbose_request))
+ 		printk(KERN_DEBUG DRV_NAME ": %s: enable MSI\n", pci_name(dev));
+ 
+-	status = pci_enable_msi(dev);
++	if (dev->msi_enabled)
++		status = -EALREADY;
++	else if (dev->msix_enabled)
++		status = -ENXIO;
++	else
++		status = pci_enable_msi(dev);
+ 
+ 	if (status) {
+ 		pr_warn_ratelimited("%s: error enabling MSI for guest %u: err %d\n",
diff --git a/debian/patches/bugfix/all/xen-pciback-return-error-on-xen_pci_op_enable_msix-w.patch b/debian/patches/bugfix/all/xen-pciback-return-error-on-xen_pci_op_enable_msix-w.patch
new file mode 100644
index 0000000..0d37a4c
--- /dev/null
+++ b/debian/patches/bugfix/all/xen-pciback-return-error-on-xen_pci_op_enable_msix-w.patch
@@ -0,0 +1,60 @@
+From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+Date: Mon, 2 Nov 2015 18:07:44 -0500
+Subject: [2/5] xen/pciback: Return error on XEN_PCI_OP_enable_msix when device
+ has MSI or MSI-X enabled
+Origin: https://git.kernel.org/linus/5e0ce1455c09dd61d029b8ad45d82e1ac0b6c4c9
+
+The guest sequence of:
+
+  a) XEN_PCI_OP_enable_msix
+  b) XEN_PCI_OP_enable_msix
+
+results in hitting an NULL pointer due to using freed pointers.
+
+The device passed in the guest MUST have MSI-X capability.
+
+The a) constructs and SysFS representation of MSI and MSI groups.
+The b) adds a second set of them but adding in to SysFS fails (duplicate entry).
+'populate_msi_sysfs' frees the newly allocated msi_irq_groups (note that
+in a) pdev->msi_irq_groups is still set) and also free's ALL of the
+MSI-X entries of the device (the ones allocated in step a) and b)).
+
+The unwind code: 'free_msi_irqs' deletes all the entries and tries to
+delete the pdev->msi_irq_groups (which hasn't been set to NULL).
+However the pointers in the SysFS are already freed and we hit an
+NULL pointer further on when 'strlen' is attempted on a freed pointer.
+
+The patch adds a simple check in the XEN_PCI_OP_enable_msix to guard
+against that. The check for msi_enabled is not stricly neccessary.
+
+This is part of XSA-157
+
+CC: stable@vger.kernel.org
+Reviewed-by: David Vrabel <david.vrabel@citrix.com>
+Reviewed-by: Jan Beulich <jbeulich@suse.com>
+Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+---
+ drivers/xen/xen-pciback/pciback_ops.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
+index 8bfb87c..029f33d 100644
+--- a/drivers/xen/xen-pciback/pciback_ops.c
++++ b/drivers/xen/xen-pciback/pciback_ops.c
+@@ -206,9 +206,16 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev,
+ 	if (unlikely(verbose_request))
+ 		printk(KERN_DEBUG DRV_NAME ": %s: enable MSI-X\n",
+ 		       pci_name(dev));
++
+ 	if (op->value > SH_INFO_MAX_VEC)
+ 		return -EINVAL;
+ 
++	if (dev->msix_enabled)
++		return -EALREADY;
++
++	if (dev->msi_enabled)
++		return -ENXIO;
++
+ 	entries = kmalloc(op->value * sizeof(*entries), GFP_KERNEL);
+ 	if (entries == NULL)
+ 		return -ENOMEM;
diff --git a/debian/patches/bugfix/all/xen-pciback-save-xen_pci_op-commands-before-processi.patch b/debian/patches/bugfix/all/xen-pciback-save-xen_pci_op-commands-before-processi.patch
new file mode 100644
index 0000000..101afe8
--- /dev/null
+++ b/debian/patches/bugfix/all/xen-pciback-save-xen_pci_op-commands-before-processi.patch
@@ -0,0 +1,77 @@
+From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+Date: Mon, 16 Nov 2015 12:40:48 -0500
+Subject: [7/7] xen/pciback: Save xen_pci_op commands before processing it
+Origin: https://git.kernel.org/linus/8135cf8b092723dbfcc611fe6fdcb3a36c9951c5
+
+Double fetch vulnerabilities that happen when a variable is
+fetched twice from shared memory but a security check is only
+performed the first time.
+
+The xen_pcibk_do_op function performs a switch statements on the op->cmd
+value which is stored in shared memory. Interestingly this can result
+in a double fetch vulnerability depending on the performed compiler
+optimization.
+
+This patch fixes it by saving the xen_pci_op command before
+processing it. We also use 'barrier' to make sure that the
+compiler does not perform any optimization.
+
+This is part of XSA155.
+
+CC: stable@vger.kernel.org
+Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+Signed-off-by: Jan Beulich <JBeulich@suse.com>
+Signed-off-by: David Vrabel <david.vrabel@citrix.com>
+Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+---
+ drivers/xen/xen-pciback/pciback.h     |  1 +
+ drivers/xen/xen-pciback/pciback_ops.c | 15 ++++++++++++++-
+ 2 files changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/xen/xen-pciback/pciback.h b/drivers/xen/xen-pciback/pciback.h
+index 58e38d5..4d529f3 100644
+--- a/drivers/xen/xen-pciback/pciback.h
++++ b/drivers/xen/xen-pciback/pciback.h
+@@ -37,6 +37,7 @@ struct xen_pcibk_device {
+ 	struct xen_pci_sharedinfo *sh_info;
+ 	unsigned long flags;
+ 	struct work_struct op_work;
++	struct xen_pci_op op;
+ };
+ 
+ struct xen_pcibk_dev_data {
+diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
+index c4a0666..a0e0e3e 100644
+--- a/drivers/xen/xen-pciback/pciback_ops.c
++++ b/drivers/xen/xen-pciback/pciback_ops.c
+@@ -298,9 +298,11 @@ void xen_pcibk_do_op(struct work_struct *data)
+ 		container_of(data, struct xen_pcibk_device, op_work);
+ 	struct pci_dev *dev;
+ 	struct xen_pcibk_dev_data *dev_data = NULL;
+-	struct xen_pci_op *op = &pdev->sh_info->op;
++	struct xen_pci_op *op = &pdev->op;
+ 	int test_intx = 0;
+ 
++	*op = pdev->sh_info->op;
++	barrier();
+ 	dev = xen_pcibk_get_pci_dev(pdev, op->domain, op->bus, op->devfn);
+ 
+ 	if (dev == NULL)
+@@ -342,6 +344,17 @@ void xen_pcibk_do_op(struct work_struct *data)
+ 		if ((dev_data->enable_intx != test_intx))
+ 			xen_pcibk_control_isr(dev, 0 /* no reset */);
+ 	}
++	pdev->sh_info->op.err = op->err;
++	pdev->sh_info->op.value = op->value;
++#ifdef CONFIG_PCI_MSI
++	if (op->cmd == XEN_PCI_OP_enable_msix && op->err == 0) {
++		unsigned int i;
++
++		for (i = 0; i < op->value; i++)
++			pdev->sh_info->op.msix_entries[i].vector =
++				op->msix_entries[i].vector;
++	}
++#endif
+ 	/* Tell the driver domain that we're done. */
+ 	wmb();
+ 	clear_bit(_XEN_PCIF_active, (unsigned long *)&pdev->sh_info->flags);
diff --git a/debian/patches/bugfix/x86/KVM-x86-Reload-pit-counters-for-all-channels-when-re.patch b/debian/patches/bugfix/x86/KVM-x86-Reload-pit-counters-for-all-channels-when-re.patch
new file mode 100644
index 0000000..12c2968
--- /dev/null
+++ b/debian/patches/bugfix/x86/KVM-x86-Reload-pit-counters-for-all-channels-when-re.patch
@@ -0,0 +1,53 @@
+From: Andrew Honig <ahonig@google.com>
+Date: Wed, 18 Nov 2015 14:50:23 -0800
+Subject: KVM: x86: Reload pit counters for all channels when restoring state
+Origin: https://git.kernel.org/linus/0185604c2d82c560dab2f2933a18f797e74ab5a8
+
+Currently if userspace restores the pit counters with a count of 0
+on channels 1 or 2 and the guest attempts to read the count on those
+channels, then KVM will perform a mod of 0 and crash.  This will ensure
+that 0 values are converted to 65536 as per the spec.
+
+This is CVE-2015-7513.
+
+Signed-off-by: Andy Honig <ahonig@google.com>
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+[carnil: Backport to 4.3.3: context]
+---
+ arch/x86/kvm/x86.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/arch/x86/kvm/x86.c
++++ b/arch/x86/kvm/x86.c
+@@ -3559,10 +3559,11 @@ static int kvm_vm_ioctl_get_pit(struct k
+ static int kvm_vm_ioctl_set_pit(struct kvm *kvm, struct kvm_pit_state *ps)
+ {
+ 	int r = 0;
+-
++	int i;
+ 	mutex_lock(&kvm->arch.vpit->pit_state.lock);
+ 	memcpy(&kvm->arch.vpit->pit_state, ps, sizeof(struct kvm_pit_state));
+-	kvm_pit_load_count(kvm, 0, ps->channels[0].count, 0);
++	for (i = 0; i < 3; i++)
++		kvm_pit_load_count(kvm, i, ps->channels[i].count, 0);
+ 	mutex_unlock(&kvm->arch.vpit->pit_state.lock);
+ 	return r;
+ }
+@@ -3583,6 +3584,7 @@ static int kvm_vm_ioctl_get_pit2(struct
+ static int kvm_vm_ioctl_set_pit2(struct kvm *kvm, struct kvm_pit_state2 *ps)
+ {
+ 	int r = 0, start = 0;
++	int i;
+ 	u32 prev_legacy, cur_legacy;
+ 	mutex_lock(&kvm->arch.vpit->pit_state.lock);
+ 	prev_legacy = kvm->arch.vpit->pit_state.flags & KVM_PIT_FLAGS_HPET_LEGACY;
+@@ -3592,7 +3594,8 @@ static int kvm_vm_ioctl_set_pit2(struct
+ 	memcpy(&kvm->arch.vpit->pit_state.channels, &ps->channels,
+ 	       sizeof(kvm->arch.vpit->pit_state.channels));
+ 	kvm->arch.vpit->pit_state.flags = ps->flags;
+-	kvm_pit_load_count(kvm, 0, kvm->arch.vpit->pit_state.channels[0].count, start);
++	for (i = 0; i < 3; i++)
++		kvm_pit_load_count(kvm, i, kvm->arch.vpit->pit_state.channels[i].count, start);
+ 	mutex_unlock(&kvm->arch.vpit->pit_state.lock);
+ 	return r;
+ }
diff --git a/debian/patches/debian/ptrace-fix-abi-change-for-priv-esc-fix.patch b/debian/patches/debian/ptrace-fix-abi-change-for-priv-esc-fix.patch
new file mode 100644
index 0000000..1243c3e
--- /dev/null
+++ b/debian/patches/debian/ptrace-fix-abi-change-for-priv-esc-fix.patch
@@ -0,0 +1,19 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Sun, 27 Dec 2015 21:11:09 +0000
+Subject: ptrace: Fix ABI change for priv-esc fix
+Forwarded: not-needed
+
+Hide the new #include from genksyms.
+---
+--- a/kernel/ptrace.c
++++ b/kernel/ptrace.c
+@@ -20,7 +20,9 @@
+ #include <linux/uio.h>
+ #include <linux/audit.h>
+ #include <linux/pid_namespace.h>
++#ifndef __GENKSYMS__
+ #include <linux/user_namespace.h>
++#endif
+ #include <linux/syscalls.h>
+ #include <linux/uaccess.h>
+ #include <linux/regset.h>
diff --git a/debian/patches/series b/debian/patches/series
index aafb392..f22c3f2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -650,3 +650,23 @@ bugfix/all/unix-avoid-use-after-free-in-ep_remove_wait_queue.patch
 debian/af_unix-avoid-abi-changes.patch
 bugfix/all/btrfs-fix-truncation-of-compressed-and-inlined-exten.patch
 bugfix/all/net-add-validation-for-the-socket-syscall-protocol.patch
+bugfix/all/xen-add-ring_copy_request.patch
+bugfix/all/xen-netback-don-t-use-last-request-to-determine-mini.patch
+bugfix/all/xen-netback-use-ring_copy_request-throughout.patch
+bugfix/all/xen-blkback-only-read-request-operation-from-shared-.patch
+bugfix/all/xen-blkback-read-from-indirect-descriptors-only-once.patch
+bugfix/all/xen-pciback-save-xen_pci_op-commands-before-processi.patch
+bugfix/all/xen-pciback-return-error-on-xen_pci_op_enable_msi-wh.patch
+bugfix/all/xen-pciback-return-error-on-xen_pci_op_enable_msix-w.patch
+bugfix/all/xen-pciback-do-not-install-an-irq-handler-for-msi-in.patch
+bugfix/all/xen-pciback-for-xen_pci_op_disable_msi-x-only-disabl.patch
+bugfix/all/xen-pciback-don-t-allow-msi-x-ops-if-pci_command_mem.patch
+bugfix/all/pptp-verify-sockaddr_len-in-pptp_bind-and-pptp_conne.patch
+bugfix/all/bluetooth-validate-socket-address-length-in-sco_sock.patch
+bugfix/all/ptrace-being-capable-wrt-a-process-requires-mapped-uids-gids.patch
+debian/ptrace-fix-abi-change-for-priv-esc-fix.patch
+bugfix/all/keys-fix-race-between-read-and-revoke.patch
+bugfix/x86/KVM-x86-Reload-pit-counters-for-all-channels-when-re.patch
+bugfix/all/revert-net-add-length-argument-to-skb_copy_and_csum_datagram_iovec.patch
+bugfix/all/udp-properly-support-msg_peek-with-truncated-buffers.patch
+bugfix/all/revert-xhci-don-t-finish-a-td-if-we-get-a-short-transfer.patch

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [BUG] pci-passthrough generates "xen:events: Failed to obtain physical IRQ" for some devices
  2016-02-01 10:43     ` Ian Campbell
@ 2016-02-01 14:50       ` Konrad Rzeszutek Wilk
  2016-02-03 14:22         ` Marek Marczykowski-Górecki
  0 siblings, 1 reply; 15+ messages in thread
From: Konrad Rzeszutek Wilk @ 2016-02-01 14:50 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Tommi Airikka, 810379, xen-devel

> The second bullet looks at first pretty interesting from this PoV,
> see http://xenbits.xen.org/xsa/advisory-157.html for info on the XSA and
> the various patches. Konrad is on the CC already so hopefully he has some
> ideas.

Thanks. I will try to reproduce this with the upstream kernel first as
those patches are there.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [BUG] pci-passthrough generates "xen:events: Failed to obtain physical IRQ" for some devices
  2016-02-01 14:50       ` Konrad Rzeszutek Wilk
@ 2016-02-03 14:22         ` Marek Marczykowski-Górecki
  2016-02-03 15:26           ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 15+ messages in thread
From: Marek Marczykowski-Górecki @ 2016-02-03 14:22 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: Tommi Airikka, Ian Campbell, 810379, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 973 bytes --]

On Mon, Feb 01, 2016 at 09:50:53AM -0500, Konrad Rzeszutek Wilk wrote:
> > The second bullet looks at first pretty interesting from this PoV,
> > see http://xenbits.xen.org/xsa/advisory-157.html for info on the XSA and
> > the various patches. Konrad is on the CC already so hopefully he has some
> > ideas.
> 
> Thanks. I will try to reproduce this with the upstream kernel first as
> those patches are there.

According to one Qubes OS user report[1], the bug was introduced between
version, which differs only by XSA-155 patches (including one for
pciback), especially not XSA-157. 
Maybe on some code path, some value is not copied back to pdev->sh_info->op?

[1]
https://groups.google.com/d/msgid/qubes-devel/e64792c5-b9af-42ac-8d67-adce426b9dcb%40googlegroups.com

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [BUG] pci-passthrough generates "xen:events: Failed to obtain physical IRQ" for some devices
  2016-02-03 14:22         ` Marek Marczykowski-Górecki
@ 2016-02-03 15:26           ` Konrad Rzeszutek Wilk
  2016-02-08 17:39             ` Marek Marczykowski-Górecki
  0 siblings, 1 reply; 15+ messages in thread
From: Konrad Rzeszutek Wilk @ 2016-02-03 15:26 UTC (permalink / raw)
  To: Marek Marczykowski-Górecki
  Cc: Tommi Airikka, Ian Campbell, 810379, xen-devel

[-- Attachment #1: Type: text/plain, Size: 977 bytes --]

On Wed, Feb 03, 2016 at 03:22:30PM +0100, Marek Marczykowski-Górecki wrote:
> On Mon, Feb 01, 2016 at 09:50:53AM -0500, Konrad Rzeszutek Wilk wrote:
> > > The second bullet looks at first pretty interesting from this PoV,
> > > see http://xenbits.xen.org/xsa/advisory-157.html for info on the XSA and
> > > the various patches. Konrad is on the CC already so hopefully he has some
> > > ideas.
> > 
> > Thanks. I will try to reproduce this with the upstream kernel first as
> > those patches are there.
> 
> According to one Qubes OS user report[1], the bug was introduced between
> version, which differs only by XSA-155 patches (including one for
> pciback), especially not XSA-157. 
> Maybe on some code path, some value is not copied back to pdev->sh_info->op?

I found two bugs (attached the draft not-compiled patches). Upstream
wise I seem to be tripping over another issue.

There is also some more work required in there to fix the MSI-x enable op.

[-- Attachment #2: 0001-xen-pciback-Check-PF-instead-of-VF-for-PCI_COMMAND_M.patch --]
[-- Type: text/plain, Size: 1737 bytes --]

>From 34c754a209747826336f6e1f0477a55d214fcc28 Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Wed, 3 Feb 2016 10:18:18 -0500
Subject: [PATCH 1/2] xen/pciback: Check PF instead of VF for
 PCI_COMMAND_MEMORY

c/s 408fb0e5aa7fda0059db282ff58c3b2a4278baa0
"xen/pciback: Don't allow MSI-X ops if PCI_COMMAND_MEMORY is not set."
would check the device for PCI_COMMAND_MEMORY which is great.
Except that VF devices are unique - for example they have no
legacy interrupts, and also any writes to PCI_COMMAND_MEMORY
are silently ignored (by the hardware).

CC: stable@vger.kernel.org
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 drivers/xen/xen-pciback/pciback_ops.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
index 73dafdc..8c86a53 100644
--- a/drivers/xen/xen-pciback/pciback_ops.c
+++ b/drivers/xen/xen-pciback/pciback_ops.c
@@ -213,6 +213,7 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev,
 	int i, result;
 	struct msix_entry *entries;
 	u16 cmd;
+	struct pci_dev *phys_dev;
 
 	if (unlikely(verbose_request))
 		printk(KERN_DEBUG DRV_NAME ": %s: enable MSI-X\n",
@@ -227,8 +228,10 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev,
 	/*
 	 * PCI_COMMAND_MEMORY must be enabled, otherwise we may not be able
 	 * to access the BARs where the MSI-X entries reside.
+	 * But VF devices are unique in which the PF needs to be checked.
 	 */
-	pci_read_config_word(dev, PCI_COMMAND, &cmd);
+	phys_dev = pci_physfn(dev);
+	pci_read_config_word(phys_dev, PCI_COMMAND, &cmd);
 	if (dev->msi_enabled || !(cmd & PCI_COMMAND_MEMORY))
 		return -ENXIO;
 
-- 
2.1.0


[-- Attachment #3: 0002-xen-pciback-Save-the-number-of-MSI-X-entries-to-be-c.patch --]
[-- Type: text/plain, Size: 2010 bytes --]

>From 0d83766e257e3bfb5ecd7483e2263ef89a986f4a Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Wed, 3 Feb 2016 10:22:02 -0500
Subject: [PATCH 2/2] xen/pciback: Save the number of MSI-X entries to be
 copied later.

c/s  8135cf8b092723dbfcc611fe6fdcb3a36c9951c5
"xen/pciback: Save xen_pci_op commands before processing it"
would copyback the processed values - which was great.

However it missed the case that xen_pcibk_enable_msix - when
completing would overwrite op->value (which had the number
of MSI-X vectors requested) with the return value (which for
success was zero). Hence the copy-back routine (which would use
op->value) would copy exactly zero MSI-X vectors back.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 drivers/xen/xen-pciback/pciback_ops.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
index 8c86a53..2fc5880 100644
--- a/drivers/xen/xen-pciback/pciback_ops.c
+++ b/drivers/xen/xen-pciback/pciback_ops.c
@@ -335,7 +335,9 @@ void xen_pcibk_do_op(struct work_struct *data)
 	struct xen_pcibk_dev_data *dev_data = NULL;
 	struct xen_pci_op *op = &pdev->op;
 	int test_intx = 0;
-
+#ifdef CONFIG_PCI_MSI
+	unsigned int nr = 0;
+#endif
 	*op = pdev->sh_info->op;
 	barrier();
 	dev = xen_pcibk_get_pci_dev(pdev, op->domain, op->bus, op->devfn);
@@ -363,6 +365,7 @@ void xen_pcibk_do_op(struct work_struct *data)
 			op->err = xen_pcibk_disable_msi(pdev, dev, op);
 			break;
 		case XEN_PCI_OP_enable_msix:
+			nr = op->value;
 			op->err = xen_pcibk_enable_msix(pdev, dev, op);
 			break;
 		case XEN_PCI_OP_disable_msix:
@@ -385,7 +388,7 @@ void xen_pcibk_do_op(struct work_struct *data)
 	if (op->cmd == XEN_PCI_OP_enable_msix && op->err == 0) {
 		unsigned int i;
 
-		for (i = 0; i < op->value; i++)
+		for (i = 0; i < nr; i++)
 			pdev->sh_info->op.msix_entries[i].vector =
 				op->msix_entries[i].vector;
 	}
-- 
2.1.0


[-- Attachment #4: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [BUG] pci-passthrough generates "xen:events: Failed to obtain physical IRQ" for some devices
  2016-01-30 13:18   ` Tommi Airikka
  2016-02-01 10:43     ` Ian Campbell
@ 2016-02-03 20:28     ` Konrad Rzeszutek Wilk
  2016-02-04  9:37       ` Ian Campbell
  1 sibling, 1 reply; 15+ messages in thread
From: Konrad Rzeszutek Wilk @ 2016-02-03 20:28 UTC (permalink / raw)
  To: Tommi Airikka; +Cc: 810379, xen-devel

[-- Attachment #1: Type: text/plain, Size: 329 bytes --]

> > And I wonder if the XEN_DOMCTL_irq_permission aka, xc_domain_irq_permission
> > had been called. I remember that at some point we missed it for Xend..
> >

False alarm.

It was all in Linux. Attached are four patches (the first two
are for your issue you discovered).
I was wondering if there is a way for you to test them?


[-- Attachment #2: 0001-xen-pciback-Check-PF-instead-of-VF-for-PCI_COMMAND_M.patch --]
[-- Type: text/plain, Size: 1737 bytes --]

>From 9b8c92f9535ca9af672facd05360570730a33e05 Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Wed, 3 Feb 2016 10:18:18 -0500
Subject: [PATCH 1/4] xen/pciback: Check PF instead of VF for
 PCI_COMMAND_MEMORY

c/s 408fb0e5aa7fda0059db282ff58c3b2a4278baa0
"xen/pciback: Don't allow MSI-X ops if PCI_COMMAND_MEMORY is not set."
would check the device for PCI_COMMAND_MEMORY which is great.
Except that VF devices are unique - for example they have no
legacy interrupts, and also any writes to PCI_COMMAND_MEMORY
are silently ignored (by the hardware).

CC: stable@vger.kernel.org
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 drivers/xen/xen-pciback/pciback_ops.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
index 73dafdc..8c86a53 100644
--- a/drivers/xen/xen-pciback/pciback_ops.c
+++ b/drivers/xen/xen-pciback/pciback_ops.c
@@ -213,6 +213,7 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev,
 	int i, result;
 	struct msix_entry *entries;
 	u16 cmd;
+	struct pci_dev *phys_dev;
 
 	if (unlikely(verbose_request))
 		printk(KERN_DEBUG DRV_NAME ": %s: enable MSI-X\n",
@@ -227,8 +228,10 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev,
 	/*
 	 * PCI_COMMAND_MEMORY must be enabled, otherwise we may not be able
 	 * to access the BARs where the MSI-X entries reside.
+	 * But VF devices are unique in which the PF needs to be checked.
 	 */
-	pci_read_config_word(dev, PCI_COMMAND, &cmd);
+	phys_dev = pci_physfn(dev);
+	pci_read_config_word(phys_dev, PCI_COMMAND, &cmd);
 	if (dev->msi_enabled || !(cmd & PCI_COMMAND_MEMORY))
 		return -ENXIO;
 
-- 
2.1.0


[-- Attachment #3: 0002-xen-pciback-Save-the-number-of-MSI-X-entries-to-be-c.patch --]
[-- Type: text/plain, Size: 2010 bytes --]

>From 0f8901117800fc2f1a87cc5468f1ab7e4288cc5f Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Wed, 3 Feb 2016 10:22:02 -0500
Subject: [PATCH 2/4] xen/pciback: Save the number of MSI-X entries to be
 copied later.

c/s  8135cf8b092723dbfcc611fe6fdcb3a36c9951c5
"xen/pciback: Save xen_pci_op commands before processing it"
would copyback the processed values - which was great.

However it missed the case that xen_pcibk_enable_msix - when
completing would overwrite op->value (which had the number
of MSI-X vectors requested) with the return value (which for
success was zero). Hence the copy-back routine (which would use
op->value) would copy exactly zero MSI-X vectors back.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 drivers/xen/xen-pciback/pciback_ops.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
index 8c86a53..2fc5880 100644
--- a/drivers/xen/xen-pciback/pciback_ops.c
+++ b/drivers/xen/xen-pciback/pciback_ops.c
@@ -335,7 +335,9 @@ void xen_pcibk_do_op(struct work_struct *data)
 	struct xen_pcibk_dev_data *dev_data = NULL;
 	struct xen_pci_op *op = &pdev->op;
 	int test_intx = 0;
-
+#ifdef CONFIG_PCI_MSI
+	unsigned int nr = 0;
+#endif
 	*op = pdev->sh_info->op;
 	barrier();
 	dev = xen_pcibk_get_pci_dev(pdev, op->domain, op->bus, op->devfn);
@@ -363,6 +365,7 @@ void xen_pcibk_do_op(struct work_struct *data)
 			op->err = xen_pcibk_disable_msi(pdev, dev, op);
 			break;
 		case XEN_PCI_OP_enable_msix:
+			nr = op->value;
 			op->err = xen_pcibk_enable_msix(pdev, dev, op);
 			break;
 		case XEN_PCI_OP_disable_msix:
@@ -385,7 +388,7 @@ void xen_pcibk_do_op(struct work_struct *data)
 	if (op->cmd == XEN_PCI_OP_enable_msix && op->err == 0) {
 		unsigned int i;
 
-		for (i = 0; i < op->value; i++)
+		for (i = 0; i < nr; i++)
 			pdev->sh_info->op.msix_entries[i].vector =
 				op->msix_entries[i].vector;
 	}
-- 
2.1.0


[-- Attachment #4: 0003-xen-pcifront-Report-the-errors-better.patch --]
[-- Type: text/plain, Size: 1856 bytes --]

>From 3a0d57b60a61eb461504f8ed1845afd5084b7889 Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Wed, 3 Feb 2016 16:39:21 -0500
Subject: [PATCH 3/4] xen/pcifront: Report the errors better.

The messages should be different depending on the type of error.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 arch/x86/include/asm/xen/pci.h | 4 ++--
 arch/x86/pci/xen.c             | 5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/xen/pci.h b/arch/x86/include/asm/xen/pci.h
index 968d57d..f320ee3 100644
--- a/arch/x86/include/asm/xen/pci.h
+++ b/arch/x86/include/asm/xen/pci.h
@@ -57,7 +57,7 @@ static inline int xen_pci_frontend_enable_msi(struct pci_dev *dev,
 {
 	if (xen_pci_frontend && xen_pci_frontend->enable_msi)
 		return xen_pci_frontend->enable_msi(dev, vectors);
-	return -ENODEV;
+	return -ENOSYS;
 }
 static inline void xen_pci_frontend_disable_msi(struct pci_dev *dev)
 {
@@ -69,7 +69,7 @@ static inline int xen_pci_frontend_enable_msix(struct pci_dev *dev,
 {
 	if (xen_pci_frontend && xen_pci_frontend->enable_msix)
 		return xen_pci_frontend->enable_msix(dev, vectors, nvec);
-	return -ENODEV;
+	return -ENOSYS;
 }
 static inline void xen_pci_frontend_disable_msix(struct pci_dev *dev)
 {
diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c
index ff31ab4..beac4df 100644
--- a/arch/x86/pci/xen.c
+++ b/arch/x86/pci/xen.c
@@ -196,7 +196,10 @@ static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 	return 0;
 
 error:
-	dev_err(&dev->dev, "Xen PCI frontend has not registered MSI/MSI-X support!\n");
+	if (ret == -ENOSYS)
+		dev_err(&dev->dev, "Xen PCI frontend has not registered MSI/MSI-X support!\n");
+	else if (ret)
+		dev_err(&dev->dev, "Xen PCI frontend error: %d!\n", ret);
 free:
 	kfree(v);
 	return ret;
-- 
2.1.0


[-- Attachment #5: 0004-xen-pcifront-Fix-mysterious-crashes-when-NUMA-locali.patch --]
[-- Type: text/plain, Size: 4075 bytes --]

>From 25af39d59d2ff4a5e5bc872b8d4c451bbeffa312 Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Wed, 3 Feb 2016 16:43:56 -0500
Subject: [PATCH 4/4] xen/pcifront: Fix mysterious crashes when NUMA locality
 information was extracted.

Occasionaly PV guests would crash with:

pciback 0000:00:00.1: Xen PCI mapped GSI0 to IRQ16
BUG: unable to handle kernel paging request at 0000000d1a8c0be0
.. snip..
  <ffffffff8139ce1b>] find_next_bit+0xb/0x10
  [<ffffffff81387f22>] cpumask_next_and+0x22/0x40
  [<ffffffff813c1ef8>] pci_device_probe+0xb8/0x120
  [<ffffffff81529097>] ? driver_sysfs_add+0x77/0xa0
  [<ffffffff815293e4>] driver_probe_device+0x1a4/0x2d0
  [<ffffffff813c1ddd>] ? pci_match_device+0xdd/0x110
  [<ffffffff81529657>] __device_attach_driver+0xa7/0xb0
  [<ffffffff815295b0>] ? __driver_attach+0xa0/0xa0
  [<ffffffff81527622>] bus_for_each_drv+0x62/0x90
  [<ffffffff8152978d>] __device_attach+0xbd/0x110
  [<ffffffff815297fb>] device_attach+0xb/0x10
  [<ffffffff813b75ac>] pci_bus_add_device+0x3c/0x70
  [<ffffffff813b7618>] pci_bus_add_devices+0x38/0x80
  [<ffffffff813dc34e>] pcifront_scan_root+0x13e/0x1a0
  [<ffffffff817a0692>] pcifront_backend_changed+0x262/0x60b
  [<ffffffff814644c6>] ? xenbus_gather+0xd6/0x160
  [<ffffffff8120900f>] ? put_object+0x2f/0x50
  [<ffffffff81465c1d>] xenbus_otherend_changed+0x9d/0xa0
  [<ffffffff814678ee>] backend_changed+0xe/0x10
  [<ffffffff81463a28>] xenwatch_thread+0xc8/0x190
  [<ffffffff810f22f0>] ? woken_wake_function+0x10/0x10

which was the result of two things:

When we call pci_scan_root_bus we would pass in 'sd' (sysdata)
pointer which was an 'pcifront_sd' structure. However in the
pci_device_add it expects that the 'sd' is 'struct sysdata' and
sets the dev->node to what is in sd->node (offset 4):

set_dev_node(&dev->dev, pcibus_to_node(bus));

 __pcibus_to_node(const struct pci_bus *bus)
{
        const struct pci_sysdata *sd = bus->sysdata;

        return sd->node;
}

However our structure was pcifront_sd which had nothing at that
offset:

struct pcifront_sd {
        int                        domain;    /*     0     4 */
        /* XXX 4 bytes hole, try to pack */
        struct pcifront_device *   pdev;      /*     8     8 */
}

That is an hole - filled with garbage as we used kmalloc instead of
kzalloc (the second problem).

This patch fixes the issue by:
 1) Use kzalloc to initialize to a well known state.
 2) Put 'struct pci_sysdata' at the start of 'pcifront_sd'. That
    way access to the 'node' will access the right offset.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 drivers/pci/xen-pcifront.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
index c777b97..66d197d 100644
--- a/drivers/pci/xen-pcifront.c
+++ b/drivers/pci/xen-pcifront.c
@@ -53,7 +53,7 @@ struct pcifront_device {
 };
 
 struct pcifront_sd {
-	int domain;
+	struct pci_sysdata sd;
 	struct pcifront_device *pdev;
 };
 
@@ -67,7 +67,9 @@ static inline void pcifront_init_sd(struct pcifront_sd *sd,
 				    unsigned int domain, unsigned int bus,
 				    struct pcifront_device *pdev)
 {
-	sd->domain = domain;
+	/* Because we do not expose that information via XenBus. */
+	sd->sd.node = first_online_node;
+	sd->sd.domain = domain;
 	sd->pdev = pdev;
 }
 
@@ -468,8 +470,8 @@ static int pcifront_scan_root(struct pcifront_device *pdev,
 	dev_info(&pdev->xdev->dev, "Creating PCI Frontend Bus %04x:%02x\n",
 		 domain, bus);
 
-	bus_entry = kmalloc(sizeof(*bus_entry), GFP_KERNEL);
-	sd = kmalloc(sizeof(*sd), GFP_KERNEL);
+	bus_entry = kzalloc(sizeof(*bus_entry), GFP_KERNEL);
+	sd = kzalloc(sizeof(*sd), GFP_KERNEL);
 	if (!bus_entry || !sd) {
 		err = -ENOMEM;
 		goto err_out;
@@ -576,6 +578,7 @@ static void pcifront_free_roots(struct pcifront_device *pdev)
 		free_root_bus_devs(bus_entry->bus);
 
 		kfree(bus_entry->bus->sysdata);
+		bus_entry->bus->sysdata = NULL;
 
 		device_unregister(bus_entry->bus->bridge);
 		pci_remove_bus(bus_entry->bus);
-- 
2.1.0


[-- Attachment #6: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [BUG] pci-passthrough generates "xen:events: Failed to obtain physical IRQ" for some devices
  2016-02-03 20:28     ` Konrad Rzeszutek Wilk
@ 2016-02-04  9:37       ` Ian Campbell
  2016-02-04 23:35         ` Tommi Airikka
  0 siblings, 1 reply; 15+ messages in thread
From: Ian Campbell @ 2016-02-04  9:37 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk, Tommi Airikka; +Cc: 810379, xen-devel

On Wed, 2016-02-03 at 15:28 -0500, Konrad Rzeszutek Wilk wrote:
> > > And I wonder if the XEN_DOMCTL_irq_permission aka,
> > > xc_domain_irq_permission
> > > had been called. I remember that at some point we missed it for
> > > Xend..
> > > 
> 
> False alarm.
> 
> It was all in Linux. Attached are four patches (the first two
> are for your issue you discovered).
> I was wondering if there is a way for you to test them?

Tommy,

Please see the Debian Kernel Handbook and in particular
https://www.debian.org/doc/manuals/debian-kernel-handbook/ch-common-tasks.html#s-common-official
for instructions on rebuilding the Debian kernel with additional patches.

Ian.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [BUG] pci-passthrough generates "xen:events: Failed to obtain physical IRQ" for some devices
  2016-02-04  9:37       ` Ian Campbell
@ 2016-02-04 23:35         ` Tommi Airikka
  2016-02-12 21:36           ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 15+ messages in thread
From: Tommi Airikka @ 2016-02-04 23:35 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel, 810379


[-- Attachment #1.1: Type: text/plain, Size: 55277 bytes --]

Hi,

I patched the deb8u2 source with all four patches and built a new deb.

As two of the patches make some changes on the pcifront, I thought it could
be a good idea to first upgrade the domU 'bug' with the new linux-image.

domU 'bug' "uname -a":
Linux bug 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2a~test
(2016-02-04) x86_64 GNU/Linux

dom0 "uname -a":
Linux dom0 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2 (2016-01-02)
x86_64 GNU/Linux

At first, all seemed to be as expected. I still got the "Failed to obtain
physical IRQ" as the dom0 is not upgraded with the new linux-image.
But after a couple of minutes, I got "INFO: task khubd:205 blocked for more
than 120 seconds." with a call trace in dmesg (and there is a new call
trace periodically every 120 seconds).

domU 'bug' "dmesg":
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.16.0-4-amd64 (debian-kernel@lists.debian.org)
(gcc version 4.8.4 (Debian 4.8.4-1) ) #1 SMP Debian
3.16.7-ckt20-1+deb8u2a~test (2016-02-04)
[    0.000000] Command line: root=/dev/xvda2 ro elevator=noop
root=/dev/xvda2 ro
[    0.000000] ACPI in unprivileged domain disabled
[    0.000000] 1-1 mapping on 8000->100000
[    0.000000] Set 1015808 page(s) to 1-1 mapping
[    0.000000] 1-1 mapping on 100000->8000000
[    0.000000] e820: BIOS-provided physical RAM map:
[    0.000000] Xen: [mem 0x0000000000000000-0x000000000009ffff] usable
[    0.000000] Xen: [mem 0x00000000000a0000-0x00000000000fffff] reserved
[    0.000000] Xen: [mem 0x0000000000100000-0x0000000007ffffff] usable
[    0.000000] Xen: [mem 0x0000000008000000-0x00000000f1de3fff] unusable
[    0.000000] Xen: [mem 0x00000000f1de4000-0x00000000f1dedfff] ACPI data
[    0.000000] Xen: [mem 0x00000000f1dee000-0x00000000f7ffffff] reserved
[    0.000000] Xen: [mem 0x00000000fec00000-0x00000000feefffff] reserved
[    0.000000] Xen: [mem 0x00000000ff800000-0x00000000ffffffff] reserved
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] DMI not present or invalid.
[    0.000000] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[    0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable
[    0.000000] AGP: No AGP bridge found
[    0.000000] e820: last_pfn = 0x8000 max_arch_pfn = 0x400000000
[    0.000000] Base memory trampoline at [ffff88000009a000] 9a000 size 24576
[    0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff]
[    0.000000]  [mem 0x00000000-0x000fffff] page 4k
[    0.000000] init_memory_mapping: [mem 0x07e00000-0x07ffffff]
[    0.000000]  [mem 0x07e00000-0x07ffffff] page 4k
[    0.000000] BRK [0x01b02000, 0x01b02fff] PGTABLE
[    0.000000] init_memory_mapping: [mem 0x04000000-0x07dfffff]
[    0.000000]  [mem 0x04000000-0x07dfffff] page 4k
[    0.000000] BRK [0x01b03000, 0x01b03fff] PGTABLE
[    0.000000] BRK [0x01b04000, 0x01b04fff] PGTABLE
[    0.000000] BRK [0x01b05000, 0x01b05fff] PGTABLE
[    0.000000] BRK [0x01b06000, 0x01b06fff] PGTABLE
[    0.000000] BRK [0x01b07000, 0x01b07fff] PGTABLE
[    0.000000] init_memory_mapping: [mem 0x00100000-0x03ffffff]
[    0.000000]  [mem 0x00100000-0x03ffffff] page 4k
[    0.000000] RAMDISK: [mem 0x01f18000-0x04a4efff]
[    0.000000] NUMA turned off
[    0.000000] Faking a node at [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x00000000-0x07ffffff]
[    0.000000]   NODE_DATA [mem 0x07fe7000-0x07febfff]
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x00001000-0x00ffffff]
[    0.000000]   DMA32    [mem 0x01000000-0xffffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00001000-0x0009ffff]
[    0.000000]   node   0: [mem 0x00100000-0x07ffffff]
[    0.000000] On node 0 totalpages: 32671
[    0.000000]   DMA zone: 56 pages used for memmap
[    0.000000]   DMA zone: 21 pages reserved
[    0.000000]   DMA zone: 3999 pages, LIFO batch:0
[    0.000000]   DMA32 zone: 392 pages used for memmap
[    0.000000]   DMA32 zone: 28672 pages, LIFO batch:7
[    0.000000] SFI: Simple Firmware Interface v0.81
http://simplefirmware.org
[    0.000000] smpboot: Allowing 1 CPUs, 0 hotplug CPUs
[    0.000000] nr_irqs_gsi: 16
[    0.000000] PM: Registered nosave memory: [mem 0x000a0000-0x000fffff]
[    0.000000] e820: [mem 0xf8000000-0xfebfffff] available for PCI devices
[    0.000000] Booting paravirtualized kernel on Xen
[    0.000000] Xen version: 4.4.1 (preserve-AD)
[    0.000000] setup_percpu: NR_CPUS:512 nr_cpumask_bits:512 nr_cpu_ids:1
nr_node_ids:1
[    0.000000] PERCPU: Embedded 27 pages/cpu @ffff880007c00000 s80896 r8192
d21504 u2097152
[    0.000000] pcpu-alloc: s80896 r8192 d21504 u2097152 alloc=1*2097152
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists in Node order, mobility grouping on.
Total pages: 32202
[    0.000000] Policy zone: DMA32
[    0.000000] Kernel command line: root=/dev/xvda2 ro elevator=noop
root=/dev/xvda2 ro
[    0.000000] PID hash table entries: 512 (order: 0, 4096 bytes)
[    0.000000] xsave: enabled xstate_bv 0x3, cntxt size 0x240
[    0.000000] AGP: Checking aperture...
[    0.000000] AGP: No AGP bridge found
[    0.000000] Calgary: detecting Calgary via BIOS EBDA area
[    0.000000] Calgary: Unable to locate Rio Grande table in EBDA - bailing!
[    0.000000] Memory: 72396K/130684K available (5219K kernel code, 947K
rwdata, 1836K rodata, 1204K init, 840K bss, 58288K reserved)
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU dyntick-idle grace-period acceleration is enabled.
[    0.000000]  RCU restricting CPUs from NR_CPUS=512 to nr_cpu_ids=1.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS:33024 nr_irqs:256 16
[    0.000000] xen:events: Using FIFO-based ABI
[    0.000000] Console: colour dummy device 80x25
[    0.000000] console [tty0] enabled
[    0.000000] console [hvc0] enabled
[    0.000000] Xen: using vcpuop timer interface
[    0.000000] installing Xen timer for CPU 0
[    0.000000] tsc: Detected 2294.880 MHz processor
[    0.004000] Calibrating delay loop (skipped), value calculated using
timer frequency.. 4589.76 BogoMIPS (lpj=9179520)
[    0.004000] pid_max: default: 32768 minimum: 301
[    0.004000] Security Framework initialized
[    0.004000] AppArmor: AppArmor disabled by boot time parameter
[    0.004000] Yama: disabled by default; enable with sysctl kernel.yama.*
[    0.004000] Dentry cache hash table entries: 16384 (order: 5, 131072
bytes)
[    0.004000] Inode-cache hash table entries: 8192 (order: 4, 65536 bytes)
[    0.004000] Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
[    0.004000] Mountpoint-cache hash table entries: 512 (order: 0, 4096
bytes)
[    0.004000] Initializing cgroup subsys memory
[    0.004000] Initializing cgroup subsys devices
[    0.004000] Initializing cgroup subsys freezer
[    0.004000] Initializing cgroup subsys net_cls
[    0.004000] Initializing cgroup subsys blkio
[    0.004000] Initializing cgroup subsys perf_event
[    0.004000] Initializing cgroup subsys net_prio
[    0.004000] ENERGY_PERF_BIAS: Set to 'normal', was 'performance'
ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)
[    0.004000] CPU: Physical Processor ID: 0
[    0.004000] CPU: Processor Core ID: 1
[    0.004000] Last level iTLB entries: 4KB 512, 2MB 8, 4MB 8
Last level dTLB entries: 4KB 512, 2MB 32, 4MB 32, 1GB 0
tlb_flushall_shift: 2
[    0.035851] Freeing SMP alternatives memory: 20K (ffffffff81a1b000 -
ffffffff81a20000)
[    0.039467] ftrace: allocating 21679 entries in 85 pages
[    0.048176] Performance Events: unsupported p6 CPU model 58 no PMU
driver, software events only.
[    0.050760] x86: Booted up 1 node, 1 CPUs
[    0.050949] NMI watchdog: disabled (cpu0): hardware events not enabled
[    0.051055] devtmpfs: initialized
[    0.055826] pinctrl core: initialized pinctrl subsystem
[    0.056120] NET: Registered protocol family 16
[    0.056143] xen:grant_table: Grant tables using version 1 layout
[    0.056167] Grant table initialized
[    0.056748] PCI: setting up Xen PCI frontend stub
[    0.056757] PCI: pci_cache_line_size set to 64 bytes
[    0.060893] ACPI: Interpreter disabled.
[    0.060924] xen:balloon: Initialising balloon driver
[    0.060946] xen_balloon: Initialising balloon driver
[    0.060946] vgaarb: loaded
[    0.060946] PCI: System does not support PCI
[    0.060946] PCI: System does not support PCI
[    0.060946] Switched to clocksource xen
[    0.066106] pnp: PnP ACPI: disabled
[    0.068130] NET: Registered protocol family 2
[    0.068357] TCP established hash table entries: 1024 (order: 1, 8192
bytes)
[    0.068371] TCP bind hash table entries: 1024 (order: 2, 16384 bytes)
[    0.068379] TCP: Hash tables configured (established 1024 bind 1024)
[    0.068398] TCP: reno registered
[    0.068406] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.068416] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.068467] NET: Registered protocol family 1
[    0.068488] PCI: CLS 0 bytes, default 64
[    0.068553] Unpacking initramfs...
[    0.111279] Freeing initrd memory: 44252K (ffff880001f18000 -
ffff880004a4f000)
[    0.113621] platform rtc_cmos: registered platform RTC device (no PNP
device found)
[    0.113824] RAPL PMU detected, hw unit 2^-16 Joules, API unit is 2^-32
Joules, 3 fixed counters 163840 ms ovfl timer
[    0.113861] microcode: CPU0 sig=0x306a9, pf=0x2, revision=0x19
[    0.113914] microcode: Microcode Update Driver: v2.00 <
tigran@aivazian.fsnet.co.uk>, Peter Oruba
[    0.114130] futex hash table entries: 256 (order: 2, 16384 bytes)
[    0.114158] audit: initializing netlink subsys (disabled)
[    0.114176] audit: type=2000 audit(1454626961.628:1): initialized
[    0.114464] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[    0.114489] zbud: loaded
[    0.114637] VFS: Disk quotas dquot_6.5.2
[    0.114650] Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.114703] msgmni has been set to 227
[    0.115097] alg: No test for stdrng (krng)
[    0.115123] Block layer SCSI generic (bsg) driver version 0.4 loaded
(major 252)
[    0.115164] io scheduler noop registered (default)
[    0.115169] io scheduler deadline registered
[    0.115195] io scheduler cfq registered
[    0.115253] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
[    0.115271] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
[    0.115301] intel_idle: does not run on family 6 model 58
[    0.115590] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.115841] Linux agpgart interface v0.103
[    0.115913] i8042: PNP: No PS/2 controller found. Probing ports directly.
[    1.337539] i8042: No controller found
[    1.337715] mousedev: PS/2 mouse device common for all mice
[    1.398030] rtc_cmos rtc_cmos: rtc core: registered rtc_cmos as rtc0
[    1.398084] rtc_cmos: probe of rtc_cmos failed with error -38
[    1.398117] ledtrig-cpu: registered to indicate activity on CPUs
[    1.398136] AMD IOMMUv2 driver by Joerg Roedel <joerg.roedel@amd.com>
[    1.398139] AMD IOMMUv2 functionality not available on this system
[    1.398235] TCP: cubic registered
[    1.398254] NET: Registered protocol family 10
[    1.398432] mip6: Mobile IPv6
[    1.398439] NET: Registered protocol family 17
[    1.398448] mpls_gso: MPLS GSO support
[    1.398454] mce: Unable to init device /dev/mcelog (rc: -5)
[    1.398596] registered taskstats version 1
[    1.398647] xenbus_probe_frontend: Device with no driver:
device/vbd/51714
[    1.398652] xenbus_probe_frontend: Device with no driver:
device/vbd/51713
[    1.398655] xenbus_probe_frontend: Device with no driver: device/vif/0
[    1.398658] xenbus_probe_frontend: Device with no driver: device/pci/0
[    1.398693] rtc_hctosys: unable to open rtc device (rtc0)
[    1.398742] PM: Hibernation image not present or could not be loaded.
[    1.399253] Freeing unused kernel memory: 1204K (ffffffff818ee000 -
ffffffff81a1b000)
[    1.399263] Write protecting the kernel read-only data: 8192k
[    1.401793] Freeing unused kernel memory: 912K (ffff88000151c000 -
ffff880001600000)
[    1.401905] Freeing unused kernel memory: 212K (ffff8800017cb000 -
ffff880001800000)
[    1.420329] systemd-udevd[58]: starting version 215
[    1.420858] random: systemd-udevd urandom read with 3 bits of entropy
available
[    1.443892] xen_netfront: Initialising Xen virtual ethernet driver
[    1.511482] blkfront: xvda2: flush diskcache: enabled; persistent
grants: enabled; indirect descriptors: enabled;
[    1.514156] blkfront: xvda1: flush diskcache: enabled; persistent
grants: enabled; indirect descriptors: enabled;
[    2.104730] PM: Starting manual resume from disk
[    2.104745] PM: Hibernation image partition 202:1 present
[    2.104746] PM: Looking for hibernation image.
[    2.105114] PM: Image not found (code -22)
[    2.105118] PM: Hibernation image not present or could not be loaded.
[    4.299926] EXT4-fs (xvda2): mounted filesystem with ordered data mode.
Opts: (null)
[    4.386272] random: nonblocking pool is initialized
[    5.569639] systemd[1]: systemd 215 running in system mode. (+PAM +AUDIT
+SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
[    5.569746] systemd[1]: Detected virtualization 'xen'.
[    5.569766] systemd[1]: Detected architecture 'x86-64'.
[    6.733819] systemd[1]: Inserted module 'autofs4'
[    6.750629] systemd[1]: Set hostname to <bug>.
[    9.533126] systemd[1]: Cannot add dependency job for unit dbus.socket,
ignoring: Unit dbus.socket failed to load: No such file or directory.
[    9.533160] systemd[1]: Cannot add dependency job for unit
display-manager.service, ignoring: Unit display-manager.service failed to
load: No such file or directory.
[    9.533670] systemd[1]: Starting Forward Password Requests to Wall
Directory Watch.
[    9.533836] systemd[1]: Started Forward Password Requests to Wall
Directory Watch.
[    9.533865] systemd[1]: Expecting device dev-hvc0.device...
[    9.534044] systemd[1]: Starting Remote File Systems (Pre).
[    9.534129] systemd[1]: Reached target Remote File Systems (Pre).
[    9.534183] systemd[1]: Starting Arbitrary Executable File Formats File
System Automount Point.
[    9.534402] systemd[1]: Set up automount Arbitrary Executable File
Formats File System Automount Point.
[    9.534443] systemd[1]: Starting Dispatch Password Requests to Console
Directory Watch.
[    9.534524] systemd[1]: Started Dispatch Password Requests to Console
Directory Watch.
[    9.534546] systemd[1]: Starting Paths.
[    9.534632] systemd[1]: Reached target Paths.
[    9.534661] systemd[1]: Starting Encrypted Volumes.
[    9.534741] systemd[1]: Reached target Encrypted Volumes.
[    9.534763] systemd[1]: Expecting device dev-xvda1.device...
[    9.534845] systemd[1]: Starting Root Slice.
[    9.534953] systemd[1]: Created slice Root Slice.
[    9.534977] systemd[1]: Starting User and Session Slice.
[    9.535108] systemd[1]: Created slice User and Session Slice.
[    9.535132] systemd[1]: Starting Delayed Shutdown Socket.
[    9.535538] systemd[1]: Listening on Delayed Shutdown Socket.
[    9.535565] systemd[1]: Starting /dev/initctl Compatibility Named Pipe.
[    9.535709] systemd[1]: Listening on /dev/initctl Compatibility Named
Pipe.
[    9.535733] systemd[1]: Starting Journal Socket (/dev/log).
[    9.535872] systemd[1]: Listening on Journal Socket (/dev/log).
[    9.535907] systemd[1]: Starting udev Kernel Socket.
[    9.536043] systemd[1]: Listening on udev Kernel Socket.
[    9.536073] systemd[1]: Starting udev Control Socket.
[    9.536187] systemd[1]: Listening on udev Control Socket.
[    9.536214] systemd[1]: Starting Journal Socket.
[    9.536351] systemd[1]: Listening on Journal Socket.
[    9.536388] systemd[1]: Starting System Slice.
[    9.536531] systemd[1]: Created slice System Slice.
[    9.536572] systemd[1]: Starting File System Check on Root Device...
[    9.538068] systemd[1]: Starting system-getty.slice.
[    9.538314] systemd[1]: Created slice system-getty.slice.
[    9.538341] systemd[1]: Starting system-serial\x2dgetty.slice.
[    9.538483] systemd[1]: Created slice system-serial\x2dgetty.slice.
[    9.538565] systemd[1]: Starting Increase datagram queue length...
[    9.542353] systemd[1]: Mounting POSIX Message Queue File System...
[    9.546880] systemd[1]: Mounting Debug File System...
[    9.578669] systemd[1]: Started Set Up Additional Binary Formats.
[    9.578747] systemd[1]: Mounting Huge Pages File System...
[    9.580657] systemd[1]: Starting Create list of required static device
nodes for the current kernel...
[    9.587373] systemd[1]: Starting Load Kernel Modules...
[    9.589167] systemd[1]: Starting udev Coldplug all Devices...
[    9.590713] systemd[1]: Starting Slices.
[    9.590778] systemd[1]: Reached target Slices.
[    9.658770] systemd[1]: Started Increase datagram queue length.
[    9.659677] systemd[1]: Starting Syslog Socket.
[    9.659768] systemd[1]: Listening on Syslog Socket.
[    9.659794] systemd[1]: Starting Sockets.
[    9.659824] systemd[1]: Reached target Sockets.
[    9.659842] systemd[1]: Starting Journal Service...
[    9.661017] systemd[1]: Started Journal Service.
[   10.686460] systemd-udevd[137]: starting version 215
[   11.087720] EXT4-fs (xvda2): re-mounted. Opts: errors=remount-ro
[   11.257117] systemd-journald[124]: Received request to flush runtime
journal from PID 1
[   12.525672] input: PC Speaker as /devices/platform/pcspkr/input/input0
[   12.526446] pcifront pci-0: Installing PCI frontend
[   12.526468] xen:swiotlb_xen: Warning: only able to allocate 4 MB for
software IO TLB
[   12.530788] software IO TLB [mem 0x02000000-0x02400000] (4MB) mapped at
[ffff880002000000-ffff8800023fffff]
[   12.531162] pcifront pci-0: Creating PCI Frontend Bus 0000:00
[   12.531224] pcifront pci-0: PCI host bridge to bus 0000:00
[   12.531231] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
[   12.531236] pci_bus 0000:00: root bus resource [mem
0x00000000-0xfffffffff]
[   12.531242] pci_bus 0000:00: root bus resource [bus 00-ff]
[   12.531509] pci 0000:00:01.0: [1912:0014] type 00 class 0x0c0330
[   12.531897] pci 0000:00:01.0: reg 0x10: [mem 0xfbff0000-0xfbff1fff 64bit]
[   12.536917] pci 0000:00:00.1: [14e4:165f] type 00 class 0x020000
[   12.537273] pci 0000:00:00.1: reg 0x10: [mem 0xfabc0000-0xfabcffff 64bit
pref]
[   12.537651] pci 0000:00:00.1: reg 0x18: [mem 0xfabb0000-0xfabbffff 64bit
pref]
[   12.537903] pci 0000:00:00.1: reg 0x20: [mem 0xfaba0000-0xfabaffff 64bit
pref]
[   12.539995] pcifront pci-0: New device on 0000:00:00.1 found.
[   12.542275] pcifront pci-0: claiming resource 0000:00:01.0/0
[   12.542285] pcifront pci-0: claiming resource 0000:00:00.1/0
[   12.542290] pcifront pci-0: claiming resource 0000:00:00.1/2
[   12.542294] pcifront pci-0: claiming resource 0000:00:00.1/4
[   12.542405] pci 0000:00:01.0: Xen PCI mapped GSI18 to IRQ29
[   12.656749] alg: No test for crc32 (crc32-pclmul)
[   12.905693] intel_rapl: Found RAPL domain package
[   12.905708] intel_rapl: Found RAPL domain core
[   12.956320] Adding 262140k swap on /dev/xvda1.  Priority:-1 extents:1
across:262140k SSFS
[   13.033326] pps_core: LinuxPPS API ver. 1 registered
[   13.033340] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo
Giometti <giometti@linux.it>
[   13.034413] PTP clock support registered
[   13.107656] tg3.c:v3.137 (May 11, 2014)
[   13.107885] tg3 0000:00:00.1: Xen PCI mapped GSI17 to IRQ30
[   13.120967] usbcore: registered new interface driver usbfs
[   13.121269] usbcore: registered new interface driver hub
[   13.121327] usbcore: registered new device driver usb
[   13.136707] tg3 0000:00:00.1 eth1: Tigon3 [partno(N/A) rev 5720000] (PCI
Express) MAC address 34:64:a9:9a:a8:b1
[   13.136726] tg3 0000:00:00.1 eth1: attached PHY is 5720C
(10/100/1000Base-T Ethernet) (WireSpeed[1], EEE[1])
[   13.136734] tg3 0000:00:00.1 eth1: RXcsums[1] LinkChgREG[0] MIirq[0]
ASF[1] TSOcap[1]
[   13.136740] tg3 0000:00:00.1 eth1: dma_rwctrl[00000001] dma_mask[64-bit]
[   13.143564] xen:events: xen_bind_pirq_gsi_to_irq: returning irq 29 for
gsi 18
[   13.143579] xhci_hcd 0000:00:01.0: Xen PCI mapped GSI18 to IRQ29
[   13.143886] xhci_hcd 0000:00:01.0: xHCI Host Controller
[   13.143899] xhci_hcd 0000:00:01.0: new USB bus registered, assigned bus
number 1
[   13.150842] xen:events: Failed to obtain physical IRQ 31
[   13.150863] xen:events: Failed to obtain physical IRQ 32
[   13.150953] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[   13.150961] usb usb1: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[   13.150967] usb usb1: Product: xHCI Host Controller
[   13.150971] usb usb1: Manufacturer: Linux 3.16.0-4-amd64 xhci_hcd
[   13.150976] usb usb1: SerialNumber: 0000:00:01.0
[   13.151281] hub 1-0:1.0: USB hub found
[   13.151303] hub 1-0:1.0: 2 ports detected
[   13.151437] xhci_hcd 0000:00:01.0: xHCI Host Controller
[   13.151446] xhci_hcd 0000:00:01.0: new USB bus registered, assigned bus
number 2
[   13.155915] usb usb2: We don't know the algorithms for LPM for this
host, disabling LPM.
[   13.155962] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003
[   13.155969] usb usb2: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[   13.155975] usb usb2: Product: xHCI Host Controller
[   13.155979] usb usb2: Manufacturer: Linux 3.16.0-4-amd64 xhci_hcd
[   13.155984] usb usb2: SerialNumber: 0000:00:01.0
[   13.157061] hub 2-0:1.0: USB hub found
[   13.157084] hub 2-0:1.0: 2 ports detected
[  240.060071] INFO: task khubd:205 blocked for more than 120 seconds.
[  240.060086]       Not tainted 3.16.0-4-amd64 #1
[  240.060090] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables
this message.
[  240.060095] khubd           D ffff880001d20e78     0   205      2
0x00000000
[  240.060104]  ffff880001d20a20 0000000000000246 0000000000012f00
ffff8800062f3fd8
[  240.060112]  0000000000012f00 ffff880001d20a20 ffff880005dc8148
ffff8800062f3d00
[  240.060119]  ffff880005dc8140 ffff880001d20a20 0000000000000200
ffff880004f83c60
[  240.060126] Call Trace:
[  240.060138]  [<ffffffff8150f969>] ? schedule_timeout+0x229/0x2a0
[  240.060146]  [<ffffffff8118e5a8>] ? kfree+0x118/0x220
[  240.060153]  [<ffffffff815137c6>] ? _raw_spin_lock_irqsave+0x16/0x50
[  240.060162]  [<ffffffff81072d56>] ? lock_timer_base.isra.35+0x26/0x50
[  240.060168]  [<ffffffff810725da>] ? internal_add_timer+0x2a/0x70
[  240.060174]  [<ffffffff81074817>] ? mod_timer+0x127/0x1e0
[  240.060180]  [<ffffffff81510e68>] ? wait_for_completion+0xa8/0x120
[  240.060188]  [<ffffffff81096de0>] ? wake_up_state+0x10/0x10
[  240.060198]  [<ffffffffa0199ecc>] ? xhci_alloc_dev+0xac/0x250 [xhci_hcd]
[  240.060208]  [<ffffffffa016378b>] ? usb_alloc_dev+0x6b/0x2f0 [usbcore]
[  240.060217]  [<ffffffffa016a561>] ? hub_thread+0xcb1/0x1740 [usbcore]
[  240.060225]  [<ffffffff810a7ba0>] ? prepare_to_wait_event+0xf0/0xf0
[  240.060234]  [<ffffffffa01698b0>] ? hub_port_debounce+0x130/0x130
[usbcore]
[  240.060242]  [<ffffffff8108805d>] ? kthread+0xbd/0xe0
[  240.060248]  [<ffffffff81087fa0>] ? kthread_create_on_node+0x180/0x180
[  240.060254]  [<ffffffff81513c18>] ? ret_from_fork+0x58/0x90
[  240.060260]  [<ffffffff81087fa0>] ? kthread_create_on_node+0x180/0x180
[  360.060060] INFO: task khubd:205 blocked for more than 120 seconds.
[  360.060075]       Not tainted 3.16.0-4-amd64 #1
[  360.060080] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables
this message.
[  360.060086] khubd           D ffff880001d20e78     0   205      2
0x00000000
[  360.060095]  ffff880001d20a20 0000000000000246 0000000000012f00
ffff8800062f3fd8
[  360.060104]  0000000000012f00 ffff880001d20a20 ffff880005dc8148
ffff8800062f3d00
[  360.060112]  ffff880005dc8140 ffff880001d20a20 0000000000000200
ffff880004f83c60
[  360.060119] Call Trace:
[  360.060131]  [<ffffffff8150f969>] ? schedule_timeout+0x229/0x2a0
[  360.060139]  [<ffffffff8118e5a8>] ? kfree+0x118/0x220
[  360.060145]  [<ffffffff815137c6>] ? _raw_spin_lock_irqsave+0x16/0x50
[  360.060155]  [<ffffffff81072d56>] ? lock_timer_base.isra.35+0x26/0x50
[  360.060161]  [<ffffffff810725da>] ? internal_add_timer+0x2a/0x70
[  360.060167]  [<ffffffff81074817>] ? mod_timer+0x127/0x1e0
[  360.060173]  [<ffffffff81510e68>] ? wait_for_completion+0xa8/0x120
[  360.060181]  [<ffffffff81096de0>] ? wake_up_state+0x10/0x10
[  360.060190]  [<ffffffffa0199ecc>] ? xhci_alloc_dev+0xac/0x250 [xhci_hcd]
[  360.060200]  [<ffffffffa016378b>] ? usb_alloc_dev+0x6b/0x2f0 [usbcore]
[  360.060209]  [<ffffffffa016a561>] ? hub_thread+0xcb1/0x1740 [usbcore]
[  360.060217]  [<ffffffff810a7ba0>] ? prepare_to_wait_event+0xf0/0xf0
[  360.060225]  [<ffffffffa01698b0>] ? hub_port_debounce+0x130/0x130
[usbcore]
[  360.060233]  [<ffffffff8108805d>] ? kthread+0xbd/0xe0
[  360.060239]  [<ffffffff81087fa0>] ? kthread_create_on_node+0x180/0x180
[  360.060245]  [<ffffffff81513c18>] ? ret_from_fork+0x58/0x90
[  360.060251]  [<ffffffff81087fa0>] ? kthread_create_on_node+0x180/0x180



Next, I upgraded dom0 with the new linux-image deb and rebooted the machine.

dom0 "uname -a":
Linux dom0 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2a~test
(2016-02-04) x86_64 GNU/Linux

domU 'bug' "uname -a":
Linux bug 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2a~test
(2016-02-04) x86_64 GNU/Linux

And now everything seems to work. No more "Failed to obtain physical IRQ",
I can mount my usb flash stick using the passthroughed usb controller. No
call traces in dmesg.

domU 'bug' "dmesg":
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.16.0-4-amd64 (debian-kernel@lists.debian.org)
(gcc version 4.8.4 (Debian 4.8.4-1) ) #1 SMP Debian
3.16.7-ckt20-1+deb8u2a~test (2016-02-04)
[    0.000000] Command line: root=/dev/xvda2 ro elevator=noop
root=/dev/xvda2 ro
[    0.000000] ACPI in unprivileged domain disabled
[    0.000000] 1-1 mapping on 8000->100000
[    0.000000] Set 1015808 page(s) to 1-1 mapping
[    0.000000] 1-1 mapping on 100000->8000000
[    0.000000] e820: BIOS-provided physical RAM map:
[    0.000000] Xen: [mem 0x0000000000000000-0x000000000009ffff] usable
[    0.000000] Xen: [mem 0x00000000000a0000-0x00000000000fffff] reserved
[    0.000000] Xen: [mem 0x0000000000100000-0x0000000007ffffff] usable
[    0.000000] Xen: [mem 0x0000000008000000-0x00000000f1de3fff] unusable
[    0.000000] Xen: [mem 0x00000000f1de4000-0x00000000f1dedfff] ACPI data
[    0.000000] Xen: [mem 0x00000000f1dee000-0x00000000f7ffffff] reserved
[    0.000000] Xen: [mem 0x00000000fec00000-0x00000000feefffff] reserved
[    0.000000] Xen: [mem 0x00000000ff800000-0x00000000ffffffff] reserved
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] DMI not present or invalid.
[    0.000000] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[    0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable
[    0.000000] AGP: No AGP bridge found
[    0.000000] e820: last_pfn = 0x8000 max_arch_pfn = 0x400000000
[    0.000000] Base memory trampoline at [ffff88000009a000] 9a000 size 24576
[    0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff]
[    0.000000]  [mem 0x00000000-0x000fffff] page 4k
[    0.000000] init_memory_mapping: [mem 0x07e00000-0x07ffffff]
[    0.000000]  [mem 0x07e00000-0x07ffffff] page 4k
[    0.000000] BRK [0x01b02000, 0x01b02fff] PGTABLE
[    0.000000] init_memory_mapping: [mem 0x04000000-0x07dfffff]
[    0.000000]  [mem 0x04000000-0x07dfffff] page 4k
[    0.000000] BRK [0x01b03000, 0x01b03fff] PGTABLE
[    0.000000] BRK [0x01b04000, 0x01b04fff] PGTABLE
[    0.000000] BRK [0x01b05000, 0x01b05fff] PGTABLE
[    0.000000] BRK [0x01b06000, 0x01b06fff] PGTABLE
[    0.000000] BRK [0x01b07000, 0x01b07fff] PGTABLE
[    0.000000] init_memory_mapping: [mem 0x00100000-0x03ffffff]
[    0.000000]  [mem 0x00100000-0x03ffffff] page 4k
[    0.000000] RAMDISK: [mem 0x01f18000-0x04a4efff]
[    0.000000] NUMA turned off
[    0.000000] Faking a node at [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x00000000-0x07ffffff]
[    0.000000]   NODE_DATA [mem 0x07fe7000-0x07febfff]
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x00001000-0x00ffffff]
[    0.000000]   DMA32    [mem 0x01000000-0xffffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00001000-0x0009ffff]
[    0.000000]   node   0: [mem 0x00100000-0x07ffffff]
[    0.000000] On node 0 totalpages: 32671
[    0.000000]   DMA zone: 56 pages used for memmap
[    0.000000]   DMA zone: 21 pages reserved
[    0.000000]   DMA zone: 3999 pages, LIFO batch:0
[    0.000000]   DMA32 zone: 392 pages used for memmap
[    0.000000]   DMA32 zone: 28672 pages, LIFO batch:7
[    0.000000] SFI: Simple Firmware Interface v0.81
http://simplefirmware.org
[    0.000000] smpboot: Allowing 1 CPUs, 0 hotplug CPUs
[    0.000000] nr_irqs_gsi: 16
[    0.000000] PM: Registered nosave memory: [mem 0x000a0000-0x000fffff]
[    0.000000] e820: [mem 0xf8000000-0xfebfffff] available for PCI devices
[    0.000000] Booting paravirtualized kernel on Xen
[    0.000000] Xen version: 4.4.1 (preserve-AD)
[    0.000000] setup_percpu: NR_CPUS:512 nr_cpumask_bits:512 nr_cpu_ids:1
nr_node_ids:1
[    0.000000] PERCPU: Embedded 27 pages/cpu @ffff880007c00000 s80896 r8192
d21504 u2097152
[    0.000000] pcpu-alloc: s80896 r8192 d21504 u2097152 alloc=1*2097152
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists in Node order, mobility grouping on.
Total pages: 32202
[    0.000000] Policy zone: DMA32
[    0.000000] Kernel command line: root=/dev/xvda2 ro elevator=noop
root=/dev/xvda2 ro
[    0.000000] PID hash table entries: 512 (order: 0, 4096 bytes)
[    0.000000] xsave: enabled xstate_bv 0x3, cntxt size 0x240
[    0.000000] AGP: Checking aperture...
[    0.000000] AGP: No AGP bridge found
[    0.000000] Calgary: detecting Calgary via BIOS EBDA area
[    0.000000] Calgary: Unable to locate Rio Grande table in EBDA - bailing!
[    0.000000] Memory: 72396K/130684K available (5219K kernel code, 947K
rwdata, 1836K rodata, 1204K init, 840K bss, 58288K reserved)
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU dyntick-idle grace-period acceleration is enabled.
[    0.000000]  RCU restricting CPUs from NR_CPUS=512 to nr_cpu_ids=1.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS:33024 nr_irqs:256 16
[    0.000000] xen:events: Using FIFO-based ABI
[    0.000000] Console: colour dummy device 80x25
[    0.000000] console [tty0] enabled
[    0.000000] console [hvc0] enabled
[    0.000000] Xen: using vcpuop timer interface
[    0.000000] installing Xen timer for CPU 0
[    0.000000] tsc: Detected 2294.850 MHz processor
[    0.004000] Calibrating delay loop (skipped), value calculated using
timer frequency.. 4589.70 BogoMIPS (lpj=9179400)
[    0.004000] pid_max: default: 32768 minimum: 301
[    0.004000] Security Framework initialized
[    0.004000] AppArmor: AppArmor disabled by boot time parameter
[    0.004000] Yama: disabled by default; enable with sysctl kernel.yama.*
[    0.004000] Dentry cache hash table entries: 16384 (order: 5, 131072
bytes)
[    0.004000] Inode-cache hash table entries: 8192 (order: 4, 65536 bytes)
[    0.004000] Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
[    0.004000] Mountpoint-cache hash table entries: 512 (order: 0, 4096
bytes)
[    0.004000] Initializing cgroup subsys memory
[    0.004000] Initializing cgroup subsys devices
[    0.004000] Initializing cgroup subsys freezer
[    0.004000] Initializing cgroup subsys net_cls
[    0.004000] Initializing cgroup subsys blkio
[    0.004000] Initializing cgroup subsys perf_event
[    0.004000] Initializing cgroup subsys net_prio
[    0.004000] ENERGY_PERF_BIAS: Set to 'normal', was 'performance'
ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)
[    0.004000] CPU: Physical Processor ID: 0
[    0.004000] CPU: Processor Core ID: 0
[    0.004000] Last level iTLB entries: 4KB 512, 2MB 8, 4MB 8
Last level dTLB entries: 4KB 512, 2MB 32, 4MB 32, 1GB 0
tlb_flushall_shift: 2
[    0.034866] Freeing SMP alternatives memory: 20K (ffffffff81a1b000 -
ffffffff81a20000)
[    0.037443] ftrace: allocating 21679 entries in 85 pages
[    0.044144] Performance Events: unsupported p6 CPU model 58 no PMU
driver, software events only.
[    0.045610] x86: Booted up 1 node, 1 CPUs
[    0.045660] NMI watchdog: disabled (cpu0): hardware events not enabled
[    0.045739] devtmpfs: initialized
[    0.049008] pinctrl core: initialized pinctrl subsystem
[    0.049089] NET: Registered protocol family 16
[    0.049124] xen:grant_table: Grant tables using version 1 layout
[    0.049147] Grant table initialized
[    0.049432] PCI: setting up Xen PCI frontend stub
[    0.049432] PCI: pci_cache_line_size set to 64 bytes
[    0.049786] ACPI: Interpreter disabled.
[    0.049808] xen:balloon: Initialising balloon driver
[    0.052037] xen_balloon: Initialising balloon driver
[    0.052061] vgaarb: loaded
[    0.052133] PCI: System does not support PCI
[    0.052137] PCI: System does not support PCI
[    0.052288] Switched to clocksource xen
[    0.056226] pnp: PnP ACPI: disabled
[    0.057990] NET: Registered protocol family 2
[    0.058160] TCP established hash table entries: 1024 (order: 1, 8192
bytes)
[    0.058172] TCP bind hash table entries: 1024 (order: 2, 16384 bytes)
[    0.058178] TCP: Hash tables configured (established 1024 bind 1024)
[    0.058193] TCP: reno registered
[    0.058200] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.058207] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.058247] NET: Registered protocol family 1
[    0.058262] PCI: CLS 0 bytes, default 64
[    0.058310] Unpacking initramfs...
[    0.097449] Freeing initrd memory: 44252K (ffff880001f18000 -
ffff880004a4f000)
[    0.099078] platform rtc_cmos: registered platform RTC device (no PNP
device found)
[    0.099138] RAPL PMU detected, hw unit 2^-16 Joules, API unit is 2^-32
Joules, 3 fixed counters 163840 ms ovfl timer
[    0.099170] microcode: CPU0 sig=0x306a9, pf=0x2, revision=0x19
[    0.099218] microcode: Microcode Update Driver: v2.00 <
tigran@aivazian.fsnet.co.uk>, Peter Oruba
[    0.099429] futex hash table entries: 256 (order: 2, 16384 bytes)
[    0.099456] audit: initializing netlink subsys (disabled)
[    0.099475] audit: type=2000 audit(1454627953.001:1): initialized
[    0.099755] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[    0.099779] zbud: loaded
[    0.099917] VFS: Disk quotas dquot_6.5.2
[    0.099930] Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.099981] msgmni has been set to 227
[    0.100254] alg: No test for stdrng (krng)
[    0.100275] Block layer SCSI generic (bsg) driver version 0.4 loaded
(major 252)
[    0.100314] io scheduler noop registered (default)
[    0.100319] io scheduler deadline registered
[    0.100346] io scheduler cfq registered
[    0.100405] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
[    0.100423] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
[    0.100451] intel_idle: does not run on family 6 model 58
[    0.102533] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.102816] Linux agpgart interface v0.103
[    0.102897] i8042: PNP: No PS/2 controller found. Probing ports directly.
[    1.282113] i8042: No controller found
[    1.282447] mousedev: PS/2 mouse device common for all mice
[    1.342255] rtc_cmos rtc_cmos: rtc core: registered rtc_cmos as rtc0
[    1.342308] rtc_cmos: probe of rtc_cmos failed with error -38
[    1.342341] ledtrig-cpu: registered to indicate activity on CPUs
[    1.342361] AMD IOMMUv2 driver by Joerg Roedel <joerg.roedel@amd.com>
[    1.342364] AMD IOMMUv2 functionality not available on this system
[    1.342459] TCP: cubic registered
[    1.342478] NET: Registered protocol family 10
[    1.342654] mip6: Mobile IPv6
[    1.342662] NET: Registered protocol family 17
[    1.342671] mpls_gso: MPLS GSO support
[    1.342678] mce: Unable to init device /dev/mcelog (rc: -5)
[    1.342820] registered taskstats version 1
[    1.342878] xenbus_probe_frontend: Device with no driver:
device/vbd/51714
[    1.342883] xenbus_probe_frontend: Device with no driver:
device/vbd/51713
[    1.342886] xenbus_probe_frontend: Device with no driver: device/vif/0
[    1.342889] xenbus_probe_frontend: Device with no driver: device/pci/0
[    1.342925] rtc_hctosys: unable to open rtc device (rtc0)
[    1.342973] PM: Hibernation image not present or could not be loaded.
[    1.343486] Freeing unused kernel memory: 1204K (ffffffff818ee000 -
ffffffff81a1b000)
[    1.343495] Write protecting the kernel read-only data: 8192k
[    1.346220] Freeing unused kernel memory: 912K (ffff88000151c000 -
ffff880001600000)
[    1.346355] Freeing unused kernel memory: 212K (ffff8800017cb000 -
ffff880001800000)
[    1.368373] systemd-udevd[58]: starting version 215
[    1.369126] random: systemd-udevd urandom read with 3 bits of entropy
available
[    1.395026] xen_netfront: Initialising Xen virtual ethernet driver
[    1.462872] blkfront: xvda2: flush diskcache: enabled; persistent
grants: enabled; indirect descriptors: enabled;
[    1.465338] Setting capacity to 20971520
[    1.465352] xvda2: detected capacity change from 0 to 10737418240
[    1.466851] blkfront: xvda1: flush diskcache: enabled; persistent
grants: enabled; indirect descriptors: enabled;
[    2.927311] PM: Starting manual resume from disk
[    2.927327] PM: Hibernation image partition 202:1 present
[    2.927329] PM: Looking for hibernation image.
[    2.927847] PM: Image not found (code -22)
[    2.927850] PM: Hibernation image not present or could not be loaded.
[    5.327133] random: nonblocking pool is initialized
[    6.193668] EXT4-fs (xvda2): mounted filesystem with ordered data mode.
Opts: (null)
[    9.539459] systemd[1]: systemd 215 running in system mode. (+PAM +AUDIT
+SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
[    9.539564] systemd[1]: Detected virtualization 'xen'.
[    9.539579] systemd[1]: Detected architecture 'x86-64'.
[   10.339528] systemd[1]: Inserted module 'autofs4'
[   10.396195] systemd[1]: Set hostname to <bug>.
[   11.949956] systemd[1]: Cannot add dependency job for unit dbus.socket,
ignoring: Unit dbus.socket failed to load: No such file or directory.
[   11.949986] systemd[1]: Cannot add dependency job for unit
display-manager.service, ignoring: Unit display-manager.service failed to
load: No such file or directory.
[   11.950446] systemd[1]: Starting Forward Password Requests to Wall
Directory Watch.
[   11.950588] systemd[1]: Started Forward Password Requests to Wall
Directory Watch.
[   11.950615] systemd[1]: Expecting device dev-hvc0.device...
[   11.950786] systemd[1]: Starting Remote File Systems (Pre).
[   11.950883] systemd[1]: Reached target Remote File Systems (Pre).
[   11.950934] systemd[1]: Starting Arbitrary Executable File Formats File
System Automount Point.
[   11.951149] systemd[1]: Set up automount Arbitrary Executable File
Formats File System Automount Point.
[   11.951187] systemd[1]: Starting Dispatch Password Requests to Console
Directory Watch.
[   11.951267] systemd[1]: Started Dispatch Password Requests to Console
Directory Watch.
[   11.951288] systemd[1]: Starting Paths.
[   11.951371] systemd[1]: Reached target Paths.
[   11.951394] systemd[1]: Starting Encrypted Volumes.
[   11.951471] systemd[1]: Reached target Encrypted Volumes.
[   11.951493] systemd[1]: Expecting device dev-xvda1.device...
[   11.951570] systemd[1]: Starting Root Slice.
[   11.951673] systemd[1]: Created slice Root Slice.
[   11.951695] systemd[1]: Starting User and Session Slice.
[   11.951819] systemd[1]: Created slice User and Session Slice.
[   11.951842] systemd[1]: Starting Delayed Shutdown Socket.
[   11.952330] systemd[1]: Listening on Delayed Shutdown Socket.
[   11.952357] systemd[1]: Starting /dev/initctl Compatibility Named Pipe.
[   11.952491] systemd[1]: Listening on /dev/initctl Compatibility Named
Pipe.
[   11.952514] systemd[1]: Starting Journal Socket (/dev/log).
[   11.952651] systemd[1]: Listening on Journal Socket (/dev/log).
[   11.952684] systemd[1]: Starting udev Kernel Socket.
[   11.952790] systemd[1]: Listening on udev Kernel Socket.
[   11.952819] systemd[1]: Starting udev Control Socket.
[   11.952930] systemd[1]: Listening on udev Control Socket.
[   11.952957] systemd[1]: Starting Journal Socket.
[   11.953089] systemd[1]: Listening on Journal Socket.
[   11.953127] systemd[1]: Starting System Slice.
[   11.953270] systemd[1]: Created slice System Slice.
[   11.953311] systemd[1]: Starting File System Check on Root Device...
[   11.954749] systemd[1]: Starting system-getty.slice.
[   11.954968] systemd[1]: Created slice system-getty.slice.
[   11.954992] systemd[1]: Starting system-serial\x2dgetty.slice.
[   11.955134] systemd[1]: Created slice system-serial\x2dgetty.slice.
[   11.955226] systemd[1]: Starting Increase datagram queue length...
[   11.956709] systemd[1]: Mounting POSIX Message Queue File System...
[   11.959557] systemd[1]: Mounting Debug File System...
[   12.135725] systemd[1]: Started Set Up Additional Binary Formats.
[   12.135808] systemd[1]: Mounting Huge Pages File System...
[   12.137545] systemd[1]: Starting Create list of required static device
nodes for the current kernel...
[   12.224465] systemd[1]: Starting Load Kernel Modules...
[   12.226092] systemd[1]: Starting udev Coldplug all Devices...
[   12.227596] systemd[1]: Starting Slices.
[   12.227728] systemd[1]: Reached target Slices.
[   12.233385] systemd[1]: Started Increase datagram queue length.
[   12.233708] systemd[1]: Starting Syslog Socket.
[   12.233859] systemd[1]: Listening on Syslog Socket.
[   12.233889] systemd[1]: Starting Sockets.
[   12.233969] systemd[1]: Reached target Sockets.
[   12.233995] systemd[1]: Starting Journal Service...
[   12.235536] systemd[1]: Started Journal Service.
[   14.527439] systemd-udevd[142]: starting version 215
[   14.879135] EXT4-fs (xvda2): re-mounted. Opts: errors=remount-ro
[   15.060743] systemd-journald[124]: Received request to flush runtime
journal from PID 1
[   15.138443] input: PC Speaker as /devices/platform/pcspkr/input/input0
[   15.140288] pcifront pci-0: Installing PCI frontend
[   15.140314] xen:swiotlb_xen: Warning: only able to allocate 4 MB for
software IO TLB
[   15.143506] software IO TLB [mem 0x02400000-0x02800000] (4MB) mapped at
[ffff880002400000-ffff8800027fffff]
[   15.143821] pcifront pci-0: Creating PCI Frontend Bus 0000:00
[   15.144654] pcifront pci-0: PCI host bridge to bus 0000:00
[   15.144666] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
[   15.144672] pci_bus 0000:00: root bus resource [mem
0x00000000-0xfffffffff]
[   15.144679] pci_bus 0000:00: root bus resource [bus 00-ff]
[   15.145145] pci 0000:00:01.0: [1912:0014] type 00 class 0x0c0330
[   15.145589] pci 0000:00:01.0: reg 0x10: [mem 0xfbff0000-0xfbff1fff 64bit]
[   15.150664] pci 0000:00:00.1: [14e4:165f] type 00 class 0x020000
[   15.151307] pci 0000:00:00.1: reg 0x10: [mem 0xfabc0000-0xfabcffff 64bit
pref]
[   15.151733] pci 0000:00:00.1: reg 0x18: [mem 0xfabb0000-0xfabbffff 64bit
pref]
[   15.152192] pci 0000:00:00.1: reg 0x20: [mem 0xfaba0000-0xfabaffff 64bit
pref]
[   15.155084] pcifront pci-0: New device on 0000:00:00.1 found.
[   15.157304] pcifront pci-0: claiming resource 0000:00:01.0/0
[   15.157316] pcifront pci-0: claiming resource 0000:00:00.1/0
[   15.157321] pcifront pci-0: claiming resource 0000:00:00.1/2
[   15.157326] pcifront pci-0: claiming resource 0000:00:00.1/4
[   15.157608] pci 0000:00:01.0: Xen PCI mapped GSI18 to IRQ29
[   15.226457] alg: No test for crc32 (crc32-pclmul)
[   15.365920] intel_rapl: Found RAPL domain package
[   15.365934] intel_rapl: Found RAPL domain core
[   15.416601] usbcore: registered new interface driver usbfs
[   15.416868] usbcore: registered new interface driver hub
[   15.416932] usbcore: registered new device driver usb
[   15.448763] xen:events: xen_bind_pirq_gsi_to_irq: returning irq 29 for
gsi 18
[   15.448783] xhci_hcd 0000:00:01.0: Xen PCI mapped GSI18 to IRQ29
[   15.449088] xhci_hcd 0000:00:01.0: xHCI Host Controller
[   15.449105] xhci_hcd 0000:00:01.0: new USB bus registered, assigned bus
number 1
[   15.461222] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[   15.461245] usb usb1: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[   15.461265] usb usb1: Product: xHCI Host Controller
[   15.461271] usb usb1: Manufacturer: Linux 3.16.0-4-amd64 xhci_hcd
[   15.461276] usb usb1: SerialNumber: 0000:00:01.0
[   15.461635] hub 1-0:1.0: USB hub found
[   15.461660] hub 1-0:1.0: 2 ports detected
[   15.461796] xhci_hcd 0000:00:01.0: xHCI Host Controller
[   15.461808] xhci_hcd 0000:00:01.0: new USB bus registered, assigned bus
number 2
[   15.461855] usb usb2: We don't know the algorithms for LPM for this
host, disabling LPM.
[   15.461885] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003
[   15.461891] usb usb2: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[   15.461897] usb usb2: Product: xHCI Host Controller
[   15.461901] usb usb2: Manufacturer: Linux 3.16.0-4-amd64 xhci_hcd
[   15.461906] usb usb2: SerialNumber: 0000:00:01.0
[   15.462175] hub 2-0:1.0: USB hub found
[   15.462194] hub 2-0:1.0: 2 ports detected
[   15.523663] pps_core: LinuxPPS API ver. 1 registered
[   15.523676] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo
Giometti <giometti@linux.it>
[   15.557171] PTP clock support registered
[   15.642442] tg3.c:v3.137 (May 11, 2014)
[   15.642549] tg3 0000:00:00.1: Xen PCI mapped GSI17 to IRQ32
[   15.673476] tg3 0000:00:00.1 eth1: Tigon3 [partno(N/A) rev 5720000] (PCI
Express) MAC address 34:64:a9:9a:a8:b1
[   15.673494] tg3 0000:00:00.1 eth1: attached PHY is 5720C
(10/100/1000Base-T Ethernet) (WireSpeed[1], EEE[1])
[   15.673502] tg3 0000:00:00.1 eth1: RXcsums[1] LinkChgREG[0] MIirq[0]
ASF[1] TSOcap[1]
[   15.673508] tg3 0000:00:00.1 eth1: dma_rwctrl[00000001] dma_mask[64-bit]
[   15.727471] Adding 262140k swap on /dev/xvda1.  Priority:-1 extents:1
across:262140k SSFS
[   15.776043] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[   15.908336] usb 1-1: New USB device found, idVendor=1307, idProduct=0163
[   15.908350] usb 1-1: New USB device strings: Mfr=1, Product=2,
SerialNumber=3
[   15.908356] usb 1-1: Product: USB Mass Storage Device
[   15.908361] usb 1-1: Manufacturer: USBest Technology
[   15.908366] usb 1-1: SerialNumber: 081104644414d4
[   15.996660] SCSI subsystem initialized
[   16.008836] usb-storage 1-1:1.0: USB Mass Storage device detected
[   16.008940] scsi0 : usb-storage 1-1:1.0
[   16.009037] usbcore: registered new interface driver usb-storage
[   17.009371] scsi 0:0:0:0: Direct-Access
0.00 PQ: 0 ANSI: 2
[   17.011432] scsi 0:0:0:1: CD-ROM
0.00 PQ: 0 ANSI: 0 CCS
[   17.075703] sr0: scsi3-mmc drive: 93x/93x cd/rw xa/form2 cdda tray
[   17.075720] cdrom: Uniform CD-ROM driver Revision: 3.20
[   17.076299] sr 0:0:0:1: Attached scsi CD-ROM sr0
[   17.092662] scsi 0:0:0:0: Attached scsi generic sg0 type 0
[   17.092787] sr 0:0:0:1: Attached scsi generic sg1 type 5
[   17.149685] sd 0:0:0:0: [sda] 1968127 512-byte logical blocks: (1.00
GB/960 MiB)
[   17.151230] sd 0:0:0:0: [sda] Write Protect is off
[   17.151242] sd 0:0:0:0: [sda] Mode Sense: 00 00 00 00
[   17.154123] sd 0:0:0:0: [sda] Asking for cache data failed
[   17.154139] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   17.269987]  sda: sda1 sda2
[   17.272430] sd 0:0:0:0: [sda] Attached SCSI removable disk


dom0 "xl dmesg":
(XEN) Xen version 4.4.1 (Debian 4.4.1-9+deb8u3) (ultrotter@debian.org) (gcc
(Debian 4.9.2-10) 4.9.2) debug=n Wed Nov 25 15:46:22 EET 2015
(XEN) Bootloader: GRUB 2.02~beta2-22+deb8u1
(XEN) Command line: placeholder dom0_mem=1024M,max:1024M
(XEN) Video information:
(XEN)  VGA is text mode 80x25, font 8x16
(XEN)  VBE/DDC methods: none; EDID transfer time: 0 seconds
(XEN)  EDID info not retrieved because no DDC retrieval method detected
(XEN) Disc information:
(XEN)  Found 4 MBR signatures
(XEN)  Found 2 EDD information structures
(XEN) Xen-e820 RAM map:
(XEN)  0000000000000000 - 0000000000099800 (usable)
(XEN)  0000000000099800 - 0000000000099c00 (reserved)
(XEN)  000000000009e000 - 00000000000a0000 (reserved)
(XEN)  00000000000f0000 - 0000000000100000 (reserved)
(XEN)  0000000000100000 - 00000000f1de4000 (usable)
(XEN)  00000000f1de4000 - 00000000f1dee000 (ACPI data)
(XEN)  00000000f1dee000 - 00000000f8000000 (reserved)
(XEN)  00000000fec00000 - 00000000fee10000 (reserved)
(XEN)  00000000ff800000 - 0000000100000000 (reserved)
(XEN)  0000000100000000 - 000000028bfff000 (usable)
(XEN) ACPI: RSDP 000F4F00, 0024 (r2 HP    )
(XEN) ACPI: XSDT F1DE6400, 00B4 (r1 HP     ProLiant        2   �     162E)
(XEN) ACPI: FACP F1DE6540, 00F4 (r3 HP     ProLiant        2   �     162E)
(XEN) ACPI: DSDT F1DE6640, 1C1A (r1 HP         DSDT        1 INTL 20030228)
(XEN) ACPI: FACS F1DE4140, 0040
(XEN) ACPI: SPCR F1DE4180, 0050 (r1 HP     SPCRRBSU        1   �     162E)
(XEN) ACPI: MCFG F1DE4200, 003C (r1 HP     ProLiant        1             0)
(XEN) ACPI: HPET F1DE4240, 0038 (r1 HP     ProLiant        2   �     162E)
(XEN) ACPI: FFFF F1DE4280, 0064 (r2 HP     ProLiant        2   �     162E)
(XEN) ACPI: SPMI F1DE4300, 0040 (r5 HP     ProLiant        1   �     162E)
(XEN) ACPI: ERST F1DE4340, 0230 (r1 HP     ProLiant        1   �     162E)
(XEN) ACPI: APIC F1DE4580, 0252 (r1 HP     ProLiant        2             0)
(XEN) ACPI: FFFF F1DE4800, 0176 (r1 HP     ProLiant        1   �     162E)
(XEN) ACPI: BERT F1DE4980, 0030 (r1 HP     ProLiant        1   �     162E)
(XEN) ACPI: HEST F1DE49C0, 00BC (r1 HP     ProLiant        1   �     162E)
(XEN) ACPI: FFFF F1DE4A80, 1914 (r1 HP     ProLiant        1   �     162E)
(XEN) ACPI: FFFF F1DE63C0, 002D (r1 HP     ProLiant        1             0)
(XEN) ACPI: SSDT F1DE8280, 0137 (r3     HP  CRSPCI0        2   HP        1)
(XEN) ACPI: SSDT F1DE83C0, 0177 (r3     HP   riser0        2 INTL 20030228)
(XEN) ACPI: SSDT F1DE8540, 01E1 (r1     HP      pcc        1 INTL 20090625)
(XEN) ACPI: SSDT F1DE8740, 0377 (r1     HP     pmab        1 INTL 20090625)
(XEN) ACPI: SSDT F1DE8AC0, 0504 (r1 INTEL  PPM RCM  80000001 INTL 20061109)
(XEN) System RAM: 10205MB (10450416kB)
(XEN) Domain heap initialised
(XEN) Processor #0 7:10 APIC version 21
(XEN) Processor #2 7:10 APIC version 21
(XEN) IOAPIC[0]: apic_id 8, version 32, address 0xfec00000, GSI 0-23
(XEN) Enabling APIC mode:  Flat.  Using 1 I/O APICs
(XEN) Using scheduler: SMP Credit Scheduler (credit)
(XEN) Detected 2294.851 MHz processor.
(XEN) Initing memory sharing.
(XEN) xstate_init: using cntxt_size: 0x240 and states: 0x3
(XEN) I/O virtualisation disabled
(XEN) Enabled directed EOI with ioapic_ack_old on!
(XEN) ENABLING IO-APIC IRQs
(XEN)  -> Using old ACK method
(XEN) Platform timer is 14.318MHz HPET
(XEN) Allocated console ring of 16 KiB.
(XEN) VMX: Supported advanced features:
(XEN)  - APIC MMIO access virtualisation
(XEN)  - APIC TPR shadow
(XEN)  - Extended Page Tables (EPT)
(XEN)  - Virtual-Processor Identifiers (VPID)
(XEN)  - Virtual NMI
(XEN)  - MSR direct-access bitmap
(XEN)  - Unrestricted Guest
(XEN) HVM: ASIDs enabled.
(XEN) HVM: VMX enabled
(XEN) HVM: Hardware Assisted Paging (HAP) detected
(XEN) HVM: HAP page sizes: 4kB, 2MB
(XEN) Brought up 2 CPUs
(XEN) *** LOADING DOMAIN 0 ***
(XEN)  Xen  kernel: 64-bit, lsb, compat32
(XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x1f18000
(XEN) PHYSICAL MEMORY ARRANGEMENT:
(XEN)  Dom0 alloc.:   000000023c000000->0000000240000000 (241834 pages to
be allocated)
(XEN)  Init. ramdisk: 000000028aeaa000->000000028bdffc27
(XEN) VIRTUAL MEMORY ARRANGEMENT:
(XEN)  Loaded kernel: ffffffff81000000->ffffffff81f18000
(XEN)  Init. ramdisk: ffffffff81f18000->ffffffff82e6dc27
(XEN)  Phys-Mach map: ffffffff82e6e000->ffffffff8306e000
(XEN)  Start info:    ffffffff8306e000->ffffffff8306e4b4
(XEN)  Page tables:   ffffffff8306f000->ffffffff8308c000
(XEN)  Boot stack:    ffffffff8308c000->ffffffff8308d000
(XEN)  TOTAL:         ffffffff80000000->ffffffff83400000
(XEN)  ENTRY ADDRESS: ffffffff819021f0
(XEN) Dom0 has maximum 2 VCPUs
(XEN) Scrubbing Free RAM:
..........................................................................................done.
(XEN) Initial low memory virq threshold set at 0x4000 pages.
(XEN) Std. Loglevel: Errors and warnings
(XEN) Guest Loglevel: Nothing (Rate-limited: Errors and warnings)
(XEN) Xen is relinquishing VGA console.
(XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input
to Xen)
(XEN) Freed 284kB init memory.
(XEN) mm.c:812: d13: Forcing read-only access to MFN fbff1
(XEN) mm.c:812: d13: Forcing read-only access to MFN fbff1
(XEN) mm.c:812: d13: Forcing read-only access to MFN fbff1
(XEN) mm.c:812: d0: Forcing read-only access to MFN fbff1



Br,
Tommi Airikka


On Thu, Feb 4, 2016 at 10:37 AM, Ian Campbell <ian.campbell@citrix.com>
wrote:

> On Wed, 2016-02-03 at 15:28 -0500, Konrad Rzeszutek Wilk wrote:
> > > > And I wonder if the XEN_DOMCTL_irq_permission aka,
> > > > xc_domain_irq_permission
> > > > had been called. I remember that at some point we missed it for
> > > > Xend..
> > > >
> >
> > False alarm.
> >
> > It was all in Linux. Attached are four patches (the first two
> > are for your issue you discovered).
> > I was wondering if there is a way for you to test them?
>
> Tommy,
>
> Please see the Debian Kernel Handbook and in particular
>
> https://www.debian.org/doc/manuals/debian-kernel-handbook/ch-common-tasks.html#s-common-official
> for instructions on rebuilding the Debian kernel with additional patches.
>
> Ian.
>
>

[-- Attachment #1.2: Type: text/html, Size: 61396 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [BUG] pci-passthrough generates "xen:events: Failed to obtain physical IRQ" for some devices
  2016-02-03 15:26           ` Konrad Rzeszutek Wilk
@ 2016-02-08 17:39             ` Marek Marczykowski-Górecki
  2016-02-09  4:59               ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 15+ messages in thread
From: Marek Marczykowski-Górecki @ 2016-02-08 17:39 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: Tommi Airikka, Ian Campbell, 810379, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1384 bytes --]

On Wed, Feb 03, 2016 at 10:26:58AM -0500, Konrad Rzeszutek Wilk wrote:
> On Wed, Feb 03, 2016 at 03:22:30PM +0100, Marek Marczykowski-Górecki wrote:
> > On Mon, Feb 01, 2016 at 09:50:53AM -0500, Konrad Rzeszutek Wilk wrote:
> > > > The second bullet looks at first pretty interesting from this PoV,
> > > > see http://xenbits.xen.org/xsa/advisory-157.html for info on the XSA and
> > > > the various patches. Konrad is on the CC already so hopefully he has some
> > > > ideas.
> > > 
> > > Thanks. I will try to reproduce this with the upstream kernel first as
> > > those patches are there.
> > 
> > According to one Qubes OS user report[1], the bug was introduced between
> > version, which differs only by XSA-155 patches (including one for
> > pciback), especially not XSA-157. 
> > Maybe on some code path, some value is not copied back to pdev->sh_info->op?
> 
> I found two bugs (attached the draft not-compiled patches). Upstream
> wise I seem to be tripping over another issue.
> 
> There is also some more work required in there to fix the MSI-x enable op.

What exactly do you have in mind here? That four patches in your next
email? Or something not yet fixed?

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [BUG] pci-passthrough generates "xen:events: Failed to obtain physical IRQ" for some devices
  2016-02-08 17:39             ` Marek Marczykowski-Górecki
@ 2016-02-09  4:59               ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 15+ messages in thread
From: Konrad Rzeszutek Wilk @ 2016-02-09  4:59 UTC (permalink / raw)
  To: Marek Marczykowski-Górecki
  Cc: Tommi Airikka, Ian Campbell, 810379, xen-devel

On Mon, Feb 08, 2016 at 06:39:17PM +0100, Marek Marczykowski-Górecki wrote:
> On Wed, Feb 03, 2016 at 10:26:58AM -0500, Konrad Rzeszutek Wilk wrote:
> > On Wed, Feb 03, 2016 at 03:22:30PM +0100, Marek Marczykowski-Górecki wrote:
> > > On Mon, Feb 01, 2016 at 09:50:53AM -0500, Konrad Rzeszutek Wilk wrote:
> > > > > The second bullet looks at first pretty interesting from this PoV,
> > > > > see http://xenbits.xen.org/xsa/advisory-157.html for info on the XSA and
> > > > > the various patches. Konrad is on the CC already so hopefully he has some
> > > > > ideas.
> > > > 
> > > > Thanks. I will try to reproduce this with the upstream kernel first as
> > > > those patches are there.
> > > 
> > > According to one Qubes OS user report[1], the bug was introduced between
> > > version, which differs only by XSA-155 patches (including one for
> > > pciback), especially not XSA-157. 
> > > Maybe on some code path, some value is not copied back to pdev->sh_info->op?
> > 
> > I found two bugs (attached the draft not-compiled patches). Upstream
> > wise I seem to be tripping over another issue.
> > 
> > There is also some more work required in there to fix the MSI-x enable op.
> 
> What exactly do you have in mind here? That four patches in your next
> email? Or something not yet fixed?

I posted it at some point. It was that the MSI-X enable op stashes the
error value in op->value. But 'op->value' is an unsigned int so the
value ends up being 0xfffffe or such. And the other PV frontends only
check for !0 - and manufacture their own value (-EINVAL).

Hence I want to update the pciff.h .. Oh here is the patch:
Oh man. A year?!

Anyhow this can be posted as a cleanup patch seperately of the
bug-fixes.

commit 393be47782bca7a24d3e365448d4d3d1a303abfe
Author: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date:   Wed Apr 1 17:01:26 2015 -0400

    xen/pcifront/pciback: Update pciif.h with ->err and ->result values.
    
    The '->err' should contain only the XEN_PCI_ERR_* type values.
    The '->result' may contain -EXX values or any other value
    that the XEN_PCI_OP_* deems appropiate.
    
    As such update the header and also the implementations.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    
    Conflicts:
    	drivers/xen/xen-pciback/pciback_ops.c
    
    Conflicts:
    	drivers/xen/xen-pciback/pciback_ops.c

diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
index b1ffebe..353c8a2 100644
--- a/drivers/pci/xen-pcifront.c
+++ b/drivers/pci/xen-pcifront.c
@@ -297,7 +297,7 @@ static int pci_frontend_enable_msix(struct pci_dev *dev,
 	} else {
 		dev_err(&dev->dev, "enable msix get err %x\n", err);
 	}
-	return err;
+	return err ? -EINVAL : 0;
 }
 
 static void pci_frontend_disable_msix(struct pci_dev *dev)
diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c
index fa2b222..4db6c19 100644
--- a/drivers/xen/xen-pciback/pciback_ops.c
+++ b/drivers/xen/xen-pciback/pciback_ops.c
@@ -266,7 +266,7 @@ error:
 		pr_warn_ratelimited("%s: error enabling MSI-X for guest %u: err %d!\n",
 				    pci_name(dev), pdev->xdev->otherend_id,
 				    result);
-	return result > 0 ? 0 : result;
+	return result >= 0 ? 0 : XEN_PCI_ERR_op_failed;
 }
 
 #endif
diff --git a/include/xen/interface/io/pciif.h b/include/xen/interface/io/pciif.h
index d9922ae..c8b674f 100644
--- a/include/xen/interface/io/pciif.h
+++ b/include/xen/interface/io/pciif.h
@@ -70,7 +70,7 @@ struct xen_pci_op {
 	/* IN: what action to perform: XEN_PCI_OP_* */
 	uint32_t cmd;
 
-	/* OUT: will contain an error number (if any) from errno.h */
+	/* OUT: will contain an XEN_PCI_ERR_* number. */
 	int32_t err;
 
 	/* IN: which device to touch */
@@ -82,7 +82,9 @@ struct xen_pci_op {
 	int32_t offset;
 	int32_t size;
 
-	/* IN/OUT: Contains the result after a READ or the value to WRITE */
+	/* IN/OUT: Contains the result after a READ or the value to WRITE.
+	 * If the err does not have XEN_PCI_ERR_success, depending on
+	 * XEN_PCI_OP_* might have the errno value. */
 	uint32_t value;
 	/* IN: Contains extra infor for this operation */
 	uint32_t info;


> 
> -- 
> Best Regards,
> Marek Marczykowski-Górecki
> Invisible Things Lab
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [BUG] pci-passthrough generates "xen:events: Failed to obtain physical IRQ" for some devices
  2016-02-04 23:35         ` Tommi Airikka
@ 2016-02-12 21:36           ` Konrad Rzeszutek Wilk
  2016-02-12 21:53             ` Tommi Airikka
  0 siblings, 1 reply; 15+ messages in thread
From: Konrad Rzeszutek Wilk @ 2016-02-12 21:36 UTC (permalink / raw)
  To: Tommi Airikka; +Cc: Ian Campbell, 810379, xen-devel

On Fri, Feb 05, 2016 at 12:35:10AM +0100, Tommi Airikka wrote:
> Hi,
> 
> I patched the deb8u2 source with all four patches and built a new deb.
.. snip..
> 
> Next, I upgraded dom0 with the new linux-image deb and rebooted the machine.
> 
> dom0 "uname -a":
> Linux dom0 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2a~test
> (2016-02-04) x86_64 GNU/Linux
> 
> domU 'bug' "uname -a":
> Linux bug 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2a~test
> (2016-02-04) x86_64 GNU/Linux
> 
> And now everything seems to work. No more "Failed to obtain physical IRQ",
> I can mount my usb flash stick using the passthroughed usb controller. No
> call traces in dmesg.

Awesome!

Are you OK if I put 'Tested-by' on the patches from you?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [BUG] pci-passthrough generates "xen:events: Failed to obtain physical IRQ" for some devices
  2016-02-12 21:36           ` Konrad Rzeszutek Wilk
@ 2016-02-12 21:53             ` Tommi Airikka
  0 siblings, 0 replies; 15+ messages in thread
From: Tommi Airikka @ 2016-02-12 21:53 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: Ian Campbell, 810379, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 842 bytes --]

Yes, you can put the 'Tested-by' from me, I'm perfectly fine with that.

Thank you for your help!

Br,
Tommi
On Fri, Feb 05, 2016 at 12:35:10AM +0100, Tommi Airikka wrote:
> Hi,
>
> I patched the deb8u2 source with all four patches and built a new deb.
.. snip..
>
> Next, I upgraded dom0 with the new linux-image deb and rebooted the
machine.
>
> dom0 "uname -a":
> Linux dom0 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2a~test
> (2016-02-04) x86_64 GNU/Linux
>
> domU 'bug' "uname -a":
> Linux bug 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2a~test
> (2016-02-04) x86_64 GNU/Linux
>
> And now everything seems to work. No more "Failed to obtain physical IRQ",
> I can mount my usb flash stick using the passthroughed usb controller. No
> call traces in dmesg.

Awesome!

Are you OK if I put 'Tested-by' on the patches from you?

[-- Attachment #1.2: Type: text/html, Size: 1218 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [BUG] pci-passthrough generates "xen:events: Failed to obtain physical IRQ" for some devices
@ 2016-01-23 16:12 Tommi Airikka
  0 siblings, 0 replies; 15+ messages in thread
From: Tommi Airikka @ 2016-01-23 16:12 UTC (permalink / raw)
  To: xen-devel; +Cc: 810379


[-- Attachment #1.1: Type: text/plain, Size: 36916 bytes --]

Xen developers,

After an upgrade of my Debian Jessie dom0 and domUs, my passthroughed
NIC stopped working.
This bug was probably introduced in Debian Jessie sometime
between 2015-12-30 and 2016-01-08 as 2015-12-30 as 2015-12-30 was the
last time I upgraded without any problems according to my dpkg.log.

This bug has also been reported to Debian Bug
(https://bugs.debian.org/810379), where I got instructions to contact you
directly.
The Debian Bug List is CC'd to keep the Debian Bug in the loop.


I created a new jessie domU (named "bug") and tried to passthrough some
PCI devices and found that both USB3 host controller and tg3 NIC generated
these lines in domU dmesg:

xen:events: Failed to obtain physical IRQ 31
xen:events: Failed to obtain physical IRQ 32
xen:events: Failed to obtain physical IRQ 33

And from the dom0 "xl dmesg":
(XEN) mm.c:812: d13: Forcing read-only access to MFN fbff1
(XEN) mm.c:812: d13: Forcing read-only access to MFN fbff1
(XEN) mm.c:812: d13: Forcing read-only access to MFN fbff1
(XEN) mm.c:812: d0: Forcing read-only access to MFN fbff1
(XEN) mm.c:812: d13: Forcing read-only access to MFN faba0
(XEN) mm.c:812: d0: Forcing read-only access to MFN faba0


domU "bug" "lspci -vn":
00:00.1 0200: 14e4:165f
        Subsystem: 103c:2133
        Flags: bus master, fast devsel, latency 0, IRQ 30
        Memory at fabc0000 (64-bit, prefetchable) [size=64K]
        Memory at fabb0000 (64-bit, prefetchable) [size=64K]
        Memory at faba0000 (64-bit, prefetchable) [size=64K]
        Expansion ROM at <ignored> [disabled]
        Capabilities: [48] Power Management version 3
        Capabilities: [50] Vital Product Data
        Capabilities: [58] MSI: Enable- Count=1/8 Maskable- 64bit+
        Capabilities: [a0] MSI-X: Enable+ Count=17 Masked-
        Capabilities: [ac] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [13c] Device Serial Number 00-00-34-64-a9-9a-a8-b1
        Capabilities: [150] Power Budgeting <?>
        Capabilities: [160] Virtual Channel
        Kernel driver in use: tg3

00:01.0 0c03: 1912:0014 (rev 03) (prog-if 30 [XHCI])
        Subsystem: 103c:1996
        Flags: bus master, fast devsel, latency 0, IRQ 29
        Memory at fbff0000 (64-bit, non-prefetchable) [size=8K]
        Capabilities: [50] Power Management version 3
        Capabilities: [70] MSI: Enable- Count=1/8 Maskable- 64bit+
        Capabilities: [90] MSI-X: Enable+ Count=8 Masked-
        Capabilities: [a0] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [150] Latency Tolerance Reporting
        Kernel driver in use: xhci_hcd

domU "bug" "cat /proc/interrupts":
           CPU0
 16:      25114  xen-percpu-virq      timer0
 17:          0  xen-percpu-ipi       resched0
 18:          0  xen-percpu-ipi       callfunc0
 19:          0  xen-percpu-virq      debug0
 20:          0  xen-percpu-ipi       callfuncsingle0
 21:          0  xen-percpu-ipi       irqwork0
 22:        473   xen-dyn-event     xenbus
 23:         96   xen-dyn-event     hvc_console
 24:       8811   xen-dyn-event     blkif
 25:        255   xen-dyn-event     blkif
 26:       3045   xen-dyn-event     eth0-q0-tx
 27:       5650   xen-dyn-event     eth0-q0-rx
 28:         93   xen-dyn-event     pcifront
 31:          0  xen-pirq-pcifront-msi-x  xhci_hcd
 32:          0  xen-pirq-pcifront-msi-x  xhci_hcd
 33:          0  xen-pirq-pcifront-msi-x  eth1
NMI:          0   Non-maskable interrupts
LOC:          0   Local timer interrupts
SPU:          0   Spurious interrupts
PMI:          0   Performance monitoring interrupts
IWI:          0   IRQ work interrupts
RTR:          0   APIC ICR read retries
RES:          0   Rescheduling interrupts
CAL:          0   Function call interrupts
TLB:          0   TLB shootdowns
TRM:          0   Thermal event interrupts
THR:          0   Threshold APIC interrupts
MCE:          0   Machine check exceptions
MCP:          0   Machine check polls
HYP:      43966   Hypervisor callback interrupts
ERR:          0
MIS:          0

domU "bug" "dmesg":
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.16.0-4-amd64 (debian-kernel at
lists.debian.org) (gcc version 4.8.4 (Debian 4.8.4-1)
[    0.000000] Command line: root=/dev/xvda2 ro elevator=noop
root=/dev/xvda2 ro
[    0.000000] ACPI in unprivileged domain disabled
[    0.000000] 1-1 mapping on 8000->100000
[    0.000000] Set 1015808 page(s) to 1-1 mapping
[    0.000000] 1-1 mapping on 100000->8000000
[    0.000000] e820: BIOS-provided physical RAM map:
[    0.000000] Xen: [mem 0x0000000000000000-0x000000000009ffff] usable
[    0.000000] Xen: [mem 0x00000000000a0000-0x00000000000fffff] reserved
[    0.000000] Xen: [mem 0x0000000000100000-0x0000000007ffffff] usable
[    0.000000] Xen: [mem 0x0000000008000000-0x00000000f1de3fff] unusable
[    0.000000] Xen: [mem 0x00000000f1de4000-0x00000000f1dedfff] ACPI data
[    0.000000] Xen: [mem 0x00000000f1dee000-0x00000000f7ffffff] reserved
[    0.000000] Xen: [mem 0x00000000fec00000-0x00000000feefffff] reserved
[    0.000000] Xen: [mem 0x00000000ff800000-0x00000000ffffffff] reserved
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] DMI not present or invalid.
[    0.000000] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[    0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable
[    0.000000] AGP: No AGP bridge found
[    0.000000] e820: last_pfn = 0x8000 max_arch_pfn = 0x400000000
[    0.000000] Base memory trampoline at [ffff88000009a000] 9a000 size 24576
[    0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff]
[    0.000000]  [mem 0x00000000-0x000fffff] page 4k
[    0.000000] init_memory_mapping: [mem 0x07e00000-0x07ffffff]
[    0.000000]  [mem 0x07e00000-0x07ffffff] page 4k
[    0.000000] BRK [0x01b02000, 0x01b02fff] PGTABLE
[    0.000000] init_memory_mapping: [mem 0x04000000-0x07dfffff]
[    0.000000]  [mem 0x04000000-0x07dfffff] page 4k
[    0.000000] BRK [0x01b03000, 0x01b03fff] PGTABLE
[    0.000000] BRK [0x01b04000, 0x01b04fff] PGTABLE
[    0.000000] BRK [0x01b05000, 0x01b05fff] PGTABLE
[    0.000000] BRK [0x01b06000, 0x01b06fff] PGTABLE
[    0.000000] BRK [0x01b07000, 0x01b07fff] PGTABLE
[    0.000000] init_memory_mapping: [mem 0x00100000-0x03ffffff]
[    0.000000]  [mem 0x00100000-0x03ffffff] page 4k
[    0.000000] RAMDISK: [mem 0x01f18000-0x049bffff]
[    0.000000] NUMA turned off
[    0.000000] Faking a node at [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x00000000-0x07ffffff]
[    0.000000]   NODE_DATA [mem 0x07fe7000-0x07febfff]
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x00001000-0x00ffffff]
[    0.000000]   DMA32    [mem 0x01000000-0xffffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00001000-0x0009ffff]
[    0.000000]   node   0: [mem 0x00100000-0x07ffffff]
[    0.000000] On node 0 totalpages: 32671
[    0.000000]   DMA zone: 56 pages used for memmap
[    0.000000]   DMA zone: 21 pages reserved
[    0.000000]   DMA zone: 3999 pages, LIFO batch:0
[    0.000000]   DMA32 zone: 392 pages used for memmap
[    0.000000]   DMA32 zone: 28672 pages, LIFO batch:7
[    0.000000] SFI: Simple Firmware Interface v0.81
http://simplefirmware.org
[    0.000000] smpboot: Allowing 1 CPUs, 0 hotplug CPUs
[    0.000000] nr_irqs_gsi: 16
[    0.000000] PM: Registered nosave memory: [mem 0x000a0000-0x000fffff]
[    0.000000] e820: [mem 0xf8000000-0xfebfffff] available for PCI devices
[    0.000000] Booting paravirtualized kernel on Xen
[    0.000000] Xen version: 4.4.1 (preserve-AD)
[    0.000000] setup_percpu: NR_CPUS:512 nr_cpumask_bits:512 nr_cpu_ids:1
nr_node_ids:1
[    0.000000] PERCPU: Embedded 27 pages/cpu @ffff880007c00000 s80896 r8192
d21504 u2097152
[    0.000000] pcpu-alloc: s80896 r8192 d21504 u2097152 alloc=1*2097152
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists in Node order, mobility grouping on.
Total pages: 32202
[    0.000000] Policy zone: DMA32
[    0.000000] Kernel command line: root=/dev/xvda2 ro elevator=noop
root=/dev/xvda2 ro
[    0.000000] PID hash table entries: 512 (order: 0, 4096 bytes)
[    0.000000] xsave: enabled xstate_bv 0x3, cntxt size 0x240
[    0.000000] AGP: Checking aperture...
[    0.000000] AGP: No AGP bridge found
[    0.000000] Calgary: detecting Calgary via BIOS EBDA area
[    0.000000] Calgary: Unable to locate Rio Grande table in EBDA - bailing!
[    0.000000] Memory: 72968K/130684K available (5219K kernel code, 947K
rwdata, 1836K rodata, 1204K init, 840K
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU dyntick-idle grace-period acceleration is enabled.
[    0.000000]  RCU restricting CPUs from NR_CPUS=512 to nr_cpu_ids=1.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS:33024 nr_irqs:256 16
[    0.000000] xen:events: Using FIFO-based ABI
[    0.000000] Console: colour dummy device 80x25
[    0.000000] console [tty0] enabled
[    0.000000] console [hvc0] enabled
[    0.000000] Xen: using vcpuop timer interface
[    0.000000] installing Xen timer for CPU 0
[    0.000000] tsc: Detected 2294.838 MHz processor
[    0.004000] Calibrating delay loop (skipped), value calculated using
timer frequency.. 4589.67 BogoMIPS (lpj=
[    0.004000] pid_max: default: 32768 minimum: 301
[    0.004000] Security Framework initialized
[    0.004000] AppArmor: AppArmor disabled by boot time parameter
[    0.004000] Yama: disabled by default; enable with sysctl kernel.yama.*
[    0.004000] Dentry cache hash table entries: 16384 (order: 5, 131072
bytes)
[    0.004000] Inode-cache hash table entries: 8192 (order: 4, 65536 bytes)
[    0.004000] Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
[    0.004000] Mountpoint-cache hash table entries: 512 (order: 0, 4096
bytes)
[    0.004000] Initializing cgroup subsys memory
[    0.004000] Initializing cgroup subsys devices
[    0.004000] Initializing cgroup subsys freezer
[    0.004000] Initializing cgroup subsys net_cls
[    0.004000] Initializing cgroup subsys blkio
[    0.004000] Initializing cgroup subsys perf_event
[    0.004000] Initializing cgroup subsys net_prio
[    0.004000] ENERGY_PERF_BIAS: Set to 'normal', was 'performance'
ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)
[    0.004000] CPU: Physical Processor ID: 0
[    0.004000] CPU: Processor Core ID: 0
[    0.004000] Last level iTLB entries: 4KB 512, 2MB 8, 4MB 8
Last level dTLB entries: 4KB 512, 2MB 32, 4MB 32, 1GB 0
tlb_flushall_shift: 2
[    0.036441] Freeing SMP alternatives memory: 20K (ffffffff81a1b000 -
ffffffff81a20000)
[    0.040068] ftrace: allocating 21679 entries in 85 pages
[    0.048193] Performance Events: unsupported p6 CPU model 58 no PMU
driver, software events only.
[    0.050513] x86: Booted up 1 node, 1 CPUs
[    0.050738] NMI watchdog: disabled (cpu0): hardware events not enabled
[    0.050849] devtmpfs: initialized
[    0.055640] pinctrl core: initialized pinctrl subsystem
[    0.055761] NET: Registered protocol family 16
[    0.055786] xen:grant_table: Grant tables using version 1 layout
[    0.055811] Grant table initialized
[    0.056754] PCI: setting up Xen PCI frontend stub
[    0.056764] PCI: pci_cache_line_size set to 64 bytes
[    0.057845] ACPI: Interpreter disabled.
[    0.057869] xen:balloon: Initialising balloon driver
[    0.057891] xen_balloon: Initialising balloon driver
[    0.057891] vgaarb: loaded
[    0.057891] PCI: System does not support PCI
[    0.057891] PCI: System does not support PCI
[    0.060186] Switched to clocksource xen
[    0.066155] pnp: PnP ACPI: disabled
[    0.068881] NET: Registered protocol family 2
[    0.069126] TCP established hash table entries: 1024 (order: 1, 8192
bytes)
[    0.069142] TCP bind hash table entries: 1024 (order: 2, 16384 bytes)
[    0.069150] TCP: Hash tables configured (established 1024 bind 1024)
[    0.069170] TCP: reno registered
[    0.069178] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.069188] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.069240] NET: Registered protocol family 1
[    0.069260] PCI: CLS 0 bytes, default 64
[    0.069323] Unpacking initramfs...
[    0.124178] Freeing initrd memory: 43680K (ffff880001f18000 -
ffff8800049c0000)
[    0.126623] platform rtc_cmos: registered platform RTC device (no PNP
device found)
[    0.126711] RAPL PMU detected, hw unit 2^-16 Joules, API unit is 2^-32
Joules, 3 fixed counters 163840 ms ovf
[    0.126757] microcode: CPU0 sig=0x306a9, pf=0x2, revision=0x19
[    0.126826] microcode: Microcode Update Driver: v2.00 <tigran at
aivazian.fsnet.co.uk>, Peter Oruba
[    0.127132] futex hash table entries: 256 (order: 2, 16384 bytes)
[    0.127170] audit: initializing netlink subsys (disabled)
[    0.127196] audit: type=2000 audit(1452265722.038:1): initialized
[    0.128047] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[    0.128087] zbud: loaded
[    0.128295] VFS: Disk quotas dquot_6.5.2
[    0.128314] Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.128403] msgmni has been set to 227
[    0.128778] alg: No test for stdrng (krng)
[    0.128809] Block layer SCSI generic (bsg) driver version 0.4 loaded
(major 252)
[    0.128867] io scheduler noop registered (default)
[    0.128875] io scheduler deadline registered
[    0.128912] io scheduler cfq registered
[    0.128995] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
[    0.129021] pciehp: PCI Express Hot Plug Controller Driver version: 0.4
[    0.129062] intel_idle: does not run on family 6 model 58
[    0.129466] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.129819] Linux agpgart interface v0.103
[    0.129918] i8042: PNP: No PS/2 controller found. Probing ports directly.
[    1.373182] i8042: No controller found
[    1.373401] mousedev: PS/2 mouse device common for all mice
[    1.460855] rtc_cmos rtc_cmos: rtc core: registered rtc_cmos as rtc0
[    1.460918] rtc_cmos: probe of rtc_cmos failed with error -38
[    1.460953] ledtrig-cpu: registered to indicate activity on CPUs
[    1.460973] AMD IOMMUv2 driver by Joerg Roedel <joerg.roedel at amd.com>
[    1.460977] AMD IOMMUv2 functionality not available on this system
[    1.461076] TCP: cubic registered
[    1.461097] NET: Registered protocol family 10
[    1.461286] mip6: Mobile IPv6
[    1.461295] NET: Registered protocol family 17
[    1.461303] mpls_gso: MPLS GSO support
[    1.461310] mce: Unable to init device /dev/mcelog (rc: -5)
[    1.461463] registered taskstats version 1
[    1.461516] xenbus_probe_frontend: Device with no driver:
device/vbd/51714
[    1.461521] xenbus_probe_frontend: Device with no driver:
device/vbd/51713
[    1.461524] xenbus_probe_frontend: Device with no driver: device/vif/0
[    1.461527] xenbus_probe_frontend: Device with no driver: device/pci/0
[    1.461569] rtc_hctosys: unable to open rtc device (rtc0)
[    1.461620] PM: Hibernation image not present or could not be loaded.
[    1.462130] Freeing unused kernel memory: 1204K (ffffffff818ee000 -
ffffffff81a1b000)
[    1.462137] Write protecting the kernel read-only data: 8192k
[    1.464662] Freeing unused kernel memory: 912K (ffff88000151c000 -
ffff880001600000)
[    1.464765] Freeing unused kernel memory: 212K (ffff8800017cb000 -
ffff880001800000)
[    1.484305] systemd-udevd[58]: starting version 215
[    1.484846] random: systemd-udevd urandom read with 4 bits of entropy
available
[    1.508462] xen_netfront: Initialising Xen virtual ethernet driver
[    1.565647] blkfront: xvda2: flush diskcache: enabled; persistent
grants: enabled; indirect descriptors: enab
[    1.568041] blkfront: xvda1: flush diskcache: enabled; persistent
grants: enabled; indirect descriptors: enab
[    9.699548] EXT4-fs (xvda2): mounted filesystem with ordered data mode.
Opts: (null)
[   10.030680] random: nonblocking pool is initialized
[   11.587594] systemd[1]: systemd 215 running in system mode. (+PAM +AUDIT
+SELINUX +IMA +SYSVINIT +LIBCRYPTSET
[   11.587689] systemd[1]: Detected virtualization 'xen'.
[   11.587704] systemd[1]: Detected architecture 'x86-64'.
[   12.754742] systemd[1]: Inserted module 'autofs4'
[   12.791362] systemd[1]: Set hostname to <bug>.
[   16.336333] systemd[1]: Cannot add dependency job for unit dbus.socket,
ignoring: Unit dbus.socket failed to
[   16.336369] systemd[1]: Cannot add dependency job for unit
display-manager.service, ignoring: Unit display-ma
[   16.336879] systemd[1]: Starting Forward Password Requests to Wall
Directory Watch.
[   16.337039] systemd[1]: Started Forward Password Requests to Wall
Directory Watch.
[   16.337067] systemd[1]: Expecting device dev-hvc0.device...
[   16.337241] systemd[1]: Starting Remote File Systems (Pre).
[   16.337329] systemd[1]: Reached target Remote File Systems (Pre).
[   16.337384] systemd[1]: Starting Arbitrary Executable File Formats File
System Automount Point.
[   16.337608] systemd[1]: Set up automount Arbitrary Executable File
Formats File System Automount Point.
[   16.337649] systemd[1]: Starting Dispatch Password Requests to Console
Directory Watch.
[   16.337733] systemd[1]: Started Dispatch Password Requests to Console
Directory Watch.
[   16.337755] systemd[1]: Starting Paths.
[   16.337842] systemd[1]: Reached target Paths.
[   16.337866] systemd[1]: Starting Encrypted Volumes.
[   16.337947] systemd[1]: Reached target Encrypted Volumes.
[   16.337970] systemd[1]: Expecting device dev-xvda1.device...
[   16.338059] systemd[1]: Starting Root Slice.
[   16.338166] systemd[1]: Created slice Root Slice.
[   16.338191] systemd[1]: Starting User and Session Slice.
[   16.338322] systemd[1]: Created slice User and Session Slice.
[   16.338346] systemd[1]: Starting Delayed Shutdown Socket.
[   16.338812] systemd[1]: Listening on Delayed Shutdown Socket.
[   16.338840] systemd[1]: Starting /dev/initctl Compatibility Named Pipe.
[   16.338979] systemd[1]: Listening on /dev/initctl Compatibility Named
Pipe.
[   16.339002] systemd[1]: Starting Journal Socket (/dev/log).
[   16.339141] systemd[1]: Listening on Journal Socket (/dev/log).
[   16.339175] systemd[1]: Starting udev Kernel Socket.
[   16.339280] systemd[1]: Listening on udev Kernel Socket.
[   16.339311] systemd[1]: Starting udev Control Socket.
[   16.339425] systemd[1]: Listening on udev Control Socket.
[   16.339454] systemd[1]: Starting Journal Socket.
[   16.339594] systemd[1]: Listening on Journal Socket.
[   16.339632] systemd[1]: Starting System Slice.
[   16.339776] systemd[1]: Created slice System Slice.
[   16.339819] systemd[1]: Starting File System Check on Root Device...
[   16.341351] systemd[1]: Starting system-getty.slice.
[   16.341580] systemd[1]: Created slice system-getty.slice.
[   16.341606] systemd[1]: Starting system-serial\x2dgetty.slice.
[   16.341751] systemd[1]: Created slice system-serial\x2dgetty.slice.
[   16.341832] systemd[1]: Starting Increase datagram queue length...
[   16.343890] systemd[1]: Mounting POSIX Message Queue File System...
[   16.349573] systemd[1]: Mounting Debug File System...
[   16.386487] systemd[1]: Started Set Up Additional Binary Formats.
[   16.386567] systemd[1]: Mounting Huge Pages File System...
[   16.388234] systemd[1]: Starting Create list of required static device
nodes for the current kernel...
[   16.420891] systemd[1]: Starting Load Kernel Modules...
[   16.422455] systemd[1]: Starting udev Coldplug all Devices...
[   16.423981] systemd[1]: Starting Slices.
[   16.424152] systemd[1]: Reached target Slices.
[   16.526927] systemd[1]: Mounted Huge Pages File System.
[   16.527472] systemd[1]: Mounted POSIX Message Queue File System.
[   16.528053] systemd[1]: Mounted Debug File System.
[   16.539437] systemd[1]: Started Increase datagram queue length.
[   16.539776] systemd[1]: Starting Syslog Socket.
[   16.539873] systemd[1]: Listening on Syslog Socket.
[   16.539901] systemd[1]: Starting Sockets.
[   16.539940] systemd[1]: Reached target Sockets.
[   16.539963] systemd[1]: Starting Journal Service...
[   16.541579] systemd[1]: Started Journal Service.
[   20.334341] systemd-udevd[138]: starting version 215
[   20.905312] EXT4-fs (xvda2): re-mounted. Opts: errors=remount-ro
[   21.199307] pcifront pci-0: Installing PCI frontend
[   21.199334] xen:swiotlb_xen: Warning: only able to allocate 4 MB for
software IO TLB
[   21.202593] software IO TLB [mem 0x05800000-0x05c00000] (4MB) mapped at
[ffff880005800000-ffff880005bfffff]
[   21.211902] pcifront pci-0: Creating PCI Frontend Bus 0000:00
[   21.211974] pcifront pci-0: PCI host bridge to bus 0000:00
[   21.211982] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
[   21.211988] pci_bus 0000:00: root bus resource [mem
0x00000000-0xfffffffff]
[   21.211994] pci_bus 0000:00: root bus resource [bus 00-ff]
[   21.214065] pci 0000:00:01.0: [1912:0014] type 00 class 0x0c0330
[   21.214505] pci 0000:00:01.0: reg 0x10: [mem 0xfbff0000-0xfbff1fff 64bit]
[   21.218500] alg: No test for crc32 (crc32-pclmul)
[   21.234075] pci 0000:00:00.1: [14e4:165f] type 00 class 0x020000
[   21.234630] pci 0000:00:00.1: reg 0x10: [mem 0xfabc0000-0xfabcffff 64bit
pref]
[   21.234914] pci 0000:00:00.1: reg 0x18: [mem 0xfabb0000-0xfabbffff 64bit
pref]
[   21.235179] pci 0000:00:00.1: reg 0x20: [mem 0xfaba0000-0xfabaffff 64bit
pref]
[   21.242805] pcifront pci-0: New device on 0000:00:00.1 found.
[   21.261341] pcifront pci-0: claiming resource 0000:00:01.0/0
[   21.261355] pcifront pci-0: claiming resource 0000:00:00.1/0
[   21.261360] pcifront pci-0: claiming resource 0000:00:00.1/2
[   21.261365] pcifront pci-0: claiming resource 0000:00:00.1/4
[   21.261545] pci 0000:00:01.0: Xen PCI mapped GSI18 to IRQ29
[   21.364943] systemd-journald[124]: Received request to flush runtime
journal from PID 1
[   21.584884] input: PC Speaker as /devices/platform/pcspkr/input/input0
[   21.635516] intel_rapl: Found RAPL domain package
[   21.635530] intel_rapl: Found RAPL domain core
[   21.936105] pps_core: LinuxPPS API ver. 1 registered
[   21.936119] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo
Giometti <giometti at linux.it>
[   21.961610] PTP clock support registered
[   22.109201] tg3.c:v3.137 (May 11, 2014)
[   22.109445] tg3 0000:00:00.1: Xen PCI mapped GSI17 to IRQ30
[   22.131432] tg3 0000:00:00.1 eth1: Tigon3 [partno(N/A) rev 5720000] (PCI
Express) MAC address 34:64:a9:9a:a8:
[   22.131450] tg3 0000:00:00.1 eth1: attached PHY is 5720C
(10/100/1000Base-T Ethernet) (WireSpeed[1], EEE[1])
[   22.131459] tg3 0000:00:00.1 eth1: RXcsums[1] LinkChgREG[0] MIirq[0]
ASF[1] TSOcap[1]
[   22.131466] tg3 0000:00:00.1 eth1: dma_rwctrl[00000001] dma_mask[64-bit]
[   22.154753] usbcore: registered new interface driver usbfs
[   22.155023] usbcore: registered new interface driver hub
[   22.157566] usbcore: registered new device driver usb
[   22.293477] xen:events: xen_bind_pirq_gsi_to_irq: returning irq 29 for
gsi 18
[   22.293493] xhci_hcd 0000:00:01.0: Xen PCI mapped GSI18 to IRQ29
[   22.293632] xhci_hcd 0000:00:01.0: xHCI Host Controller
[   22.293645] xhci_hcd 0000:00:01.0: new USB bus registered, assigned bus
number 1
[   22.302041] xen:events: Failed to obtain physical IRQ 31
[   22.302064] xen:events: Failed to obtain physical IRQ 32
[   22.302159] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[   22.302166] usb usb1: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[   22.302172] usb usb1: Product: xHCI Host Controller
[   22.302176] usb usb1: Manufacturer: Linux 3.16.0-4-amd64 xhci_hcd
[   22.302181] usb usb1: SerialNumber: 0000:00:01.0
[   22.302529] hub 1-0:1.0: USB hub found
[   22.302551] hub 1-0:1.0: 2 ports detected
[   22.302686] xhci_hcd 0000:00:01.0: xHCI Host Controller
[   22.302696] xhci_hcd 0000:00:01.0: new USB bus registered, assigned bus
number 2
[   22.302750] usb usb2: We don't know the algorithms for LPM for this
host, disabling LPM.
[   22.302780] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003
[   22.302786] usb usb2: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[   22.302792] usb usb2: Product: xHCI Host Controller
[   22.302796] usb usb2: Manufacturer: Linux 3.16.0-4-amd64 xhci_hcd
[   22.302801] usb usb2: SerialNumber: 0000:00:01.0
[   22.303057] hub 2-0:1.0: USB hub found
[   22.303075] hub 2-0:1.0: 2 ports detected
[   22.808901] Adding 262140k swap on /dev/xvda1.  Priority:-1 extents:1
across:262140k SSFS
[  188.358732] xen:events: Failed to obtain physical IRQ 33
[  188.487712] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready

The last "xen:events: Failed to obtain physical IRQ 33" is from when I
did a "ifconfig eth1 up" where eth1 is the tg3 NIC.


I also have another domU (referred to as "working" below) with a
passthroughed USB PCI host controller (not USB3), and it works fine.

domU "working" "lspci -vn":
00:00.0 USB controller [0c03]: Intel Corporation 6 Series/C200 Series
Chipset Family USB Enhanced Host Controller #2 [8086:1c2d] (rev 05)
(prog-if 20 [EHCI])
        Subsystem: Hewlett-Packard Company Device [103c:330d]
        Flags: bus master, medium devsel, latency 0, IRQ 31
        Memory at facf0000 (32-bit, non-prefetchable) [size=1K]
        Capabilities: [50] Power Management version 2
        Capabilities: [58] Debug port: BAR=1 offset=00a0
        Capabilities: [98] PCI Advanced Features
        Kernel driver in use: ehci-pci


domU "working" "cat /proc/interrupts":
           CPU0
 16:  192795228  xen-percpu-virq      timer0
 17:          0  xen-percpu-ipi       resched0
 18:          0  xen-percpu-ipi       callfunc0
 19:          0  xen-percpu-virq      debug0
 20:          0  xen-percpu-ipi       callfuncsingle0
 21:     189700  xen-percpu-ipi       irqwork0
 22:        519   xen-dyn-event     xenbus
 23:     286767   xen-dyn-event     hvc_console
 24:    1028151   xen-dyn-event     blkif
 25:        361   xen-dyn-event     blkif
 26:   47422278   xen-dyn-event     eth0-q0-tx
 27:   47133612   xen-dyn-event     eth0-q0-rx
 28:    3054706   xen-dyn-event     eth1-q0-tx
 29:    3436561   xen-dyn-event     eth1-q0-rx
 30:         27   xen-dyn-event     pcifront
 31:  297065876  xen-pirq-pcifront  ehci_hcd:usb1
NMI:          0   Non-maskable interrupts
LOC:          0   Local timer interrupts
SPU:          0   Spurious interrupts
PMI:          0   Performance monitoring interrupts
IWI:     189700   IRQ work interrupts
RTR:          0   APIC ICR read retries
RES:          0   Rescheduling interrupts
CAL:          0   Function call interrupts
TLB:          0   TLB shootdowns
TRM:          0   Thermal event interrupts
THR:          0   Threshold APIC interrupts
MCE:          0   Machine check exceptions
MCP:          0   Machine check polls
HYP:  582543792   Hypervisor callback interrupts
ERR:          0
MIS:          0



Some other info:

dom0 "grep -vE '^#|^$' /etc/xen/bug.cfg":
bootloader = '/usr/lib/xen-4.4/bin/pygrub'
vcpus       = '1'
memory      = '128'
root        = '/dev/xvda2 ro'
disk        = [
                  'phy:/dev/vg_xen/bug-disk,xvda2,w',
                  'phy:/dev/vg_xen/bug-swap,xvda1,w',
              ]
name        = 'bug'
dhcp        = 'dhcp'
vif         = [ 'mac=00:16:3E:99:92:03,bridge=br_home' ]
pci         = [ '03:00.1,permissive=1', '04:00.0,permissive=1' ]
on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'


dom0 "lspci -vnn" for the two failing (03:00.1, 04:00.0) and
the one working (00:1a.0) devices mentioned above:

00:1a.0 USB controller [0c03]: Intel Corporation 6 Series/C200 Series
Chipset Family USB Enhanced Host Controller #2 [8086:1c2d] (rev 05)
(prog-if 20 [EHCI])
        Subsystem: Hewlett-Packard Company Device [103c:330d]
        Flags: bus master, medium devsel, latency 0, IRQ 21
        Memory at facf0000 (32-bit, non-prefetchable) [size=1K]
        Capabilities: [50] Power Management version 2
        Capabilities: [58] Debug port: BAR=1 offset=00a0
        Capabilities: [98] PCI Advanced Features
        Kernel driver in use: pciback

03:00.1 Ethernet controller [0200]: Broadcom Corporation NetXtreme BCM5720
Gigabit Ethernet PCIe [14e4:165f]
        Subsystem: Hewlett-Packard Company Device [103c:2133]
        Flags: bus master, fast devsel, latency 0, IRQ 17
        Memory at fabc0000 (64-bit, prefetchable) [size=64K]
        Memory at fabb0000 (64-bit, prefetchable) [size=64K]
        Memory at faba0000 (64-bit, prefetchable) [size=64K]
        Expansion ROM at f8020000 [disabled] [size=128K]
        Capabilities: [48] Power Management version 3
        Capabilities: [50] Vital Product Data
        Capabilities: [58] MSI: Enable- Count=1/8 Maskable- 64bit+
        Capabilities: [a0] MSI-X: Enable- Count=17 Masked-
        Capabilities: [ac] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [13c] Device Serial Number 00-00-34-64-a9-9a-a8-b1
        Capabilities: [150] Power Budgeting <?>
        Capabilities: [160] Virtual Channel
        Kernel driver in use: pciback

04:00.0 USB controller [0c03]: Renesas Technology Corp. uPD720201 USB 3.0
Host Controller [1912:0014] (rev 03) (prog-if 30 [XHCI])
        Subsystem: Hewlett-Packard Company Device [103c:1996]
        Flags: bus master, fast devsel, latency 0, IRQ 18
        Memory at fbff0000 (64-bit, non-prefetchable) [size=8K]
        Capabilities: [50] Power Management version 3
        Capabilities: [70] MSI: Enable- Count=1/8 Maskable- 64bit+
        Capabilities: [90] MSI-X: Enable+ Count=8 Masked-
        Capabilities: [a0] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [150] Latency Tolerance Reporting
        Kernel driver in use: pciback


dom0 "xl pci-list bug":
Vdev Device
00.0 0000:03:00.1
00.0 0000:04:00.0

dom0 "xl pci-list working"
Vdev Device
00.0 0000:00:1a.0


dom0 "xl dmesg":
(XEN) Xen version 4.4.1 (Debian 4.4.1-9+deb8u3) (ultrotter@debian.org) (gcc
(Debian 4.9.2-10) 4.9.2) debug=n Wed Nov 25 15:46:22 EET 2015
(XEN) Bootloader: GRUB 2.02~beta2-22+deb8u1
(XEN) Command line: placeholder dom0_mem=1024M,max:1024M
(XEN) Video information:
(XEN)  VGA is text mode 80x25, font 8x16
(XEN)  VBE/DDC methods: none; EDID transfer time: 0 seconds
(XEN)  EDID info not retrieved because no DDC retrieval method detected
(XEN) Disc information:
(XEN)  Found 4 MBR signatures
(XEN)  Found 2 EDD information structures
(XEN) Xen-e820 RAM map:
(XEN)  0000000000000000 - 0000000000099800 (usable)
(XEN)  0000000000099800 - 0000000000099c00 (reserved)
(XEN)  000000000009e000 - 00000000000a0000 (reserved)
(XEN)  00000000000f0000 - 0000000000100000 (reserved)
(XEN)  0000000000100000 - 00000000f1de4000 (usable)
(XEN)  00000000f1de4000 - 00000000f1dee000 (ACPI data)
(XEN)  00000000f1dee000 - 00000000f8000000 (reserved)
(XEN)  00000000fec00000 - 00000000fee10000 (reserved)
(XEN)  00000000ff800000 - 0000000100000000 (reserved)
(XEN)  0000000100000000 - 000000028bfff000 (usable)
(XEN) ACPI: RSDP 000F4F00, 0024 (r2 HP    )
(XEN) ACPI: XSDT F1DE6400, 00B4 (r1 HP     ProLiant        2   �     162E)
(XEN) ACPI: FACP F1DE6540, 00F4 (r3 HP     ProLiant        2   �     162E)
(XEN) ACPI: DSDT F1DE6640, 1C1A (r1 HP         DSDT        1 INTL 20030228)
(XEN) ACPI: FACS F1DE4140, 0040
(XEN) ACPI: SPCR F1DE4180, 0050 (r1 HP     SPCRRBSU        1   �     162E)
(XEN) ACPI: MCFG F1DE4200, 003C (r1 HP     ProLiant        1             0)
(XEN) ACPI: HPET F1DE4240, 0038 (r1 HP     ProLiant        2   �     162E)
(XEN) ACPI: FFFF F1DE4280, 0064 (r2 HP     ProLiant        2   �     162E)
(XEN) ACPI: SPMI F1DE4300, 0040 (r5 HP     ProLiant        1   �     162E)
(XEN) ACPI: ERST F1DE4340, 0230 (r1 HP     ProLiant        1   �     162E)
(XEN) ACPI: APIC F1DE4580, 0252 (r1 HP     ProLiant        2             0)
(XEN) ACPI: FFFF F1DE4800, 0176 (r1 HP     ProLiant        1   �     162E)
(XEN) ACPI: BERT F1DE4980, 0030 (r1 HP     ProLiant        1   �     162E)
(XEN) ACPI: HEST F1DE49C0, 00BC (r1 HP     ProLiant        1   �     162E)
(XEN) ACPI: FFFF F1DE4A80, 1914 (r1 HP     ProLiant        1   �     162E)
(XEN) ACPI: FFFF F1DE63C0, 002D (r1 HP     ProLiant        1             0)
(XEN) ACPI: SSDT F1DE8280, 0137 (r3     HP  CRSPCI0        2   HP        1)
(XEN) ACPI: SSDT F1DE83C0, 0177 (r3     HP   riser0        2 INTL 20030228)
(XEN) ACPI: SSDT F1DE8540, 01E1 (r1     HP      pcc        1 INTL 20090625)
(XEN) ACPI: SSDT F1DE8740, 0377 (r1     HP     pmab        1 INTL 20090625)
(XEN) ACPI: SSDT F1DE8AC0, 0504 (r1 INTEL  PPM RCM  80000001 INTL 20061109)
(XEN) System RAM: 10205MB (10450416kB)
(XEN) Domain heap initialised
(XEN) Processor #0 7:10 APIC version 21
(XEN) Processor #2 7:10 APIC version 21
(XEN) IOAPIC[0]: apic_id 8, version 32, address 0xfec00000, GSI 0-23
(XEN) Enabling APIC mode:  Flat.  Using 1 I/O APICs
(XEN) Using scheduler: SMP Credit Scheduler (credit)
(XEN) Detected 2294.838 MHz processor.
(XEN) Initing memory sharing.
(XEN) xstate_init: using cntxt_size: 0x240 and states: 0x3
(XEN) I/O virtualisation disabled
(XEN) Enabled directed EOI with ioapic_ack_old on!
(XEN) ENABLING IO-APIC IRQs
(XEN)  -> Using old ACK method
(XEN) Platform timer is 14.318MHz HPET
(XEN) Allocated console ring of 16 KiB.
(XEN) VMX: Supported advanced features:
(XEN)  - APIC MMIO access virtualisation
(XEN)  - APIC TPR shadow
(XEN)  - Extended Page Tables (EPT)
(XEN)  - Virtual-Processor Identifiers (VPID)
(XEN)  - Virtual NMI
(XEN)  - MSR direct-access bitmap
(XEN)  - Unrestricted Guest
(XEN) HVM: ASIDs enabled.
(XEN) HVM: VMX enabled
(XEN) HVM: Hardware Assisted Paging (HAP) detected
(XEN) HVM: HAP page sizes: 4kB, 2MB
(XEN) Brought up 2 CPUs
(XEN) *** LOADING DOMAIN 0 ***
(XEN)  Xen  kernel: 64-bit, lsb, compat32
(XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x1f18000
(XEN) PHYSICAL MEMORY ARRANGEMENT:
(XEN)  Dom0 alloc.:   000000023c000000->0000000240000000 (241836 pages to
be allocated)
(XEN)  Init. ramdisk: 000000028aeac000->000000028bdff8e4
(XEN) VIRTUAL MEMORY ARRANGEMENT:
(XEN)  Loaded kernel: ffffffff81000000->ffffffff81f18000
(XEN)  Init. ramdisk: ffffffff81f18000->ffffffff82e6b8e4
(XEN)  Phys-Mach map: ffffffff82e6c000->ffffffff8306c000
(XEN)  Start info:    ffffffff8306c000->ffffffff8306c4b4
(XEN)  Page tables:   ffffffff8306d000->ffffffff8308a000
(XEN)  Boot stack:    ffffffff8308a000->ffffffff8308b000
(XEN)  TOTAL:         ffffffff80000000->ffffffff83400000
(XEN)  ENTRY ADDRESS: ffffffff819021f0
(XEN) Dom0 has maximum 2 VCPUs
(XEN) Scrubbing Free RAM:
..........................................................................................done.
(XEN) Initial low memory virq threshold set at 0x4000 pages.
(XEN) Std. Loglevel: Errors and warnings
(XEN) Guest Loglevel: Nothing (Rate-limited: Errors and warnings)
(XEN) Xen is relinquishing VGA console.
(XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input
to Xen)
(XEN) Freed 284kB init memory.
(XEN) mm.c:812: d13: Forcing read-only access to MFN fbff1
(XEN) mm.c:812: d13: Forcing read-only access to MFN fbff1
(XEN) mm.c:812: d13: Forcing read-only access to MFN fbff1
(XEN) mm.c:812: d0: Forcing read-only access to MFN fbff1
(XEN) mm.c:812: d13: Forcing read-only access to MFN faba0
(XEN) mm.c:812: d0: Forcing read-only access to MFN faba0
(XEN) mm.c:812: d14: Forcing read-only access to MFN fbff1
(XEN) mm.c:812: d14: Forcing read-only access to MFN fbff1
(XEN) mm.c:812: d14: Forcing read-only access to MFN fbff1
(XEN) mm.c:812: d0: Forcing read-only access to MFN fbff1

dom0 "uname -a":
Linux dom0 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2 (2016-01-02)
x86_64 GNU/Linux

domU "bug" "uname -a":
Linux bug 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2 (2016-01-02)
x86_64 GNU/Linux

domU "working" "uname -a":
Linux working 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2
(2016-01-02) x86_64 GNU/Linux


Br,
Tommi Airikka

[-- Attachment #1.2: Type: text/html, Size: 41209 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2016-02-12 21:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CANQMFx4YULqKctKZqeESesTQjLQun7rQ0ZjGzq96TXTtUw6VWA@mail.gmail.com>
2016-01-27 18:30 ` [BUG] pci-passthrough generates "xen:events: Failed to obtain physical IRQ" for some devices Konrad Rzeszutek Wilk
2016-01-30  2:13   ` Marek Marczykowski-Górecki
2016-01-30 13:18   ` Tommi Airikka
2016-02-01 10:43     ` Ian Campbell
2016-02-01 14:50       ` Konrad Rzeszutek Wilk
2016-02-03 14:22         ` Marek Marczykowski-Górecki
2016-02-03 15:26           ` Konrad Rzeszutek Wilk
2016-02-08 17:39             ` Marek Marczykowski-Górecki
2016-02-09  4:59               ` Konrad Rzeszutek Wilk
2016-02-03 20:28     ` Konrad Rzeszutek Wilk
2016-02-04  9:37       ` Ian Campbell
2016-02-04 23:35         ` Tommi Airikka
2016-02-12 21:36           ` Konrad Rzeszutek Wilk
2016-02-12 21:53             ` Tommi Airikka
2016-01-23 16:12 Tommi Airikka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.