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>
{
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 = {