summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-08-30 07:42:38 +0000
committerkib <kib@FreeBSD.org>2013-08-30 07:42:38 +0000
commitf8c0849efff16d60a8ceaa0515e45d857fdbad0c (patch)
tree510e86d35ef762e86057edb62728904b8955ab3d /sys/amd64/include
parentdc9c173247c790c181a79be41f9f9218a09e91de (diff)
downloadFreeBSD-src-f8c0849efff16d60a8ceaa0515e45d857fdbad0c.zip
FreeBSD-src-f8c0849efff16d60a8ceaa0515e45d857fdbad0c.tar.gz
Provide a wrapper for the INVPCID instruction, definition of the
descriptor and symbolic names for the operation types. Sponsored by: The FreeBSD Foundation Reviewed by: alc Tested by: pho, bf
Diffstat (limited to 'sys/amd64/include')
-rw-r--r--sys/amd64/include/cpufunc.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index 881fcd2..3d381c6 100644
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -472,6 +472,26 @@ invlpg(u_long addr)
__asm __volatile("invlpg %0" : : "m" (*(char *)addr) : "memory");
}
+#define INVPCID_ADDR 0
+#define INVPCID_CTX 1
+#define INVPCID_CTXGLOB 2
+#define INVPCID_ALLCTX 3
+
+struct invpcid_descr {
+ uint64_t pcid:12 __packed;
+ uint64_t pad:52 __packed;
+ uint64_t addr;
+} __packed;
+
+static __inline void
+invpcid(struct invpcid_descr *d, int type)
+{
+
+ /* invpcid (%rdx),%rax */
+ __asm __volatile(".byte 0x66,0x0f,0x38,0x82,0x02"
+ : : "d" (d), "a" ((u_long)type) : "memory");
+}
+
static __inline u_short
rfs(void)
{
OpenPOWER on IntegriCloud