From: Avi Kivity <avi@redhat.com>
To: Mohammed Gamal <m.gamal005@gmail.com>
Cc: mtosatti@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCH] VMX: Fix and improve guest state validity checks
Date: Tue, 25 May 2010 14:22:13 +0300 [thread overview]
Message-ID: <4BFBB2E5.6070906@redhat.com> (raw)
In-Reply-To: <AANLkTilOnavcSTHkJ4V99GQkIB0coP1dVabieHFdFVV5@mail.gmail.com>
On 05/25/2010 01:36 PM, Mohammed Gamal wrote:
>
>> Any reference to back this up? I think rpl is valid regardless of
>> ss.unusable (i.e. loading selector 0003 results in an unusable segment with
>> rpl=3), but I don't see how dpl can be valid in an unusable segment.
>>
>>
> Intel 64 and IA-32 Architectures Software Developer’s Manual Volume
> 3B, System Programming Guide, Part 2, Chapter 22, Section 22.3.1.2:
> Checks on Guest Segment Registers.
> You'll note that DS, ES, FS, GS checks are done when the segment is
> usable. SS checks are not necessarily checked only when the segment is
> usable.
>
Strange, but consistent with
> If the unusable bit is 1, the base address, the segment limit, and the
> remainder of the access rights are undefined after VM entry. The only
> exceptions are the following:
> — Bits 3:0 of the base address for SS are cleared to 0.
> — SS.DPL: always loaded from the SS access-rights field. This will be
> the current privilege level (CPL) after the VM entry completes.
> — SS.B: set to 1.
> — The base addresses for FS and GS: always loaded. On processors
> that support Intel 64 architecture, the values loaded for base
> addresses for FS and GS are also manifest in the FS.base and
> GS.base MSRs.
> — The base address for LDTR on processors that support Intel 64 archi-
> tecture: set to an undefined but canonical value.
> — Bits 63:32 of the base addresses for SS, DS, and ES on processors
> that support Intel 64 architecture: cleared to 0.
So you are right.
Seems to me we can simplify vmx_get_cpl() on this basis to look at ss.dpl.
--
error compiling committee.c: too many arguments to function
prev parent reply other threads:[~2010-05-25 11:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-11 16:52 [PATCH] VMX: Fix and improve guest state validity checks Mohammed Gamal
2010-05-13 1:52 ` Marcelo Tosatti
2010-05-13 6:24 ` Avi Kivity
2010-05-13 20:15 ` Mohammed Gamal
2010-05-25 9:37 ` Avi Kivity
2010-05-25 10:36 ` Mohammed Gamal
2010-05-25 11:22 ` Avi Kivity [this message]
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=4BFBB2E5.6070906@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=m.gamal005@gmail.com \
--cc=mtosatti@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox