qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 1/1] hw/pflash_cfi01: Allow backing devices to be smaller


From: David Edmondson
Subject: Re: [PATCH v4 1/1] hw/pflash_cfi01: Allow backing devices to be smaller than memory region
Date: Tue, 14 Sep 2021 15:01:26 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

On Thursday, 2021-09-09 at 11:27:56 +02, Philippe Mathieu-Daudé wrote:

> Hi David,

Philippe, thank you for the careful and considered review.

>> +static MemTxResult pflash_outer_write_with_attrs(void *opaque, hwaddr addr,
>> +                                                 uint64_t value, unsigned 
>> len,
>> +                                                 MemTxAttrs attrs)
>> +{
>> +    PFlashCFI01 *pfl = opaque;
>> +
>> +    trace_pflash_outer_write(pfl->name, addr, len);
>> +    if (pfl->ro) {
>> +        return MEMTX_ERROR;
>> +    } else {
>> +        warn_report_once("%s: "
>> +                         "attempt to write outside of the backing block 
>> device "
>> +                         "(offset " TARGET_FMT_plx ") ignored",
>> +                         pfl->name, addr);
>
> This doesn't seem acceptable on mainstream, see:
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg607292.html

If this position still holds (it seems reasonable to assume so), then
the approach in this patch isn't going to be useful for writeable pflash
devices. With appropriate adjustment for your other comments, it may
well be fine for read-only devices.

Given that, I will go back to trying to find an approach that works for
writeable devices, perhaps by always intercepting reads/writes and
driving the block layer directly (while I previously had that working,
the performance was poor, which I can re-examine).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]