[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f031b6bc-c98d-8e46-34ac-79e540674a55@redhat.com>
Date: Wed, 23 Jun 2021 16:16:47 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org,
Yu Zhang <yu.c.zhang@...ux.intel.com>,
Maxim Levitsky <mlevitsk@...hat.com>
Subject: Re: [PATCH 07/54] KVM: x86: Alert userspace that KVM_SET_CPUID{,2}
after KVM_RUN is broken
On 22/06/21 19:56, Sean Christopherson wrote:
> + /*
> + * KVM does not correctly handle changing guest CPUID after KVM_RUN, as
> + * MAXPHYADDR, GBPAGES support, AMD reserved bit behavior, etc.. aren't
> + * tracked in kvm_mmu_page_role. As a result, KVM may miss guest page
> + * faults due to reusing SPs/SPTEs. Alert userspace, but otherwise
> + * sweep the problem under the rug.
> + *
> + * KVM's horrific CPUID ABI makes the problem all but impossible to
> + * solve, as correctly handling multiple vCPU models (with respect to
> + * paging and physical address properties) in a single VM would require
> + * tracking all relevant CPUID information in kvm_mmu_page_role. That
> + * is very undesirable as it would double the memory requirements for
> + * gfn_track (see struct kvm_mmu_page_role comments), and in practice
> + * no sane VMM mucks with the core vCPU model on the fly.
> + */
> + if (vcpu->arch.last_vmentry_cpu != -1)
> + pr_warn_ratelimited("KVM: KVM_SET_CPUID{,2} after KVM_RUN may cause guest instability\n");
Let's make this even stronger and promise to break it in 5.16.
Paolo
Powered by blists - more mailing lists