From: Yazen Ghannam <yazen.ghannam@amd.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Steven Noonan <steven@uplinklabs.net>,
linux-kernel@vger.kernel.org,
Ariadne Conill <ariadne@ariadne.space>,
x86@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 1/2] x86/amd_node: fix integer divide by zero during init
Date: Thu, 4 Dec 2025 11:45:33 -0500 [thread overview]
Message-ID: <20251204164533.GB983706@yaz-khff2.amd.com> (raw)
In-Reply-To: <20251203211813.GAaTCpFeDir7jXkEPf@fat_crate.local>
On Wed, Dec 03, 2025 at 10:18:13PM +0100, Borislav Petkov wrote:
> On Fri, Nov 14, 2025 at 07:57:35PM +0000, Steven Noonan wrote:
> > On a Xen dom0 boot, this feature does not behave, and we end up
> > calculating:
> >
> > num_roots = 1
> > num_nodes = 2
> > roots_per_node = 0
> >
> > This causes a divide-by-zero in the modulus inside the loop.
> >
> > This change adds a couple of guards for invalid states where we might
> > get a divide-by-zero.
> >
> > Signed-off-by: Steven Noonan <steven@uplinklabs.net>
> > Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
> > CC: Yazen Ghannam <yazen.ghannam@amd.com>
> > CC: x86@vger.kernel.org
> > CC: stable@vger.kernel.org
> > ---
> > arch/x86/kernel/amd_node.c | 11 +++++++++++
> > 1 file changed, 11 insertions(+)
> >
> > diff --git a/arch/x86/kernel/amd_node.c b/arch/x86/kernel/amd_node.c
> > index 3d0a4768d603c..cdc6ba224d4ad 100644
> > --- a/arch/x86/kernel/amd_node.c
> > +++ b/arch/x86/kernel/amd_node.c
> > @@ -282,6 +282,17 @@ static int __init amd_smn_init(void)
>
> That better not be loading at all on a X86_FEATURE_HYPERVISOR configuration.
>
Right, so we need a !hypervisor check.
I'm not familiar with the Xen implementation. Does it expect the dom0
guest to be effectively the same as bare metal? Basically, this would
act as the 'management' VM that touch hardware?
Thanks,
Yazen
prev parent reply other threads:[~2025-12-04 16:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-14 19:57 Steven Noonan
2025-11-14 19:57 ` [PATCH 2/2] x86/amd_node: fix null pointer dereference if amd_smn_init failed Steven Noonan
2025-12-03 20:54 ` Yazen Ghannam
2025-12-03 20:45 ` [PATCH 1/2] x86/amd_node: fix integer divide by zero during init Yazen Ghannam
2025-12-04 20:16 ` Steven Noonan
2025-12-05 15:37 ` Yazen Ghannam
2025-12-03 21:18 ` Borislav Petkov
2025-12-04 16:45 ` Yazen Ghannam [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251204164533.GB983706@yaz-khff2.amd.com \
--to=yazen.ghannam@amd.com \
--cc=ariadne@ariadne.space \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=steven@uplinklabs.net \
--cc=x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®