From: "Nakajima, Jun" <jun.nakajima@intel.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
Sergey Dyasli <sergey.dyasli@citrix.com>,
"JBeulich@suse.com" <JBeulich@suse.com>
Cc: "Tian, Kevin" <kevin.tian@intel.com>,
"Tim (Xen.org)" <tim@xen.org>,
George Dunlap <George.Dunlap@citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
"suravee.suthikulpanit@amd.com" <suravee.suthikulpanit@amd.com>,
"boris.ostrovsky@oracle.com" <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH v3 5/9] x86/vvmx: make updating shadow EPTP value more efficient
Date: Fri, 6 Oct 2017 05:33:27 +0000 [thread overview]
Message-ID: <2A378368-AD3D-4541-B6F8-E1102F5E0BE8@intel.com> (raw)
In-Reply-To: <4543adff-1270-19b3-2b53-36b7f07f908d@citrix.com>
On 10/5/17, 6:13 AM, "Andrew Cooper" wrote:
On 05/10/17 14:04, Sergey Dyasli wrote:
> On Thu, 2017-10-05 at 03:27 -0600, Jan Beulich wrote:
>>>>> On 05.10.17 at 10:18, <sergey.dyasli@citrix.com> wrote:
>>> --- a/xen/arch/x86/hvm/vmx/entry.S
>>> +++ b/xen/arch/x86/hvm/vmx/entry.S
>>> @@ -80,7 +80,7 @@ UNLIKELY_END(realmode)
>>> mov %rsp,%rdi
>>> call vmx_vmenter_helper
>>> cmp $0,%eax
>>> - jne .Lvmx_vmentry_restart
>>> + je .Lvmx_vmentry_restart
>> If you make the function return bool, the cmp above also needs
>> changing (and then preferably to "test %al, %al", in which case
>> it would then also better be "jz" instead of "je").
> Here's the updated delta:
>
> diff --git a/xen/arch/x86/hvm/vmx/entry.S b/xen/arch/x86/hvm/vmx/entry.S
> index 9fb8f89220..47cd674260 100644
> --- a/xen/arch/x86/hvm/vmx/entry.S
> +++ b/xen/arch/x86/hvm/vmx/entry.S
> @@ -79,8 +79,8 @@ UNLIKELY_END(realmode)
>
> mov %rsp,%rdi
> call vmx_vmenter_helper
> - cmp $0,%eax
> - jne .Lvmx_vmentry_restart
> + test %al, %al
> + jz .Lvmx_vmentry_restart
> mov VCPU_hvm_guest_cr2(%rbx),%rax
>
> pop %r15
> diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
> index c9a4111267..a5c2bd71cd 100644
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -4197,7 +4197,8 @@ static void lbr_fixup(void)
> bdw_erratum_bdf14_fixup();
> }
>
> -int vmx_vmenter_helper(const struct cpu_user_regs *regs)
> +/* Returns false if the vmentry has to be restarted */
> +bool vmx_vmenter_helper(const struct cpu_user_regs *regs)
> {
> struct vcpu *curr = current;
> u32 new_asid, old_asid;
> @@ -4206,7 +4207,7 @@ int vmx_vmenter_helper(const struct cpu_user_regs *regs)
>
> /* Shadow EPTP can't be updated here because irqs are disabled */
> if ( nestedhvm_vcpu_in_guestmode(curr) && vcpu_nestedhvm(curr).stale_np2m )
> - return 1;
> + return false;
>
> if ( curr->domain->arch.hvm_domain.pi_ops.do_resume )
> curr->domain->arch.hvm_domain.pi_ops.do_resume(curr);
> @@ -4269,7 +4270,7 @@ int vmx_vmenter_helper(const struct cpu_user_regs *regs)
> __vmwrite(GUEST_RSP, regs->rsp);
> __vmwrite(GUEST_RFLAGS, regs->rflags | X86_EFLAGS_MBS);
>
> - return 0;
> + return true;
> }
With this, the whole series is Acked-by: Andrew Cooper
<andrew.cooper3@citrix.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
---
Jun
Intel Open Source Technology Center
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-10-06 5:33 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-03 15:20 [PATCH v3 0/9] Nested p2m: allow sharing between vCPUs Sergey Dyasli
2017-10-03 15:20 ` [PATCH v3 1/9] x86/np2m: refactor p2m_get_nestedp2m() Sergey Dyasli
2017-10-03 15:20 ` [PATCH v3 2/9] x86/np2m: flush all np2m objects on nested INVEPT Sergey Dyasli
2017-10-04 14:12 ` George Dunlap
2017-10-03 15:20 ` [PATCH v3 3/9] x86/np2m: remove np2m_base from p2m_get_nestedp2m() Sergey Dyasli
2017-10-03 21:51 ` Boris Ostrovsky
2017-10-03 15:20 ` [PATCH v3 4/9] x86/np2m: simplify nestedhvm_hap_nested_page_fault() Sergey Dyasli
2017-10-04 14:26 ` George Dunlap
2017-10-03 15:21 ` [PATCH v3 5/9] x86/vvmx: make updating shadow EPTP value more efficient Sergey Dyasli
2017-10-04 14:38 ` George Dunlap
2017-10-04 14:55 ` Andrew Cooper
2017-10-05 8:18 ` Sergey Dyasli
2017-10-05 9:27 ` Jan Beulich
2017-10-05 13:04 ` Sergey Dyasli
2017-10-05 13:12 ` Andrew Cooper
2017-10-06 5:33 ` Nakajima, Jun [this message]
2017-10-03 15:21 ` [PATCH v3 6/9] x86/np2m: send flush IPIs only when a vcpu is actively using an np2m Sergey Dyasli
2017-10-04 14:53 ` George Dunlap
2017-10-03 15:21 ` [PATCH v3 7/9] x86/np2m: implement sharing of np2m between vCPUs Sergey Dyasli
2017-10-03 15:21 ` [PATCH v3 8/9] x86/np2m: refactor p2m_get_nestedp2m_locked() Sergey Dyasli
2017-10-03 15:21 ` [PATCH v3 9/9] x86/np2m: add break to np2m_flush_eptp() Sergey Dyasli
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=2A378368-AD3D-4541-B6F8-E1102F5E0BE8@intel.com \
--to=jun.nakajima@intel.com \
--cc=George.Dunlap@citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=kevin.tian@intel.com \
--cc=sergey.dyasli@citrix.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=tim@xen.org \
--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 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.