X86 platform drivers
 help / color / mirror / Atom feed
* [PATCH] platform/x86/amd/pmf: fix compat ioctl handling
@ 2026-09-15 20:25 Arnd Bergmann
  2026-09-18 18:27 ` Ilpo Järvinen
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2026-09-15 20:25 UTC (permalink / raw)
  To: Shyam Sundar S K, Hans de Goede, Ilpo Järvinen,
	Sanket Goswami
  Cc: Arnd Bergmann, platform-driver-x86, linux-kernel

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform/x86/amd/pmf: fix compat ioctl handling
  2026-09-15 20:25 [PATCH] platform/x86/amd/pmf: fix compat ioctl handling Arnd Bergmann
@ 2026-09-18 18:27 ` Ilpo Järvinen
  0 siblings, 0 replies; 2+ messages in thread
From: Ilpo Järvinen @ 2026-09-18 18:27 UTC (permalink / raw)
  To: Shyam Sundar S K, Hans de Goede, Sanket Goswami, Arnd Bergmann
  Cc: Arnd Bergmann, platform-driver-x86, linux-kernel

On Tue, 15 Sep 2026 22:25:20 +0200, Arnd Bergmann wrote:

> 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.
> 
> [...]

Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.

FYI [if applicable to your patch], as per Linus' policy change, also
fixes are mostly routed through for-next unless the fix is for a
commit introduced in the most recent cycle or is clearly a regression
fix.

The list of commits applied:
[1/1] platform/x86/amd/pmf: fix compat ioctl handling
      commit: ac523aa5562fd4761509a012a68d2462ccf6c921

--
 i.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-18 18:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-15 20:25 [PATCH] platform/x86/amd/pmf: fix compat ioctl handling Arnd Bergmann
2026-09-18 18:27 ` Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox