From: David Vrabel <david.vrabel@citrix.com>
To: "Tian, Kevin" <kevin.tian@intel.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Jan Beulich <jbeulich@suse.com>,
"Nakajima, Jun" <jun.nakajima@intel.com>
Subject: Re: [PATCHv5 1/2] x86/ept: invalidate guest physical mappings on VMENTER
Date: Fri, 18 Dec 2015 10:18:12 +0000 [thread overview]
Message-ID: <5673DD64.90500@citrix.com> (raw)
In-Reply-To: <AADFC41AFE54684AB9EE6CBC0274A5D15F74E124@SHSMSX101.ccr.corp.intel.com>
On 18/12/15 07:53, Tian, Kevin wrote:
>> From: David Vrabel [mailto:david.vrabel@citrix.com]
>> Sent: Thursday, December 17, 2015 11:17 PM
>
> [...]
>
>> diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
>> index f7c5e4f..cca35f2 100644
>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>
> [...]
>
>> @@ -3507,6 +3495,16 @@ void vmx_vmenter_helper(const struct cpu_user_regs *regs)
>> if ( unlikely(need_flush) )
>> vpid_sync_all();
>>
>> + if ( paging_mode_hap(curr->domain) )
>> + {
>> + struct ept_data *ept = &p2m_get_hostp2m(curr->domain)->ept;
>> + unsigned int cpu = smp_processor_id();
>> +
>> + if ( cpumask_test_cpu(cpu, ept->invalidate)
>> + && cpumask_test_and_clear_cpu(cpu, ept->invalidate) )
>
> Just test_and_clear should be enough.
The first test is to avoid the locked test and clear in the common case.
But this is probably better written as
if ( cpumask_test_cpu(cpu, ept->invalidate) )
{
cpumask_clear_cpu(cpu, ept->invalidate);
__invept(...);
}
>> --- a/xen/arch/x86/mm/p2m-ept.c
>> +++ b/xen/arch/x86/mm/p2m-ept.c
>> @@ -1089,9 +1089,10 @@ static void ept_memory_type_changed(struct p2m_domain
>> *p2m)
>>
>> static void __ept_sync_domain(void *info)
>> {
>> - struct ept_data *ept = &((struct p2m_domain *)info)->ept;
>> -
>> - __invept(INVEPT_SINGLE_CONTEXT, ept_get_eptp(ept), 0);
>> + /*
>> + * The invalidate will be done before VMENTER (see
>
> invalidate -> invalidation?
That would be the correct English grammer, yes.
David
next prev parent reply other threads:[~2015-12-18 10:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-17 15:17 [PATCHv5 0/2] x86/ept: reduce translation invalidation impact David Vrabel
2015-12-17 15:17 ` [PATCHv5 1/2] x86/ept: invalidate guest physical mappings on VMENTER David Vrabel
2015-12-17 15:56 ` Andrew Cooper
2015-12-18 7:53 ` Tian, Kevin
2015-12-18 10:18 ` David Vrabel [this message]
2015-12-18 10:24 ` George Dunlap
2015-12-18 10:30 ` David Vrabel
2015-12-18 10:32 ` Jan Beulich
2015-12-18 11:37 ` David Vrabel
2015-12-17 15:17 ` [PATCHv5 2/2] x86/ept: defer the invalidation until the p2m lock is released David Vrabel
2015-12-18 7:46 ` [PATCHv5 0/2] x86/ept: reduce translation invalidation impact Tian, Kevin
2015-12-18 10:12 ` David Vrabel
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=5673DD64.90500@citrix.com \
--to=david.vrabel@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=jun.nakajima@intel.com \
--cc=kevin.tian@intel.com \
--cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).