public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Michael Roth <michael.roth@amd.com>, x86@kernel.org
Cc: 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>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Joerg Roedel <jroedel@suse.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] x86: Ensure input to pfn_to_kaddr() is treated as a 64-bit type
Date: Wed, 15 Nov 2023 12:48:58 -0800	[thread overview]
Message-ID: <e42524f9-87ef-47f4-9c79-bc06b4d71a58@intel.com> (raw)
In-Reply-To: <20231115201431.820278-1-michael.roth@amd.com>

On 11/15/23 12:14, Michael Roth wrote:
> While it might be argued that the issue is on the caller side, other
> archs/macros have taken similar approaches to deal with instances like
> this, such as commit e48866647b48 ("ARM: 8396/1: use phys_addr_t in
> pfn_to_kaddr()").

Gah, I really hope nobody is arguing that for real, or is even thinking
about this as a valid argument.

The helper should, well, help the caller.  It makes zero sense to me
that every single call site would need to know if the argument's type
was big enough to hold the _return_ value.  This nonsense can only even
happen with macros.  Type promotion would just do the right thing for
any sanely declared actual helper function.

  reply	other threads:[~2023-11-15 20:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-15 20:14 [PATCH v2] x86: Ensure input to pfn_to_kaddr() is treated as a 64-bit type Michael Roth
2023-11-15 20:48 ` Dave Hansen [this message]
2023-11-15 22:42   ` Michael Roth
2023-11-16  5:50     ` H. Peter Anvin

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=e42524f9-87ef-47f4-9c79-bc06b4d71a58@intel.com \
    --to=dave.hansen@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.roth@amd.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --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