From: Laszlo Ersek <lersek@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
qemu devel list <qemu-devel@nongnu.org>
Cc: "Michael S. Tsirkin" <mst@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] q35/mch: implement extended TSEG sizes
Date: Thu, 8 Jun 2017 20:31:02 +0200 [thread overview]
Message-ID: <51ff0ee5-3875-1a51-415c-170a8b3b8eaf@redhat.com> (raw)
In-Reply-To: <961e1ac9-56a5-df24-9ed7-e1981e61942a@redhat.com>
On 06/08/17 18:34, Paolo Bonzini wrote:
>
>
> On 08/06/2017 18:10, Laszlo Ersek wrote:
>> When the guest writes value 0xffff to this register, the value that can be
>> read back is that of "mch.extended-tseg-mbytes" -- unless it remains
>> 0xffff. The guest is required to write 0xffff first (as opposed to a
>> read-only register) because PCI config space is generally not cleared on
>> QEMU reset, and after S3 resume or reboot, new guest firmware running on
>> old QEMU could read a guest OS-injected value from this register.
>
> I guess that's also a reason not to make it readonly (that is, it would
> require some firmware code anyway to test for "readonlyness" and
> distinguish old machine types from new)?
That's right; in
<https://lists.01.org/pipermail/edk2-devel/2017-May/010432.html> I wrote,
> If we invent such a new register, it should be in a location that is
> either read-only, or zeroed-on-reset, in current QEMU. Otherwise, new
> firmware running on old QEMU could be misled by a guest OS that writes
> to this register, and then either reboots or enters S3.
>
> ... With this in mind, I don't oppose "having to write somewhere to
> read back the result", but then let's please make that write access as
> well to the same new qemu-specific register, and not to MCH_ESMRAMC.
The problem is that config space is by default r/w and not cleared on
reboot -- see Gerd's
<https://lists.01.org/pipermail/edk2-devel/2017-May/010456.html> --, and
once we designate another offset as "special" (either "reactive" or
"read only"), the firmware will have to write to it and read it back
unconditionally, to tell it apart from the default / original /
non-special config space.
Thanks!
Laszlo
next prev parent reply other threads:[~2017-06-08 18:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-08 16:10 [Qemu-devel] [PATCH] q35/mch: implement extended TSEG sizes Laszlo Ersek
2017-06-08 16:34 ` Paolo Bonzini
2017-06-08 18:31 ` Laszlo Ersek [this message]
2017-06-08 17:41 ` Michael S. Tsirkin
2017-06-08 19:48 ` Gerd Hoffmann
2017-06-08 19:55 ` Michael S. Tsirkin
2017-06-08 23:01 ` Laszlo Ersek
2017-06-09 0:19 ` Michael S. Tsirkin
2017-06-09 17:41 ` Laszlo Ersek
2017-06-09 11:40 ` Paolo Bonzini
2017-06-09 20:01 ` Gerd Hoffmann
2017-06-14 18:25 ` Michael S. Tsirkin
2017-06-15 7:07 ` Gerd Hoffmann
2017-06-16 3:23 ` Michael S. Tsirkin
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=51ff0ee5-3875-1a51-415c-170a8b3b8eaf@redhat.com \
--to=lersek@redhat.com \
--cc=kraxel@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--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).