lkml.org 
[lkml]   [2022]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC PATCH] KVM: x86/mmu: replace BUG() with KVM_BUG() in shadow mmu
On Wed, Nov 23, 2022 at 3:18 PM Sean Christopherson <seanjc@google.com> wrote:
>
> On Wed, Nov 23, 2022, Mingwei Zhang wrote:
> > diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
> > index 4736d7849c60..075d31b0db9c 100644
> > --- a/arch/x86/kvm/mmu/mmu.c
> > +++ b/arch/x86/kvm/mmu/mmu.c
> > @@ -955,12 +955,12 @@ static void pte_list_remove(u64 *spte, struct kvm_rmap_head *rmap_head)
> >
> > if (!rmap_head->val) {
> > pr_err("%s: %p 0->BUG\n", __func__, spte);
> > - BUG();
> > + KVM_BUG();
>
> This won't compile. KVM_BUG() isn't a direct replacement for BUG(), it's more
> akin to WARN().
>
> And that's why I suggested this be RFC: @kvm needs to be plumbed down here in order
> to use KVM_BUG(). I don't mind that too much, it's just a little unfortunate.

I wonder if using kvm_get_running_vcpu()->kvm is safe here? Assuming
we can, then @kvm plumbing shouldn't be a problem.

\
 
 \ /
  Last update: 2022-11-24 00:50    [W:2.115 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site