Re: [RFC v2 01/17] x86/apic: Add new driver for Secure AVIC

Thomas Gleixner
2025-03-21T12:44:29Z

On Thu, Mar 20 2025 at 16:51, Borislav Petkov wrote:
> On Wed, Feb 26, 2025 at 02:35:09PM +0530, Neeraj Upadhyay wrote:
>> +static int x2apic_savic_probe(void)
>> +{
>> + if (!cc_platform_has(CC_ATTR_SNP_SECURE_AVIC))
>> + return 0;
>> +
>> + if (!x2apic_mode) {
>> + pr_err("Secure AVIC enabled in non x2APIC mode\n");
>> + snp_abort();
>> + }
>> +
>> + pr_info("Secure AVIC Enabled\n");
>
> That's not necessary.
>
> Actually, you could figure out why that
>
> pr_info("Switched APIC routing to: %s\n", driver->name);
>
> doesn't come out in current kernels anymore:
>
> $ dmesg | grep -i "switched apic"
> $
>
> and fix that as a separate patch.
>
> Looks like it broke in 6.10 or so:
>
> $ grep -E "Switched APIC" *
> 10-rc1+:APIC: Switched APIC routing to: physical flat
> 10-rc6+:APIC: Switched APIC routing to: physical flat

It's very simple. Before that the default driver was logical flat.

838ba7733e4e ("x86/apic: Remove logical destination mode for 64-bit")

Removed logical destination mode and defaulted to physical flat.

So if you box does not switch to something else it keeps the default and
does not print. See the first condition in apic_install_driver().

But that SNP thing will switch and print....

Thanks,

tglx