From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Wei Liu <wei.liu2@citrix.com>, Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 6/6] x86/emul: dedup hvmemul_cpuid() and pv_emul_cpuid()
Date: Tue, 6 Nov 2018 15:52:24 +0000 [thread overview]
Message-ID: <2b95ed09-cf3c-d60f-d511-a579de9d108d@citrix.com> (raw)
In-Reply-To: <5BE1B58C02000078001F8BB8@prv1-mh.provo.novell.com>
On 06/11/18 15:38, Jan Beulich wrote:
>>>> On 05.11.18 at 12:21, <andrew.cooper3@citrix.com> wrote:
>> They are identical, so provide a single x86emul_cpuid() instead.
>>
>> As x86_emulate() now only uses the ->cpuid() hook for real CPUID instructions,
>> the hook can be omitted from all special-purpose emulation ops.
> So I was expecting the hook to go away altogether, but I
> now realize that it can't because of some of the customization
> that's needed. That, in turn, means that the removal of the
> hook specification as per above will get us into problems the
> moment we need to check a feature that can't be taken
> straight from the policy object. I'm therefore unconvinced we
> actually want to go this far. It'll require enough care already
> to not blindly clone a new vcpu_has_...() wrongly from the
> many pre-existing examples in such a case. Thoughts?
All dynamic bits in CPUID are derived from other control state. e.g. we
check CR4.OSXSAVE, not CPUID.OSXSAVE. The other dynamic bits are APIC,
which comes from MSR_APIC_BASE, and OSPKE which also comes from CR4.
In the emulator itself, I think it would be a bug if we ever had
vcpu_has_osxsave etc, because that isn't how pipelines actually behave.
The feature checks here are semantically equivalent to "do the
instruction decode and execution units have silicon to cope with these
instructions".
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-11-06 15:52 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-05 11:21 [PATCH 0/6] x86/emul: Use struct cpuid_policy for feature checks Andrew Cooper
2018-11-05 11:21 ` [PATCH 1/6] tools: Move the typesafe min/max helpers into xen-tools/libs.h Andrew Cooper
2018-11-05 11:23 ` Wei Liu
2018-11-05 11:21 ` [PATCH 2/6] libx86: Split x86_cpuid_policy_fill_native() out of calculate_raw_policy() Andrew Cooper
2018-11-06 13:44 ` Jan Beulich
2018-11-09 16:24 ` Andrew Cooper
2018-11-12 8:13 ` Jan Beulich
2018-11-06 16:31 ` Roger Pau Monné
2018-11-09 16:26 ` Andrew Cooper
2018-11-05 11:21 ` [PATCH 3/6] tools/x86emul: Use struct cpuid_policy in the userspace test harnesses Andrew Cooper
2018-11-06 15:25 ` Jan Beulich
2018-11-05 11:21 ` [PATCH 4/6] x86/emul: Pass a full cpuid_policy into x86_emulate() Andrew Cooper
2018-11-06 15:28 ` Jan Beulich
2018-11-05 11:21 ` [PATCH 5/6] x86/emul: Don't use the ->cpuid() hook for feature checks Andrew Cooper
2018-11-06 15:32 ` Jan Beulich
2018-11-05 11:21 ` [PATCH 6/6] x86/emul: dedup hvmemul_cpuid() and pv_emul_cpuid() Andrew Cooper
2018-11-06 15:38 ` Jan Beulich
2018-11-06 15:52 ` Andrew Cooper [this message]
2018-11-06 16:16 ` Jan Beulich
2018-11-09 17:16 ` Andrew Cooper
2018-11-12 8:17 ` Jan Beulich
2018-11-14 0:20 ` Woods, Brian
2018-11-14 7:47 ` Jan Beulich
2018-11-15 14:23 ` Andrew Cooper
2018-11-15 15:09 ` Jan Beulich
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=2b95ed09-cf3c-d60f-d511-a579de9d108d@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.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).