On 8/23/21 21:04, David Hildenbrand wrote: > On 23.08.21 20:41, Peter Xu wrote: >> On Mon, Aug 23, 2021 at 06:41:55PM +0200, Philippe Mathieu-Daudé wrote: >>> +/* Permission to restrict bus memory accesses. See >>> MemTxAttrs::bus_perm */ >>> +enum { >>> + MEMTXPERM_UNSPECIFIED = 0, >>> + MEMTXPERM_UNRESTRICTED = 1, >>> + MEMTXPERM_RAM_DEVICE = 2, >>> +}; >> >> Is there a difference between UNSPECIFIED and UNRESTRICTED? >> >> If no, should we merge them? >> > > I'd assume MEMTXPERM_UNSPECIFIED has to be treated like > MEMTXPERM_UNRESTRICTED, so I'd also think we should just squash them.
For now they are treated the same way, but ideally we should explicitly classify bus accesses and remove the MEMTXPERM_UNSPECIFIED. While we can use the same definition with comments, I think having different definitions ease maintainance (thinking of git-grep), but if we know we will never classify/convert the devices, then indeed having MEMTXPERM_UNSPECIFIED is pointless and confusing.