On 2017-01-13 19:10, Vaidyanath, Rajiv wrote:
> 
>> Are you running thatversion?
> 
> 
> Yes,I believe so.
> 
> 
> [root@jailhouse]# jailhouse --version
> Jailhouse management tool v0.6

The hypervisor version is actually reported via the serial port during
startup, but I assume you did a make install and got that piece updated
as well (double-check nevertheless).

> 
> ------------------------------------------------------------------------
> *From:* Jan Kiszka <[email protected]>
> *Sent:* Friday, January 13, 2017 1:00:01 PM
> *To:* Vaidyanath, Rajiv; [email protected]
> *Subject:* Re: Device assignment to non-root
>  
> On 2017-01-13 18:47, Vaidyanath, Rajiv wrote:
>>  
>> 
>> Hi Everyone,
>> 
>> I've added a Broadcom NIC BCM5722 card to the system to be used by the
>> non-root cell and also updated mem_regions, pci_devices and pci_caps (
>> attached snippet.txt and lspci-v-vv.txt ). I checked the values in the
>> 'lspci -v -vv' output and matched it to the entries in the non-root
>> config for the Broadcom NIC.
>> 
>> When I boot the non-root cell, I get this message:
>> 
>> FATAL: Invalid PCI config write, port: cfe, size 2, address port: 800100e8
> 
> I think I covered parsing this in my Jailhouse tutorial slides as well:
> This is a write access to PCI device 01:00.0 (BDF in bits 8..23) at
> config space offset 0xe8 (bits 0..7). Usually, this is about unknown or
> potentially dangerous capabilities - but here it is the MSI cap.
> 
>> RIP: 0xffffffff816ffec8 RSP: 0xffff88000b963c70 FLAGS: 2
>> RAX: 0x0000000000000080 RBX: 0x0000000000000002 RCX: 0x00000000000000ea
>> RDX: 0x0000000000000cfe RSI: 0x0000000000000097 RDI: 0x00000000800100e8
>> CS: 10 BASE: 0x0000000000000000 AR-BYTES: a09b EFER.LMA 1
>> CR0: 0x0000000080050033 CR3: 0x0000000001e12000 CR4: 0x00000000000426e0
>> EFER: 0x0000000000000d01
>> Parking CPU 3 (Cell: "linux2")
>> 
>> I followed the e1000-demo to get started with this. Do I need to adjust
>> anything else in the configs ?
> 
> I did some last minute fixes on PCI device assignment before v0.6
> (proper reset of MSI and MSI-X states on handover). Are you running that
> version? If not, please update and retry.

OK, it's not the easy solution, and something is rather fishy here: The
write is targeting the first two bytes of the cap, which are read-only
anyway, ie. it is not changing the cap's state, but we still get a
violation. Please try to run with these instrumentations and report the
full dump:

diff --git a/hypervisor/arch/x86/pci.c b/hypervisor/arch/x86/pci.c
index cd22742..3e927b0 100644
--- a/hypervisor/arch/x86/pci.c
+++ b/hypervisor/arch/x86/pci.c
@@ -333,12 +333,21 @@ int arch_pci_update_msi(struct pci_device *device,
        u16 bdf = info->bdf;
        int result = 0;
 
+       if (device->cell != &root_cell)
+               printk("%s: %x: %d %08x %08x %08x %08x\n", __FUNCTION__,
+                      device->info->bdf, vectors,
+                      device->msi_registers.raw[0],
+                      device->msi_registers.raw[1],
+                      device->msi_registers.raw[2],
+                      device->msi_registers.raw[3]);
        if (vectors == 0)
                return 0;
 
        for (n = 0; n < vectors; n++) {
                irq_msg = x86_pci_translate_msi(device, n, vectors, msi);
                result = iommu_map_interrupt(device->cell, bdf, n, irq_msg);
+               if (device->cell != &root_cell)
+                       printk("%llx %d\n", *(u64 *)&irq_msg, result);
                // HACK for QEMU
                if (result == -ENOSYS) {
                        for (n = 1; n < (info->msi_64bits ? 4 : 3); n++)

Jan

-- 
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to