From: Randy Dunlap <rdunlap@infradead.org>
To: Linus Torvalds <torvalds@linux-foundation.org>,
Borislav Petkov <bp@alien8.de>
Cc: x86-ml <x86@kernel.org>, lkml <linux-kernel@vger.kernel.org>,
linux-edac <linux-edac@vger.kernel.org>
Subject: Re: [GIT PULL] EDAC updates for v6.9
Date: Mon, 11 Mar 2024 19:24:16 -0700 [thread overview]
Message-ID: <a4bdcf74-5c6f-4483-a4f0-8ad6558a3c8d@infradead.org> (raw)
In-Reply-To: <CAHk-=whTBKoHrBpMxh7OHQ=pcdy6K2zqqsJOZeCC4xSqRXb5Bg@mail.gmail.com>
On 3/11/24 18:12, Linus Torvalds wrote:
> On Mon, 11 Mar 2024 at 08:57, Borislav Petkov <bp@alien8.de> wrote:
>>
>> - return topology_die_id(err->cpu) % amd_get_nodes_per_socket();
>> + return topology_amd_node_id(err->cpu) % topology_amd_nodes_per_pkg();
>
> Ho humm. Lookie here:
>
> static inline unsigned int topology_amd_nodes_per_pkg(void)
> { return 0; };
>
and there's an extra/trailing ';'.
> that's the UP case.
>
> Yeah, I'm assuming nobody tests this for UP, but it's clearly wrong to
> potentially do that modulus by zero.
>
> So I made the merge also change that UP case of
> topology_amd_nodes_per_pkg() to return 1.
>
> Because dammit, not only is a mod-by-zero wrong, a UP system most
> definitely has one node per package, not zero.
>
> Linus
>
--
#Randy
next prev parent reply other threads:[~2024-03-12 2:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-11 15:57 [GIT PULL] EDAC updates for v6.9 Borislav Petkov
2024-03-12 1:12 ` Linus Torvalds
2024-03-12 2:24 ` Randy Dunlap [this message]
2024-03-12 2:25 ` Linus Torvalds
2024-03-12 7:45 ` Borislav Petkov
2024-03-12 9:16 ` Ingo Molnar
2024-03-12 9:29 ` Borislav Petkov
2024-03-12 10:07 ` Thomas Gleixner
2024-03-12 1:30 ` pr-tracker-bot
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=a4bdcf74-5c6f-4483-a4f0-8ad6558a3c8d@infradead.org \
--to=rdunlap@infradead.org \
--cc=bp@alien8.de \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=x86@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;
as well as URLs for NNTP newsgroup(s).