Re: [PATCH 12/21] KVM: SEV: WARN on unhandled VM type when initializing VM
From: Sean Christopherson
Date: Fri Apr 10 2026 - 11:53:52 EST
On Fri, Apr 10, 2026, Yan Zhao wrote:
> On Thu, Apr 09, 2026 at 11:48:28AM -0700, Sean Christopherson wrote:
> > On Thu, Apr 09, 2026, Yan Zhao wrote:
> > > On Tue, Mar 10, 2026 at 04:48:20PM -0700, Sean Christopherson wrote:
> > > > + default:
> > > > + WARN_ONCE(1, "Unsupported VM type %lu", kvm->arch.vm_type);
> > > After pulling the latest kvm-x86/next, I encountered this compilation warning:
> > > "arch/x86/kvm/svm/sev.c:2954:30: error: format %lu expects argument of type long
> > > unsigned int, but argument 2 has type int [-Werror=format=]",
> > >
> > > So,
> > >
> > > diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
> > > index 75d0c03d69bc..ca09c06d1e80 100644
> > > --- a/arch/x86/kvm/svm/sev.c
> > > +++ b/arch/x86/kvm/svm/sev.c
> > > @@ -2951,7 +2951,7 @@ void sev_vm_init(struct kvm *kvm)
> > > to_kvm_sev_info(kvm)->need_init = true;
> > > break;
> > > default:
> > > - WARN_ONCE(1, "Unsupported VM type %lu", kvm->arch.vm_type);
> > > + WARN_ONCE(1, "Unsupported VM type %u", kvm->arch.vm_type);
> > > break;
> > > }
> > > }
> >
> > I'll squash the above.
> >
> > How did you find this? E.g. did you cherry pick the commits into a different
> I just pulled the tag kvm-x86-next-2026.04.04, and compiled it with
> "CONFIG_KVM_WERROR=y && CONFIG_BUG=n".
Huh. TIL it's possible to compile out WARN() and BUG().
Thanks!