From: mlarkin Date: Wed, 26 Apr 2023 15:34:31 +0000 (+0000) Subject: Integrate r1.339 of vmm.c which I missed during the previous MI/MD split X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=68d96e1c1f25c30e577f696a09df2861df793e04;p=openbsd Integrate r1.339 of vmm.c which I missed during the previous MI/MD split --- revision 1.339 date: 2023/04/22 18:27:28; author: guenther; state: Exp; lines: +3 -3; commitid: ajtkYPSAhtJdB488; Rename the XCR0_* #defines to XFEATURE_* and add the new supervisor-state features: while all are appropriate for xsaves/xrstors, the supervisor-state features aren't for xcr0 but rather for the new XSS_MSR, making the current names kinda confusing. Add #defines for masking bits for xcr0 vs XSS. Add and report the new XSAVE_XFD xsave subfeature bit. --- --- diff --git a/sys/arch/amd64/amd64/vmm_machdep.c b/sys/arch/amd64/amd64/vmm_machdep.c index 9f7129fcb5e..acfca6d2947 100644 --- a/sys/arch/amd64/amd64/vmm_machdep.c +++ b/sys/arch/amd64/amd64/vmm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmm_machdep.c,v 1.1 2023/04/26 15:11:21 mlarkin Exp $ */ +/* $OpenBSD: vmm_machdep.c,v 1.2 2023/04/26 15:34:31 mlarkin Exp $ */ /* * Copyright (c) 2014 Mike Larkin * @@ -2062,7 +2062,7 @@ vcpu_reset_regs_svm(struct vcpu *vcpu, struct vcpu_reg_state *vrs) ret = vcpu_writeregs_svm(vcpu, VM_RWREGS_ALL, vrs); /* xcr0 power on default sets bit 0 (x87 state) */ - vcpu->vc_gueststate.vg_xcr0 = XCR0_X87 & xsave_mask; + vcpu->vc_gueststate.vg_xcr0 = XFEATURE_X87 & xsave_mask; vcpu->vc_parent->vm_map->pmap->eptp = 0; @@ -2863,7 +2863,7 @@ vcpu_reset_regs_vmx(struct vcpu *vcpu, struct vcpu_reg_state *vrs) /* XXX CR4 shadow */ /* xcr0 power on default sets bit 0 (x87 state) */ - vcpu->vc_gueststate.vg_xcr0 = XCR0_X87 & xsave_mask; + vcpu->vc_gueststate.vg_xcr0 = XFEATURE_X87 & xsave_mask; /* XXX PAT shadow */ vcpu->vc_shadow_pat = rdmsr(MSR_CR_PAT);