I can confirm that with the latest snapshot, VMM is working on my older i5
CPU again. Thanks, all!

On Sat, Jun 30, 2018 at 9:32 AM, Ax0n <[email protected]> wrote:

> On Fri, Jun 29, 2018 at 12:39 PM, Philip Guenther <
> [email protected]> wrote:
>
>> On Fri, 29 Jun 2018, Ax0n wrote:
>> > 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)) {
>>
>
> This did the trick. VMs work again. Thanks, Philip!
>
> [axon@transient ~]$ vmctl start 3
> vmctl: started vm 1 successfully, tty /dev/ttyp1
> [axon@transient ~]$ vmctl status
>    ID   PID VCPUS  MAXMEM  CURMEM     TTY        OWNER NAME
>     3  4398     1    256M    139M   ttyp1         axon OBSDSnap64.vm
>     1     -     1    512M       -       -         axon OBSD-Stable.vm
>     2     -     1    256M       -       -         axon OBSD-Stable-alt.vm
> [axon@transient ~]$ vmctl console 3
> Connected to /dev/ttyp1 (speed 115200)
>
>
> OpenBSD/amd64 (deepthought.labs.h-i-r.net) (tty00)
>
> login:
>
>

Reply via email to