qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Edmondson <david.edmondson@oracle.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	"Tom Lendacky" <thomas.lendacky@amd.com>,
	qemu-block@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
	"Xu Yandong" <xuyandong2@huawei.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"James Bottomley" <jejb@linux.ibm.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	qemu-devel@nongnu.org, "Max Reitz" <mreitz@redhat.com>,
	"Shannon Zhao" <shannon.zhaosl@gmail.com>,
	"Zheng Xiang" <zhengxiang9@huawei.com>,
	qemu-arm@nongnu.org, "haibinzhang(张海斌)" <haibinzhang@tencent.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"John Snow" <jsnow@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Stefano Garzarella" <sgarzare@redhat.com>
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	[thread overview]
Message-ID: <cunlf3z9ryh.fsf@oracle.com> (raw)
In-Reply-To: <384a5d1d-de25-78d7-d8b0-226ebca44a6d@redhat.com> ("Philippe Mathieu-Daudé"'s message of "Thu, 9 Sep 2021 11:27:56 +0200")

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	other threads:[~2021-09-14 14:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10 13:40 [PATCH v4 0/1] hw/pflash_cfi01: Allow an administrator to reduce the memory consumption of flash devices David Edmondson
2021-08-10 13:40 ` [PATCH v4 1/1] hw/pflash_cfi01: Allow backing devices to be smaller than memory region David Edmondson
2021-09-09  9:27   ` Philippe Mathieu-Daudé
2021-09-14 14:01     ` David Edmondson [this message]
2021-08-20 18:19 ` [PATCH v4 0/1] hw/pflash_cfi01: Allow an administrator to reduce the memory consumption of flash devices Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cunlf3z9ryh.fsf@oracle.com \
    --to=david.edmondson@oracle.com \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=haibinzhang@tencent.com \
    --cc=imammedo@redhat.com \
    --cc=jejb@linux.ibm.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.com \
    --cc=shannon.zhaosl@gmail.com \
    --cc=stefanha@redhat.com \
    --cc=thomas.lendacky@amd.com \
    --cc=xuyandong2@huawei.com \
    --cc=zhengxiang9@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).