On Fri, Jun 29, 2018 at 10:39:03AM -0700, Philip Guenther wrote:
> On Fri, 29 Jun 2018, Ax0n wrote:
> > Updated and recompiled. Here's what it's doing now. No idea what the Lock
> > Order Reversal noise is between the two VM starts, but I've seen a lot of
> > it on this laptop lately, even without using vmm. Probably unrelated.
>
> Yep, that's from the WITNESS work and not part of the xcr0 problem.
>
>
> > vmm_fpurestore: guest attempted to set invalid bits in xcr0 (guest
> > %xcr0=0x1, host mask=0xffffffffffffffff)
>
> Oh, duh: this box doesn't have XSAVE at all but we init guests as if it
> does. Try this diff on the host.
>
> Philip Guenther
>
> Index: amd64/vmm.c
> ===================================================================
> RCS file: /data/src/openbsd/src/sys/arch/amd64/amd64/vmm.c,v
> retrieving revision 1.202
> diff -u -p -r1.202 vmm.c
> --- amd64/vmm.c 22 Jun 2018 05:21:45 -0000 1.202
> +++ amd64/vmm.c 29 Jun 2018 17:36:34 -0000
> @@ -1971,7 +1971,7 @@ vcpu_reset_regs_svm(struct vcpu *vcpu, s
> 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;
> + vcpu->vc_gueststate.vg_xcr0 = XCR0_X87 & xsave_mask;
>
> exit:
> return ret;
> @@ -2764,7 +2764,7 @@ vcpu_reset_regs_vmx(struct vcpu *vcpu, s
> /* XXX CR4 shadow */
>
> /* xcr0 power on default sets bit 0 (x87 state) */
> - vcpu->vc_gueststate.vg_xcr0 = XCR0_X87;
> + vcpu->vc_gueststate.vg_xcr0 = XCR0_X87 & xsave_mask;
>
> /* Flush the VMCS */
> if (vmclear(&vcpu->vc_control_pa)) {
>
Did this result from the recent FPU rejiggery?
I think this has worked before in the past...