Re: [PATCH] KVM: TDX: Fix APIC MSR ranges in tdx_has_emulated_msr()

Dmytro Maluka
2026-03-18T20:30:38Z

On Wed, Mar 18, 2026 at 12:42:59PM -0700, Dave Hansen wrote:
> It might also be handy to have a:
>
> #define X2APIC_LAST_MSR(r) (X2APIC_MSR(x)+APIC_ISR_NR-1)
>
> so that the resulting code is a bit more readable:
>
> case X2APIC_MSR(APIC_IRR) ... X2APIC_LAST_MSR(APIC_IRR):
>
> Dmytro, if you feel a burning need to respin this, don't let me stop
> you. I can probably just fix this up when it gets applied, or Isaku can
> make those changes and resend it too.

Sure, please feel free to take over this. I even have no way to test it
anyway. :)

I'm hesitating whether X2APIC_LAST_MSR would be the best name for it,
given that it is for ISR/IRR/TMR only and is using APIC_ISR_NR (so
maybe, don't know, X2APIC_LAST_ISR_MSR?).