All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <keir.fraser@eu.citrix.com>
To: Ben Guthro <bguthro@virtualiron.com>,
	xen-devel <xen-devel@lists.xensource.com>,
	Robert Phillips <rphillips@virtualiron.com>
Subject: Re: [PATCH][SVM] CPL initialization fix
Date: Mon, 10 Mar 2008 19:26:23 +0000	[thread overview]
Message-ID: <C3FB3BDF.1DC3E%keir.fraser@eu.citrix.com> (raw)
In-Reply-To: <C3FB3A02.1DC1F%keir.fraser@eu.citrix.com>

For reference, from AMD's manual, Vol.2:
"The processor reads the current privilege level from the CPL field in the
VMCB, not from SS.DPL. However, SS.DPL should match the CPL field."

And from Intel's manual, Vol.3B:
"Note that the value of the DPL field for SS is always equal to the logical
processor¹s current privilege level (CPL)."

 -- Keir

On 10/3/08 19:18, "Keir Fraser" <keir.fraser@eu.citrix.com> wrote:

> CPL is architecturally SS.DPL in almost all cases. It's certainly not
> CS.DPL. What do you mean by 'migrate a QEMU guest'?
> 
>  -- Keir
> 
> On 10/3/08 19:14, "Ben Guthro" <bguthro@virtualiron.com> wrote:
> 
>> CPL should be determined by code segment's DPL, not data segment's.
>> 
>> This solves a problem migrating a QEMU guest without PV-on-HVM drivers
>> 
>> Signed-off-by: Robert Plillips <rphillips@virtualiron.com>
>> Signed-off-by: Ben Guthro <bguthro@virtualoiron.com>
>> diff -r f76f151a7431 xen/arch/x86/hvm/svm/svm.c
>> --- a/xen/arch/x86/hvm/svm/svm.c
>> +++ b/xen/arch/x86/hvm/svm/svm.c
>> @@ -557,7 +557,7 @@ static void svm_set_segment_register(str
>>          break;
>>      case x86_seg_ss:
>>          memcpy(&vmcb->ss, reg, sizeof(*reg));
>> -        vmcb->cpl = vmcb->ss.attr.fields.dpl;
>> +        vmcb->cpl = vmcb->cs.attr.fields.dpl;
>>          break;
>>      case x86_seg_tr:
>>          memcpy(&vmcb->tr, reg, sizeof(*reg));
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

  reply	other threads:[~2008-03-10 19:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-10 19:14 [PATCH][SVM] CPL initialization fix Ben Guthro
2008-03-10 19:18 ` Keir Fraser
2008-03-10 19:26   ` Keir Fraser [this message]
2008-03-10 20:01     ` Robert Phillips
2008-03-10 21:57       ` Keir Fraser

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=C3FB3BDF.1DC3E%keir.fraser@eu.citrix.com \
    --to=keir.fraser@eu.citrix.com \
    --cc=bguthro@virtualiron.com \
    --cc=rphillips@virtualiron.com \
    --cc=xen-devel@lists.xensource.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.