From: Arnd Bergmann <arnd@kernel.org>
To: "Shyam Sundar S K" <Shyam-sundar.S-k@amd.com>,
"Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Sanket Goswami" <Sanket.Goswami@amd.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] platform/x86/amd/pmf: fix compat ioctl handling
Date: Tue, 15 Sep 2026 22:25:20 +0200 [thread overview]
Message-ID: <20260915202535.3689880-1-arnd@kernel.org> (raw)
From: Arnd Bergmann <arnd@arndb.de>
Build testing with -Wpadded shows a structure that is incompatible
between 32-bit and 64-bit x86 userspace:
./usr/include/linux/amd-pmf.h:202:1: error: padding struct size to alignment boundary with 4 bytes [-Werror=padded]
Use the 64-bit padded on all architectures here to avoid both
the warning and allow compat ioctl handling.
Fixes: 98432eec3180 ("platform/x86/amd/pmf: Add util layer and userspace character device interface")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/platform/x86/amd/pmf/util.c | 1 +
include/uapi/linux/amd-pmf.h | 3 +++
2 files changed, 4 insertions(+)
diff --git a/drivers/platform/x86/amd/pmf/util.c b/drivers/platform/x86/amd/pmf/util.c
index 4d1a61e4f1b9..2befc1b14842 100644
--- a/drivers/platform/x86/amd/pmf/util.c
+++ b/drivers/platform/x86/amd/pmf/util.c
@@ -123,6 +123,7 @@ static const struct file_operations pmf_if_ops = {
.owner = THIS_MODULE,
.open = amd_pmf_open,
.unlocked_ioctl = amd_pmf_set_ioctl,
+ .compat_ioctl = compat_ptr_ioctl,
};
static struct miscdevice amd_pmf_util_if = {
diff --git a/include/uapi/linux/amd-pmf.h b/include/uapi/linux/amd-pmf.h
index 24cf9926dc59..151f264cd7d6 100644
--- a/include/uapi/linux/amd-pmf.h
+++ b/include/uapi/linux/amd-pmf.h
@@ -199,6 +199,9 @@ struct amd_pmf_info {
/* BIOS parameters */
__u32 bios_input[AMD_PMF_BIOS_PARAMS_MAX];
__u32 bios_output[AMD_PMF_BIOS_PARAMS_MAX];
+
+ /* align to 64 bit boundary */
+ __u32 __pad;
};
#endif /* _UAPI_LINUX_AMD_PMF_H */
--
2.53.0
reply other threads:[~2026-09-15 20:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260915202535.3689880-1-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=Sanket.Goswami@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=arnd@arndb.de \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-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®