Re: [patch 05/53] x86/apic: Get rid of get_physical_broadcast()

From: Andy Shevchenko
Date: Mon Aug 07 2023 - 11:25:41 EST


On Mon, Aug 7, 2023 at 4:52 PM Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>
> There is no point for this function. The only case where this is used when

used is when

> there is no XAPIC available, which means the broadcast address is 0xF.

...

> + if (mpc_ioapic_id(ioapic_idx) >= broadcast_id) {
> + pr_err("BIOS bug, IO-APIC#%d ID is %d in the MPC table!...\n",

Wouldn't it be better to switch to FW_BUG instead of the "BIOS bug, " thingy?
Same for other similar cases.

> + ioapic_idx, mpc_ioapic_id(ioapic_idx));
> + pr_err("... fixing up to %d. (tell your hw vendor)\n", reg_00.bits.ID);
> ioapics[ioapic_idx].mp_config.apicid = reg_00.bits.ID;
> }

...

> - if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) &&
> - !APIC_XAPIC(boot_cpu_apic_version))
> + if ((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && !APIC_XAPIC(boot_cpu_apic_version))
> return io_apic_get_unique_id(idx, id);

> else

You can also kill the redundant 'else'.

> return id;

--
With Best Regards,
Andy Shevchenko