[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 6/9] rocker: add new rocker switch device
From: |
Scott Feldman |
Subject: |
Re: [Qemu-devel] [PATCH v3 6/9] rocker: add new rocker switch device |
Date: |
Wed, 14 Jan 2015 15:20:05 -0800 |
On Mon, Jan 12, 2015 at 4:57 AM, Paolo Bonzini <address@hidden> wrote:
>
>
> On 11/01/2015 04:57, address@hidden wrote:
>> +static const MemoryRegionOps rocker_mmio_ops = {
>> + .read = rocker_mmio_read,
>> + .write = rocker_mmio_write,
>> + .endianness = DEVICE_LITTLE_ENDIAN,
>> + .valid = {
>> + .min_access_size = 4,
>> + .max_access_size = 8,
>> + },
>> + .impl = {
>> + .min_access_size = 4,
>> + .max_access_size = 8,
>> + },
>> +};
>
> I suggest that you only use 32-bit registers in the internal
> implementation, where writing to the low part of a 64-bit register only
> writes to a latch. You can then use .impl.max_access_size == 4 but keep
> .valid.max_access_size == 8.
>
> QEMU will then take care of passing 64-bit writes down as two 32-bit
> writes, in increasing address.
I tried setting .impl.max_access_size=4 and the Linux driver self-test
fails on 64-bit reg write/read. 32-bit regs writes/reads are OK. On
the 64-bit write/read, the self test writes a value and expects to
read back 2x the value written. After making the change
.impl.max_access_size=4, the reg reads back as 0, regardless of what
was written.
The driver uses writeq/readq for 64-bit writes/reads.
I'm inclined to not change the device and leave .impl.max_access_size=8.
-scott
- Re: [Qemu-devel] [PATCH v3 3/9] rocker: add register programming guide, (continued)
- [Qemu-devel] [PATCH v3 1/9] net: add MAC address string printer, sfeldma, 2015/01/10
- [Qemu-devel] [PATCH v3 4/9] pci: add rocker device ID, sfeldma, 2015/01/10
- [Qemu-devel] [PATCH v3 8/9] rocker: add tests, sfeldma, 2015/01/10
- [Qemu-devel] [PATCH v3 9/9] MAINTAINERS: add rocker, sfeldma, 2015/01/10
- [Qemu-devel] [PATCH v3 7/9] qmp: add rocker device support, sfeldma, 2015/01/10
- [Qemu-devel] [PATCH v3 6/9] rocker: add new rocker switch device, sfeldma, 2015/01/10
- Re: [Qemu-devel] [PATCH v3 6/9] rocker: add new rocker switch device, Jason Wang, 2015/01/16