Re: How to pass through off-chip USB controller


Geoffroy Van Cutsem
 

-----Original Message-----
From: acrn-users@... [mailto:acrn-
users@...] On Behalf Of Wu, Binbin
Sent: Sunday, September 9, 2018 11:57 AM
To: acrn-users@...
Cc: Tzeng, Tonny <tonny.tzeng@...>
Subject: Re: [acrn-users] How to pass through off-chip USB controller

Hi Geoffroy,

Thanks for providing the info.
After checking the code, I did found a logic error when handling msix table
read/write in passthrough.
I have sent out a patch to fix the issue to acrn-dev@... for
review.
Thanks Binbin! I guess that's the one: https://lists.projectacrn.org/g/acrn-dev/message/11368?

We will keep an eye on it (to see when it gets merged) and perhaps even test it beforehand on our side if we get a chance!

Thanks,
Geoffroy


On 9/7/2018 9:50 PM, Geoffroy Van Cutsem wrote:

Hi Binbin, Edwin,

The error Tonny got at the time was with this combination (so not the
latest as of today):

- HV/DM: f815415

- SOS: Clear 24030 w/ 4.14.57-69 kernel

Looking it up on Github, this is the line you’re asking for:
https://github.com/projectacrn/acrn-hypervisor/blob/acrn-2018w30.4-140
000p/devicemodel/hw/pci/passthrough.c#L560

And yes, that’s the one you have below J

Thanks,

Geoffroy

*From:*acrn-users@...
[mailto:acrn-users@...] *On Behalf Of *Wu, Binbin
*Sent:* Friday, September 7, 2018 9:16 AM
*To:* acrn-users@...
*Subject:* Re: [acrn-users] How to pass through off-chip USB
controller

Hi Tonny,
Which version of your clearlinux SOS?
Is there any chance that can you confirm that whether
hw/pci/passthrough.c:560 is the line of code in bold?

static void

msix_table_write(struct vmctx *ctx, int vcpu, struct passthru_dev
*ptdev,

uint64_t offset, int size, uint64_t data)

{

struct pci_vdev *dev;

struct msix_table_entry *entry;

uint8_t *dest8;

uint16_t *dest16;

uint32_t *dest32;

uint64_t *dest64;

size_t entry_offset;

uint32_t vector_control;

int index;

dev = ptdev->dev;

if (offset >= dev->msix.pba_offset &&

    offset < dev->msix.pba_offset + dev->msix.pba_size) {

switch (size) {

case 1:

dest8 = (uint8_t *)(dev->msix.pba_page + offset -

    dev->msix.pba_page_offset);

*dest8 = data;

break;

case 2:

dest16 = (uint16_t *)(dev->msix.pba_page + offset -

    dev->msix.pba_page_offset);

*dest16 = data;

break;

case 4:

dest32 = (uint32_t *)(dev->msix.pba_page + offset -

    dev->msix.pba_page_offset);

**dest32 = data; *//is hw/pci/passthrough.c:560 this line of code?

break;

case 8:

dest64 = (uint64_t *)(dev->msix.pba_page + offset -

    dev->msix.pba_page_offset);

*dest64 = data;

break;

default:

break;

}

return;

}


Join acrn-users@lists.projectacrn.org to automatically receive all group messages.