[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 04/40] memory: Rename readable flag to romd_mode
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 04/40] memory: Rename readable flag to romd_mode |
Date: |
Tue, 7 May 2013 17:10:35 +0100 |
On 7 May 2013 15:16, Paolo Bonzini <address@hidden> wrote:
> From: Jan Kiszka <address@hidden>
>
> "Readable" is a very unfortunate name for this flag because even a
> rom_device region will always be readable from the guest POV. What
> differs is the mapping, just like the comments had to explain already.
> Also, readable could currently be understood as being a generic region
> flag, but it only applies to rom_device regions.
>
> So name the flag and the function to modify it after the original term
"rename"
> "ROMD" which could also be interpreted as "ROM direct", i.e. ROM mode
> with direct access. In any case, the scope if the flag is clearer now.
"scope of".
> --- a/hw/block/pflash_cfi02.c
> +++ b/hw/block/pflash_cfi02.c
> @@ -111,7 +111,7 @@ static void pflash_setup_mappings(pflash_t *pfl)
>
> static void pflash_register_memory(pflash_t *pfl, int rom_mode)
> {
> - memory_region_rom_device_set_readable(&pfl->orig_mem, rom_mode);
> + memory_region_rom_device_set_romd(&pfl->orig_mem, rom_mode);
Obvious opportunity to change the name of the pflash_register_memory
parameter to match (separate trivial patch would be fine).
> pfl->rom_mode = rom_mode;
> }
>
> diff --git a/include/exec/memory.h b/include/exec/memory.h
> index efe210b..f65acfd 100644
> --- a/include/exec/memory.h
> +++ b/include/exec/memory.h
> @@ -126,7 +126,7 @@ struct MemoryRegion {
> ram_addr_t ram_addr;
> bool subpage;
> bool terminates;
> - bool readable;
> + bool romd_mode;
> bool ram;
> bool readonly; /* For RAM regions */
> bool enabled;
> @@ -355,16 +355,16 @@ uint64_t memory_region_size(MemoryRegion *mr);
> bool memory_region_is_ram(MemoryRegion *mr);
>
> /**
> - * memory_region_is_romd: check whether a memory region is ROMD
> + * memory_region_is_romd: check whether a memory region is in ROMD mode
> *
> - * Returns %true is a memory region is ROMD and currently set to allow
> + * Returns %true is a memory region is a ROM device and currently set to
> allow
"Returns %true if"
> * direct reads.
> *
> * @mr: the memory region being queried
> */
> static inline bool memory_region_is_romd(MemoryRegion *mr)
> {
> - return mr->rom_device && mr->readable;
> + return mr->rom_device && mr->romd_mode;
> }
>
> /**
> @@ -502,18 +502,18 @@ void memory_region_reset_dirty(MemoryRegion *mr, hwaddr
> addr,
> void memory_region_set_readonly(MemoryRegion *mr, bool readonly);
>
> /**
> - * memory_region_rom_device_set_readable: enable/disable ROM readability
> + * memory_region_rom_device_set_romd: enable/disable ROMD mode
> *
> * Allows a ROM device (initialized with memory_region_init_rom_device() to
> - * to be marked as readable (default) or not readable. When it is readable,
> - * the device is mapped to guest memory. When not readable, reads are
> - * forwarded to the #MemoryRegion.read function.
> + * set to ROMD mode (default) or MMIO mode. When it is in ROMD mode, the
> + * device is mapped to guest memory and satisfies read access directly.
> + * When in MMIO mode, reads are forwarded to the #MemoryRegion.read function.
> + * Writes are always handled by the #MemoryRegion.write function.
> *
> * @mr: the memory region to be updated
> - * @readable: whether reads are satisified directly (%true) or via callbacks
> - * (%false)
> + * @romd_mode: whether the region in in ROMD mode or not
"is in", but that's not what the parameter means anyway.
"@romd_mode: %true to put the region into ROMD mode"
thanks
-- PMM
- [Qemu-devel] [PATCH 19/40] dma: eliminate old-style IOMMU support, (continued)
- [Qemu-devel] [PATCH 19/40] dma: eliminate old-style IOMMU support, Paolo Bonzini, 2013/05/07
- [Qemu-devel] [PATCH 21/40] spapr_vio: take care of creating our own AddressSpace/DMAContext, Paolo Bonzini, 2013/05/07
- [Qemu-devel] [PATCH 26/40] memory: add ref/unref calls, Paolo Bonzini, 2013/05/07
- [Qemu-devel] [PATCH 28/40] sysbus: set owner for MMIO regions, Paolo Bonzini, 2013/05/07
- [Qemu-devel] [PATCH 27/40] pci: set owner for BARs, Paolo Bonzini, 2013/05/07
- [Qemu-devel] [PATCH 29/40] acpi: add memory_region_set_owner calls, Paolo Bonzini, 2013/05/07
- [Qemu-devel] [PATCH 16/40] spapr: convert TCE API to use an opaque type, Paolo Bonzini, 2013/05/07
- [Qemu-devel] [PATCH 25/40] memory: add ref/unref, Paolo Bonzini, 2013/05/07
- [Qemu-devel] [PATCH 23/40] memory: give name to every AddressSpace, Paolo Bonzini, 2013/05/07
- [Qemu-devel] [PATCH 04/40] memory: Rename readable flag to romd_mode, Paolo Bonzini, 2013/05/07
[Qemu-devel] [PATCH 06/40] memory: make memory_global_sync_dirty_bitmap take an AddressSpace, Paolo Bonzini, 2013/05/07
[Qemu-devel] [PATCH 08/40] memory: limit sections in the radix tree to the actual address space size, Paolo Bonzini, 2013/05/07
[Qemu-devel] [PATCH 15/40] vfio: abort if an emulated iommu is used, Paolo Bonzini, 2013/05/07
[Qemu-devel] [PATCH 05/40] memory: do not duplicate memory_region_destructor_none, Paolo Bonzini, 2013/05/07