Compare commits

...

7 Commits

Author SHA1 Message Date
Folke Gleumes
f2f95eff68 cherry-pick improved erratum 1386 workaround
The original fix disabled the xsaves feature for zen1/2. The issue has
since been fixed in the cpus microcode and this patch keeps the feature enabled
if the microcode version is recent enough to contain the fix.
The patch had to be altered slightly to apply cleanly on 6.5, but no
changes content-wise.

Signed-off-by: Folke Gleumes <f.gleumes@proxmox.com>
2024-04-17 16:51:43 +02:00
Fabian Grünbichler
045f60b5a3 config: disable CONFIG_N_GSM
rather exotic driver with frequent security issues over the past months, see
- CVE-2023-6546
- https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=67c37756898a
- https://lore.kernel.org/all/DB9PR10MB5881D2170678C169FB42A423E0082@DB9PR10MB5881.EURPRD10.PROD.OUTLOOK.COM/

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
(cherry picked from commit da0caf9dc2)
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-04-17 11:56:34 +02:00
Fabian Grünbichler
64823a3dce fix #5373: cherry-pick USB ethernet naming fix
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
(cherry picked from commit 70198d2b84)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-15 09:37:08 +02:00
Thomas Lamprecht
8ce54f1b60 update ABI file for 6.5.13-5-pve
(generated with debian/scripts/abi-generate)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-05 14:02:41 +02:00
Thomas Lamprecht
1fe41eff57 bump version to 6.5.13-5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-05 13:04:13 +02:00
Stoiko Ivanov
16c080df7a revert 2 changes in thermal driver causing an early kernel Oops.
The second patch, that is reverted (first):
`thermal: trip: Drop lockdep assertion from thermal_zone_trip_id()`
only touches code introduced by the first patch.
The first patch causes the following Oops (reproduced on an old
HP DL380 G8):
```
[    2.960519] ACPI: button: Power Button [PWRF]
[    2.963126] BUG: kernel NULL pointer dereference, address: 000000000000000c
[    2.965667] #PF: supervisor read access in kernel mode
[    2.966954] #PF: error_code(0x0000) - not-present page
[    2.966954] PGD 0 P4D 0
[    2.966954] Oops: 0000 [#1] PREEMPT SMP PTI
[    2.966954] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G          I        6.5.13-4-pve #1
[    2.966954] Hardware name: HP ProLiant DL380p Gen8, BIOS P70 05/24/2019
[    2.966954] RIP: 0010:step_wise_throttle+0x48/0x360
[    2.966954] Code: 04 25 28 00 00 00 48 89 45 d0 31 c0 48 63 c6 48 8d 14 40 48 8b 87 50 03 00 00 4c 8d 24 90 e8 cf d0 ff ff c6 45 bf 00 89 45 b4 <41> 8b 04 24 41 39 85 78 03 00 00 0f 8d a9 02 00 00 0f 1f 44 00 00
[    2.966954] RSP: 0000:ffff9e2b8014bae8 EFLAGS: 00010246
[    2.966954] RAX: 0000000000000002 RBX: 0000000000000001 RCX: 0000000000000000
[    2.966954] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
[    2.966954] RBP: ffff9e2b8014bb40 R08: 0000000000000000 R09: 0000000000000000
[    2.966954] R10: 0000000000000000 R11: 0000000000000000 R12: 000000000000000c
[    2.966954] R13: ffff8c7ac421d000 R14: 0000000000000001 R15: 0000000000000000
[    2.966954] FS:  0000000000000000(0000) GS:ffff8c7def600000(0000) knlGS:0000000000000000
[    2.966954] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    2.966954] CR2: 000000000000000c CR3: 0000000513a34001 CR4: 00000000000606f0
[    2.966954] Call Trace:
[    2.966954]  <TASK>
```

the relevant mainline kernels (6.6.15), corresponding to the
Ubuntu-patchset (which mixes changes from 6.6.15, with ones from
6.1.76) [0] - also boot happily - so I strongly assume that the
changes depend on one of the many commits introduced in linux-upstream
between v6.5.1 and v6.6.1.
As it looks like a refactoring (upon which later changes are based),
and not a bug-fix in itself - simply dropping it seems sensible.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2024-04-05 12:21:20 +02:00
Stoiko Ivanov
803ddb6d55 revert cifs backport to 6.1 added between 6.5.13-1 and 6.5.13-2
copying files within a cifs-share currently result in the following
trace:
```
[  495.388739] BUG: unable to handle page fault for address: fffffffffffffffe
[  495.388744] #PF: supervisor read access in kernel mode
[  495.388746] #PF: error_code(0x0000) - not-present page
[  495.388747] PGD 172c3f067 P4D 172c3f067 PUD 172c41067 PMD 0
[  495.388752] Oops: 0000 [#2] PREEMPT SMP NOPTI
[  495.388754] CPU: 1 PID: 3894 Comm: cp Tainted: G      D            6.5.0-32-generic #32-Ubuntu                                                                                                                                                                                [  495.388756] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 4.2023.08-4 02/15/2024
[  495.388758] RIP: 0010:cifs_flush_folio+0x41/0xf0 [cifs]
...
```

a quick check identified proxmox-kernel-6.5.13-2 as the first affected
version, and `2dc07a11e269bfbe5589e99b60cdbae0118be979` as likely
source of the issue. The commit adapts the changes from
`7b2404a886f8b91250c31855d287e632123e1746` to work with the code in
kernel 6.1.
This is not needed as the relevant changes were made in 6.4 and
are already part of the 6.5 tree -
`66dabbb65d673aef40dd17bf62c042be8f6d4a4b`

reverting the commit fixes copying files within a samba share.

Tested/reproduced with:
* a VM with the kernel as cifs-client
* one very crude samba-share allowing guest-write access on a Debian
  bookworm host
* as well as a share using cifscreds + multiuser (`mount.cifs(8)`)
* mounting the share, copying any file from one directory to another
  on the same share (with `cp` and Thunar and Nautilus).

Reported to Ubuntu upstream at [1].

[0] https://lore.kernel.org/linux-mm/ZZhrpNJ3zxMR8wcU@eldamar.lan/
[1] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2055002

Reported-by: Daniela Häsler <daniela@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2024-04-04 14:58:45 +02:00
9 changed files with 535 additions and 2 deletions

View File

@ -6,7 +6,7 @@ KERNEL_MIN=5
KERNEL_PATCHLEVEL=13
# increment KREL for every published package release!
# rebuild packages with new KREL and run 'make abiupdate'
KREL=4
KREL=5
KERNEL_MAJMIN=$(KERNEL_MAJ).$(KERNEL_MIN)
KERNEL_VER=$(KERNEL_MAJMIN).$(KERNEL_PATCHLEVEL)

View File

@ -10565,6 +10565,7 @@ EXPORT_SYMBOL vmlinux 0xb9af1d0d __xa_clear_mark
EXPORT_SYMBOL vmlinux 0xb9afdc4e pci_free_irq_vectors
EXPORT_SYMBOL vmlinux 0xb9b7faa6 rproc_add
EXPORT_SYMBOL vmlinux 0xb9c6b6e2 tcp_openreq_init_rwin
EXPORT_SYMBOL vmlinux 0xb9cfb89a get_thermal_instance
EXPORT_SYMBOL vmlinux 0xb9db722d agp_copy_info
EXPORT_SYMBOL vmlinux 0xb9e12d4a pci_enable_ptm
EXPORT_SYMBOL vmlinux 0xb9e276cf wrmsr_safe_regs_on_cpu
@ -11234,7 +11235,6 @@ EXPORT_SYMBOL vmlinux 0xd9491c14 xa_destroy
EXPORT_SYMBOL vmlinux 0xd9519a42 genphy_c37_read_status
EXPORT_SYMBOL vmlinux 0xd960d290 eisa_bus_type
EXPORT_SYMBOL vmlinux 0xd971c6c4 xen_arch_register_cpu
EXPORT_SYMBOL vmlinux 0xd97552f7 get_thermal_instance
EXPORT_SYMBOL vmlinux 0xd985dc99 mempool_free_pages
EXPORT_SYMBOL vmlinux 0xd9893bc0 path_has_submounts
EXPORT_SYMBOL vmlinux 0xd99c9f52 pipe_lock

9
debian/changelog vendored
View File

@ -1,3 +1,12 @@
proxmox-kernel-6.5 (6.5.13-5) bookworm; urgency=medium
* revert a backport to avoid breaking copying files within a CIFS mount
* revert a backport for the thermal subsystem that causes early boot failure
for some hardware using the step-wise-throttle governor
-- Proxmox Support Team <support@proxmox.com> Fri, 05 Apr 2024 13:03:12 +0200
proxmox-kernel-6.5 (6.5.13-4) bookworm; urgency=medium
* update sources to Ubuntu-6.5.0-32.32 based on stable-tree backports of up

1
debian/rules vendored
View File

@ -102,6 +102,7 @@ PMX_CONFIG_OPTS= \
-e CONFIG_ARCH_HAS_CPU_FINALIZE_INIT \
-d CONFIG_GDS_FORCE_MITIGATION \
-d CONFIG_WQ_CPU_INTENSIVE_REPORT \
-d CONFIG_N_GSM \
-d UBSAN_BOUNDS \
debian/control: $(wildcard debian/*.in)

View File

@ -0,0 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Stoiko Ivanov <s.ivanov@proxmox.com>
Date: Wed, 3 Apr 2024 10:29:59 +0200
Subject: [PATCH] Revert "cifs: fix flushing folio regression for 6.1 backport"
This reverts commit 2dc07a11e269bfbe5589e99b60cdbae0118be979.
---
fs/smb/client/cifsfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c
index 55a6d0296ec82..82313b2534631 100644
--- a/fs/smb/client/cifsfs.c
+++ b/fs/smb/client/cifsfs.c
@@ -1245,7 +1245,7 @@ static int cifs_flush_folio(struct inode *inode, loff_t pos, loff_t *_fstart, lo
int rc = 0;
folio = filemap_get_folio(inode->i_mapping, index);
- if (!folio)
+ if (IS_ERR(folio))
return 0;
size = folio_size(folio);

View File

@ -0,0 +1,24 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Stoiko Ivanov <s.ivanov@proxmox.com>
Date: Thu, 4 Apr 2024 11:41:15 +0200
Subject: [PATCH] Revert "thermal: trip: Drop lockdep assertion from
thermal_zone_trip_id()"
This reverts commit c723c4fca6d2db3815623ff4dc0ea51667b56b89.
---
drivers/thermal/thermal_trip.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/thermal/thermal_trip.c b/drivers/thermal/thermal_trip.c
index 68bea8706c597..1d4fe63e09f77 100644
--- a/drivers/thermal/thermal_trip.c
+++ b/drivers/thermal/thermal_trip.c
@@ -201,6 +201,8 @@ int thermal_zone_trip_id(struct thermal_zone_device *tz,
{
int i;
+ lockdep_assert_held(&tz->lock);
+
for (i = 0; i < tz->num_trips; i++) {
if (&tz->trips[i] == trip)
return i;

View File

@ -0,0 +1,343 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Stoiko Ivanov <s.ivanov@proxmox.com>
Date: Thu, 4 Apr 2024 11:41:17 +0200
Subject: [PATCH] Revert "thermal: core: Store trip pointer in struct
thermal_instance"
This reverts commit 643b451957369f28b7770af387d14d4e4712074b.
---
drivers/thermal/gov_bang_bang.c | 23 +++++++++++++++--------
drivers/thermal/gov_fair_share.c | 5 ++---
drivers/thermal/gov_power_allocator.c | 11 +++--------
drivers/thermal/gov_step_wise.c | 16 +++++++++-------
drivers/thermal/thermal_core.c | 15 +++++----------
drivers/thermal/thermal_core.h | 4 +---
drivers/thermal/thermal_helpers.c | 5 +----
drivers/thermal/thermal_sysfs.c | 3 +--
drivers/thermal/thermal_trip.c | 15 ---------------
9 files changed, 37 insertions(+), 60 deletions(-)
diff --git a/drivers/thermal/gov_bang_bang.c b/drivers/thermal/gov_bang_bang.c
index 49cdfaa3a9279..1b121066521ff 100644
--- a/drivers/thermal/gov_bang_bang.c
+++ b/drivers/thermal/gov_bang_bang.c
@@ -13,21 +13,28 @@
#include "thermal_core.h"
-static int thermal_zone_trip_update(struct thermal_zone_device *tz, int trip_index)
+static int thermal_zone_trip_update(struct thermal_zone_device *tz, int trip_id)
{
- const struct thermal_trip *trip = &tz->trips[trip_index];
+ struct thermal_trip trip;
struct thermal_instance *instance;
+ int ret;
+
+ ret = __thermal_zone_get_trip(tz, trip_id, &trip);
+ if (ret) {
+ pr_warn_once("Failed to retrieve trip point %d\n", trip_id);
+ return ret;
+ }
- if (!trip->hysteresis)
+ if (!trip.hysteresis)
dev_info_once(&tz->device,
"Zero hysteresis value for thermal zone %s\n", tz->type);
dev_dbg(&tz->device, "Trip%d[temp=%d]:temp=%d:hyst=%d\n",
- trip_index, trip->temperature, tz->temperature,
- trip->hysteresis);
+ trip_id, trip.temperature, tz->temperature,
+ trip.hysteresis);
list_for_each_entry(instance, &tz->thermal_instances, tz_node) {
- if (instance->trip != trip)
+ if (instance->trip != trip_id)
continue;
/* in case fan is in initial state, switch the fan off */
@@ -45,10 +52,10 @@ static int thermal_zone_trip_update(struct thermal_zone_device *tz, int trip_ind
* enable fan when temperature exceeds trip_temp and disable
* the fan in case it falls below trip_temp minus hysteresis
*/
- if (instance->target == 0 && tz->temperature >= trip->temperature)
+ if (instance->target == 0 && tz->temperature >= trip.temperature)
instance->target = 1;
else if (instance->target == 1 &&
- tz->temperature <= trip->temperature - trip->hysteresis)
+ tz->temperature <= trip.temperature - trip.hysteresis)
instance->target = 0;
dev_dbg(&instance->cdev->device, "target=%d\n",
diff --git a/drivers/thermal/gov_fair_share.c b/drivers/thermal/gov_fair_share.c
index 2abeb8979f500..03c2daeb6ee8b 100644
--- a/drivers/thermal/gov_fair_share.c
+++ b/drivers/thermal/gov_fair_share.c
@@ -49,7 +49,7 @@ static long get_target_state(struct thermal_zone_device *tz,
/**
* fair_share_throttle - throttles devices associated with the given zone
* @tz: thermal_zone_device
- * @trip_index: trip point index
+ * @trip: trip point index
*
* Throttling Logic: This uses three parameters to calculate the new
* throttle state of the cooling devices associated with the given zone.
@@ -65,9 +65,8 @@ static long get_target_state(struct thermal_zone_device *tz,
* (Heavily assumes the trip points are in ascending order)
* new_state of cooling device = P3 * P2 * P1
*/
-static int fair_share_throttle(struct thermal_zone_device *tz, int trip_index)
+static int fair_share_throttle(struct thermal_zone_device *tz, int trip)
{
- const struct thermal_trip *trip = &tz->trips[trip_index];
struct thermal_instance *instance;
int total_weight = 0;
int total_instance = 0;
diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c
index fc969642f70b7..fb311339bd08f 100644
--- a/drivers/thermal/gov_power_allocator.c
+++ b/drivers/thermal/gov_power_allocator.c
@@ -90,14 +90,12 @@ static u32 estimate_sustainable_power(struct thermal_zone_device *tz)
u32 sustainable_power = 0;
struct thermal_instance *instance;
struct power_allocator_params *params = tz->governor_data;
- const struct thermal_trip *trip_max_desired_temperature =
- &tz->trips[params->trip_max_desired_temperature];
list_for_each_entry(instance, &tz->thermal_instances, tz_node) {
struct thermal_cooling_device *cdev = instance->cdev;
u32 min_power;
- if (instance->trip != trip_max_desired_temperature)
+ if (instance->trip != params->trip_max_desired_temperature)
continue;
if (!cdev_is_power_actor(cdev))
@@ -385,13 +383,12 @@ static int allocate_power(struct thermal_zone_device *tz,
{
struct thermal_instance *instance;
struct power_allocator_params *params = tz->governor_data;
- const struct thermal_trip *trip_max_desired_temperature =
- &tz->trips[params->trip_max_desired_temperature];
u32 *req_power, *max_power, *granted_power, *extra_actor_power;
u32 *weighted_req_power;
u32 total_req_power, max_allocatable_power, total_weighted_req_power;
u32 total_granted_power, power_range;
int i, num_actors, total_weight, ret = 0;
+ int trip_max_desired_temperature = params->trip_max_desired_temperature;
num_actors = 0;
total_weight = 0;
@@ -567,14 +564,12 @@ static void allow_maximum_power(struct thermal_zone_device *tz, bool update)
{
struct thermal_instance *instance;
struct power_allocator_params *params = tz->governor_data;
- const struct thermal_trip *trip_max_desired_temperature =
- &tz->trips[params->trip_max_desired_temperature];
u32 req_power;
list_for_each_entry(instance, &tz->thermal_instances, tz_node) {
struct thermal_cooling_device *cdev = instance->cdev;
- if ((instance->trip != trip_max_desired_temperature) ||
+ if ((instance->trip != params->trip_max_desired_temperature) ||
(!cdev_is_power_actor(instance->cdev)))
continue;
diff --git a/drivers/thermal/gov_step_wise.c b/drivers/thermal/gov_step_wise.c
index 849dc1ec8d27c..1050fb4d94c2d 100644
--- a/drivers/thermal/gov_step_wise.c
+++ b/drivers/thermal/gov_step_wise.c
@@ -81,24 +81,26 @@ static void update_passive_instance(struct thermal_zone_device *tz,
static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip_id)
{
- const struct thermal_trip *trip = &tz->trips[trip_id];
enum thermal_trend trend;
struct thermal_instance *instance;
+ struct thermal_trip trip;
bool throttle = false;
int old_target;
+ __thermal_zone_get_trip(tz, trip_id, &trip);
+
trend = get_tz_trend(tz, trip_id);
- if (tz->temperature >= trip->temperature) {
+ if (tz->temperature >= trip.temperature) {
throttle = true;
- trace_thermal_zone_trip(tz, trip_id, trip->type);
+ trace_thermal_zone_trip(tz, trip_id, trip.type);
}
dev_dbg(&tz->device, "Trip%d[type=%d,temp=%d]:trend=%d,throttle=%d\n",
- trip_id, trip->type, trip->temperature, trend, throttle);
+ trip_id, trip.type, trip.temperature, trend, throttle);
list_for_each_entry(instance, &tz->thermal_instances, tz_node) {
- if (instance->trip != trip)
+ if (instance->trip != trip_id)
continue;
old_target = instance->target;
@@ -112,11 +114,11 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip_id
/* Activate a passive thermal instance */
if (old_target == THERMAL_NO_TARGET &&
instance->target != THERMAL_NO_TARGET)
- update_passive_instance(tz, trip->type, 1);
+ update_passive_instance(tz, trip.type, 1);
/* Deactivate a passive thermal instance */
else if (old_target != THERMAL_NO_TARGET &&
instance->target == THERMAL_NO_TARGET)
- update_passive_instance(tz, trip->type, -1);
+ update_passive_instance(tz, trip.type, -1);
instance->initialized = true;
mutex_lock(&instance->cdev->lock);
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index c066c09555667..69cff5fc32156 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -582,7 +582,7 @@ struct thermal_zone_device *thermal_zone_get_by_id(int id)
/**
* thermal_zone_bind_cooling_device() - bind a cooling device to a thermal zone
* @tz: pointer to struct thermal_zone_device
- * @trip_index: indicates which trip point the cooling devices is
+ * @trip: indicates which trip point the cooling devices is
* associated with in this thermal zone.
* @cdev: pointer to struct thermal_cooling_device
* @upper: the Maximum cooling state for this trip point.
@@ -602,7 +602,7 @@ struct thermal_zone_device *thermal_zone_get_by_id(int id)
* Return: 0 on success, the proper error value otherwise.
*/
int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
- int trip_index,
+ int trip,
struct thermal_cooling_device *cdev,
unsigned long upper, unsigned long lower,
unsigned int weight)
@@ -611,15 +611,12 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
struct thermal_instance *pos;
struct thermal_zone_device *pos1;
struct thermal_cooling_device *pos2;
- const struct thermal_trip *trip;
bool upper_no_limit;
int result;
- if (trip_index >= tz->num_trips || trip_index < 0)
+ if (trip >= tz->num_trips || trip < 0)
return -EINVAL;
- trip = &tz->trips[trip_index];
-
list_for_each_entry(pos1, &thermal_tz_list, node) {
if (pos1 == tz)
break;
@@ -724,7 +721,7 @@ EXPORT_SYMBOL_GPL(thermal_zone_bind_cooling_device);
* thermal_zone_unbind_cooling_device() - unbind a cooling device from a
* thermal zone.
* @tz: pointer to a struct thermal_zone_device.
- * @trip_index: indicates which trip point the cooling devices is
+ * @trip: indicates which trip point the cooling devices is
* associated with in this thermal zone.
* @cdev: pointer to a struct thermal_cooling_device.
*
@@ -735,15 +732,13 @@ EXPORT_SYMBOL_GPL(thermal_zone_bind_cooling_device);
* Return: 0 on success, the proper error value otherwise.
*/
int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz,
- int trip_index,
+ int trip,
struct thermal_cooling_device *cdev)
{
struct thermal_instance *pos, *next;
- const struct thermal_trip *trip;
mutex_lock(&tz->lock);
mutex_lock(&cdev->lock);
- trip = &tz->trips[trip_index];
list_for_each_entry_safe(pos, next, &tz->thermal_instances, tz_node) {
if (pos->tz == tz && pos->trip == trip && pos->cdev == cdev) {
list_del(&pos->tz_node);
diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
index a33b389bbcfe8..17c1bbed734d3 100644
--- a/drivers/thermal/thermal_core.h
+++ b/drivers/thermal/thermal_core.h
@@ -91,7 +91,7 @@ struct thermal_instance {
char name[THERMAL_NAME_LENGTH];
struct thermal_zone_device *tz;
struct thermal_cooling_device *cdev;
- const struct thermal_trip *trip;
+ int trip;
bool initialized;
unsigned long upper; /* Highest cooling state for this trip point */
unsigned long lower; /* Lowest cooling state for this trip point */
@@ -123,8 +123,6 @@ void __thermal_zone_device_update(struct thermal_zone_device *tz,
void __thermal_zone_set_trips(struct thermal_zone_device *tz);
int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
struct thermal_trip *trip);
-int thermal_zone_trip_id(struct thermal_zone_device *tz,
- const struct thermal_trip *trip);
int __thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);
/* sysfs I/F */
diff --git a/drivers/thermal/thermal_helpers.c b/drivers/thermal/thermal_helpers.c
index 421ed301541e1..cfba0965a22da 100644
--- a/drivers/thermal/thermal_helpers.c
+++ b/drivers/thermal/thermal_helpers.c
@@ -41,17 +41,14 @@ int get_tz_trend(struct thermal_zone_device *tz, int trip)
struct thermal_instance *
get_thermal_instance(struct thermal_zone_device *tz,
- struct thermal_cooling_device *cdev, int trip_index)
+ struct thermal_cooling_device *cdev, int trip)
{
struct thermal_instance *pos = NULL;
struct thermal_instance *target_instance = NULL;
- const struct thermal_trip *trip;
mutex_lock(&tz->lock);
mutex_lock(&cdev->lock);
- trip = &tz->trips[trip_index];
-
list_for_each_entry(pos, &tz->thermal_instances, tz_node) {
if (pos->tz == tz && pos->trip == trip && pos->cdev == cdev) {
target_instance = pos;
diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index eef40d4f30639..4e6a97db894e9 100644
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -943,8 +943,7 @@ trip_point_show(struct device *dev, struct device_attribute *attr, char *buf)
instance =
container_of(attr, struct thermal_instance, attr);
- return sprintf(buf, "%d\n",
- thermal_zone_trip_id(instance->tz, instance->trip));
+ return sprintf(buf, "%d\n", instance->trip);
}
ssize_t
diff --git a/drivers/thermal/thermal_trip.c b/drivers/thermal/thermal_trip.c
index 1d4fe63e09f77..21736e02fa360 100644
--- a/drivers/thermal/thermal_trip.c
+++ b/drivers/thermal/thermal_trip.c
@@ -195,18 +195,3 @@ int thermal_zone_set_trip(struct thermal_zone_device *tz, int trip_id,
return 0;
}
-
-int thermal_zone_trip_id(struct thermal_zone_device *tz,
- const struct thermal_trip *trip)
-{
- int i;
-
- lockdep_assert_held(&tz->lock);
-
- for (i = 0; i < tz->num_trips; i++) {
- if (&tz->trips[i] == trip)
- return i;
- }
-
- return -ENODATA;
-}

View File

@ -0,0 +1,50 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
Date: Wed, 3 Apr 2024 15:21:58 +0200
Subject: [PATCH] net: usb: ax88179_178a: avoid the interface always configured
as random address
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
After the commit d2689b6a86b9 ("net: usb: ax88179_178a: avoid two
consecutive device resets"), reset is not executed from bind operation and
mac address is not read from the device registers or the devicetree at that
moment. Since the check to configure if the assigned mac address is random
or not for the interface, happens after the bind operation from
usbnet_probe, the interface keeps configured as random address, although the
address is correctly read and set during open operation (the only reset
now).
In order to keep only one reset for the device and to avoid the interface
always configured as random address, after reset, configure correctly the
suitable field from the driver, if the mac address is read successfully from
the device registers or the devicetree. Take into account if a locally
administered address (random) was previously stored.
cc: stable@vger.kernel.org # 6.6+
Fixes: d2689b6a86b9 ("net: usb: ax88179_178a: avoid two consecutive device resets")
Reported-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240403132158.344838-1-jtornosm@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 2e91bb99b9d4f756e92e83c4453f894dda220f09)
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
drivers/net/usb/ax88179_178a.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
index d837c1887416..e0e9b4c53cb0 100644
--- a/drivers/net/usb/ax88179_178a.c
+++ b/drivers/net/usb/ax88179_178a.c
@@ -1273,6 +1273,8 @@ static void ax88179_get_mac_addr(struct usbnet *dev)
if (is_valid_ether_addr(mac)) {
eth_hw_addr_set(dev->net, mac);
+ if (!is_local_ether_addr(mac))
+ dev->net->addr_assign_type = NET_ADDR_PERM;
} else {
netdev_info(dev->net, "invalid MAC address, using random\n");
eth_hw_addr_random(dev->net);

View File

@ -0,0 +1,83 @@
From fe4261ef5f99878f60290709d10d44bba326f95f Mon Sep 17 00:00:00 2001
From: "Borislav Petkov (AMD)" <bp@alien8.de>
Date: Sun, 24 Mar 2024 20:51:35 +0100
Subject: [PATCH] x86/CPU/AMD: Improve the erratum 1386 workaround
Disable XSAVES only on machines which haven't loaded the microcode
revision containing the erratum fix.
This will come in handy when running archaic OSes as guests. OSes whose
brilliant programmers thought that CPUID is overrated and one should not
query it but use features directly, ala shoot first, ask questions
later... but only if you're alive after the shooting.
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
[ FG: port to 6.5 ]
Signed-off-by: Folke Gleumes <f.gleumes@proxmox.com>
Tested-by: "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Link: https://lore.kernel.org/r/20240324200525.GBZgCHhYFsBj12PrKv@fat_crate.local
---
arch/x86/include/asm/cpu_device_id.h | 8 ++++++++
arch/x86/kernel/cpu/amd.c | 11 +++++++++++
2 files changed, 19 insertions(+)
diff --git a/arch/x86/include/asm/cpu_device_id.h b/arch/x86/include/asm/cpu_device_id.h
index eb8fcede9e3b..bf4e065cf1e2 100644
--- a/arch/x86/include/asm/cpu_device_id.h
+++ b/arch/x86/include/asm/cpu_device_id.h
@@ -190,6 +190,14 @@ struct x86_cpu_desc {
.x86_microcode_rev = (revision), \
}
+#define AMD_CPU_DESC(fam, model, stepping, revision) { \
+ .x86_family = (fam), \
+ .x86_vendor = X86_VENDOR_AMD, \
+ .x86_model = (model), \
+ .x86_stepping = (stepping), \
+ .x86_microcode_rev = (revision), \
+}
+
extern const struct x86_cpu_id *x86_match_cpu(const struct x86_cpu_id *match);
extern bool x86_cpu_has_min_microcode_rev(const struct x86_cpu_desc *table);
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 9390074ddb25..8201271f6505 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -13,6 +13,7 @@
#include <asm/apic.h>
#include <asm/cacheinfo.h>
#include <asm/cpu.h>
+#include <asm/cpu_device_id.h>
#include <asm/spec-ctrl.h>
#include <asm/smp.h>
#include <asm/numa.h>
@@ -945,6 +946,11 @@ static void init_amd_bd(struct cpuinfo_x86 *c)
clear_rdrand_cpuid_bit(c);
}
+static const struct x86_cpu_desc erratum_1386_microcode[] = {
+ AMD_CPU_DESC(0x17, 0x1, 0x2, 0x0800126e),
+ AMD_CPU_DESC(0x17, 0x31, 0x0, 0x08301052),
+};
+
void init_spectral_chicken(struct cpuinfo_x86 *c)
{
#ifdef CONFIG_CPU_UNRET_ENTRY
@@ -972,7 +978,12 @@ void init_spectral_chicken(struct cpuinfo_x86 *c)
*
* Affected parts all have no supervisor XSAVE states, meaning that
* the XSAVEC instruction (which works fine) is equivalent.
+ * Clear the feature flag only on microcode revisions which
+ * don't have the fix.
*/
+ if (x86_cpu_has_min_microcode_rev(erratum_1386_microcode))
+ return;
+
clear_cpu_cap(c, X86_FEATURE_XSAVES);
}
--
2.39.2