qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] usb-ohci: Add address masking.


From: andrzej zaborowski
Subject: Re: [Qemu-devel] [PATCH] usb-ohci: Add address masking.
Date: Sun, 7 Dec 2008 17:05:03 +0100

2008/12/5  <address@hidden>:
> Hi,
> About this
>> [1] It's actually the offset from the start of the first page of that region.
>> In practice this difference doesn't matter, and makes the implementation a
>> lot simpler.
> again.
>
> The patch below adds address mask(0xff) to mmio read/write funcs in usb-ohci.
> I know now we are deleting this kind of address mask/subtract things.
> But because of the restriction [1] above, we have to add address mask here.
>
> The mmio change potentially breaks PCI device emulations which has mmio region
> smaller than page size, like usb-ohci and rtl8139 (both have 256byte), because
> PCI memory regions are configured to be aligned to it size, but to page.

I think it's more correct to substract an offset from the address
because masking causes the address to wrap and effectively the
registers become visible at multiple addresses.

On the other hand I don't see why we need the restriction [1].
Looking at exec.c, at least for io regions, it should be acceptable
for ->region_offset to be unaligned.

>
> usb-ohci is really broken now.
> rtl8139 is OK because it already has address mask.
> Others are not checked.

Cheers




reply via email to

[Prev in Thread] Current Thread [Next in Thread]