x86/svm: Don't unconditionally use a new ASID in svm_invlpg_intercept()

paging_invlpg() already returns a boolean indicating whether an invalidation
is necessary or not.  A return value of 0 indicates that the specified virtual
address wasn't shadowed (or has already been flushed), cannot currently be
cached in the TLB.

This is a performance optimisation.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Tim Deegan <tim@xen.org>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
Andrew Cooper committed 2016-05-10 18:08:58 +01:00
1 parent a373db28ea
commit eee511dec9
1 file changed
+2 -2
+2 -2
View File
@@ -2224,8 +2224,8 @@ static void svm_invlpg_intercept(unsigned long vaddr)
{
struct vcpu *curr = current;
HVMTRACE_LONG_2D(INVLPG, 0, TRC_PAR_LONG(vaddr));
paging_invlpg(curr, vaddr);
svm_asid_g_invlpg(curr, vaddr);
if ( paging_invlpg(curr, vaddr) )
svm_asid_g_invlpg(curr, vaddr);
}
static struct hvm_function_table __initdata svm_function_table = {
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.