On 28/05/20 06:35, Yan Zhao wrote: > On Tue, May 26, 2020 at 10:26:35AM +0100, Peter Maydell wrote: >> On Mon, 25 May 2020 at 11:20, Paolo Bonzini <pbonz...@redhat.com> wrote: >>> Not all of them, only those that need to return MEMTX_ERROR. I would >>> like some guidance from Peter as to whether (or when) reads from ROMs >>> should return MEMTX_ERROR. This way, we can use that information to >>> device what the read-only ram-device regions should do. >> >> In general I think writes to ROMs (and indeed reads from ROMs) should >> not return MEMTX_ERROR. I think that in real hardware you could have >> a ROM that behaved either way; so our default behaviour should probably >> be to do what we've always done and not report a MEMTX_ERROR. (If we >> needed to I suppose we should implement a MEMTX_ERROR-reporting ROM, >> but to be honest there aren't really many real ROMs in systems these >> days: it's more often flash, whose response to writes is defined >> by the spec and is I think to ignore writes which aren't the >> magic "shift to program-the-flash-mode" sequence.) >> > then should I just drop the writes to read-only ram-device regions and > vfio regions without returning MEMTX_ERROR? > do you think it's good?
I am not really sure, I have to think more about it. I think read-only RAMD regions are slightly different because the guest can expect "magic" behavior from RAMD regions (e.g. registers that trigger I/O on writes) that are simply not there for ROM. So I'm still inclined to queue your v6 patch series. Thanks, Paolo