[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CALMp9eTmHs4k7_iiCb16u96whZFdW-Mckw2mL2WRtDag15256g@mail.gmail.com>
Date: Mon, 5 Jan 2026 10:25:27 -0800
From: Jim Mattson <jmattson@...gle.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>, kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] KVM: x86: Return "unsupported" instead of "invalid" on
access to unsupported PV MSR
On Tue, Dec 30, 2025 at 12:59 PM Sean Christopherson <seanjc@...gle.com> wrote:
>
> Return KVM_MSR_RET_UNSUPPORTED instead of '1' (which for all intents and
> purposes means "invalid") when rejecting accesses to KVM PV MSRs to adhere
> to KVM's ABI of allowing host reads and writes of '0' to MSRs that are
> advertised to userspace via KVM_GET_MSR_INDEX_LIST, even if the vCPU model
> doesn't support the MSR.
>
> E.g. running a QEMU VM with
>
> -cpu host,-kvmclock,kvm-pv-enforce-cpuid
>
> yields:
>
> qemu: error: failed to set MSR 0x12 to 0x0
> qemu: target/i386/kvm/kvm.c:3301: kvm_buf_set_msrs:
> Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.
>
> Fixes: 66570e966dd9 ("kvm: x86: only provide PV features if enabled in guest's CPUID")
> Cc: stable@...r.kernel.org
> Signed-off-by: Sean Christopherson <seanjc@...gle.com>
Reviewed-by: Jim Mattson <jmattson@...gle.com>
Powered by blists - more mailing lists