summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDave Voutila <dv@cvs.openbsd.org>2023-04-26 09:39:57 +0000
committerDave Voutila <dv@cvs.openbsd.org>2023-04-26 09:39:57 +0000
commit70f8986048cf5f6a0c4a744f93a3b3edfe2ed10a (patch)
treee8f7a6ebde59bd109c2684e375fc33c44ca29327 /sys
parent67b440f9ef3fd2f110b0029b07ba989e7e33d795 (diff)
Unbreak vmm on Intel. Mistakenly enabled CET on non-CET systems.
Found by anton@ & jsg@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/vmm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c
index 42ac8007029..01e7859cda3 100644
--- a/sys/arch/amd64/amd64/vmm.c
+++ b/sys/arch/amd64/amd64/vmm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmm.c,v 1.340 2023/04/24 16:53:57 dv Exp $ */
+/* $OpenBSD: vmm.c,v 1.341 2023/04/26 09:39:56 dv Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
@@ -3520,7 +3520,7 @@ vcpu_reset_regs_vmx(struct vcpu *vcpu, struct vcpu_reg_state *vrs)
vmx_setmsrbr(vcpu, MSR_TSC);
/* If host supports CET, pass through access to the guest. */
- if (rcr4() | CR4_CET)
+ if (rcr4() & CR4_CET)
vmx_setmsrbrw(vcpu, MSR_S_CET);
/* XXX CR0 shadow */
@@ -7059,7 +7059,7 @@ vmm_handle_cpuid(struct vcpu *vcpu)
*rcx &= ~SEFF0ECX_PKU;
/* Expose IBT bit if we've enabled CET on the host. */
- if (rcr4() | CR4_CET)
+ if (rcr4() & CR4_CET)
*rdx |= SEFF0EDX_IBT;
else
*rdx &= ~SEFF0EDX_IBT;