svn commit: r259641 - in head/sys/amd64: amd64 include vmm/intel
Neel Natu
neel at FreeBSD.org
Fri Dec 20 05:50:24 UTC 2013
Author: neel
Date: Fri Dec 20 05:50:22 2013
New Revision: 259641
URL: http://svnweb.freebsd.org/changeset/base/259641
Log:
Re-arrange bits in the amd64/pmap 'pm_flags' field.
The least significant 8 bits of 'pm_flags' are now used for the IPI vector
to use for nested page table TLB shootdown.
Previously we used IPI_AST to interrupt the host cpu which is functionally
correct but could lead to misleading interrupt counts for AST handler. The
AST handler was also doing a lot more than what is required for the nested
page table TLB shootdown (EOI and IRET).
Modified:
head/sys/amd64/amd64/pmap.c
head/sys/amd64/include/pmap.h
head/sys/amd64/vmm/intel/ept.c
Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c Fri Dec 20 00:56:23 2013 (r259640)
+++ head/sys/amd64/amd64/pmap.c Fri Dec 20 05:50:22 2013 (r259641)
@@ -1295,6 +1295,7 @@ pmap_invalidate_page_pcid(pmap_t pmap, v
static __inline void
pmap_invalidate_ept(pmap_t pmap)
{
+ int ipinum;
sched_pin();
KASSERT(!CPU_ISSET(curcpu, &pmap->pm_active),
@@ -1319,11 +1320,9 @@ pmap_invalidate_ept(pmap_t pmap)
/*
* Force the vcpu to exit and trap back into the hypervisor.
- *
- * XXX this is not optimal because IPI_AST builds a trapframe
- * whereas all we need is an 'eoi' followed by 'iret'.
*/
- ipi_selected(pmap->pm_active, IPI_AST);
+ ipinum = pmap->pm_flags & PMAP_NESTED_IPIMASK;
+ ipi_selected(pmap->pm_active, ipinum);
sched_unpin();
}
Modified: head/sys/amd64/include/pmap.h
==============================================================================
--- head/sys/amd64/include/pmap.h Fri Dec 20 00:56:23 2013 (r259640)
+++ head/sys/amd64/include/pmap.h Fri Dec 20 05:50:22 2013 (r259641)
@@ -312,9 +312,10 @@ struct pmap {
};
/* flags */
-#define PMAP_PDE_SUPERPAGE (1 << 0) /* supports 2MB superpages */
-#define PMAP_EMULATE_AD_BITS (1 << 1) /* needs A/D bits emulation */
-#define PMAP_SUPPORTS_EXEC_ONLY (1 << 2) /* execute only mappings ok */
+#define PMAP_NESTED_IPIMASK 0xff
+#define PMAP_PDE_SUPERPAGE (1 << 8) /* supports 2MB superpages */
+#define PMAP_EMULATE_AD_BITS (1 << 9) /* needs A/D bits emulation */
+#define PMAP_SUPPORTS_EXEC_ONLY (1 << 10) /* execute only mappings ok */
typedef struct pmap *pmap_t;
Modified: head/sys/amd64/vmm/intel/ept.c
==============================================================================
--- head/sys/amd64/vmm/intel/ept.c Fri Dec 20 00:56:23 2013 (r259640)
+++ head/sys/amd64/vmm/intel/ept.c Fri Dec 20 05:50:22 2013 (r259641)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
#include <machine/vmm.h>
#include "vmx_cpufunc.h"
+#include "vmm_ipi.h"
#include "vmx_msr.h"
#include "ept.h"
@@ -98,6 +99,8 @@ ept_init(void)
!INVEPT_ALL_TYPES_SUPPORTED(cap))
return (EINVAL);
+ ept_pmap_flags = vmm_ipinum & PMAP_NESTED_IPIMASK;
+
use_superpages = 1;
TUNABLE_INT_FETCH("hw.vmm.ept.use_superpages", &use_superpages);
if (use_superpages && EPT_PDE_SUPERPAGE(cap))
More information about the svn-src-head
mailing list