|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 2/2] x86: use invpcid to do global flushing
>>> On 05.03.18 at 10:50, <wei.liu2@xxxxxxxxxx> wrote:
> @@ -120,11 +121,24 @@ unsigned int flush_area_local(const void *va, unsigned
> int flags)
> else
> {
> u32 t = pre_flush();
> - unsigned long cr4 = read_cr4();
>
> - write_cr4(cr4 & ~X86_CR4_PGE);
> - barrier();
> - write_cr4(cr4);
> + if ( !cpu_has_invpcid )
> + {
> + unsigned long cr4 = read_cr4();
> +
> + write_cr4(cr4 & ~X86_CR4_PGE);
> + barrier();
> + write_cr4(cr4);
> + }
> + else
> + {
> + /*
> + * Using invpcid to flush all mappings works
> + * regardless of whether PCID is enabled or not.
> + * It is faster than read-modify-write CR4.
> + */
> + invpcid_flush_all();
> + }
As just validly indicated by Jürgen, this is where my comment I
gave to one of his patches actually belongs: This is correct for
FLUSH_TLB_GLOBAL, but goes too far for FLUSH_TLB.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |