From: Yang Weijiang <weijiang.yang@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, rkrcmar@redhat.com,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
mst@redhat.com, yu-cheng.yu@intel.com, yi.z.zhang@intel.com,
hjl.tools@gmail.com, Zhang Yi <yi.z.zhang@linux.intel.com>
Subject: Re: [Qemu-devel][PATCH 2/4] Add CET SHSTK and IBT CPUID feature-word definitions.
Date: Sat, 29 Dec 2018 23:26:43 +0800 [thread overview]
Message-ID: <20181229152642.GA6590@localhost.localdomain> (raw)
In-Reply-To: <97d6366b-df95-cf00-d652-3176547ae5ca@redhat.com>
On Fri, Dec 28, 2018 at 03:25:10PM +0100, Paolo Bonzini wrote:
Thanks a lot Paolo for the comments!
I'll fix the issue in next version.
> On 26/12/18 09:25, Yang Weijiang wrote:
> > @@ -1233,6 +1252,14 @@ static const ExtSaveArea x86_ext_save_areas[] = {
> > { .feature = FEAT_7_0_ECX, .bits = CPUID_7_0_ECX_PKU,
> > .offset = offsetof(X86XSaveArea, pkru_state),
> > .size = sizeof(XSavePKRU) },
> > + [XSTATE_CET_U_BIT] = {
> > + .feature = FEAT_7_0_ECX, .bits = CPUID_7_0_ECX_CET_SHSTK,
> > + .offset = offsetof(X86XSaveArea, cet_u),
>
> These offsets are incorrect, since supervisor states are only stored in
> the compacted format. In fact, in patch 4, supervisor states should
> return 0 in CPUID(EAX=0Dh,ECX=n).EBX.
>
> You can use offset == 0 to distinguish supervisor and user states, so
> that supervisor states are skipped in xsave_area_size and x86_cpu_reset.
>
> Thanks,
>
> Paolo
>
> > + .size = sizeof(XSaveCETU) },
> > + [XSTATE_CET_S_BIT] = {
> > + .feature = FEAT_7_0_ECX, .bits = CPUID_7_0_ECX_CET_SHSTK,
> > + .offset = offsetof(X86XSaveArea, cet_s),
> > + .size = sizeof(XSaveCETS) },
> > };
> >
> > static uint32_t xsave_area_size(uint64_t mask)
WARNING: multiple messages have this Message-ID (diff)
From: Yang Weijiang <weijiang.yang@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, rkrcmar@redhat.com,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
mst@redhat.com, yu-cheng.yu@intel.com, yi.z.zhang@intel.com,
hjl.tools@gmail.com, Zhang Yi <yi.z.zhang@linux.intel.com>
Subject: Re: [Qemu-devel] [PATCH 2/4] Add CET SHSTK and IBT CPUID feature-word definitions.
Date: Sat, 29 Dec 2018 23:26:43 +0800 [thread overview]
Message-ID: <20181229152642.GA6590@localhost.localdomain> (raw)
In-Reply-To: <97d6366b-df95-cf00-d652-3176547ae5ca@redhat.com>
On Fri, Dec 28, 2018 at 03:25:10PM +0100, Paolo Bonzini wrote:
Thanks a lot Paolo for the comments!
I'll fix the issue in next version.
> On 26/12/18 09:25, Yang Weijiang wrote:
> > @@ -1233,6 +1252,14 @@ static const ExtSaveArea x86_ext_save_areas[] = {
> > { .feature = FEAT_7_0_ECX, .bits = CPUID_7_0_ECX_PKU,
> > .offset = offsetof(X86XSaveArea, pkru_state),
> > .size = sizeof(XSavePKRU) },
> > + [XSTATE_CET_U_BIT] = {
> > + .feature = FEAT_7_0_ECX, .bits = CPUID_7_0_ECX_CET_SHSTK,
> > + .offset = offsetof(X86XSaveArea, cet_u),
>
> These offsets are incorrect, since supervisor states are only stored in
> the compacted format. In fact, in patch 4, supervisor states should
> return 0 in CPUID(EAX=0Dh,ECX=n).EBX.
>
> You can use offset == 0 to distinguish supervisor and user states, so
> that supervisor states are skipped in xsave_area_size and x86_cpu_reset.
>
> Thanks,
>
> Paolo
>
> > + .size = sizeof(XSaveCETU) },
> > + [XSTATE_CET_S_BIT] = {
> > + .feature = FEAT_7_0_ECX, .bits = CPUID_7_0_ECX_CET_SHSTK,
> > + .offset = offsetof(X86XSaveArea, cet_s),
> > + .size = sizeof(XSaveCETS) },
> > };
> >
> > static uint32_t xsave_area_size(uint64_t mask)
next prev parent reply other threads:[~2018-12-29 15:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-26 8:25 [Qemu-devel][PATCH 0/4] This patch-set is to enable Guest CET support Yang Weijiang
2018-12-26 8:25 ` [Qemu-devel] [PATCH " Yang Weijiang
2018-12-26 8:25 ` [Qemu-devel][PATCH 1/4] Add CET xsaves/xrstors related macros and structures Yang Weijiang
2018-12-26 8:25 ` [Qemu-devel] [PATCH " Yang Weijiang
2018-12-26 8:25 ` [Qemu-devel][PATCH 2/4] Add CET SHSTK and IBT CPUID feature-word definitions Yang Weijiang
2018-12-26 8:25 ` [Qemu-devel] [PATCH " Yang Weijiang
2018-12-28 14:25 ` [Qemu-devel][PATCH " Paolo Bonzini
2018-12-28 14:25 ` [Qemu-devel] [PATCH " Paolo Bonzini
2018-12-29 15:26 ` Yang Weijiang [this message]
2018-12-29 15:26 ` Yang Weijiang
2018-12-26 8:25 ` [Qemu-devel][PATCH 3/4] Add hepler functions for CPUID xsave area size calculation Yang Weijiang
2018-12-26 8:25 ` [Qemu-devel] [PATCH " Yang Weijiang
2019-01-08 16:11 ` [Qemu-devel][PATCH " Christophe de Dinechin
2019-01-08 16:11 ` [Qemu-devel] [PATCH " Christophe de Dinechin
2018-12-26 8:25 ` [Qemu-devel][PATCH 4/4] Report CPUID xsave area support for CET Yang Weijiang
2018-12-26 8:25 ` [Qemu-devel] [PATCH " Yang Weijiang
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=20181229152642.GA6590@localhost.localdomain \
--to=weijiang.yang@intel.com \
--cc=hjl.tools@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rkrcmar@redhat.com \
--cc=yi.z.zhang@intel.com \
--cc=yi.z.zhang@linux.intel.com \
--cc=yu-cheng.yu@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.