Re: KVM_SET_CPUID doesn't check supported bits (was Re: [PATCH 0/6] KVM: x86: KVM_SET_SREGS.CR4 bug fixes and cleanup)

2020-12-07 Thread Jim Mattson
On Mon, Dec 7, 2020 at 3:47 AM stsp wrote: > > 07.12.2020 14:29, Paolo Bonzini пишет: > > On 07/12/20 12:24, stsp wrote: > >> It tries to enable VME among other things. > >> qemu appears to disable VME by default, > >> unless you do "-cpu host". So we have a situation where > >> the host (which

Re: KVM_SET_CPUID doesn't check supported bits (was Re: [PATCH 0/6] KVM: x86: KVM_SET_SREGS.CR4 bug fixes and cleanup)

2020-12-07 Thread stsp
07.12.2020 17:34, Paolo Bonzini пишет: > It is too late to change that aspect of the API, unfortunately. We > don't know how various userspaces would behave. Which means some sensible behaviour already exists if I don't call KVM_SET_CPUID2. So what is it, #UD on CPUID? I

Re: KVM_SET_CPUID doesn't check supported bits (was Re: [PATCH 0/6] KVM: x86: KVM_SET_SREGS.CR4 bug fixes and cleanup)

2020-12-07 Thread stsp
07.12.2020 17:09, Paolo Bonzini пишет: Il lun 7 dic 2020, 15:04 stsp > ha scritto: Perhaps it would be good if guest cpuid to have a default values of KVM_GET_SUPPORTED_CPUID, so that the user doesn't have to do the needless calls to just copy host

Re: KVM_SET_CPUID doesn't check supported bits (was Re: [PATCH 0/6] KVM: x86: KVM_SET_SREGS.CR4 bug fixes and cleanup)

2020-12-07 Thread stsp
07.12.2020 16:35, Paolo Bonzini пишет: Il lun 7 dic 2020, 12:47 stsp > ha scritto: So am I right that KVM_SET_CPUID only "lowers" the supported bits? In which case I don't need to call it at all, but instead just call KVM_GET_SUPPORTED_CPUID and see if

Re: KVM_SET_CPUID doesn't check supported bits (was Re: [PATCH 0/6] KVM: x86: KVM_SET_SREGS.CR4 bug fixes and cleanup)

2020-12-07 Thread stsp
07.12.2020 14:29, Paolo Bonzini пишет: On 07/12/20 12:24, stsp wrote: It tries to enable VME among other things. qemu appears to disable VME by default, unless you do "-cpu host". So we have a situation where the host (which is qemu) doesn't have VME, and guest (dosemu) is trying to enable it.

Re: KVM_SET_CPUID doesn't check supported bits (was Re: [PATCH 0/6] KVM: x86: KVM_SET_SREGS.CR4 bug fixes and cleanup)

2020-12-07 Thread Paolo Bonzini
On 07/12/20 12:24, stsp wrote: It tries to enable VME among other things. qemu appears to disable VME by default, unless you do "-cpu host". So we have a situation where the host (which is qemu) doesn't have VME, and guest (dosemu) is trying to enable it. Now obviously KVM_SET_CPUID doesn't

KVM_SET_CPUID doesn't check supported bits (was Re: [PATCH 0/6] KVM: x86: KVM_SET_SREGS.CR4 bug fixes and cleanup)

2020-12-07 Thread stsp
[re-send because of bad formatting] 09.10.2020 18:30, Sean Christopherson пишет: The only other effect of setting VMXE was clearing VME. Which shouldn't affect anything either, right? Hmm, clearing VME would mean that exceptions/interrupts within the guest would trigger a switch out of v86 and

KVM_SET_CPUID doesn't check supported bits (was Re: [PATCH 0/6] KVM: x86: KVM_SET_SREGS.CR4 bug fixes and cleanup)

2020-12-07 Thread stsp
09.10.2020 18:30, Sean Christopherson пишет: The only other effect of setting VMXE was clearing VME. Which shouldn't affect anything either, right? Hmm, clearing VME would mean that exceptions/interrupts within the guest would trigger a switch out of v86 and into vanilla protected mode. v86