From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Pu Wen <puwen@hygon.cn>, <xen-devel@lists.xenproject.org>
Cc: "Wei Liu" <wl@xen.org>, "Jan Beulich" <jbeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH v2] SVM: Add union intstat_t for offset 68h in vmcb struct
Date: Tue, 24 Mar 2020 12:28:55 +0000 [thread overview]
Message-ID: <f82b6a33-6af6-8c9d-2876-b518167eb832@citrix.com> (raw)
In-Reply-To: <20200324103726.3406-1-puwen@hygon.cn>
On 24/03/2020 10:37, Pu Wen wrote:
> According to chapter "Appendix B Layout of VMCB" in the new version
> (v3.32) AMD64 APM[1], bit 1 of the VMCB offset 68h is defined as
> GUEST_INTERRUPT_MASK.
>
> In current xen codes, it use whole u64 interrupt_shadow to setup
> interrupt shadow, which will misuse other bit in VMCB offset 68h
> as part of interrupt_shadow.
>
> Add union intstat_t for VMCB offset 68h and fix codes to only use
> bit 0 as intr_shadow according to the new APM description.
>
> Reference:
> [1] https://www.amd.com/system/files/TechDocs/24593.pdf
>
> Signed-off-by: Pu Wen <puwen@hygon.cn>
Hmm - this field doesn't appear to be part of AVIC, which makes me
wonder what we're doing without it.
It appears to be a shadow copy of EFLAGS.IF which is only written on
vmexit, and never consumed, but this is based on Appendix B which is the
only reference I can find to the field at all. Neither the
VMRUN/#VMEXIT descriptions discuss it at all.
Given its position next to the (ambiguous) INTERRUPT_SHADOW, it just
might actually distinguish the STI shadow from the MovSS shadow, but it
could only do that by not behaving as described, and being asymmetric
with EFLAGS. I don't have time to investigate this right now.
We need the field described in Xen to set it appropriately for virtual
vmexit, but I think that is the extent of what we need to do.
~Andrew
next prev parent reply other threads:[~2020-03-24 12:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-24 10:37 [Xen-devel] [PATCH v2] SVM: Add union intstat_t for offset 68h in vmcb struct Pu Wen
2020-03-24 11:55 ` Jan Beulich
2020-03-25 15:21 ` Pu Wen
2020-03-24 12:28 ` Andrew Cooper [this message]
2020-03-25 15:22 ` Pu Wen
2020-03-25 15:56 ` Andrew Cooper
2020-03-26 10:16 ` Wen Pu
2020-03-25 10:30 ` Roger Pau Monné
2020-03-25 15:23 ` Pu Wen
2020-03-25 16:03 ` Andrew Cooper
2020-03-26 10:16 ` Wen Pu
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=f82b6a33-6af6-8c9d-2876-b518167eb832@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=puwen@hygon.cn \
--cc=roger.pau@citrix.com \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.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).