public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: BrillyWu@viatech.com.cn
Cc: mtosatti@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: Add CPUID support for VIA CPU
Date: Thu, 14 Apr 2011 10:48:20 +0300	[thread overview]
Message-ID: <4DA6A6C4.4040507@redhat.com> (raw)
In-Reply-To: <C4F7CD9A92DBFF48AD8779355CD4D7890D7A1B@exchsg04.s3graphics.com>

On 04/14/2011 06:14 AM, BrillyWu@viatech.com.cn wrote:
>   On 04/13/2011 02:05 PM, BrillyWu@viatech.com.cn wrote:
> >  >  >>
> >  >  >>   +	/* cpuid 0xC0000001.edx */
> >  >  >>  +	const u32 kvm_supported_word5_x86_features =
> >  >  >>   +		F(XSTORE) | F(XSTORE_EN) | F(XCRYPT) | F(XCRYPT_EN) |
> >  >  >>   +		F(ACE2) | F(ACE2_EN) | F(PHE) | F(PHE_EN) |
> >  >  >>   +		F(PMM) | F(PMM_EN);
> >  >  >>   +
> >
> >  >  >   Are all of these features save wrt save/restore? (do they all act
> >  >  >on  state in standard registers?)  Do they need any control register
> >  >  >bits  to be active or MSRs to configure?
> >
> >  >  These features depend on instructions for the PadLock hardware engine of VIA CPU.
> >  >  The PadLock instructions just act on standard registers like general X86 instructions, and the features have been enabled when the CPU leave the factory, so there is no need to activate any control register bits or configure MSRs.
>
> >  I see there is a dependency on EFLAGS[30].  Does a VM entry clear this bit?  If not, we have to do it ourselves.
>
> Yes, PadLock hardware engine has some association with EFLAGS[30], but it just required that the EFLAGS[30] should be set to "0"
> before using PadLock ACE instructions. It is recommanded that execute instruction sequence "pushf;popf" to clear this bit before using
> ACE instructions.
> AFAIK, the VM entry never sets the EFLAGS[30] bit, so it seems that we do not have to do it ourselves.

I don't think we need to.  kvm kernel code doesn't use padlock; other 
sources which might set EFLAGS[30] are:

- the guest; but VMEXIT clears EFLAGS
- userspace; but syscall/sysenter/int instructions clear EFLAGS[30]
- another kernel thread; there is likely a popf in the context switch 
path somewhere (we should verify this)

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2011-04-14  7:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-13  3:26 [PATCH] KVM: Add CPUID support for VIA CPU BrillyWu
2011-04-13  8:59 ` Avi Kivity
2011-04-13 11:05   ` BrillyWu
2011-04-13 11:32     ` Avi Kivity
2011-04-14  3:14       ` BrillyWu
2011-04-14  7:48         ` Avi Kivity [this message]
2011-04-14  9:54           ` BrillyWu
2011-04-14 10:07             ` Avi Kivity
2011-04-21 10:06               ` BrillyWu
2011-04-24  7:18                 ` Avi Kivity
2011-04-25  5:55                   ` BrillyWu
2011-04-27  8:48                     ` Avi Kivity
2011-04-28  1:27                       ` [PATCH] qemu-kvm: " BrillyWu
2011-04-14  3:59       ` [PATCH v2] KVM: " BrillyWu

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=4DA6A6C4.4040507@redhat.com \
    --to=avi@redhat.com \
    --cc=BrillyWu@viatech.com.cn \
    --cc=kvm@vger.kernel.org \
    --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