1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-11 17:10:13 +00:00

Compare commits

...

33 Commits

Author SHA1 Message Date
Shuah Khan
b69053dd3f wifi: mt76: Remove blank line after mt792x firmware version dmesg
An extra blank line gets printed after printing firmware version
because the build date is null terminated. Remove the "\n" from
dev_info() calls to print firmware version and build date to fix
the problem.

Reported-by: Mario Limonciello <superm1@gmail.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-12-31 17:03:35 -08:00
Shuah Khan
af7809f037 Revert "wifi: mt76: Strip whitespace from build ddate"
This reverts commit f804a5895ebad2b2d4fb8a3688d2115926e993d5.

This change introduced the following panic, and mt792x_load_firmware()
fails. wifi is dead on systems with mt792x wireless.

kern  :crit  : kernel BUG at lib/string_helpers.c:1043!
kern  :warn  : Oops: invalid opcode: 0000 [#1] SMP NOPTI
kern  :warn  : CPU: 14 UID: 0 PID: 61 Comm: kworker/14:0 Tainted: G        W
        6.19.0-rc1 #1 PREEMPT(voluntary)
kern  :warn  : Tainted: [W]=WARN
kern  :warn  : Hardware name: Framework Laptop 13 (AMD Ryzen 7040Series)/FRANMDCP07, BIOS 03.16 07/25/2025
kern  :warn  : Workqueue: events mt7921_init_work [mt7921_common]
kern  :warn  : RIP: 0010:__fortify_panic+0xd/0xf
kern  :warn  : Code: 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 40 0f b6 ff e8 c3 55 71 00 <0f> 0b 48 8b 54 24 10 48 8b 74 24 08 4c 89 e9 48 c7 c7 00 a2 d5 a0
kern  :warn  : RSP: 0018:ffffa7a5c03a3d10 EFLAGS: 00010246
kern  :warn  : RAX: ffffffffa0d7aaf2 RBX: 0000000000000000 RCX: ffffffffa0d7aaf2
kern  :warn  : RDX: 0000000000000011 RSI: ffffffffa0d5a170 RDI: ffffffffa128db10
kern  :warn  : RBP: ffff91650ae52060 R08: 0000000000000010 R09: ffffa7a5c31b2000
kern  :warn  : R10: ffffa7a5c03a3bf0 R11: 00000000ffffffff R12: 0000000000000000
kern  :warn  : R13: ffffa7a5c31b2000 R14: 0000000000001000 R15: 0000000000000000
kern  :warn  : FS:  0000000000000000(0000) GS:ffff91743e664000(0000) knlGS:0000000000000000
kern  :warn  : CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
kern  :warn  : CR2: 00007f10786c241c CR3: 00000003eca24000 CR4: 0000000000f50ef0
kern  :warn  : PKRU: 55555554
kern  :warn  : Call Trace:
kern  :warn  :  <TASK>
kern  :warn  :  mt76_connac2_load_patch.cold+0x2b/0xa41 [mt76_connac_lib]
kern  :warn  :  ? srso_alias_return_thunk+0x5/0xfbef5
kern  :warn  :  mt792x_load_firmware+0x36/0x150 [mt792x_lib]
kern  :warn  :  mt7921_run_firmware+0x2c/0x4a0 [mt7921_common]
kern  :warn  :  ? srso_alias_return_thunk+0x5/0xfbef5
kern  :warn  :  ? mt7921_rr+0x12/0x30 [mt7921e]
kern  :warn  :  ? srso_alias_return_thunk+0x5/0xfbef5
kern  :warn  :  ? ____mt76_poll_msec+0x75/0xb0 [mt76]
kern  :warn  :  mt7921e_mcu_init+0x4c/0x7a [mt7921e]
kern  :warn  :  mt7921_init_work+0x51/0x190 [mt7921_common]
kern  :warn  :  process_one_work+0x18b/0x340
kern  :warn  :  worker_thread+0x256/0x3a0
kern  :warn  :  ? __pfx_worker_thread+0x10/0x10
kern  :warn  :  kthread+0xfc/0x240
kern  :warn  :  ? __pfx_kthread+0x10/0x10
kern  :warn  :  ? __pfx_kthread+0x10/0x10
kern  :warn  :  ret_from_fork+0x254/0x290
kern  :warn  :  ? __pfx_kthread+0x10/0x10
kern  :warn  :  ret_from_fork_asm+0x1a/0x30
kern  :warn  :  </TASK>

Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2025-12-31 17:03:35 -08:00
Linus Torvalds
9528d5c091 platform-drivers-x86 for v6.19-2
Fixes and New HW Support
 
 - alienware-wmi-wmax: Area-51, x16, and 16X Aurora laptops support
 
 - asus-armoury:
   - Fix FA507R PPT data
   - Add TDP data for more laptop models
 
 - asus-nb-wmi: Asus Zenbook 14 display toggle key support
 
 - dell-lis3lv02d: Dell Latitude 5400 support
 
 - hp-bioscfg: Fix out-of-bounds array access in ACPI package parsing
 
 - ibm_rtl: Fix EBDA signature search pointer arithmetic
 
 - ideapad-laptop: Reassign KEY_CUT to KEY_SELECTIVE_SCREENSHOT
 
 - intel/pmt:
   - Fix kobject memory leak on init failure
   - Use valid pointers on error handling path
 
 - intel/vsec: Correct kernel doc comments
 
 - mellanox: mlxbf-pmc: Fix event names
 
 - msi-laptop: Add sysfs_remove_group()
 
 - samsumg-galaxybook: Do not cast pointer to a shorter type
 
 - think-lmi: WMI certificate thumbprint support for ThinkCenter
 
 - uniwill: Tuxedo Book BA15 Gen10 support
 
 The following is an automated shortlog grouped by driver:
 
 alienware-wmi-wmax:
  -  Add AWCC support for Alienware x16
  -  Add support for Alienware 16X Aurora
  -  Add support for new Area-51 laptops
 
 asus-armoury:
  -  add support for FA608UM
  -  add support for G615LR
  -  add support for G835LW
  -  add support for GA403WR
  -  add support for GU605CR
  -  fix ppt data for FA507R
 
 asus-nb-wmi:
  -  Add keymap for display toggle
 
 dell-lis3lv02d:
  -  Add Latitude 5400
 
 hp-bioscfg:
  -  Fix out-of-bounds array access in ACPI package parsing
 
 ibm_rtl:
  -  fix EBDA signature search pointer arithmetic
 
 ideapad-laptop:
  -  Reassign KEY_CUT to KEY_SELECTIVE_SCREENSHOT
 
 intel/pmt/discovery:
  -  use valid device pointer in dev_err_probe
 
 intel/pmt:
  -  Fix kobject memory leak on init failure
 
 intel/vsec:
  -  correct kernel-doc comments
 
 mlxbf-pmc:
  -  Remove trailing whitespaces from event names
 
 msi-laptop:
  -  add missing sysfs_remove_group()
 
 samsung-galaxybook:
  -  Fix problematic pointer cast
 
 think-lmi:
  -  Add WMI certificate thumbprint support for ThinkCenter
 
 uniwill:
  -  Add TUXEDO Book BA15 Gen10
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQSCSUwRdwTNL2MhaBlZrE9hU+XOMQUCaVT4igAKCRBZrE9hU+XO
 MTB4AQCIWd1/VEyiHw7nLVraCvVcG25m+E61XkALpP3KHzuWsAD/ejev+eNcng9W
 G+TnUShOsVJ3w++juDHX1PNG7CSNqQ4=
 =tvjU
 -----END PGP SIGNATURE-----

Merge tag 'platform-drivers-x86-v6.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver fixes from Ilpo Järvinen:

 - alienware-wmi-wmax: Area-51, x16, and 16X Aurora laptops support

 - asus-armoury:
    - Fix FA507R PPT data
    - Add TDP data for more laptop models

 - asus-nb-wmi: Asus Zenbook 14 display toggle key support

 - dell-lis3lv02d: Dell Latitude 5400 support

 - hp-bioscfg: Fix out-of-bounds array access in ACPI package parsing

 - ibm_rtl: Fix EBDA signature search pointer arithmetic

 - ideapad-laptop: Reassign KEY_CUT to KEY_SELECTIVE_SCREENSHOT

 - intel/pmt:
    - Fix kobject memory leak on init failure
    - Use valid pointers on error handling path

 - intel/vsec: Correct kernel doc comments

 - mellanox: mlxbf-pmc: Fix event names

 - msi-laptop: Add sysfs_remove_group()

 - samsumg-galaxybook: Do not cast pointer to a shorter type

 - think-lmi: WMI certificate thumbprint support for ThinkCenter

 - uniwill: Tuxedo Book BA15 Gen10 support

* tag 'platform-drivers-x86-v6.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (22 commits)
  platform/x86: asus-armoury: add support for G835LW
  platform/x86: asus-armoury: fix ppt data for FA507R
  platform/x86/intel/pmt/discovery: use valid device pointer in dev_err_probe
  platform/x86: hp-bioscfg: Fix out-of-bounds array access in ACPI package parsing
  platform/x86: asus-armoury: add support for G615LR
  platform/x86: asus-armoury: add support for FA608UM
  platform/x86: asus-armoury: add support for GA403WR
  platform/x86: asus-armoury: add support for GU605CR
  platform/x86: ideapad-laptop: Reassign KEY_CUT to KEY_SELECTIVE_SCREENSHOT
  platform/x86: samsung-galaxybook: Fix problematic pointer cast
  platform/x86/intel/pmt: Fix kobject memory leak on init failure
  platform/x86/intel/vsec: correct kernel-doc comments
  platform/x86: ibm_rtl: fix EBDA signature search pointer arithmetic
  platform/x86: msi-laptop: add missing sysfs_remove_group()
  platform/x86: think-lmi: Add WMI certificate thumbprint support for ThinkCenter
  platform/x86: dell-lis3lv02d: Add Latitude 5400
  platform/mellanox: mlxbf-pmc: Remove trailing whitespaces from event names
  platform/x86: asus-nb-wmi: Add keymap for display toggle
  platform/x86/uniwill: Add TUXEDO Book BA15 Gen10
  platform/x86: alienware-wmi-wmax: Add support for Alienware 16X Aurora
  ...
2025-12-31 12:25:22 -08:00
Linus Torvalds
349bd28a86 VFIO fixes for v6.19-rc4
- Restrict ROM access to dword to resolve a regression introduced
    with qword access seen on some Intel NICs.  Update VGA region
    access to the same given lack of precedent for 64-bit users.
    (Kevin Tian)
 
  - Fix missing .get_region_info_caps callback in the xe-vfio-pci
    variant driver due to integration through the DRM tree.
    (Michal Wajdeczko)
 
  - Add aligned 64-bit access macros to tools/include/linux/types.h,
    allowing removal of uapi/linux/type.h includes from various
    vfio selftest, resolving redefinition warnings for integration
    with KVM selftests. (David Matlack)
 
  - Fix error path memory leak in pds-vfio-pci variant driver.
    (Zilin Guan)
 
  - Fix error path use-after-free in xe-vfio-pci variant driver.
    (Alper Ak)
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEQvbATlQL0amee4qQI5ubbjuwiyIFAmlUP2oRHGFsZXhAc2hh
 emJvdC5vcmcACgkQI5ubbjuwiyKYsw//fEJ6vfn0TOP/ahfY9tRpw6suZJuEo5wx
 SJj57kMF85/V64iaewRq1G1hbrEAEcOgDtpcR3y57lHAS8METKxyjxL5YZdqvgX4
 kRvDwRJRcFz/kvmO0PZx6rn21ZxLv2d9RXahDwaqaQfw2pR2ZOtr/zaawMr6LPmw
 Z1dl0UhQnHIhw4kG1QKUhdCozhAgSV3/pmGV2bOjgXRS0rVUZ3UQZ0RprLe6uIEl
 hSWLmeWUtyrt30gVzoKPTWWuRvuIw2lnAH2PGhNtha70Djyx1EAUs7iqUA8XBsQh
 7JG/T1yibh9CzE5OzI+JBmix5s8zxd4q0RHNa9T31EMHSdzCJhXQfLiZVeJVv9O6
 EHsFVWHzE4CXgSMEpD+QjfCrEwBcF4n6W6N68BFAuAVN51+0DoFinFF0PaqpTivj
 U/Yh1erkfFhy8IlO33Q2dAOxBfy1aIkszKS2Xkc1pwX3vReMlHiWDmyM5ciB0VKJ
 GwslXQwGljSNuxE81e7EFI6g18FGGLGt5EkkYPhSS/hYAZQy0RpqPdRopcP85OiO
 HtyfZZZ/Ph0y13f7c7rH5awGm9NOc9W+2xNKxuKNkjwvEmjO12lRmrzGkKPu/OTi
 YluIWSFG7gBQfb8eFgcfJoM7vcrRCJ+JeSp5fa7u8QLUsTk+var+/WCxKs9BpX31
 hDb8rHj0Bwo=
 =a1By
 -----END PGP SIGNATURE-----

Merge tag 'vfio-v6.19-rc4' of https://github.com/awilliam/linux-vfio

Pull VFIO fixes from Alex Williamson:

 - Restrict ROM access to dword to resolve a regression introduced with
   qword access seen on some Intel NICs. Update VGA region access to the
   same given lack of precedent for 64-bit users (Kevin Tian)

 - Fix missing .get_region_info_caps callback in the xe-vfio-pci variant
   driver due to integration through the DRM tree (Michal Wajdeczko)

 - Add aligned 64-bit access macros to tools/include/linux/types.h,
   allowing removal of uapi/linux/type.h includes from various vfio
   selftest, resolving redefinition warnings for integration with KVM
   selftests (David Matlack)

 - Fix error path memory leak in pds-vfio-pci variant driver (Zilin Guan)

 - Fix error path use-after-free in xe-vfio-pci variant driver (Alper Ak)

* tag 'vfio-v6.19-rc4' of https://github.com/awilliam/linux-vfio:
  vfio/xe: Fix use-after-free in xe_vfio_pci_alloc_file()
  vfio/pds: Fix memory leak in pds_vfio_dirty_enable()
  vfio: selftests: Drop <uapi/linux/types.h> includes
  tools include: Add definitions for __aligned_{l,b}e64
  vfio/xe: Add default handler for .get_region_info_caps
  vfio/pci: Disable qword access to the VGA region
  vfio/pci: Disable qword access to the PCI ROM bar
2025-12-31 10:38:48 -08:00
Denis Benato
c6703f10c8
platform/x86: asus-armoury: add support for G835LW
Add TDP data for laptop model G835LW.

Signed-off-by: Denis Benato <denis.benato@linux.dev>
Link: https://patch.msgid.link/20251229204458.2658777-1-denis.benato@linux.dev
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-30 12:51:46 +02:00
Denis Benato
6a02651c4c
platform/x86: asus-armoury: fix ppt data for FA507R
PPT data for FA507R was reported to be wrong by a user:
change limits to make them equal to Armoury Crate limits.

Fixes: 39ae6c50e599 ("platform/x86: asus-armoury: add ppt_* and nv_* tuning knobs")
Signed-off-by: Denis Benato <denis.benato@linux.dev>
Link: https://patch.msgid.link/20251229150755.1351495-1-denis.benato@linux.dev
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-29 17:41:21 +02:00
Alok Tiwari
66e245db16
platform/x86/intel/pmt/discovery: use valid device pointer in dev_err_probe
The PMT feature probe creates a child device with device_create().
If device creation fail, the code pass priv->dev (which is an ERR_PTR)
to dev_err_probe(), which is not a valid device pointer.

This patch change the dev_err_probe() call to use the parent auxiliary
device (&auxdev->dev) and update the error message to reference the
parent device name. It ensure correct error reporting and avoid
passing an invalid device pointer.

Fixes: d9a078809356 ("platform/x86/intel/pmt: Add PMT Discovery driver")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Link: https://patch.msgid.link/20251224095133.115678-1-alok.a.tiwari@oracle.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-29 17:22:44 +02:00
Junrui Luo
e44c42c830
platform/x86: hp-bioscfg: Fix out-of-bounds array access in ACPI package parsing
The hp_populate_*_elements_from_package() functions in the hp-bioscfg
driver contain out-of-bounds array access vulnerabilities.

These functions parse ACPI packages into internal data structures using
a for loop with index variable 'elem' that iterates through
enum_obj/integer_obj/order_obj/password_obj/string_obj arrays.

When processing multi-element fields like PREREQUISITES and
ENUM_POSSIBLE_VALUES, these functions read multiple consecutive array
elements using expressions like 'enum_obj[elem + reqs]' and
'enum_obj[elem + pos_values]' within nested loops.

The bug is that the bounds check only validated elem, but did not consider
the additional offset when accessing elem + reqs or elem + pos_values.

The fix changes the bounds check to validate the actual accessed index.

Reported-by: Yuhao Jiang <danisjiang@gmail.com>
Reported-by: Junrui Luo <moonafterrain@outlook.com>
Fixes: e6c7b3e15559 ("platform/x86: hp-bioscfg: string-attributes")
Signed-off-by: Junrui Luo <moonafterrain@outlook.com>
Link: https://patch.msgid.link/SYBPR01MB788173D7DD4EA2CB6383683DAFB0A@SYBPR01MB7881.ausprd01.prod.outlook.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-29 15:42:53 +02:00
Denis Benato
499d987b65
platform/x86: asus-armoury: add support for G615LR
Add TDP data for laptop model G615LR.

Signed-off-by: Denis Benato <denis.benato@linux.dev>
Link: https://patch.msgid.link/20251225031041.2321249-1-denis.benato@linux.dev
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-29 14:31:43 +02:00
Denis Benato
a22d893f49
platform/x86: asus-armoury: add support for FA608UM
Add TDP data for laptop model FA608UM.

Signed-off-by: Denis Benato <denis.benato@linux.dev>
Link: https://patch.msgid.link/20251225030354.2315874-1-denis.benato@linux.dev
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-29 14:31:26 +02:00
Denis Benato
a051171502
platform/x86: asus-armoury: add support for GA403WR
Add TDP data for laptop model GA403WR.

Signed-off-by: Denis Benato <denis.benato@linux.dev>
Link: https://patch.msgid.link/20251225025301.1980627-1-denis.benato@linux.dev
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-29 14:31:09 +02:00
Denis Benato
063185ba32
platform/x86: asus-armoury: add support for GU605CR
Add TDP data for laptop model GU605CR.

Signed-off-by: Denis Benato <denis.benato@linux.dev>
Link: https://patch.msgid.link/20251225023841.1970513-1-denis.benato@linux.dev
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-29 14:30:47 +02:00
Tomáš Hnyk
cbf3dc3260
platform/x86: ideapad-laptop: Reassign KEY_CUT to KEY_SELECTIVE_SCREENSHOT
As per Lenovo documentation, Fn+Print-Screen should "Open the Snipping
tool" which corresponds to KEY_SELECTIVE_SCREENSHOT (keycode 0x27a). It
is currently assigned to KEY_CUT because keycodes under 248 were
preferred due to X11 limitations.

Reassign Fn+Print-Screen from KEY_CUT to KEY_SELECTIVE_SCREENSHOT.

Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220566
Signed-off-by: Tomáš Hnyk <tomashnyk@gmail.com>
Link: https://patch.msgid.link/20251226203454.405520-1-tomashnyk@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-29 13:56:14 +02:00
Armin Wolf
d37cd54ebe
platform/x86: samsung-galaxybook: Fix problematic pointer cast
A user reported that reading the charge threshold on his device
results in very strange values (like 78497792) being returned.
The reason for this seems to be the fact that the driver casts
the int pointer to an u8 pointer, leaving the last 3 bytes of
the destination uninitialized. Fix this by using a temporary
variable instead.

Cc: stable@vger.kernel.org
Fixes: 56f529ce4370 ("platform/x86: samsung-galaxybook: Add samsung-galaxybook driver")
Reported-by: Gianni Ceccarelli <dakkar@thenautilus.net>
Closes: https://lore.kernel.org/platform-driver-x86/20251228115556.14362d66@thenautilus.net/
Tested-by: Gianni Ceccarelli <dakkar@thenautilus.net>
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://patch.msgid.link/20251228214217.35972-1-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-29 12:55:50 +02:00
Alper Ak
acf44a2361 vfio/xe: Fix use-after-free in xe_vfio_pci_alloc_file()
migf->filp is accessed after migf has been freed. Save the error
value before calling kfree() to prevent use-after-free.

Fixes: 1f5556ec8b9e ("vfio/xe: Add device specific vfio_pci driver variant for Intel graphics")
Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
Link: https://lore.kernel.org/r/20251225151349.360870-1-alperyasinak1@gmail.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
2025-12-28 12:42:46 -07:00
Zilin Guan
665077d78d vfio/pds: Fix memory leak in pds_vfio_dirty_enable()
pds_vfio_dirty_enable() allocates memory for region_info. If
interval_tree_iter_first() returns NULL, the function returns -EINVAL
immediately without freeing the allocated memory, causing a memory leak.

Fix this by jumping to the out_free_region_info label to ensure
region_info is freed.

Fixes: 2e7c6feb4ef52 ("vfio/pds: Add multi-region support")
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Link: https://lore.kernel.org/r/20251225143150.1117366-1-zilin@seu.edu.cn
Signed-off-by: Alex Williamson <alex@shazbot.org>
2025-12-28 12:33:40 -07:00
David Matlack
193120dddd vfio: selftests: Drop <uapi/linux/types.h> includes
Drop the <uapi/linux/types.h> includes now that <linux/types.h>
(tools/include/linux/types.h) has a definition for __aligned_le64, which
is needed by <linux/iommufd.h>.

Including <uapi/linux/types.h> is harmless but causes benign typedef
redefinitions. This is not a problem for VFIO selftests but becomes an
issue when the VFIO selftests library is built into KVM selftests, since
they are built with -std=gnu99 which does not allow typedef redifitions.

No functional change intended.

Signed-off-by: David Matlack <dmatlack@google.com>
Link: https://lore.kernel.org/r/20251219233818.1965306-3-dmatlack@google.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
2025-12-23 14:17:13 -07:00
David Matlack
30fb98ec34 tools include: Add definitions for __aligned_{l,b}e64
Add definitions for the missing __aligned_le64 and __aligned_be64 to
tools/include/linux/types.h. The former is needed by <linux/iommufd.h>
for builds where tools/include/ is on the include path ahead of
usr/include/.

Signed-off-by: David Matlack <dmatlack@google.com>
Link: https://lore.kernel.org/r/20251219233818.1965306-2-dmatlack@google.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
2025-12-23 14:16:18 -07:00
Michal Wajdeczko
1e91505038 vfio/xe: Add default handler for .get_region_info_caps
New requirement for the vfio drivers was added by the commit
f97859503859 ("vfio: Require drivers to implement get_region_info")
followed by commit 1b0ecb5baf4a ("vfio/pci: Convert all PCI drivers
to get_region_info_caps") that was missed by the new vfio/xe driver.

Add handler for .get_region_info_caps to avoid -EINVAL errors.

Fixes: 2e38c50ae492 ("vfio/xe: Add device specific vfio_pci driver variant for Intel graphics")
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Tested-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Link: https://lore.kernel.org/r/20251218205106.4578-1-michal.wajdeczko@intel.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
2025-12-23 14:13:36 -07:00
Kevin Tian
8bb808cea3 vfio/pci: Disable qword access to the VGA region
Seems no reason to allow qword access to the old VGA resource. Better
restrict it to dword access as before.

Suggested-by: Alex Williamson <alex@shazbot.org>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20251218081650.555015-3-kevin.tian@intel.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
2025-12-23 14:07:08 -07:00
Kevin Tian
dc85a46928 vfio/pci: Disable qword access to the PCI ROM bar
Commit 2b938e3db335 ("vfio/pci: Enable iowrite64 and ioread64 for vfio
pci") enables qword access to the PCI bar resources. However certain
devices (e.g. Intel X710) are observed with problem upon qword accesses
to the rom bar, e.g. triggering PCI aer errors.

This is triggered by Qemu which caches the rom content by simply does a
pread() of the remaining size until it gets the full contents. The other
bars would only perform operations at the same access width as their
guest drivers.

Instead of trying to identify all broken devices, universally disable
qword access to the rom bar i.e. going back to the old way which worked
reliably for years.

Reported-by: Farrah Chen <farrah.chen@intel.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220740
Fixes: 2b938e3db335 ("vfio/pci: Enable iowrite64 and ioread64 for vfio pci")
Cc: stable@vger.kernel.org
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Tested-by: Farrah Chen <farrah.chen@intel.com>
Link: https://lore.kernel.org/r/20251218081650.555015-2-kevin.tian@intel.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
2025-12-23 14:07:08 -07:00
Kaushlendra Kumar
00c22b1e84
platform/x86/intel/pmt: Fix kobject memory leak on init failure
When kobject_init_and_add() fails in pmt_features_discovery(), the
function returns without calling kobject_put(). This violates the
kobject API contract where kobject_put() must be called even on
initialization failure to properly release allocated resources.

Fixes: d9a078809356 ("platform/x86/intel/pmt: Add PMT Discovery driver")
Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Link: https://patch.msgid.link/20251223084041.3832933-1-kaushlendra.kumar@intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-23 13:57:48 +02:00
Randy Dunlap
20e20b147c
platform/x86/intel/vsec: correct kernel-doc comments
Fix kernel-doc warnings in intel_vsec.h to eliminate all kernel-doc
warnings:

Warning: include/linux/intel_vsec.h:92 struct member 'read_telem' not
 described in 'pmt_callbacks'
Warning: include/linux/intel_vsec.h:146 expecting prototype for struct
 intel_sec_device.  Prototype was for struct intel_vsec_device instead
Warning: include/linux/intel_vsec.h:146 struct member 'priv_data_size'
 not described in 'intel_vsec_device'

In struct pmt_callbacks, correct the kernel-doc for @read_telem.
kernel-doc doesn't support documenting callback function parameters,
so drop the '@' signs on those and use "* *" to make them somewhat
readable in the produced documentation output.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://patch.msgid.link/20251216063801.2896495-1-rdunlap@infradead.org
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-22 16:19:53 +02:00
Junrui Luo
15dd100349
platform/x86: ibm_rtl: fix EBDA signature search pointer arithmetic
The ibm_rtl_init() function searches for the signature but has a pointer
arithmetic error. The loop counter suggests searching at 4-byte intervals
but the implementation only advances by 1 byte per iteration.

Fix by properly advancing the pointer by sizeof(unsigned int) bytes
each iteration.

Reported-by: Yuhao Jiang <danisjiang@gmail.com>
Reported-by: Junrui Luo <moonafterrain@outlook.com>
Fixes: 35f0ce032b0f ("IBM Real-Time "SMI Free" mode driver -v7")
Signed-off-by: Junrui Luo <moonafterrain@outlook.com>
Link: https://patch.msgid.link/SYBPR01MB78812D887A92DE3802D0D06EAFA9A@SYBPR01MB7881.ausprd01.prod.outlook.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-22 16:19:19 +02:00
Thomas Fourier
1461209cf8
platform/x86: msi-laptop: add missing sysfs_remove_group()
A sysfs group is created in msi_init() when old_ec_model is enabled, but
never removed. Remove the msipf_old_attribute_group in that case.

Fixes: 03696e51d75a ("msi-laptop: Disable brightness control for new EC")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Link: https://patch.msgid.link/20251217103617.27668-2-fourier.thomas@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-22 16:17:49 +02:00
Mark Pearson
0512606360
platform/x86: think-lmi: Add WMI certificate thumbprint support for ThinkCenter
The ThinkCenter team are adding WMI certificate thumbprint support.

Updating the driver to enable it. They are using the same GUID as
Thinkpad/ThinkStation.
Tested on M75q Gen 5.

Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Link: https://patch.msgid.link/20251127202959.399040-1-mpearson-lenovo@squebb.ca
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-22 16:12:41 +02:00
Dmytro Bagrii
a5b9fdd33c
platform/x86: dell-lis3lv02d: Add Latitude 5400
Add accelerometer address 0x29 for Dell Latitude 5400.

The address is verified as below:

    $ cat /sys/class/dmi/id/product_name
    Latitude 5400

    $ grep -H '' /sys/bus/pci/drivers/i801_smbus/0000\:00*/i2c-*/name
    /sys/bus/pci/drivers/i801_smbus/0000:00:1f.4/i2c-10/name:SMBus I801 adapter at 0000:00:1f.4

    $ i2cdetect 10
    WARNING! This program can confuse your I2C bus, cause data loss and worse!
    I will probe file /dev/i2c-10.
    I will probe address range 0x08-0x77.
    Continue? [Y/n] Y
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:                         08 -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- UU -- -- -- -- -- --
    30: 30 -- -- -- -- 35 UU UU -- -- -- -- -- -- -- --
    40: -- -- -- -- 44 -- -- -- -- -- -- -- -- -- -- --
    50: UU -- 52 -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --

    $ xargs -n1 -a /proc/cmdline | grep ^dell_lis3lv02d
    dell_lis3lv02d.probe_i2c_addr=1

    $ dmesg | grep lis3lv02d
    ...
    [  206.012411] i2c i2c-10: Probing for lis3lv02d on address 0x29
    [  206.013727] i2c i2c-10: Detected lis3lv02d on address 0x29, please report this upstream to platform-driver-x86@vger.kernel.org so that a quirk can be added
    [  206.240841] lis3lv02d_i2c 10-0029: supply Vdd not found, using dummy regulator
    [  206.240868] lis3lv02d_i2c 10-0029: supply Vdd_IO not found, using dummy regulator
    [  206.261258] lis3lv02d: 8 bits 3DC sensor found
    [  206.346722] input: ST LIS3LV02DL Accelerometer as /devices/faux/lis3lv02d/input/input17

    $ cat /sys/class/input/input17/name
    ST LIS3LV02DL Accelerometer

Signed-off-by: Dmytro Bagrii <dimich.dmb@gmail.com>
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Link: https://patch.msgid.link/20251128161523.6224-1-dimich.dmb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-22 16:11:35 +02:00
Shravan Kumar Ramani
f13bce715d
platform/mellanox: mlxbf-pmc: Remove trailing whitespaces from event names
Some event names have trailing whitespaces at the end which causes programming
of counters using the name for these specific events to fail and hence need to
be removed.

Fixes: 423c3361855c ("platform/mellanox: mlxbf-pmc: Add support for BlueField-3")
Signed-off-by: Shravan Kumar Ramani <shravankr@nvidia.com>
Reviewed-by: David Thompson <davthompson@nvidia.com>
Link: https://patch.msgid.link/065cbae0717dcc1169681c4dbb1a6e050b8574b3.1766059953.git.shravankr@nvidia.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-22 16:09:29 +02:00
Tim Wassink
e521dc1687
platform/x86: asus-nb-wmi: Add keymap for display toggle
On the Asus Zenbook 14 (UX3405MA), the Fn+F7 key combination emits
WMI code 0x2d, which was previously unmapped.

Map this code to KEY_DISPLAYTOGGLE. This matches the behavior of the
display toggle/projector mode key found on other Asus laptops, allowing
userspace to handle multi-monitor switching or screen toggling.

Tested on ASUS Zenbook 14 UX3405MA.

Signed-off-by: Tim Wassink <timwassink.dev@gmail.com>
Reviewed-by: Denis Benato <benato.denis96@gmail.com>
Link: https://patch.msgid.link/20251221181724.19927-1-timwassink.dev@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-22 16:06:50 +02:00
Werner Sembach
4dcb6e4af1
platform/x86/uniwill: Add TUXEDO Book BA15 Gen10
Add TUXEDO Book BA15 Gen10 to the list of supported devices of the
Uniwill driver.

Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
Link: https://patch.msgid.link/20251212180319.712913-1-wse@tuxedocomputers.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-15 16:05:49 +02:00
Kurt Borja
7f3c2499da
platform/x86: alienware-wmi-wmax: Add support for Alienware 16X Aurora
Add AWCC support for Alienware 16X Aurora laptops.

Cc: stable@vger.kernel.org
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://patch.msgid.link/20251205-area-51-v1-3-d2cb13530851@gmail.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-15 16:04:11 +02:00
Kurt Borja
a584644a49
platform/x86: alienware-wmi-wmax: Add AWCC support for Alienware x16
Add AWCC support for Alienware x16 laptops.

Cc: stable@vger.kernel.org
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://patch.msgid.link/20251205-area-51-v1-2-d2cb13530851@gmail.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-15 16:04:10 +02:00
Kurt Borja
433f7744cb
platform/x86: alienware-wmi-wmax: Add support for new Area-51 laptops
Add AWCC support for new Alienware Area-51 laptops.

Cc: stable@vger.kernel.org
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://patch.msgid.link/20251205-area-51-v1-1-d2cb13530851@gmail.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2025-12-15 16:04:07 +02:00
31 changed files with 315 additions and 58 deletions

View File

@ -3019,7 +3019,7 @@ int mt76_connac2_load_ram(struct mt76_dev *dev, const char *fw_wm,
} }
hdr = (const void *)(fw->data + fw->size - sizeof(*hdr)); hdr = (const void *)(fw->data + fw->size - sizeof(*hdr));
dev_info(dev->dev, "WM Firmware Version: %.10s, Build Time: %.15s\n", dev_info(dev->dev, "WM Firmware Version: %.10s, Build Time: %.15s",
hdr->fw_ver, hdr->build_date); hdr->fw_ver, hdr->build_date);
ret = mt76_connac_mcu_send_ram_firmware(dev, hdr, fw->data, false); ret = mt76_connac_mcu_send_ram_firmware(dev, hdr, fw->data, false);
@ -3048,7 +3048,7 @@ int mt76_connac2_load_ram(struct mt76_dev *dev, const char *fw_wm,
} }
hdr = (const void *)(fw->data + fw->size - sizeof(*hdr)); hdr = (const void *)(fw->data + fw->size - sizeof(*hdr));
dev_info(dev->dev, "WA Firmware Version: %.10s, Build Time: %.15s\n", dev_info(dev->dev, "WA Firmware Version: %.10s, Build Time: %.15s",
hdr->fw_ver, hdr->build_date); hdr->fw_ver, hdr->build_date);
ret = mt76_connac_mcu_send_ram_firmware(dev, hdr, fw->data, true); ret = mt76_connac_mcu_send_ram_firmware(dev, hdr, fw->data, true);
@ -3101,7 +3101,6 @@ int mt76_connac2_load_patch(struct mt76_dev *dev, const char *fw_name)
int i, ret, sem, max_len = mt76_is_sdio(dev) ? 2048 : 4096; int i, ret, sem, max_len = mt76_is_sdio(dev) ? 2048 : 4096;
const struct mt76_connac2_patch_hdr *hdr; const struct mt76_connac2_patch_hdr *hdr;
const struct firmware *fw = NULL; const struct firmware *fw = NULL;
char build_date[17];
sem = mt76_connac_mcu_patch_sem_ctrl(dev, true); sem = mt76_connac_mcu_patch_sem_ctrl(dev, true);
switch (sem) { switch (sem) {
@ -3125,11 +3124,8 @@ int mt76_connac2_load_patch(struct mt76_dev *dev, const char *fw_name)
} }
hdr = (const void *)fw->data; hdr = (const void *)fw->data;
strscpy(build_date, hdr->build_date, sizeof(build_date)); dev_info(dev->dev, "HW/SW Version: 0x%x, Build Time: %.16s",
build_date[16] = '\0'; be32_to_cpu(hdr->hw_sw_ver), hdr->build_date);
strim(build_date);
dev_info(dev->dev, "HW/SW Version: 0x%x, Build Time: %.16s\n",
be32_to_cpu(hdr->hw_sw_ver), build_date);
for (i = 0; i < be32_to_cpu(hdr->desc.n_region); i++) { for (i = 0; i < be32_to_cpu(hdr->desc.n_region); i++) {
struct mt76_connac2_patch_sec *sec; struct mt76_connac2_patch_sec *sec;

View File

@ -801,18 +801,18 @@ static const struct mlxbf_pmc_events mlxbf_pmc_llt_miss_events[] = {
{11, "GDC_MISS_MACHINE_CHI_TXDAT"}, {11, "GDC_MISS_MACHINE_CHI_TXDAT"},
{12, "GDC_MISS_MACHINE_CHI_RXDAT"}, {12, "GDC_MISS_MACHINE_CHI_RXDAT"},
{13, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC0_0"}, {13, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC0_0"},
{14, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC0_1 "}, {14, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC0_1"},
{15, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC0_2"}, {15, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC0_2"},
{16, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC0_3 "}, {16, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC0_3"},
{17, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_0 "}, {17, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_0"},
{18, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_1 "}, {18, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_1"},
{19, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_2 "}, {19, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_2"},
{20, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_3 "}, {20, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC1_3"},
{21, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE0_0"}, {21, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE0_0"},
{22, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE0_1"}, {22, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE0_1"},
{23, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE0_2"}, {23, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE0_2"},
{24, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE0_3"}, {24, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE0_3"},
{25, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE1_0 "}, {25, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE1_0"},
{26, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE1_1"}, {26, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE1_1"},
{27, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE1_2"}, {27, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE1_2"},
{28, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE1_3"}, {28, "GDC_MISS_MACHINE_G_FIFO_FF_EXEC_DONE1_3"},

View File

@ -449,12 +449,27 @@ static const struct dmi_system_id power_limits[] = {
.ac_data = &(struct power_limits) { .ac_data = &(struct power_limits) {
.ppt_pl1_spl_min = 15, .ppt_pl1_spl_min = 15,
.ppt_pl1_spl_max = 80, .ppt_pl1_spl_max = 80,
.ppt_pl2_sppt_min = 25, .ppt_pl2_sppt_min = 35,
.ppt_pl2_sppt_max = 80, .ppt_pl2_sppt_max = 80,
.ppt_pl3_fppt_min = 35, .ppt_pl3_fppt_min = 35,
.ppt_pl3_fppt_max = 80 .ppt_pl3_fppt_max = 80,
.nv_dynamic_boost_min = 5,
.nv_dynamic_boost_max = 25,
.nv_temp_target_min = 75,
.nv_temp_target_max = 87,
},
.dc_data = &(struct power_limits) {
.ppt_pl1_spl_min = 15,
.ppt_pl1_spl_def = 45,
.ppt_pl1_spl_max = 65,
.ppt_pl2_sppt_min = 35,
.ppt_pl2_sppt_def = 54,
.ppt_pl2_sppt_max = 65,
.ppt_pl3_fppt_min = 35,
.ppt_pl3_fppt_max = 65,
.nv_temp_target_min = 75,
.nv_temp_target_max = 87,
}, },
.dc_data = NULL,
}, },
}, },
{ {
@ -552,6 +567,42 @@ static const struct dmi_system_id power_limits[] = {
}, },
}, },
}, },
{
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "FA608UM"),
},
.driver_data = &(struct power_data) {
.ac_data = &(struct power_limits) {
.ppt_pl1_spl_min = 15,
.ppt_pl1_spl_def = 45,
.ppt_pl1_spl_max = 90,
.ppt_pl2_sppt_min = 35,
.ppt_pl2_sppt_def = 54,
.ppt_pl2_sppt_max = 90,
.ppt_pl3_fppt_min = 35,
.ppt_pl3_fppt_def = 90,
.ppt_pl3_fppt_max = 65,
.nv_dynamic_boost_min = 10,
.nv_dynamic_boost_max = 15,
.nv_temp_target_min = 75,
.nv_temp_target_max = 87,
.nv_tgp_min = 55,
.nv_tgp_max = 100,
},
.dc_data = &(struct power_limits) {
.ppt_pl1_spl_min = 15,
.ppt_pl1_spl_def = 45,
.ppt_pl1_spl_max = 65,
.ppt_pl2_sppt_min = 35,
.ppt_pl2_sppt_def = 54,
.ppt_pl2_sppt_max = 65,
.ppt_pl3_fppt_min = 35,
.ppt_pl3_fppt_max = 65,
.nv_temp_target_min = 75,
.nv_temp_target_max = 87,
},
},
},
{ {
.matches = { .matches = {
DMI_MATCH(DMI_BOARD_NAME, "FA608WI"), DMI_MATCH(DMI_BOARD_NAME, "FA608WI"),
@ -822,6 +873,38 @@ static const struct dmi_system_id power_limits[] = {
.requires_fan_curve = true, .requires_fan_curve = true,
}, },
}, },
{
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "GA403WR"),
},
.driver_data = &(struct power_data) {
.ac_data = &(struct power_limits) {
.ppt_pl1_spl_min = 15,
.ppt_pl1_spl_max = 80,
.ppt_pl2_sppt_min = 25,
.ppt_pl2_sppt_max = 80,
.ppt_pl3_fppt_min = 35,
.ppt_pl3_fppt_max = 80,
.nv_dynamic_boost_min = 0,
.nv_dynamic_boost_max = 25,
.nv_temp_target_min = 75,
.nv_temp_target_max = 87,
.nv_tgp_min = 80,
.nv_tgp_max = 95,
},
.dc_data = &(struct power_limits) {
.ppt_pl1_spl_min = 15,
.ppt_pl1_spl_max = 35,
.ppt_pl2_sppt_min = 25,
.ppt_pl2_sppt_max = 35,
.ppt_pl3_fppt_min = 35,
.ppt_pl3_fppt_max = 65,
.nv_temp_target_min = 75,
.nv_temp_target_max = 87,
},
.requires_fan_curve = true,
},
},
{ {
.matches = { .matches = {
DMI_MATCH(DMI_BOARD_NAME, "GA503QR"), DMI_MATCH(DMI_BOARD_NAME, "GA503QR"),
@ -950,6 +1033,35 @@ static const struct dmi_system_id power_limits[] = {
}, },
}, },
}, },
{
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "GU605CR"),
},
.driver_data = &(struct power_data) {
.ac_data = &(struct power_limits) {
.ppt_pl1_spl_min = 30,
.ppt_pl1_spl_max = 85,
.ppt_pl2_sppt_min = 38,
.ppt_pl2_sppt_max = 110,
.nv_dynamic_boost_min = 5,
.nv_dynamic_boost_max = 20,
.nv_temp_target_min = 75,
.nv_temp_target_max = 87,
.nv_tgp_min = 80,
.nv_tgp_def = 90,
.nv_tgp_max = 105,
},
.dc_data = &(struct power_limits) {
.ppt_pl1_spl_min = 30,
.ppt_pl1_spl_max = 85,
.ppt_pl2_sppt_min = 38,
.ppt_pl2_sppt_max = 110,
.nv_temp_target_min = 75,
.nv_temp_target_max = 87,
},
.requires_fan_curve = true,
},
},
{ {
.matches = { .matches = {
DMI_MATCH(DMI_BOARD_NAME, "GU605CW"), DMI_MATCH(DMI_BOARD_NAME, "GU605CW"),
@ -1260,6 +1372,35 @@ static const struct dmi_system_id power_limits[] = {
.requires_fan_curve = true, .requires_fan_curve = true,
}, },
}, },
{
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "G615LR"),
},
.driver_data = &(struct power_data) {
.ac_data = &(struct power_limits) {
.ppt_pl1_spl_min = 28,
.ppt_pl1_spl_def = 140,
.ppt_pl1_spl_max = 175,
.ppt_pl2_sppt_min = 28,
.ppt_pl2_sppt_max = 175,
.nv_temp_target_min = 75,
.nv_temp_target_max = 87,
.nv_dynamic_boost_min = 5,
.nv_dynamic_boost_max = 25,
.nv_tgp_min = 65,
.nv_tgp_max = 115,
},
.dc_data = &(struct power_limits) {
.ppt_pl1_spl_min = 25,
.ppt_pl1_spl_max = 55,
.ppt_pl2_sppt_min = 25,
.ppt_pl2_sppt_max = 70,
.nv_temp_target_min = 75,
.nv_temp_target_max = 87,
},
.requires_fan_curve = true,
},
},
{ {
.matches = { .matches = {
DMI_MATCH(DMI_BOARD_NAME, "G634J"), DMI_MATCH(DMI_BOARD_NAME, "G634J"),
@ -1426,6 +1567,35 @@ static const struct dmi_system_id power_limits[] = {
.requires_fan_curve = true, .requires_fan_curve = true,
}, },
}, },
{
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "G835LW"),
},
.driver_data = &(struct power_data) {
.ac_data = &(struct power_limits) {
.ppt_pl1_spl_min = 28,
.ppt_pl1_spl_def = 140,
.ppt_pl1_spl_max = 175,
.ppt_pl2_sppt_min = 28,
.ppt_pl2_sppt_max = 175,
.nv_dynamic_boost_min = 5,
.nv_dynamic_boost_max = 25,
.nv_temp_target_min = 75,
.nv_temp_target_max = 87,
.nv_tgp_min = 80,
.nv_tgp_max = 150,
},
.dc_data = &(struct power_limits) {
.ppt_pl1_spl_min = 25,
.ppt_pl1_spl_max = 55,
.ppt_pl2_sppt_min = 25,
.ppt_pl2_sppt_max = 70,
.nv_temp_target_min = 75,
.nv_temp_target_max = 87,
},
.requires_fan_curve = true,
},
},
{ {
.matches = { .matches = {
DMI_MATCH(DMI_BOARD_NAME, "H7606W"), DMI_MATCH(DMI_BOARD_NAME, "H7606W"),

View File

@ -580,6 +580,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x2a, { KEY_SELECTIVE_SCREENSHOT } }, { KE_KEY, 0x2a, { KEY_SELECTIVE_SCREENSHOT } },
{ KE_IGNORE, 0x2b, }, /* PrintScreen (also send via PS/2) on newer models */ { KE_IGNORE, 0x2b, }, /* PrintScreen (also send via PS/2) on newer models */
{ KE_IGNORE, 0x2c, }, /* CapsLock (also send via PS/2) on newer models */ { KE_IGNORE, 0x2c, }, /* CapsLock (also send via PS/2) on newer models */
{ KE_KEY, 0x2d, { KEY_DISPLAYTOGGLE } },
{ KE_KEY, 0x30, { KEY_VOLUMEUP } }, { KE_KEY, 0x30, { KEY_VOLUMEUP } },
{ KE_KEY, 0x31, { KEY_VOLUMEDOWN } }, { KE_KEY, 0x31, { KEY_VOLUMEDOWN } },
{ KE_KEY, 0x32, { KEY_MUTE } }, { KE_KEY, 0x32, { KEY_MUTE } },

View File

@ -89,6 +89,30 @@ static struct awcc_quirks generic_quirks = {
static struct awcc_quirks empty_quirks; static struct awcc_quirks empty_quirks;
static const struct dmi_system_id awcc_dmi_table[] __initconst = { static const struct dmi_system_id awcc_dmi_table[] __initconst = {
{
.ident = "Alienware 16 Area-51",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
DMI_MATCH(DMI_PRODUCT_NAME, "Alienware 16 Area-51"),
},
.driver_data = &g_series_quirks,
},
{
.ident = "Alienware 16X Aurora",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
DMI_MATCH(DMI_PRODUCT_NAME, "Alienware 16X Aurora"),
},
.driver_data = &g_series_quirks,
},
{
.ident = "Alienware 18 Area-51",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
DMI_MATCH(DMI_PRODUCT_NAME, "Alienware 18 Area-51"),
},
.driver_data = &g_series_quirks,
},
{ {
.ident = "Alienware 16 Aurora", .ident = "Alienware 16 Aurora",
.matches = { .matches = {
@ -161,6 +185,14 @@ static const struct dmi_system_id awcc_dmi_table[] __initconst = {
}, },
.driver_data = &generic_quirks, .driver_data = &generic_quirks,
}, },
{
.ident = "Alienware x16",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x16"),
},
.driver_data = &g_series_quirks,
},
{ {
.ident = "Alienware x17", .ident = "Alienware x17",
.matches = { .matches = {

View File

@ -44,6 +44,7 @@ static const struct dmi_system_id lis3lv02d_devices[] __initconst = {
/* /*
* Additional individual entries were added after verification. * Additional individual entries were added after verification.
*/ */
DELL_LIS3LV02D_DMI_ENTRY("Latitude 5400", 0x29),
DELL_LIS3LV02D_DMI_ENTRY("Latitude 5480", 0x29), DELL_LIS3LV02D_DMI_ENTRY("Latitude 5480", 0x29),
DELL_LIS3LV02D_DMI_ENTRY("Latitude 5500", 0x29), DELL_LIS3LV02D_DMI_ENTRY("Latitude 5500", 0x29),
DELL_LIS3LV02D_DMI_ENTRY("Latitude E6330", 0x29), DELL_LIS3LV02D_DMI_ENTRY("Latitude E6330", 0x29),

View File

@ -207,7 +207,7 @@ static int hp_populate_enumeration_elements_from_package(union acpi_object *enum
case PREREQUISITES: case PREREQUISITES:
size = min_t(u32, enum_data->common.prerequisites_size, MAX_PREREQUISITES_SIZE); size = min_t(u32, enum_data->common.prerequisites_size, MAX_PREREQUISITES_SIZE);
for (reqs = 0; reqs < size; reqs++) { for (reqs = 0; reqs < size; reqs++) {
if (elem >= enum_obj_count) { if (elem + reqs >= enum_obj_count) {
pr_err("Error enum-objects package is too small\n"); pr_err("Error enum-objects package is too small\n");
return -EINVAL; return -EINVAL;
} }
@ -255,7 +255,7 @@ static int hp_populate_enumeration_elements_from_package(union acpi_object *enum
for (pos_values = 0; pos_values < size && pos_values < MAX_VALUES_SIZE; for (pos_values = 0; pos_values < size && pos_values < MAX_VALUES_SIZE;
pos_values++) { pos_values++) {
if (elem >= enum_obj_count) { if (elem + pos_values >= enum_obj_count) {
pr_err("Error enum-objects package is too small\n"); pr_err("Error enum-objects package is too small\n");
return -EINVAL; return -EINVAL;
} }

View File

@ -227,7 +227,7 @@ static int hp_populate_integer_elements_from_package(union acpi_object *integer_
size = min_t(u32, integer_data->common.prerequisites_size, MAX_PREREQUISITES_SIZE); size = min_t(u32, integer_data->common.prerequisites_size, MAX_PREREQUISITES_SIZE);
for (reqs = 0; reqs < size; reqs++) { for (reqs = 0; reqs < size; reqs++) {
if (elem >= integer_obj_count) { if (elem + reqs >= integer_obj_count) {
pr_err("Error elem-objects package is too small\n"); pr_err("Error elem-objects package is too small\n");
return -EINVAL; return -EINVAL;
} }

View File

@ -216,6 +216,11 @@ static int hp_populate_ordered_list_elements_from_package(union acpi_object *ord
size = min_t(u32, ordered_list_data->common.prerequisites_size, size = min_t(u32, ordered_list_data->common.prerequisites_size,
MAX_PREREQUISITES_SIZE); MAX_PREREQUISITES_SIZE);
for (reqs = 0; reqs < size; reqs++) { for (reqs = 0; reqs < size; reqs++) {
if (elem + reqs >= order_obj_count) {
pr_err("Error elem-objects package is too small\n");
return -EINVAL;
}
ret = hp_convert_hexstr_to_str(order_obj[elem + reqs].string.pointer, ret = hp_convert_hexstr_to_str(order_obj[elem + reqs].string.pointer,
order_obj[elem + reqs].string.length, order_obj[elem + reqs].string.length,
&str_value, &value_len); &str_value, &value_len);

View File

@ -303,6 +303,11 @@ static int hp_populate_password_elements_from_package(union acpi_object *passwor
MAX_PREREQUISITES_SIZE); MAX_PREREQUISITES_SIZE);
for (reqs = 0; reqs < size; reqs++) { for (reqs = 0; reqs < size; reqs++) {
if (elem + reqs >= password_obj_count) {
pr_err("Error elem-objects package is too small\n");
return -EINVAL;
}
ret = hp_convert_hexstr_to_str(password_obj[elem + reqs].string.pointer, ret = hp_convert_hexstr_to_str(password_obj[elem + reqs].string.pointer,
password_obj[elem + reqs].string.length, password_obj[elem + reqs].string.length,
&str_value, &value_len); &str_value, &value_len);

View File

@ -217,7 +217,7 @@ static int hp_populate_string_elements_from_package(union acpi_object *string_ob
MAX_PREREQUISITES_SIZE); MAX_PREREQUISITES_SIZE);
for (reqs = 0; reqs < size; reqs++) { for (reqs = 0; reqs < size; reqs++) {
if (elem >= string_obj_count) { if (elem + reqs >= string_obj_count) {
pr_err("Error elem-objects package is too small\n"); pr_err("Error elem-objects package is too small\n");
return -EINVAL; return -EINVAL;
} }

View File

@ -273,7 +273,7 @@ static int __init ibm_rtl_init(void) {
/* search for the _RTL_ signature at the start of the table */ /* search for the _RTL_ signature at the start of the table */
for (i = 0 ; i < ebda_size/sizeof(unsigned int); i++) { for (i = 0 ; i < ebda_size/sizeof(unsigned int); i++) {
struct ibm_rtl_table __iomem * tmp; struct ibm_rtl_table __iomem * tmp;
tmp = (struct ibm_rtl_table __iomem *) (ebda_map+i); tmp = (struct ibm_rtl_table __iomem *) (ebda_map + i*sizeof(unsigned int));
if ((readq(&tmp->signature) & RTL_MASK) == RTL_SIGNATURE) { if ((readq(&tmp->signature) & RTL_MASK) == RTL_SIGNATURE) {
phys_addr_t addr; phys_addr_t addr;
unsigned int plen; unsigned int plen;

View File

@ -503,8 +503,10 @@ static int pmt_features_discovery(struct pmt_features_priv *priv,
ret = kobject_init_and_add(&feature->kobj, ktype, &priv->dev->kobj, ret = kobject_init_and_add(&feature->kobj, ktype, &priv->dev->kobj,
"%s", pmt_feature_names[feature->id]); "%s", pmt_feature_names[feature->id]);
if (ret) if (ret) {
kobject_put(&feature->kobj);
return ret; return ret;
}
kobject_uevent(&feature->kobj, KOBJ_ADD); kobject_uevent(&feature->kobj, KOBJ_ADD);
pmt_features_add_feat(feature); pmt_features_add_feat(feature);
@ -546,9 +548,9 @@ static int pmt_features_probe(struct auxiliary_device *auxdev, const struct auxi
priv->dev = device_create(&intel_pmt_class, &auxdev->dev, MKDEV(0, 0), priv, priv->dev = device_create(&intel_pmt_class, &auxdev->dev, MKDEV(0, 0), priv,
"%s-%s", "features", dev_name(priv->parent)); "%s-%s", "features", dev_name(priv->parent));
if (IS_ERR(priv->dev)) if (IS_ERR(priv->dev))
return dev_err_probe(priv->dev, PTR_ERR(priv->dev), return dev_err_probe(&auxdev->dev, PTR_ERR(priv->dev),
"Could not create %s-%s device node\n", "Could not create %s-%s device node\n",
"features", dev_name(priv->dev)); "features", dev_name(priv->parent));
/* Initialize each feature */ /* Initialize each feature */
for (i = 0; i < ivdev->num_resources; i++) { for (i = 0; i < ivdev->num_resources; i++) {

View File

@ -1367,7 +1367,7 @@ static const struct key_entry ideapad_keymap[] = {
/* Performance toggle also Fn+Q, handled inside ideapad_wmi_notify() */ /* Performance toggle also Fn+Q, handled inside ideapad_wmi_notify() */
{ KE_KEY, 0x3d | IDEAPAD_WMI_KEY, { KEY_PROG4 } }, { KE_KEY, 0x3d | IDEAPAD_WMI_KEY, { KEY_PROG4 } },
/* shift + prtsc */ /* shift + prtsc */
{ KE_KEY, 0x2d | IDEAPAD_WMI_KEY, { KEY_CUT } }, { KE_KEY, 0x2d | IDEAPAD_WMI_KEY, { KEY_SELECTIVE_SCREENSHOT } },
{ KE_KEY, 0x29 | IDEAPAD_WMI_KEY, { KEY_TOUCHPAD_TOGGLE } }, { KE_KEY, 0x29 | IDEAPAD_WMI_KEY, { KEY_TOUCHPAD_TOGGLE } },
{ KE_KEY, 0x2a | IDEAPAD_WMI_KEY, { KEY_ROOT_MENU } }, { KE_KEY, 0x2a | IDEAPAD_WMI_KEY, { KEY_ROOT_MENU } },

View File

@ -195,7 +195,7 @@ static const struct tlmi_cert_guids thinkpad_cert_guid = {
}; };
static const struct tlmi_cert_guids thinkcenter_cert_guid = { static const struct tlmi_cert_guids thinkcenter_cert_guid = {
.thumbprint = NULL, .thumbprint = LENOVO_CERT_THUMBPRINT_GUID, /* Same GUID as TP */
.set_bios_setting = LENOVO_TC_SET_BIOS_SETTING_CERT_GUID, .set_bios_setting = LENOVO_TC_SET_BIOS_SETTING_CERT_GUID,
.save_bios_setting = LENOVO_TC_SAVE_BIOS_SETTING_CERT_GUID, .save_bios_setting = LENOVO_TC_SAVE_BIOS_SETTING_CERT_GUID,
.cert_to_password = LENOVO_TC_CERT_TO_PASSWORD_GUID, .cert_to_password = LENOVO_TC_CERT_TO_PASSWORD_GUID,
@ -709,6 +709,10 @@ static ssize_t cert_thumbprint(char *buf, const char *arg, int count)
if (!tlmi_priv.cert_guid->thumbprint) if (!tlmi_priv.cert_guid->thumbprint)
return -EOPNOTSUPP; return -EOPNOTSUPP;
/* Older ThinkCenter BIOS may not have support */
if (!wmi_has_guid(tlmi_priv.cert_guid->thumbprint))
return -EOPNOTSUPP;
status = wmi_evaluate_method(tlmi_priv.cert_guid->thumbprint, 0, 0, &input, &output); status = wmi_evaluate_method(tlmi_priv.cert_guid->thumbprint, 0, 0, &input, &output);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
kfree(output.pointer); kfree(output.pointer);

View File

@ -1130,6 +1130,9 @@ static void __exit msi_cleanup(void)
sysfs_remove_group(&msipf_device->dev.kobj, &msipf_attribute_group); sysfs_remove_group(&msipf_device->dev.kobj, &msipf_attribute_group);
if (!quirks->old_ec_model && threeg_exists) if (!quirks->old_ec_model && threeg_exists)
device_remove_file(&msipf_device->dev, &dev_attr_threeg); device_remove_file(&msipf_device->dev, &dev_attr_threeg);
if (quirks->old_ec_model)
sysfs_remove_group(&msipf_device->dev.kobj,
&msipf_old_attribute_group);
platform_device_unregister(msipf_device); platform_device_unregister(msipf_device);
platform_driver_unregister(&msipf_driver); platform_driver_unregister(&msipf_driver);
backlight_device_unregister(msibl_device); backlight_device_unregister(msibl_device);

View File

@ -442,12 +442,13 @@ static int galaxybook_battery_ext_property_get(struct power_supply *psy,
union power_supply_propval *val) union power_supply_propval *val)
{ {
struct samsung_galaxybook *galaxybook = ext_data; struct samsung_galaxybook *galaxybook = ext_data;
u8 value;
int err; int err;
if (psp != POWER_SUPPLY_PROP_CHARGE_CONTROL_END_THRESHOLD) if (psp != POWER_SUPPLY_PROP_CHARGE_CONTROL_END_THRESHOLD)
return -EINVAL; return -EINVAL;
err = charge_control_end_threshold_acpi_get(galaxybook, (u8 *)&val->intval); err = charge_control_end_threshold_acpi_get(galaxybook, &value);
if (err) if (err)
return err; return err;
@ -455,8 +456,10 @@ static int galaxybook_battery_ext_property_get(struct power_supply *psy,
* device stores "no end threshold" as 0 instead of 100; * device stores "no end threshold" as 0 instead of 100;
* if device has 0, report 100 * if device has 0, report 100
*/ */
if (val->intval == 0) if (value == 0)
val->intval = 100; value = 100;
val->intval = value;
return 0; return 0;
} }

View File

@ -1844,6 +1844,13 @@ static const struct dmi_system_id uniwill_dmi_table[] __initconst = {
DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR5xxY_mLED"), DMI_EXACT_MATCH(DMI_BOARD_NAME, "X6AR5xxY_mLED"),
}, },
}, },
{
.ident = "TUXEDO Book BA15 Gen10 AMD",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"),
DMI_EXACT_MATCH(DMI_BOARD_NAME, "PF5PU1G"),
},
},
{ {
.ident = "TUXEDO Pulse 14 Gen1 AMD", .ident = "TUXEDO Pulse 14 Gen1 AMD",
.matches = { .matches = {

View File

@ -561,7 +561,7 @@ nvgrace_gpu_map_and_read(struct nvgrace_gpu_pci_core_device *nvdev,
ret = vfio_pci_core_do_io_rw(&nvdev->core_device, false, ret = vfio_pci_core_do_io_rw(&nvdev->core_device, false,
nvdev->resmem.ioaddr, nvdev->resmem.ioaddr,
buf, offset, mem_count, buf, offset, mem_count,
0, 0, false); 0, 0, false, VFIO_PCI_IO_WIDTH_8);
} }
return ret; return ret;
@ -693,7 +693,7 @@ nvgrace_gpu_map_and_write(struct nvgrace_gpu_pci_core_device *nvdev,
ret = vfio_pci_core_do_io_rw(&nvdev->core_device, false, ret = vfio_pci_core_do_io_rw(&nvdev->core_device, false,
nvdev->resmem.ioaddr, nvdev->resmem.ioaddr,
(char __user *)buf, pos, mem_count, (char __user *)buf, pos, mem_count,
0, 0, true); 0, 0, true, VFIO_PCI_IO_WIDTH_8);
} }
return ret; return ret;

View File

@ -292,8 +292,11 @@ static int pds_vfio_dirty_enable(struct pds_vfio_pci_device *pds_vfio,
len = num_ranges * sizeof(*region_info); len = num_ranges * sizeof(*region_info);
node = interval_tree_iter_first(ranges, 0, ULONG_MAX); node = interval_tree_iter_first(ranges, 0, ULONG_MAX);
if (!node) if (!node) {
return -EINVAL; err = -EINVAL;
goto out_free_region_info;
}
for (int i = 0; i < num_ranges; i++) { for (int i = 0; i < num_ranges; i++) {
struct pds_lm_dirty_region_info *ri = &region_info[i]; struct pds_lm_dirty_region_info *ri = &region_info[i];
u64 region_size = node->last - node->start + 1; u64 region_size = node->last - node->start + 1;

View File

@ -135,7 +135,8 @@ VFIO_IORDWR(64)
ssize_t vfio_pci_core_do_io_rw(struct vfio_pci_core_device *vdev, bool test_mem, ssize_t vfio_pci_core_do_io_rw(struct vfio_pci_core_device *vdev, bool test_mem,
void __iomem *io, char __user *buf, void __iomem *io, char __user *buf,
loff_t off, size_t count, size_t x_start, loff_t off, size_t count, size_t x_start,
size_t x_end, bool iswrite) size_t x_end, bool iswrite,
enum vfio_pci_io_width max_width)
{ {
ssize_t done = 0; ssize_t done = 0;
int ret; int ret;
@ -150,20 +151,19 @@ ssize_t vfio_pci_core_do_io_rw(struct vfio_pci_core_device *vdev, bool test_mem,
else else
fillable = 0; fillable = 0;
if (fillable >= 8 && !(off % 8)) { if (fillable >= 8 && !(off % 8) && max_width >= 8) {
ret = vfio_pci_iordwr64(vdev, iswrite, test_mem, ret = vfio_pci_iordwr64(vdev, iswrite, test_mem,
io, buf, off, &filled); io, buf, off, &filled);
if (ret) if (ret)
return ret; return ret;
} else } else if (fillable >= 4 && !(off % 4) && max_width >= 4) {
if (fillable >= 4 && !(off % 4)) {
ret = vfio_pci_iordwr32(vdev, iswrite, test_mem, ret = vfio_pci_iordwr32(vdev, iswrite, test_mem,
io, buf, off, &filled); io, buf, off, &filled);
if (ret) if (ret)
return ret; return ret;
} else if (fillable >= 2 && !(off % 2)) { } else if (fillable >= 2 && !(off % 2) && max_width >= 2) {
ret = vfio_pci_iordwr16(vdev, iswrite, test_mem, ret = vfio_pci_iordwr16(vdev, iswrite, test_mem,
io, buf, off, &filled); io, buf, off, &filled);
if (ret) if (ret)
@ -234,6 +234,7 @@ ssize_t vfio_pci_bar_rw(struct vfio_pci_core_device *vdev, char __user *buf,
void __iomem *io; void __iomem *io;
struct resource *res = &vdev->pdev->resource[bar]; struct resource *res = &vdev->pdev->resource[bar];
ssize_t done; ssize_t done;
enum vfio_pci_io_width max_width = VFIO_PCI_IO_WIDTH_8;
if (pci_resource_start(pdev, bar)) if (pci_resource_start(pdev, bar))
end = pci_resource_len(pdev, bar); end = pci_resource_len(pdev, bar);
@ -262,6 +263,16 @@ ssize_t vfio_pci_bar_rw(struct vfio_pci_core_device *vdev, char __user *buf,
if (!io) if (!io)
return -ENOMEM; return -ENOMEM;
x_end = end; x_end = end;
/*
* Certain devices (e.g. Intel X710) don't support qword
* access to the ROM bar. Otherwise PCI AER errors might be
* triggered.
*
* Disable qword access to the ROM bar universally, which
* worked reliably for years before qword access is enabled.
*/
max_width = VFIO_PCI_IO_WIDTH_4;
} else { } else {
int ret = vfio_pci_core_setup_barmap(vdev, bar); int ret = vfio_pci_core_setup_barmap(vdev, bar);
if (ret) { if (ret) {
@ -278,7 +289,7 @@ ssize_t vfio_pci_bar_rw(struct vfio_pci_core_device *vdev, char __user *buf,
} }
done = vfio_pci_core_do_io_rw(vdev, res->flags & IORESOURCE_MEM, io, buf, pos, done = vfio_pci_core_do_io_rw(vdev, res->flags & IORESOURCE_MEM, io, buf, pos,
count, x_start, x_end, iswrite); count, x_start, x_end, iswrite, max_width);
if (done >= 0) if (done >= 0)
*ppos += done; *ppos += done;
@ -352,7 +363,7 @@ ssize_t vfio_pci_vga_rw(struct vfio_pci_core_device *vdev, char __user *buf,
* to the memory enable bit in the command register. * to the memory enable bit in the command register.
*/ */
done = vfio_pci_core_do_io_rw(vdev, false, iomem, buf, off, count, done = vfio_pci_core_do_io_rw(vdev, false, iomem, buf, off, count,
0, 0, iswrite); 0, 0, iswrite, VFIO_PCI_IO_WIDTH_4);
vga_put(vdev->pdev, rsrc); vga_put(vdev->pdev, rsrc);

View File

@ -250,6 +250,7 @@ xe_vfio_pci_alloc_file(struct xe_vfio_pci_core_device *xe_vdev,
struct xe_vfio_pci_migration_file *migf; struct xe_vfio_pci_migration_file *migf;
const struct file_operations *fops; const struct file_operations *fops;
int flags; int flags;
int ret;
migf = kzalloc(sizeof(*migf), GFP_KERNEL_ACCOUNT); migf = kzalloc(sizeof(*migf), GFP_KERNEL_ACCOUNT);
if (!migf) if (!migf)
@ -259,8 +260,9 @@ xe_vfio_pci_alloc_file(struct xe_vfio_pci_core_device *xe_vdev,
flags = type == XE_VFIO_FILE_SAVE ? O_RDONLY : O_WRONLY; flags = type == XE_VFIO_FILE_SAVE ? O_RDONLY : O_WRONLY;
migf->filp = anon_inode_getfile("xe_vfio_mig", fops, migf, flags); migf->filp = anon_inode_getfile("xe_vfio_mig", fops, migf, flags);
if (IS_ERR(migf->filp)) { if (IS_ERR(migf->filp)) {
ret = PTR_ERR(migf->filp);
kfree(migf); kfree(migf);
return ERR_CAST(migf->filp); return ERR_PTR(ret);
} }
mutex_init(&migf->lock); mutex_init(&migf->lock);
@ -504,6 +506,7 @@ static const struct vfio_device_ops xe_vfio_pci_ops = {
.open_device = xe_vfio_pci_open_device, .open_device = xe_vfio_pci_open_device,
.close_device = xe_vfio_pci_close_device, .close_device = xe_vfio_pci_close_device,
.ioctl = vfio_pci_core_ioctl, .ioctl = vfio_pci_core_ioctl,
.get_region_info_caps = vfio_pci_ioctl_get_region_info,
.device_feature = vfio_pci_core_ioctl_feature, .device_feature = vfio_pci_core_ioctl_feature,
.read = vfio_pci_core_read, .read = vfio_pci_core_read,
.write = vfio_pci_core_write, .write = vfio_pci_core_write,

View File

@ -80,13 +80,13 @@ enum intel_vsec_quirks {
/** /**
* struct pmt_callbacks - Callback infrastructure for PMT devices * struct pmt_callbacks - Callback infrastructure for PMT devices
* ->read_telem() when specified, called by client driver to access PMT data (instead * @read_telem: when specified, called by client driver to access PMT
* of direct copy). * data (instead of direct copy).
* @pdev: PCI device reference for the callback's use * * pdev: PCI device reference for the callback's use
* @guid: ID of data to acccss * * guid: ID of data to acccss
* @data: buffer for the data to be copied * * data: buffer for the data to be copied
* @off: offset into the requested buffer * * off: offset into the requested buffer
* @count: size of buffer * * count: size of buffer
*/ */
struct pmt_callbacks { struct pmt_callbacks {
int (*read_telem)(struct pci_dev *pdev, u32 guid, u64 *data, loff_t off, u32 count); int (*read_telem)(struct pci_dev *pdev, u32 guid, u64 *data, loff_t off, u32 count);
@ -120,7 +120,7 @@ struct intel_vsec_platform_info {
}; };
/** /**
* struct intel_sec_device - Auxbus specific device information * struct intel_vsec_device - Auxbus specific device information
* @auxdev: auxbus device struct for auxbus access * @auxdev: auxbus device struct for auxbus access
* @pcidev: pci device associated with the device * @pcidev: pci device associated with the device
* @resource: any resources shared by the parent * @resource: any resources shared by the parent
@ -128,6 +128,7 @@ struct intel_vsec_platform_info {
* @num_resources: number of resources * @num_resources: number of resources
* @id: xarray id * @id: xarray id
* @priv_data: any private data needed * @priv_data: any private data needed
* @priv_data_size: size of private data area
* @quirks: specified quirks * @quirks: specified quirks
* @base_addr: base address of entries (if specified) * @base_addr: base address of entries (if specified)
* @cap_id: the enumerated id of the vsec feature * @cap_id: the enumerated id of the vsec feature

View File

@ -145,6 +145,13 @@ struct vfio_pci_core_device {
struct list_head dmabufs; struct list_head dmabufs;
}; };
enum vfio_pci_io_width {
VFIO_PCI_IO_WIDTH_1 = 1,
VFIO_PCI_IO_WIDTH_2 = 2,
VFIO_PCI_IO_WIDTH_4 = 4,
VFIO_PCI_IO_WIDTH_8 = 8,
};
/* Will be exported for vfio pci drivers usage */ /* Will be exported for vfio pci drivers usage */
int vfio_pci_core_register_dev_region(struct vfio_pci_core_device *vdev, int vfio_pci_core_register_dev_region(struct vfio_pci_core_device *vdev,
unsigned int type, unsigned int subtype, unsigned int type, unsigned int subtype,
@ -188,7 +195,8 @@ pci_ers_result_t vfio_pci_core_aer_err_detected(struct pci_dev *pdev,
ssize_t vfio_pci_core_do_io_rw(struct vfio_pci_core_device *vdev, bool test_mem, ssize_t vfio_pci_core_do_io_rw(struct vfio_pci_core_device *vdev, bool test_mem,
void __iomem *io, char __user *buf, void __iomem *io, char __user *buf,
loff_t off, size_t count, size_t x_start, loff_t off, size_t count, size_t x_start,
size_t x_end, bool iswrite); size_t x_end, bool iswrite,
enum vfio_pci_io_width max_width);
bool __vfio_pci_memory_enabled(struct vfio_pci_core_device *vdev); bool __vfio_pci_memory_enabled(struct vfio_pci_core_device *vdev);
bool vfio_pci_core_range_intersect_range(loff_t buf_start, size_t buf_cnt, bool vfio_pci_core_range_intersect_range(loff_t buf_start, size_t buf_cnt,
loff_t reg_start, size_t reg_cnt, loff_t reg_start, size_t reg_cnt,

View File

@ -88,6 +88,14 @@ typedef struct {
# define __aligned_u64 __u64 __attribute__((aligned(8))) # define __aligned_u64 __u64 __attribute__((aligned(8)))
#endif #endif
#ifndef __aligned_be64
# define __aligned_be64 __be64 __attribute__((aligned(8)))
#endif
#ifndef __aligned_le64
# define __aligned_le64 __le64 __attribute__((aligned(8)))
#endif
struct list_head { struct list_head {
struct list_head *next, *prev; struct list_head *next, *prev;
}; };

View File

@ -2,7 +2,6 @@
#ifndef SELFTESTS_VFIO_LIB_INCLUDE_LIBVFIO_IOVA_ALLOCATOR_H #ifndef SELFTESTS_VFIO_LIB_INCLUDE_LIBVFIO_IOVA_ALLOCATOR_H
#define SELFTESTS_VFIO_LIB_INCLUDE_LIBVFIO_IOVA_ALLOCATOR_H #define SELFTESTS_VFIO_LIB_INCLUDE_LIBVFIO_IOVA_ALLOCATOR_H
#include <uapi/linux/types.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/iommufd.h> #include <linux/iommufd.h>

View File

@ -11,7 +11,6 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <uapi/linux/types.h>
#include <linux/limits.h> #include <linux/limits.h>
#include <linux/mman.h> #include <linux/mman.h>
#include <linux/types.h> #include <linux/types.h>

View File

@ -11,7 +11,6 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <uapi/linux/types.h>
#include <linux/iommufd.h> #include <linux/iommufd.h>
#include <linux/limits.h> #include <linux/limits.h>
#include <linux/mman.h> #include <linux/mman.h>

View File

@ -11,7 +11,6 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <uapi/linux/types.h>
#include <linux/iommufd.h> #include <linux/iommufd.h>
#include <linux/limits.h> #include <linux/limits.h>
#include <linux/mman.h> #include <linux/mman.h>

View File

@ -3,7 +3,6 @@
#include <sys/mman.h> #include <sys/mman.h>
#include <unistd.h> #include <unistd.h>
#include <uapi/linux/types.h>
#include <linux/iommufd.h> #include <linux/iommufd.h>
#include <linux/limits.h> #include <linux/limits.h>
#include <linux/mman.h> #include <linux/mman.h>

View File

@ -1,5 +1,4 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include <uapi/linux/types.h>
#include <linux/limits.h> #include <linux/limits.h>
#include <linux/sizes.h> #include <linux/sizes.h>
#include <linux/vfio.h> #include <linux/vfio.h>