Re: [PATCH v4 18/30] KVM: x86: Move "struct kvm_x86_msr_filter" definition to msrs.c

From: Sean Christopherson

Date: Tue Jun 16 2026 - 19:46:02 EST


On Tue, Jun 16, 2026, Kai Huang wrote:
> On Tue, 2026-06-16 at 09:19 -0700, Sean Christopherson wrote:
> > On Tue, Jun 16, 2026, Kai Huang wrote:
> > Unfortunately, every RCU macro I can find does typeof(*p) somewhere in its flow.
> > But I would still strongly prefer to open code a __force to strip the __rcu than
> > expose the structures outside of msrs.c and pmu.c.
> >
> > This makes gcc8 and gcc9 happy on my end. I'll squash the changes into their
> > respective patches, and update the changelogs.
>
> Fine to me (seems we are having more and more functional changes in this series
> but this particular change may not be the case).

Yeah, because KVM hardcodes a '1' to the dereference check, in practice this
isn't a functional change.

> > kvfree(rcu_dereference_check(kvm->arch.apic_map, 1));
>
> Btw, this made me look at apic_map too. And seems we can also move "struct
> kvm_apic_map" to "lapic.h". We cannot move it to lapic.c because
> kvm_sched_yield() in x86.c actually references the members of the structure.

Ya, good eyes, I'll slip in yet another patch.