[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V3 07/11] memory: implement e1000's MemoryRegion
From: |
Avi Kivity |
Subject: |
Re: [Qemu-devel] [PATCH V3 07/11] memory: implement e1000's MemoryRegionOps ref/unref |
Date: |
Tue, 11 Sep 2012 11:37:28 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0 |
On 09/11/2012 10:51 AM, Liu Ping Fan wrote:
> From: Liu Ping Fan <address@hidden>
>
> With this, e1000 show to memory core that it can be protected by
> refcnt.
>
> diff --git a/hw/e1000.c b/hw/e1000.c
> index ae8a6c5..df3a349 100644
> --- a/hw/e1000.c
> +++ b/hw/e1000.c
> @@ -1037,9 +1037,26 @@ e1000_mmio_read(void *opaque, target_phys_addr_t addr,
> unsigned size)
> return 0;
> }
>
> +static int e1000_mmio_ref(MemoryRegion *mr)
> +{
> + E1000State *e1000 = container_of(mr, E1000State, mmio);
> +
> + object_ref(OBJECT(e1000));
> + return 1;
> +}
> +
> +static void e1000_mmio_unref(MemoryRegion *mr)
> +{
> + E1000State *e1000 = container_of(mr, E1000State, mmio);
> +
> + object_unref(OBJECT(e1000));
> +}
> +
> static const MemoryRegionOps e1000_mmio_ops = {
> .read = e1000_mmio_read,
> .write = e1000_mmio_write,
> + .ref = e1000_mmio_ref,
> + .unref = e1000_mmio_unref,
> .endianness = DEVICE_LITTLE_ENDIAN,
> .impl = {
> .min_access_size = 4,
>
Does e1000_mmio_write() never call functions that assume bql protection?
The network layer, timers, and qemu_irq all need protection.
--
error compiling committee.c: too many arguments to function
- [Qemu-devel] [PATCH V3 0/10] prepare unplug out of protection of global lock, Liu Ping Fan, 2012/09/11
- [Qemu-devel] [PATCH V3 01/11] atomic: introduce atomic operations, Liu Ping Fan, 2012/09/11
- [Qemu-devel] [PATCH V3 02/11] qom: apply atomic on object's refcount, Liu Ping Fan, 2012/09/11
- [Qemu-devel] [PATCH V3 03/11] hotplug: introduce qdev_unplug_complete() to remove device from views, Liu Ping Fan, 2012/09/11
- [Qemu-devel] [PATCH V3 04/11] pci: remove pci device from mem view when unplug, Liu Ping Fan, 2012/09/11
- [Qemu-devel] [PATCH V3 05/11] memory: introduce ref, unref interface for MemoryRegionOps, Liu Ping Fan, 2012/09/11
- [Qemu-devel] [PATCH V3 07/11] memory: implement e1000's MemoryRegionOps ref/unref, Liu Ping Fan, 2012/09/11
- Re: [Qemu-devel] [PATCH V3 07/11] memory: implement e1000's MemoryRegionOps ref/unref,
Avi Kivity <=
- [Qemu-devel] [PATCH V3 10/11] vcpu: introduce lockmap, Liu Ping Fan, 2012/09/11
- Re: [Qemu-devel] [PATCH V3 10/11] vcpu: introduce lockmap, Avi Kivity, 2012/09/11
- Re: [Qemu-devel] [PATCH V3 10/11] vcpu: introduce lockmap, liu ping fan, 2012/09/11
- Re: [Qemu-devel] [PATCH V3 10/11] vcpu: introduce lockmap, Avi Kivity, 2012/09/11
- Re: [Qemu-devel] [PATCH V3 10/11] vcpu: introduce lockmap, Jan Kiszka, 2012/09/11
- Re: [Qemu-devel] [PATCH V3 10/11] vcpu: introduce lockmap, Avi Kivity, 2012/09/11
- Re: [Qemu-devel] [PATCH V3 10/11] vcpu: introduce lockmap, Jan Kiszka, 2012/09/11
- Re: [Qemu-devel] [PATCH V3 10/11] vcpu: introduce lockmap, Avi Kivity, 2012/09/11
- Re: [Qemu-devel] [PATCH V3 10/11] vcpu: introduce lockmap, Jan Kiszka, 2012/09/11
- Re: [Qemu-devel] [PATCH V3 10/11] vcpu: introduce lockmap, Avi Kivity, 2012/09/11