Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/nvmm/x86 Invert the filtering priority: now the kern...



details:   https://anonhg.NetBSD.org/src/rev/cd57a81b9c14
branches:  trunk
changeset: 840486:cd57a81b9c14
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sun Apr 07 14:28:50 2019 +0000

description:
Invert the filtering priority: now the kernel-managed cpuid leaves are
overwritable by the virtualizer. This is useful to virtualizers that want
to 100% control every leaf.

diffstat:

 sys/dev/nvmm/x86/nvmm_x86_svm.c |  9 ++++-----
 sys/dev/nvmm/x86/nvmm_x86_vmx.c |  9 ++++-----
 2 files changed, 8 insertions(+), 10 deletions(-)

diffs (74 lines):

diff -r 01624868d13a -r cd57a81b9c14 sys/dev/nvmm/x86/nvmm_x86_svm.c
--- a/sys/dev/nvmm/x86/nvmm_x86_svm.c   Sun Apr 07 14:26:26 2019 +0000
+++ b/sys/dev/nvmm/x86/nvmm_x86_svm.c   Sun Apr 07 14:28:50 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nvmm_x86_svm.c,v 1.37 2019/04/06 11:49:53 maxv Exp $   */
+/*     $NetBSD: nvmm_x86_svm.c,v 1.38 2019/04/07 14:28:50 maxv Exp $   */
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_svm.c,v 1.37 2019/04/06 11:49:53 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_svm.c,v 1.38 2019/04/07 14:28:50 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -853,6 +853,8 @@
        cpudata->gprs[NVMM_X64_GPR_RCX] = descs[2];
        cpudata->gprs[NVMM_X64_GPR_RDX] = descs[3];
 
+       svm_inkernel_handle_cpuid(vcpu, eax, ecx);
+
        for (i = 0; i < SVM_NCPUIDS; i++) {
                cpuid = &machdata->cpuid[i];
                if (!machdata->cpuidpresent[i]) {
@@ -877,9 +879,6 @@
                break;
        }
 
-       /* Overwrite non-tunable leaves. */
-       svm_inkernel_handle_cpuid(vcpu, eax, ecx);
-
        svm_inkernel_advance(cpudata->vmcb);
        exit->reason = NVMM_EXIT_NONE;
 }
diff -r 01624868d13a -r cd57a81b9c14 sys/dev/nvmm/x86/nvmm_x86_vmx.c
--- a/sys/dev/nvmm/x86/nvmm_x86_vmx.c   Sun Apr 07 14:26:26 2019 +0000
+++ b/sys/dev/nvmm/x86/nvmm_x86_vmx.c   Sun Apr 07 14:28:50 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nvmm_x86_vmx.c,v 1.24 2019/04/06 11:49:53 maxv Exp $   */
+/*     $NetBSD: nvmm_x86_vmx.c,v 1.25 2019/04/07 14:28:50 maxv Exp $   */
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.24 2019/04/06 11:49:53 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.25 2019/04/07 14:28:50 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1169,6 +1169,8 @@
        cpudata->gprs[NVMM_X64_GPR_RCX] = descs[2];
        cpudata->gprs[NVMM_X64_GPR_RDX] = descs[3];
 
+       vmx_inkernel_handle_cpuid(vcpu, eax, ecx);
+
        for (i = 0; i < VMX_NCPUIDS; i++) {
                cpuid = &machdata->cpuid[i];
                if (!machdata->cpuidpresent[i]) {
@@ -1193,9 +1195,6 @@
                break;
        }
 
-       /* Overwrite non-tunable leaves. */
-       vmx_inkernel_handle_cpuid(vcpu, eax, ecx);
-
        vmx_inkernel_advance();
        exit->reason = NVMM_EXIT_NONE;
 }



Home | Main Index | Thread Index | Old Index