From: Peter Zijlstra <peterz@infradead.org>
To: Dan Williams <dan.j.williams@intel.com>
Cc: "Wilczynski, Michal" <michal.wilczynski@intel.com>,
alison.schofield@intel.com,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>, Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Andy Lutomirski <luto@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Dave Jiang <dave.jiang@intel.com>,
Mike Rapoport <rppt@kernel.org>,
x86@kernel.org, linux-cxl@vger.kernel.org,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
Derick Marks <derick.w.marks@intel.com>
Subject: Re: [PATCH v2 1/2] x86/numa: Introduce numa_fill_memblks()
Date: Thu, 15 Jun 2023 10:29:49 +0200 [thread overview]
Message-ID: <20230615082949.GA1683497@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <6489b23bc67e0_142af829456@dwillia2-xfh.jf.intel.com.notmuch>
On Wed, Jun 14, 2023 at 05:27:39AM -0700, Dan Williams wrote:
> Wilczynski, Michal wrote:
> > On 6/14/2023 6:35 AM, alison.schofield@intel.com wrote:
> > > +static int __init cmp_memblk(const void *a, const void *b)
> > > +{
> > > + const struct numa_memblk *ma = *(const struct numa_memblk **)a;
> > > + const struct numa_memblk *mb = *(const struct numa_memblk **)b;
> >
> > Is this casting necessary ?
>
> This is idiomatic for sort() comparison handlers.
Aside of that, it *is* actually required, since sort() does indirect
calls to it's cmp_func_t argument the Control Flow Integrity (CFI, not
to be confused with Call-Frame-Information) stuff has a hard requirement
that function signatures match.
At the very least clang builds should warn if you do indirect calls with
non-matching signatures these days. And kCFI enabled builds will get you
a runtime error if you manage to ignore that warning.
> > > +
> > > + if (ma->start != mb->start)
> > > + return (ma->start < mb->start) ? -1 : 1;
> > > +
> > > + /* Caller handles duplicate start addresses */
> > > + return 0;
> > > +}
next prev parent reply other threads:[~2023-06-15 8:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-14 4:35 [PATCH v2 0/2] CXL: Apply SRAT defined PXM to entire CFMWS window alison.schofield
2023-06-14 4:35 ` [PATCH v2 1/2] x86/numa: Introduce numa_fill_memblks() alison.schofield
2023-06-14 7:35 ` Wilczynski, Michal
2023-06-14 12:27 ` Dan Williams
2023-06-15 8:29 ` Peter Zijlstra [this message]
2023-06-14 16:17 ` Alison Schofield
2023-06-14 12:44 ` Dan Williams
2023-06-14 16:09 ` Alison Schofield
2023-06-15 8:34 ` Peter Zijlstra
2023-06-15 15:44 ` Alison Schofield
2023-06-14 4:35 ` [PATCH v2 2/2] ACPI: NUMA: Apply SRAT proximity domain to entire CFMWS window alison.schofield
2023-06-14 8:32 ` [PATCH v2 0/2] CXL: Apply SRAT defined PXM " Peter Zijlstra
2023-06-14 9:10 ` Jonathan Cameron
2023-06-14 13:33 ` Dan Williams
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=20230615082949.GA1683497@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=alison.schofield@intel.com \
--cc=bp@alien8.de \
--cc=dan.j.williams@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=dave.jiang@intel.com \
--cc=derick.w.marks@intel.com \
--cc=hpa@zytor.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=michal.wilczynski@intel.com \
--cc=mingo@redhat.com \
--cc=rafael@kernel.org \
--cc=rppt@kernel.org \
--cc=tglx@linutronix.de \
--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