Re: [PATCH] x86/amd_nb: Check for invalid SMN reads

From: Borislav Petkov
Date: Mon Apr 03 2023 - 15:32:56 EST


On Mon, Apr 03, 2023 at 04:42:44PM +0000, Yazen Ghannam wrote:
> int amd_smn_read(u16 node, u32 address, u32 *value)
> {
> - return __amd_smn_rw(node, address, value, false);
> + int err = __amd_smn_rw(node, address, value, false);
> +
> + if (PCI_POSSIBLE_ERROR(*value)) {
> + err = -ENODEV;
> + *value = 0;
> + }

Why not put this check in __amd_smn_rw()?

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette