qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Kevin Wolf <kwolf@redhat.com>, Qemu-block <qemu-block@nongnu.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	John Snow <jsnow@redhat.com>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	Max Reitz <mreitz@redhat.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Laszlo Ersek <lersek@redhat.com>
Subject: Re: [Qemu-devel] [PATCH-for-4.1 v4 2/5] hw/block/pflash_cfi01: Use the correct READ_ARRAY value
Date: Fri, 12 Jul 2019 18:53:49 +0200	[thread overview]
Message-ID: <b903d7ae-968c-b02e-55e6-65ef0208da6e@redhat.com> (raw)
In-Reply-To: <CAFEAcA8RQDOJNgyWSpr5L0sgXoxvoToU3EGTX8O0+D5kmeMegg@mail.gmail.com>

On 7/12/19 5:15 PM, Peter Maydell wrote:
> On Thu, 11 Jul 2019 at 16:58, Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
>>
>> In the "Read Array Flowchart" the command has a value of 0xFF.
>>
>> In the document [*] the "Read Array Flowchart", the READ_ARRAY
>> command has a value of 0xff.
>>
>> Use the correct value in the pflash model.
>>
>> There is no change of behavior in the guest, because:
>> - when the guest were sending 0xFF, the reset_flash label
>>   was setting the command value as 0x00
>> - 0x00 was used internally for READ_ARRAY
>>
>> To keep migration with older versions behaving correctly, we
>> decide to always migrate the READ_ARRAY as 0x00.
>>
>> [*] "Common Flash Interface (CFI) and Command Sets"
>>     (Intel Application Note 646)
>>     Appendix B "Basic Command Set"
>>
>> Reviewed-by: John Snow <jsnow@redhat.com>
>> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
>> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
> 
> These changes look correct as far as they go, but are
> we sure that command value 0x00 will never be a valid
> command in some future version? If it ever does, then we
> have a problem because we can't distinguish "0xff with
> a silly encoding" from "really 0x00" in the incoming
> migration data stream.
> 
> If we're 100% confident that there will never be a true
> command 0x00 then this approach is OK.

I am not confident, the industry can surprise us.

If a CFI command of value 0x00 is ever published, then this device will
be in troubles because it can not support it (due to back-migration).
Neither in its current state, neither after this patch.

So if this ever happens, this device will never be able to announce it
supports features with a such command. And if guests require we model
this feature, then we'll increase the migration version and the device
won't be backward-migratable.

I'll try to explain that in the commit description.


  reply	other threads:[~2019-07-12 16:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-11 15:56 [Qemu-devel] [PATCH-for-4.1 v4 0/5] hw/block/pflash_cfi01: Add DeviceReset() handler Philippe Mathieu-Daudé
2019-07-11 15:56 ` [Qemu-devel] [PATCH-for-4.1 v4 1/5] hw/block/pflash_cfi01: Removed an unused timer Philippe Mathieu-Daudé
2019-07-11 15:57 ` [Qemu-devel] [PATCH-for-4.1 v4 2/5] hw/block/pflash_cfi01: Use the correct READ_ARRAY value Philippe Mathieu-Daudé
2019-07-11 16:38   ` Dr. David Alan Gilbert
2019-07-12 15:15   ` Peter Maydell
2019-07-12 16:53     ` Philippe Mathieu-Daudé [this message]
2019-07-11 15:57 ` [Qemu-devel] [PATCH-for-4.1 v4 3/5] hw/block/pflash_cfi01: Extract pflash_mode_read_array() Philippe Mathieu-Daudé
2019-07-11 15:57 ` [Qemu-devel] [PATCH-for-4.1 v4 4/5] hw/block/pflash_cfi01: Start state machine as READY to accept commands Philippe Mathieu-Daudé
2019-07-11 15:57 ` [Qemu-devel] [PATCH-for-4.1 v4 5/5] hw/block/pflash_cfi01: Add the DeviceReset() handler 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=b903d7ae-968c-b02e-55e6-65ef0208da6e@redhat.com \
    --to=philmd@redhat.com \
    --cc=alistair.francis@wdc.com \
    --cc=dgilbert@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lersek@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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).