[PATCH v4 10/12] KVM: x86: never write to memory from kvm_vcpu_check_block()

2023-12-06 Thread Jim Mattson
kvm_vcpu_check_block() is called while not in TASK_RUNNING, and therefore it cannot sleep. Writing to guest memory is therefore forbidden, but it can happen on AMD processors if kvm_check_nested_events() causes a vmexit. Fortunately, all events that are caught by kvm_check_nested_events() are als

Re: [PATCH v4 10/12] KVM: x86: never write to memory from kvm_vcpu_check_block()

2023-12-10 Thread Jim Mattson
On Thu, Dec 7, 2023 at 8:21 AM Sean Christopherson wrote: > Doh. We got the less obvious cases and missed the obvious one. > > Ugh, and we also missed a related mess in kvm_guest_apic_has_interrupt(). > That > thing should really be folded into vmx_has_nested_events(). > > Good gravy. And vmx_

Re: [PATCH v4 10/12] KVM: x86: never write to memory from kvm_vcpu_check_block()

2023-12-13 Thread Jim Mattson
On Wed, Dec 13, 2023 at 2:25 PM Maxim Levitsky wrote: > > On Tue, 2023-12-12 at 07:28 -0800, Sean Christopherson wrote: > > On Sun, Dec 10, 2023, Jim Mattson wrote: > > > On Thu, Dec 7, 2023 at 8:21 AM Sean Christopherson > > > wrote: > > > > Doh. We