[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v2 5/5] softmmu/physmem: Have flaview API check MemTxAttr
From: |
Peter Xu |
Subject: |
Re: [RFC PATCH v2 5/5] softmmu/physmem: Have flaview API check MemTxAttrs::bus_perm field |
Date: |
Mon, 23 Aug 2021 14:45:25 -0400 |
On Mon, Aug 23, 2021 at 06:41:57PM +0200, Philippe Mathieu-Daudé wrote:
> @@ -2772,7 +2772,22 @@ static inline bool
> flatview_access_allowed(MemoryRegion *mr, MemTxAttrs attrs,
> hwaddr addr, hwaddr len,
> MemTxResult *result)
> {
> - return true;
> + if (unlikely(attrs.bus_perm == MEMTXPERM_RAM_DEVICE)) {
> + if (memory_region_is_ram(mr) || memory_region_is_ram_device(mr)) {
memory_region_is_ram() should be enough ("ram_device" is only set if "ram" is
set)? Thanks,
--
Peter Xu