6.12.18-rc1 review
Subsystems (3)
Greg Kroah-Hartman
maintainerPATCH 136/150 riscv/futex: sign extend compare value in atomic cmpxchg
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andreas Schwab <[email protected]>
commit 599c44cd21f4967774e0acf58f734009be4aea9a upstream.
Make sure the compare value in the lr/sc loop is sign extended to match what lr.w does. Fortunately, due to the compiler keeping the register contents sign extended anyway the lack of the explicit extension didn't result in wrong code so far, but this cannot be relied upon.
--- arch/riscv/include/asm/futex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/include/asm/futex.h +1 -1
@@ -93,7 +93,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, _ASM_EXTABLE_UACCESS_ERR(1b, 3b, %[r]) \ _ASM_EXTABLE_UACCESS_ERR(2b, 3b, %[r]) \ : [r] "+r" (ret), [v] "=&r" (val), [u] "+m" (*uaddr), [t] "=&r" (tmp) - : [ov] "Jr" (oldval), [nv] "Jr" (newval) + : [ov] "Jr" ((long)(int)oldval), [nv] "Jr" (newval) : "memory"); __disable_user_access();
Greg Kroah-Hartman
maintainerPATCH 137/150 riscv: signal: fix signal frame size
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yong-Xuan Wang <[email protected]>
commit aa49bc2ca8524186ceb0811c23a7f00c3dea6987 upstream.
The signal context of certain RISC-V extensions will be appended after struct __riscv_extra_ext_header, which already includes an empty context header. Therefore, there is no need to preserve a separate hdr for the END of signal context.
--- arch/riscv/kernel/signal.c | 6 ------ 1 file changed, 6 deletions(-)
arch/riscv/kernel/signal.c +0 -6
@@ -215,12 +215,6 @@ static size_t get_rt_frame_size(bool calif (cal_all ||riscv_v_vstate_query (task_pt_regs (current))) total_context_size += riscv_v_sc_size; } -/* -* Preserved a __riscv_ctx_hdr for END signal context header if an -* extension uses __riscv_extra_ext_header -*/ -if (total_context_size) - total_context_size +=sizeof (struct __riscv_ctx_hdr ); frame_size += total_context_size;
Greg Kroah-Hartman
maintainerPATCH 138/150 riscv: cacheinfo: Use of_property_present() for non-boolean properties
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rob Herring <[email protected]>
commit fb8179ce2996bffaa36a04e2b6262843b01b7565 upstream.
The use of of_property_read_bool() for non-boolean properties is deprecated in favor of of_property_present() when testing for property presence.
--- arch/riscv/kernel/cacheinfo.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/riscv/kernel/cacheinfo.c +6 -6
@@ -108,11 +108,11 @@ int populate_cache_leaves(unsigned int cif (!np)return -ENOENT ; -if (of_property_read_bool (np,"cache-size" )) +if (of_property_present (np,"cache-size" ))ci_leaf_init (this_leaf++,CACHE_TYPE_UNIFIED , level); -if (of_property_read_bool (np,"i-cache-size" )) +if (of_property_present (np,"i-cache-size" ))ci_leaf_init (this_leaf++,CACHE_TYPE_INST , level); -if (of_property_read_bool (np,"d-cache-size" )) +if (of_property_present (np,"d-cache-size" ))ci_leaf_init (this_leaf++,CACHE_TYPE_DATA , level); prev = np;
@@ -125,11 +125,11 @@ int populate_cache_leaves(unsigned int cbreak ;if (level <= levels)break ; -if (of_property_read_bool (np,"cache-size" )) +if (of_property_present (np,"cache-size" ))ci_leaf_init (this_leaf++,CACHE_TYPE_UNIFIED , level); -if (of_property_read_bool (np,"i-cache-size" )) +if (of_property_present (np,"i-cache-size" ))ci_leaf_init (this_leaf++,CACHE_TYPE_INST , level); -if (of_property_read_bool (np,"d-cache-size" )) +if (of_property_present (np,"d-cache-size" ))ci_leaf_init (this_leaf++,CACHE_TYPE_DATA , level); levels = level; }
Greg Kroah-Hartman
maintainerPATCH 139/150 riscv: signal: fix signal_minsigstksz
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yong-Xuan Wang <[email protected]>
commit 564fc8eb6f78e01292ff10801f318feae6153fdd upstream.
The init_rt_signal_env() funciton is called before the alternative patch is applied, so using the alternative-related API to check the availability of an extension within this function doesn't have the intended effect. This patch reorders the init_rt_signal_env() and apply_boot_alternatives() to get the correct signal_minsigstksz.
--- arch/riscv/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/setup.c +1 -1
@@ -288,8 +288,8 @@ void __init setup_arch(char **cmdline_p)riscv_init_cbo_blocksizes ();riscv_fill_hwcap (); -init_rt_signal_env ();apply_boot_alternatives (); +init_rt_signal_env ();if (IS_ENABLED (CONFIG_RISCV_ISA_ZICBOM ) &&riscv_isa_extension_available (NULL ,ZICBOM ))
Greg Kroah-Hartman
maintainerPATCH 113/150 net: enetc: VFs do not support HWTSTAMP_TX_ONESTEP_SYNC
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Fang <[email protected]>
commit a562d0c4a893eae3ea51d512c4d90ab858a6b7ec upstream.
Actually ENETC VFs do not support HWTSTAMP_TX_ONESTEP_SYNC because only ENETC PF can access PMa_SINGLE_STEP registers. And there will be a crash if VFs are used to test one-step timestamp, the crash log as follows.
[ 129.110909] Unable to handle kernel paging request at virtual address 00000000000080c0 [ 129.287769] Call trace: [ 129.290219] enetc_port_mac_wr+0x30/0xec (P) [ 129.294504] enetc_start_xmit+0xda4/0xe74 [ 129.298525] enetc_xmit+0x70/0xec [ 129.301848] dev_hard_start_xmit+0x98/0x118
--- drivers/net/ethernet/freescale/enetc/enetc.c | 3 +++ drivers/net/ethernet/freescale/enetc/enetc_ethtool.c | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc.c +3 -0
@@ -2945,6 +2945,9 @@ static int enetc_hwtstamp_set(struct net new_offloads |=ENETC_F_TX_TSTAMP ;break ;case HWTSTAMP_TX_ONESTEP_SYNC : +if (!enetc_si_is_pf (priv->si)) +return -EOPNOTSUPP ; + new_offloads &= ~ENETC_F_TX_TSTAMP_MASK ; new_offloads |=ENETC_F_TX_ONESTEP_SYNC_TSTAMP ;break ;
drivers/net/ethernet/freescale/enetc/enetc_ethtool.c +5 -2
@@ -843,6 +843,7 @@ static int enetc_set_coalesce(struct netstatic int enetc_get_ts_info (struct net_device *ndev,struct kernel_ethtool_ts_info *info) { +struct enetc_ndev_priv *priv =netdev_priv (ndev);int *phc_idx; phc_idx =symbol_get (enetc_phc_index);
@@ -863,8 +864,10 @@ static int enetc_get_ts_info(struct net_SOF_TIMESTAMPING_TX_SOFTWARE ; info->tx_types = (1 <<HWTSTAMP_TX_OFF ) | - (1 <<HWTSTAMP_TX_ON ) | - (1 <<HWTSTAMP_TX_ONESTEP_SYNC ); + (1 <<HWTSTAMP_TX_ON ); + +if (enetc_si_is_pf (priv->si)) + info->tx_types |= (1 <<HWTSTAMP_TX_ONESTEP_SYNC ); info->rx_filters = (1 <<HWTSTAMP_FILTER_NONE ) | (1 <<HWTSTAMP_FILTER_ALL );
Greg Kroah-Hartman
maintainerPATCH 140/150 riscv: cpufeature: use bitmap_equal() instead of memcmp()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Clément Léger <[email protected]>
commit c6ec1e1b078d8e2ecd075e46db6197a14930a3fc upstream.
Comparison of bitmaps should be done using bitmap_equal(), not memcmp(), use the former one to compare isa bitmaps.
--- arch/riscv/kernel/cpufeature.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/cpufeature.c +1 -1
@@ -454,7 +454,7 @@ static void __init riscv_resolve_isa(unsif (bit <RISCV_ISA_EXT_BASE ) *this_hwcap |= isa2hwcap[bit]; } - }while (loop &&memcmp (prev_resolved_isa, resolved_isa,sizeof (prev_resolved_isa))); + }while (loop && !bitmap_equal (prev_resolved_isa, resolved_isa,RISCV_ISA_EXT_MAX )); }static void __init match_isa_ext (const char *name,const char *name_end,unsigned long *bitmap)
Greg Kroah-Hartman
maintainerPATCH 141/150 efi: Dont map the entire mokvar table to determine its size
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Jones <[email protected]>
commit 2b90e7ace79774a3540ce569e000388f8d22c9e0 upstream.
Currently, when validating the mokvar table, we (re)map the entire table on each iteration of the loop, adding space as we discover new entries. If the table grows over a certain size, this fails due to limitations of early_memmap(), and we get a failure and traceback:
------------[ cut here ]------------ WARNING: CPU: 0 PID: 0 at mm/early_ioremap.c:139 __early_ioremap+0xef/0x220 ... Call Trace: <TASK> ? __early_ioremap+0xef/0x220 ? __warn.cold+0x93/0xfa ? __early_ioremap+0xef/0x220 ? report_bug+0xff/0x140 ? early_fixup_exception+0x5d/0xb0 ? early_idt_handler_common+0x2f/0x3a ? __early_ioremap+0xef/0x220 ? efi_mokvar_table_init+0xce/0x1d0 ? setup_arch+0x864/0xc10 ? start_kernel+0x6b/0xa10 ? x86_64_start_reservations+0x24/0x30 ? x86_64_start_kernel+0xed/0xf0 ? common_startup_64+0x13e/0x141 </TASK> ---[ end trace 0000000000000000 ]--- mokvar: Failed to map EFI MOKvar config table pa=0x7c4c3000, size=265187.
Mapping the entire structure isn't actually necessary, as we don't ever need more than one entry header mapped at once.
Changes efi_mokvar_table_init() to only map each entry header, not the entire table, when determining the table size. Since we're not mapping any data past the variable name, it also changes the code to enforce that each variable name is NUL terminated, rather than attempting to verify it in place.
--- drivers/firmware/efi/mokvar-table.c | 42 +++++++++++------------------------- 1 file changed, 13 insertions(+), 29 deletions(-)
drivers/firmware/efi/mokvar-table.c +13 -29
@@ -103,9 +103,7 @@ void __init efi_mokvar_table_init(void)void *va =NULL ;unsigned long cur_offset =0 ;unsigned long offset_limit; -unsigned long map_size =0 ;unsigned long map_size_needed =0 ; -unsigned long size;struct efi_mokvar_table_entry *mokvar_entry;int err;
@@ -134,48 +132,34 @@ void __init efi_mokvar_table_init(void)*/ err = -EINVAL ;while (cur_offset +sizeof (*mokvar_entry) <= offset_limit) { - mokvar_entry = va + cur_offset; - map_size_needed = cur_offset +sizeof (*mokvar_entry); -if (map_size_needed > map_size) { -if (va) -early_memunmap (va, map_size); -/* -* Map a little more than the fixed size entry -* header, anticipating some data. It's safe to -* do so as long as we stay within current memory -* descriptor. -*/ - map_size =min (map_size_needed +2 *EFI_PAGE_SIZE , - offset_limit); - va =early_memremap (efi.mokvar_table, map_size); -if (!va) { -pr_err ("Failed to map EFI MOKvar config table pa=0x%lx, size=%lu.\n" , - efi.mokvar_table, map_size); -return ; - } - mokvar_entry = va + cur_offset; +if (va) +early_memunmap (va,sizeof (*mokvar_entry)); + va =early_memremap (efi.mokvar_table + cur_offset,sizeof (*mokvar_entry)); +if (!va) { +pr_err ("Failed to map EFI MOKvar config table pa=0x%lx, size=%zu.\n" , + efi.mokvar_table + cur_offset,sizeof (*mokvar_entry)); +return ; } + mokvar_entry = va;/* Check for last sentinel entry */ if (mokvar_entry->name[0 ] =='\0' ) {if (mokvar_entry->data_size !=0 )break ; err =0 ; + map_size_needed = cur_offset +sizeof (*mokvar_entry);break ; } -/* Sanity check that the name is null terminated */ - size =strnlen (mokvar_entry->name, -sizeof (mokvar_entry->name)); -if (size >=sizeof (mokvar_entry->name)) -break ; +/* Enforce that the name is NUL terminated */ + mokvar_entry->name[sizeof (mokvar_entry->name) -1 ] ='\0' ;/* Advance to the next entry */ - cur_offset = map_size_needed + mokvar_entry->data_size; + cur_offset +=sizeof (*mokvar_entry) + mokvar_entry->data_size; }if (va) -early_memunmap (va, map_size); +early_memunmap (va,sizeof (*mokvar_entry));if (err) {pr_err ("EFI MOKvar config table is not valid\n" );return ;
Greg Kroah-Hartman
maintainerPATCH 142/150 amdgpu/pm/legacy: fix suspend/resume issues
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: chr[] <[email protected]>
commit 91dcc66b34beb72dde8412421bdc1b4cd40e4fb8 upstream.
resume and irq handler happily races in set_power_state()
* amdgpu_legacy_dpm_compute_clocks() needs lock
* protect irq work handler
* fix dpm_enabled usage
v2: fix clang build, integrate Lijo's comments (Alex)
--- drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c | 25 ++++++++++++++++++------ drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c | 8 +++++-- drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 26 +++++++++++++++++++------ 3 files changed, 45 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c +19 -6
@@ -3043,6 +3043,7 @@ static int kv_dpm_hw_init(void *handle)if (!amdgpu_dpm)return 0 ; +mutex_lock (&adev->pm.mutex);kv_dpm_setup_asic (adev); ret =kv_dpm_enable (adev);if (ret)
@@ -3050,6 +3051,8 @@ static int kv_dpm_hw_init(void *handle)else adev->pm.dpm_enabled = true;amdgpu_legacy_dpm_compute_clocks (adev); +mutex_unlock (&adev->pm.mutex); +return ret; }
@@ -3067,32 +3070,42 @@ static int kv_dpm_suspend(void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; +cancel_work_sync (&adev->pm.dpm.thermal.work); +if (adev->pm.dpm_enabled) { +mutex_lock (&adev->pm.mutex); + adev->pm.dpm_enabled = false;/* disable dpm */ kv_dpm_disable (adev);/* reset the power state */ adev->pm.dpm.current_ps = adev->pm.dpm.requested_ps = adev->pm.dpm.boot_ps; +mutex_unlock (&adev->pm.mutex); }return 0 ; }static int kv_dpm_resume (void *handle) { -int ret; +int ret =0 ;struct amdgpu_device *adev = (struct amdgpu_device *)handle; -if (adev->pm.dpm_enabled) { +if (!amdgpu_dpm) +return 0 ; + +if (!adev->pm.dpm_enabled) { +mutex_lock (&adev->pm.mutex);/* asic init will reset to the boot state */ kv_dpm_setup_asic (adev); ret =kv_dpm_enable (adev); -if (ret) +if (ret) { adev->pm.dpm_enabled = false; -else + }else { adev->pm.dpm_enabled = true; -if (adev->pm.dpm_enabled)amdgpu_legacy_dpm_compute_clocks (adev); + } +mutex_unlock (&adev->pm.mutex); } -return 0 ; +return ret; }static bool kv_dpm_is_idle (void *handle)
drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c +6 -2
@@ -1009,9 +1009,12 @@ void amdgpu_dpm_thermal_work_handler(strenum amd_pm_state_type dpm_state =POWER_STATE_TYPE_INTERNAL_THERMAL ;int temp, size =sizeof (temp); -if (!adev->pm.dpm_enabled) -return ; +mutex_lock (&adev->pm.mutex); +if (!adev->pm.dpm_enabled) { +mutex_unlock (&adev->pm.mutex); +return ; + } if (!pp_funcs->read_sensor(adev->powerplay.pp_handle, AMDGPU_PP_SENSOR_GPU_TEMP, (void *)&temp,
@@ -1033,4 +1036,5 @@ void amdgpu_dpm_thermal_work_handler(str adev->pm.dpm.state = dpm_state;amdgpu_legacy_dpm_compute_clocks (adev->powerplay.pp_handle); +mutex_unlock (&adev->pm.mutex); }
drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c +20 -6
@@ -7783,6 +7783,7 @@ static int si_dpm_hw_init(void *handle)if (!amdgpu_dpm)return 0 ; +mutex_lock (&adev->pm.mutex);si_dpm_setup_asic (adev); ret =si_dpm_enable (adev);if (ret)
@@ -7790,6 +7791,7 @@ static int si_dpm_hw_init(void *handle)else adev->pm.dpm_enabled = true;amdgpu_legacy_dpm_compute_clocks (adev); +mutex_unlock (&adev->pm.mutex);return ret; }
@@ -7807,32 +7809,44 @@ static int si_dpm_suspend(void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; +cancel_work_sync (&adev->pm.dpm.thermal.work); +if (adev->pm.dpm_enabled) { +mutex_lock (&adev->pm.mutex); + adev->pm.dpm_enabled = false;/* disable dpm */ si_dpm_disable (adev);/* reset the power state */ adev->pm.dpm.current_ps = adev->pm.dpm.requested_ps = adev->pm.dpm.boot_ps; +mutex_unlock (&adev->pm.mutex); } +return 0 ; }static int si_dpm_resume (void *handle) { -int ret; +int ret =0 ;struct amdgpu_device *adev = (struct amdgpu_device *)handle; -if (adev->pm.dpm_enabled) { +if (!amdgpu_dpm) +return 0 ; + +if (!adev->pm.dpm_enabled) {/* asic init will reset to the boot state */ +mutex_lock (&adev->pm.mutex);si_dpm_setup_asic (adev); ret =si_dpm_enable (adev); -if (ret) +if (ret) { adev->pm.dpm_enabled = false; -else + }else { adev->pm.dpm_enabled = true; -if (adev->pm.dpm_enabled)amdgpu_legacy_dpm_compute_clocks (adev); + } +mutex_unlock (&adev->pm.mutex); } -return 0 ; + +return ret; }static bool si_dpm_is_idle (void *handle)
Greg Kroah-Hartman
maintainerPATCH 143/150 x86/microcode/AMD: Return bool from find_blobs_in_containers()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikolay Borisov <[email protected]>
commit a85c08aaa665b5436d325f6d7138732a0e1315ce upstream.
Instead of open-coding the check for size/data move it inside the function and make it return a boolean indicating whether data was found or not.
No functional changes.
[ bp: Write @ret in find_blobs_in_containers() only on success. ]
--- arch/x86/kernel/cpu/microcode/amd.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
arch/x86/kernel/cpu/microcode/amd.c +9 -6
@@ -569,14 +569,19 @@ static bool get_builtin_microcode(structreturn false; } -static void __init find_blobs_in_containers (struct cpio_data *ret) +static bool __init find_blobs_in_containers (struct cpio_data *ret) {struct cpio_data cp; +bool found;if (!get_builtin_microcode (&cp)) cp =find_microcode_in_initrd (ucode_path); - *ret = cp; + found = cp.data && cp.size; +if (found) + *ret = cp; + +return found; }void __init load_ucode_amd_bsp (struct early_load_data *ed,unsigned int cpuid_1_eax)
@@ -591,8 +596,7 @@ void __init load_ucode_amd_bsp(struct ea/* Needed in load_microcode_amd() */ ucode_cpu_info[0 ].cpu_sig.sig = cpuid_1_eax; -find_blobs_in_containers (&cp); -if (!(cp.data && cp.size)) +if (!find_blobs_in_containers (&cp))return ;if (early_apply_microcode (ed->old_rev, cp.data, cp.size))
@@ -612,8 +616,7 @@ static int __init save_microcode_in_initif (dis_ucode_ldr || c->x86_vendor !=X86_VENDOR_AMD || c->x86 <0x10 )return 0 ; -find_blobs_in_containers (&cp); -if (!(cp.data && cp.size)) +if (!find_blobs_in_containers (&cp))return -EINVAL ;scan_containers (cp.data, cp.size, &desc);
Greg Kroah-Hartman
maintainerPATCH 114/150 net: enetc: update UDP checksum when updating originTimestamp field
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Fang <[email protected]>
commit bbcbc906ab7b5834c1219cd17a38d78dba904aa0 upstream.
There is an issue with one-step timestamp based on UDP/IP. The peer will discard the sync packet because of the wrong UDP checksum. For ENETC v1, the software needs to update the UDP checksum when updating the originTimestamp field, so that the hardware can correctly update the UDP checksum when updating the correction field. Otherwise, the UDP checksum in the sync packet will be wrong.
--- drivers/net/ethernet/freescale/enetc/enetc.c | 41 ++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 7 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc.c +34 -7
@@ -253,9 +253,11 @@ static int enetc_map_tx_buffs(struct ene }if (do_onestep_tstamp) { -u32 lo, hi, val; -u64 sec, nsec; +__be32 new_sec_l, new_nsec; +u32 lo, hi, nsec, val; +__be16 new_sec_h;u8 *data; +u64 sec; lo =enetc_rd_hot (hw,ENETC_SICTR0 ); hi =enetc_rd_hot (hw,ENETC_SICTR1 );
@@ -269,13 +271,38 @@ static int enetc_map_tx_buffs(struct ene/* Update originTimestamp field of Sync packet * - 48 bits seconds field * - 32 bits nanseconds field +* +* In addition, the UDP checksum needs to be updated +* by software after updating originTimestamp field, +* otherwise the hardware will calculate the wrong +* checksum when updating the correction field and +* update it to the packet. */ data =skb_mac_header (skb); - *(__be16 *)(data + offset2) = -htons ((sec >>32 ) &0xffff ); - *(__be32 *)(data + offset2 +2 ) = -htonl (sec &0xffffffff ); - *(__be32 *)(data + offset2 +6 ) =htonl (nsec); + new_sec_h =htons ((sec >>32 ) &0xffff ); + new_sec_l =htonl (sec &0xffffffff ); + new_nsec =htonl (nsec); +if (udp) { +struct udphdr *uh =udp_hdr (skb); +__be32 old_sec_l, old_nsec; +__be16 old_sec_h; + + old_sec_h = *(__be16 *)(data + offset2); +inet_proto_csum_replace2 (&uh->check, skb, old_sec_h, + new_sec_h, false); + + old_sec_l = *(__be32 *)(data + offset2 +2 ); +inet_proto_csum_replace4 (&uh->check, skb, old_sec_l, + new_sec_l, false); + + old_nsec = *(__be32 *)(data + offset2 +6 ); +inet_proto_csum_replace4 (&uh->check, skb, old_nsec, + new_nsec, false); + } + + *(__be16 *)(data + offset2) = new_sec_h; + *(__be32 *)(data + offset2 +2 ) = new_sec_l; + *(__be32 *)(data + offset2 +6 ) = new_nsec;/* Configure single-step register */ val =ENETC_PM0_SINGLE_STEP_EN ;
Greg Kroah-Hartman
maintainerPATCH 115/150 net: enetc: correct the xdp_tx statistics
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Fang <[email protected]>
commit 432a2cb3ee97a7c6ea578888fe81baad035b9307 upstream.
The 'xdp_tx' is used to count the number of XDP_TX frames sent, not the number of Tx BDs.
--- drivers/net/ethernet/freescale/enetc/enetc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/enetc/enetc.c +1 -1
@@ -1666,7 +1666,7 @@ static int enetc_clean_rx_ring_xdp(strucenetc_xdp_drop (rx_ring, orig_i, i); tx_ring->stats.xdp_tx_drops++; }else { - tx_ring->stats.xdp_tx += xdp_tx_bd_cnt; + tx_ring->stats.xdp_tx++; rx_ring->xdp.xdp_tx_in_flight += xdp_tx_bd_cnt; xdp_tx_frm_cnt++;/* The XDP_TX enqueue was successful, so we
Greg Kroah-Hartman
maintainerPATCH 116/150 net: enetc: fix the off-by-one issue in enetc_map_tx_tso_buffs()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Fang <[email protected]>
commit 249df695c3ffe8c8d36d46c2580ce72410976f96 upstream.
There is an off-by-one issue for the err_chained_bd path, it will free one more tx_swbd than expected. But there is no such issue for the err_map_data path. To fix this off-by-one issue and make the two error handling consistent, the increment of 'i' and 'count' remain in sync and enetc_unwind_tx_frame() is called for error handling.
--- drivers/net/ethernet/freescale/enetc/enetc.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/net/ethernet/freescale/enetc/enetc.c +7 -8
@@ -590,8 +590,13 @@ static int enetc_map_tx_tso_buffs(struct err =enetc_map_tx_tso_data (tx_ring, skb, tx_swbd, txbd, tso.data, size, size == data_len); -if (err) +if (err) { +if (i ==0 ) + i = tx_ring->bd_count; + i--; + goto err_map_data; + } data_len -= size; count++;
@@ -620,13 +625,7 @@ err_map_data:dev_err (tx_ring->dev,"DMA map error" ); err_chained_bd: -do { - tx_swbd = &tx_ring->tx_swbd[i]; -enetc_free_tx_frame (tx_ring, tx_swbd); -if (i ==0 ) - i = tx_ring->bd_count; - i--; - }while (count--); +enetc_unwind_tx_frame (tx_ring, count, i);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 117/150 phy: tegra: xusb: reset VBUS & ID OVERRIDE
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: BH Hsieh <[email protected]>
commit 55f1a5f7c97c3c92ba469e16991a09274410ceb7 upstream.
Observed VBUS_OVERRIDE & ID_OVERRIDE might be programmed with unexpected value prior to XUSB PADCTL driver, this could also occur in virtualization scenario.
For example, UEFI firmware programs ID_OVERRIDE=GROUNDED to set a type-c port to host mode and keeps the value to kernel. If the type-c port is connected a usb host, below errors can be observed right after usb host mode driver gets probed. The errors would keep until usb role class driver detects the type-c port as device mode and notifies usb device mode driver to set both ID_OVERRIDE and VBUS_OVERRIDE to correct value by XUSB PADCTL driver.
[ 173.765814] usb usb3-port2: Cannot enable. Maybe the USB cable is bad? [ 173.765837] usb usb3-port2: config error
Taking virtualization into account, asserting XUSB PADCTL reset would break XUSB functions used by other guest OS, hence only reset VBUS & ID OVERRIDE of the port in utmi_phy_init.
--- drivers/phy/tegra/xusb-tegra186.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/phy/tegra/xusb-tegra186.c +11 -0
@@ -928,6 +928,7 @@ static int tegra186_utmi_phy_init(structunsigned int index = lane->index;struct device *dev = padctl->dev;int err; +u32 reg; port =tegra_xusb_find_usb2_port (padctl, index);if (!port) {
@@ -935,6 +936,16 @@ static int tegra186_utmi_phy_init(structreturn -ENODEV ; } +if (port->mode ==USB_DR_MODE_OTG || + port->mode ==USB_DR_MODE_PERIPHERAL ) { +/* reset VBUS&ID OVERRIDE */ + reg =padctl_readl (padctl,USB2_VBUS_ID ); + reg &= ~VBUS_OVERRIDE ; + reg &= ~ID_OVERRIDE (~0 ); + reg |=ID_OVERRIDE_FLOATING ; +padctl_writel (padctl, reg,USB2_VBUS_ID ); + } +if (port->supply && port->mode ==USB_DR_MODE_HOST ) { err =regulator_enable (port->supply);if (err) {
Greg Kroah-Hartman
maintainerPATCH 118/150 phy: exynos5-usbdrd: fix MPLL_MULTIPLIER and SSC_REFCLKSEL masks in refclk
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kaustabh Chakraborty <[email protected]>
commit e2158c953c973adb49383ddea2504faf08d375b7 upstream.
In exynos5_usbdrd_{pipe3,utmi}_set_refclk(), the masks PHYCLKRST_MPLL_MULTIPLIER_MASK and PHYCLKRST_SSC_REFCLKSEL_MASK are not inverted when applied to the register values. Fix it.
--- drivers/phy/samsung/phy-exynos5-usbdrd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/phy/samsung/phy-exynos5-usbdrd.c +6 -6
@@ -488,9 +488,9 @@ exynos5_usbdrd_pipe3_set_refclk(struct p reg |=PHYCLKRST_REFCLKSEL_EXT_REFCLK ;/* FSEL settings corresponding to reference clock */ - reg &= ~PHYCLKRST_FSEL_PIPE_MASK | -PHYCLKRST_MPLL_MULTIPLIER_MASK | -PHYCLKRST_SSC_REFCLKSEL_MASK ; + reg &= ~(PHYCLKRST_FSEL_PIPE_MASK | +PHYCLKRST_MPLL_MULTIPLIER_MASK | +PHYCLKRST_SSC_REFCLKSEL_MASK );switch (phy_drd->extrefclk) {case EXYNOS5_FSEL_50MHZ : reg |= (PHYCLKRST_MPLL_MULTIPLIER_50M_REF |
@@ -532,9 +532,9 @@ exynos5_usbdrd_utmi_set_refclk(struct ph reg &= ~PHYCLKRST_REFCLKSEL_MASK ; reg |=PHYCLKRST_REFCLKSEL_EXT_REFCLK ; - reg &= ~PHYCLKRST_FSEL_UTMI_MASK | -PHYCLKRST_MPLL_MULTIPLIER_MASK | -PHYCLKRST_SSC_REFCLKSEL_MASK ; + reg &= ~(PHYCLKRST_FSEL_UTMI_MASK | +PHYCLKRST_MPLL_MULTIPLIER_MASK | +PHYCLKRST_SSC_REFCLKSEL_MASK ); reg |=PHYCLKRST_FSEL (phy_drd->extrefclk);return reg;
Greg Kroah-Hartman
maintainerPATCH 119/150 phy: exynos5-usbdrd: gs101: ensure power is gated to SS phy in phy_exit()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: André Draszik <[email protected]>
commit 8789b4296aa796f658a19cac7d27365012893de1 upstream.
We currently don't gate the power to the SS phy in phy_exit().
Shuffle the code slightly to ensure the power is gated to the SS phy as well.
--- drivers/phy/samsung/phy-exynos5-usbdrd.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/phy/samsung/phy-exynos5-usbdrd.c +8 -5
@@ -1296,14 +1296,17 @@ static int exynos5_usbdrd_gs101_phy_exitstruct exynos5_usbdrd_phy *phy_drd =to_usbdrd_phy (inst);int ret; +if (inst->phy_cfg->id ==EXYNOS5_DRDPHY_UTMI ) { + ret =exynos850_usbdrd_phy_exit (phy); +if (ret) +return ret; + } + +exynos5_usbdrd_phy_isol (inst, true); +if (inst->phy_cfg->id !=EXYNOS5_DRDPHY_UTMI )return 0 ; - ret =exynos850_usbdrd_phy_exit (phy); -if (ret) -return ret; - -exynos5_usbdrd_phy_isol (inst, true);return regulator_bulk_disable (phy_drd->drv_data->n_regulators, phy_drd->regulators); }
Greg Kroah-Hartman
maintainerPATCH 110/150 net: phy: qcom: qca807x fix condition for DAC_DSP_BIAS_CURRENT
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: George Moussalem <[email protected]>
commit 992ee3ed6e9fdd0be83a7daa5ff738e3cf86047f upstream.
While setting the DAC value, the wrong boolean value is evaluated to set the DSP bias current. So let's correct the conditional statement and use the right boolean value read from the DTS set in the priv.
--- drivers/net/phy/qcom/qca807x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/qcom/qca807x.c +1 -1
@@ -774,7 +774,7 @@ static int qca807x_config_init(struct ph control_dac &= ~QCA807X_CONTROL_DAC_MASK ;if (!priv->dac_full_amplitude) control_dac |=QCA807X_CONTROL_DAC_DSP_AMPLITUDE ; -if (!priv->dac_full_amplitude) +if (!priv->dac_full_bias_current) control_dac |=QCA807X_CONTROL_DAC_DSP_BIAS_CURRENT ;if (!priv->dac_disable_bias_current_tweak) control_dac |=QCA807X_CONTROL_DAC_BIAS_CURRENT_TWEAK ;
Greg Kroah-Hartman
maintainerPATCH 145/150 x86/microcode/AMD: Remove ugly linebreak in __verify_patch_section() signature
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Borislav Petkov (AMD)" <[email protected]>
commit 7103f0589ac220eac3d2b1e8411494b31b883d06 upstream.
No functional changes.
--- arch/x86/kernel/cpu/microcode/amd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/kernel/cpu/microcode/amd.c +1 -2
@@ -246,8 +246,7 @@ static bool verify_equivalence_table(con* On success, @sh_psize returns the patch size according to the section header, * to the caller. */ -static bool -__verify_patch_section (const u8 *buf,size_t buf_size,u32 *sh_psize) +static bool __verify_patch_section (const u8 *buf,size_t buf_size,u32 *sh_psize) {u32 p_type, p_size;const u32 *hdr;
Greg Kroah-Hartman
maintainerPATCH 146/150 x86/microcode/AMD: Remove unused save_microcode_in_initrd_amd() declarations
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Borislav Petkov (AMD)" <[email protected]>
commit 3ef0740d10b005a45e8ae5b4b7b5d37bfddf63c0 upstream.
Commit
a7939f016720 ("x86/microcode/amd: Cache builtin/initrd microcode early")
renamed it to save_microcode_in_initrd() and made it static. Zap the forgotten declarations.
No functional changes.
--- arch/x86/kernel/cpu/microcode/amd.c | 2 +- arch/x86/kernel/cpu/microcode/internal.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-)
arch/x86/kernel/cpu/microcode/amd.c +1 -1
@@ -517,7 +517,7 @@ static bool __apply_microcode_amd(struct* patch container file in initrd, traverse equivalent cpu table, look for a * matching microcode patch, and update, all in initrd memory in place. * When vmalloc() is available for use later -- on 64-bit during first AP load, -* and on 32-bit during save_microcode_in_initrd_amd() -- we can call +* and on 32-bit during save_microcode_in_initrd() -- we can call * load_microcode_amd() to save equivalent cpu table and microcode patches in * kernel heap memory. *
arch/x86/kernel/cpu/microcode/internal.h +0 -2
@@ -100,14 +100,12 @@ extern bool force_minrev;#ifdef CONFIG_CPU_SUP_AMD void load_ucode_amd_bsp (struct early_load_data *ed,unsigned int family);void load_ucode_amd_ap (unsigned int family); -int save_microcode_in_initrd_amd (unsigned int family);void reload_ucode_amd (unsigned int cpu);struct microcode_ops *init_amd_microcode (void );void exit_amd_microcode (void );#else /* CONFIG_CPU_SUP_AMD */ static inline void load_ucode_amd_bsp (struct early_load_data *ed,unsigned int family) { }static inline void load_ucode_amd_ap (unsigned int family) { } -static inline int save_microcode_in_initrd_amd (unsigned int family) {return -EINVAL ; }static inline void reload_ucode_amd (unsigned int cpu) { }static inline struct microcode_ops *init_amd_microcode (void ) {return NULL ; }static inline void exit_amd_microcode (void ) { }
Greg Kroah-Hartman
maintainerPATCH 147/150 x86/microcode/AMD: Merge early_apply_microcode() into its single callsite
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Borislav Petkov (AMD)" <[email protected]>
commit dc15675074dcfd79a2f10a6e39f96b0244961a01 upstream.
No functional changes.
--- arch/x86/kernel/cpu/microcode/amd.c | 60 +++++++++++++++--------------------- 1 file changed, 26 insertions(+), 34 deletions(-)
arch/x86/kernel/cpu/microcode/amd.c +26 -34
@@ -512,39 +512,6 @@ static bool __apply_microcode_amd(structreturn true; } -/* -* Early load occurs before we can vmalloc(). So we look for the microcode -* patch container file in initrd, traverse equivalent cpu table, look for a -* matching microcode patch, and update, all in initrd memory in place. -* When vmalloc() is available for use later -- on 64-bit during first AP load, -* and on 32-bit during save_microcode_in_initrd() -- we can call -* load_microcode_amd() to save equivalent cpu table and microcode patches in -* kernel heap memory. -* -* Returns true if container found (sets @desc), false otherwise. -*/ -static bool early_apply_microcode (u32 old_rev,void *ucode,size_t size) -{ -struct cont_desc desc = {0 }; -struct microcode_amd *mc; -bool ret = false; - -scan_containers (ucode, size, &desc); - - mc = desc.mc; -if (!mc) -return ret; - -/* -* Allow application of the same revision to pick up SMT-specific -* changes even if the revision of the other SMT thread is already -* up-to-date. -*/ -if (old_rev > mc->hdr.patch_id) -return ret; - -return __apply_microcode_amd (mc, desc.psize); -}static bool get_builtin_microcode (struct cpio_data *cp) {
@@ -583,8 +550,19 @@ static bool __init find_blobs_in_containreturn found; } +/* +* Early load occurs before we can vmalloc(). So we look for the microcode +* patch container file in initrd, traverse equivalent cpu table, look for a +* matching microcode patch, and update, all in initrd memory in place. +* When vmalloc() is available for use later -- on 64-bit during first AP load, +* and on 32-bit during save_microcode_in_initrd() -- we can call +* load_microcode_amd() to save equivalent cpu table and microcode patches in +* kernel heap memory. +*/ void __init load_ucode_amd_bsp (struct early_load_data *ed,unsigned int cpuid_1_eax) { +struct cont_desc desc = { }; +struct microcode_amd *mc;struct cpio_data cp = { };u32 dummy;
@@ -598,7 +576,21 @@ void __init load_ucode_amd_bsp(struct eaif (!find_blobs_in_containers (&cp))return ; -if (early_apply_microcode (ed->old_rev, cp.data, cp.size)) +scan_containers (cp.data, cp.size, &desc); + + mc = desc.mc; +if (!mc) +return ; + +/* +* Allow application of the same revision to pick up SMT-specific +* changes even if the revision of the other SMT thread is already +* up-to-date. +*/ +if (ed->old_rev > mc->hdr.patch_id) +return ; + +if (__apply_microcode_amd (mc, desc.psize))native_rdmsr (MSR_AMD64_PATCH_LEVEL , ed->new_rev, dummy); }
Greg Kroah-Hartman
maintainerPATCH 148/150 x86/microcode/AMD: Get rid of the _load_microcode_amd() forward declaration
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Borislav Petkov (AMD)" <[email protected]>
commit b39c387164879eef71886fc93cee5ca7dd7bf500 upstream.
Simply move save_microcode_in_initrd() down.
No functional changes.
--- arch/x86/kernel/cpu/microcode/amd.c | 54 +++++++++++++++++------------------- 1 file changed, 26 insertions(+), 28 deletions(-)
arch/x86/kernel/cpu/microcode/amd.c +26 -28
@@ -594,34 +594,6 @@ void __init load_ucode_amd_bsp(struct eanative_rdmsr (MSR_AMD64_PATCH_LEVEL , ed->new_rev, dummy); } -static enum ucode_state _load_microcode_amd (u8 family,const u8 *data,size_t size); - -static int __init save_microcode_in_initrd (void ) -{ -unsigned int cpuid_1_eax =native_cpuid_eax (1 ); -struct cpuinfo_x86 *c = &boot_cpu_data; -struct cont_desc desc = {0 }; -enum ucode_state ret; -struct cpio_data cp; - -if (dis_ucode_ldr || c->x86_vendor !=X86_VENDOR_AMD || c->x86 <0x10 ) -return 0 ; - -if (!find_blobs_in_containers (&cp)) -return -EINVAL ; - -scan_containers (cp.data, cp.size, &desc); -if (!desc.mc) -return -EINVAL ; - - ret =_load_microcode_amd (x86_family (cpuid_1_eax), desc.data, desc.size); -if (ret >UCODE_UPDATED ) -return -EINVAL ; - -return 0 ; -} -early_initcall (save_microcode_in_initrd); -static inline bool patch_cpus_equivalent (struct ucode_patch *p,struct ucode_patch *n,bool ignore_stepping)
@@ -1005,6 +977,32 @@ static enum ucode_state load_microcode_areturn ret; } +static int __init save_microcode_in_initrd (void ) +{ +unsigned int cpuid_1_eax =native_cpuid_eax (1 ); +struct cpuinfo_x86 *c = &boot_cpu_data; +struct cont_desc desc = {0 }; +enum ucode_state ret; +struct cpio_data cp; + +if (dis_ucode_ldr || c->x86_vendor !=X86_VENDOR_AMD || c->x86 <0x10 ) +return 0 ; + +if (!find_blobs_in_containers (&cp)) +return -EINVAL ; + +scan_containers (cp.data, cp.size, &desc); +if (!desc.mc) +return -EINVAL ; + + ret =_load_microcode_amd (x86_family (cpuid_1_eax), desc.data, desc.size); +if (ret >UCODE_UPDATED ) +return -EINVAL ; + +return 0 ; +} +early_initcall (save_microcode_in_initrd); +/* * AMD microcode firmware naming convention, up to family 15h they are in * the legacy file:
Greg Kroah-Hartman
maintainerPATCH 149/150 x86/microcode/AMD: Add get_patch_level()
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Borislav Petkov (AMD)" <[email protected]>
commit 037e81fb9d2dfe7b31fd97e5f578854e38f09887 upstream.
Put the MSR_AMD64_PATCH_LEVEL reading of the current microcode revision the hw has, into a separate function.
--- arch/x86/kernel/cpu/microcode/amd.c | 46 ++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 22 deletions(-)
arch/x86/kernel/cpu/microcode/amd.c +24 -22
@@ -145,6 +145,15 @@ ucode_path[] __maybe_unused = "kernel/x8*/ static u32 bsp_cpuid_1_eax__ro_after_init ; +static u32 get_patch_level (void ) +{ +u32 rev, dummy__always_unused ; + +native_rdmsr (MSR_AMD64_PATCH_LEVEL , rev, dummy); + +return rev; +} +static union cpuid_1_eax ucode_rev_to_cpuid (unsigned int val) {union zen_patch_rev p;
@@ -483,10 +492,10 @@ static void scan_containers(u8 *ucode, s } } -static bool __apply_microcode_amd (struct microcode_amd *mc,unsigned int psize) +static bool __apply_microcode_amd (struct microcode_amd *mc,u32 *cur_rev, +unsigned int psize) {unsigned long p_addr = (unsigned long )&mc->hdr.data_code; -u32 rev, dummy;native_wrmsrl (MSR_AMD64_PATCH_LOADER , p_addr);
@@ -504,9 +513,8 @@ static bool __apply_microcode_amd(struct }/* verify patch application was successful */ -native_rdmsr (MSR_AMD64_PATCH_LEVEL , rev, dummy); - -if (rev != mc->hdr.patch_id) + *cur_rev =get_patch_level (); +if (*cur_rev != mc->hdr.patch_id)return false;return true;
@@ -564,11 +572,12 @@ void __init load_ucode_amd_bsp(struct eastruct cont_desc desc = { };struct microcode_amd *mc;struct cpio_data cp = { }; -u32 dummy; +u32 rev; bsp_cpuid_1_eax = cpuid_1_eax; -native_rdmsr (MSR_AMD64_PATCH_LEVEL , ed->old_rev, dummy); + rev =get_patch_level (); + ed->old_rev = rev;/* Needed in load_microcode_amd() */ ucode_cpu_info[0 ].cpu_sig.sig = cpuid_1_eax;
@@ -590,8 +599,8 @@ void __init load_ucode_amd_bsp(struct eaif (ed->old_rev > mc->hdr.patch_id)return ; -if (__apply_microcode_amd (mc, desc.psize)) -native_rdmsr (MSR_AMD64_PATCH_LEVEL , ed->new_rev, dummy); +if (__apply_microcode_amd (mc, &rev, desc.psize)) + ed->new_rev = rev; } static inline bool patch_cpus_equivalent(struct ucode_patch *p,
@@ -693,14 +702,9 @@ static void free_cache(void)static struct ucode_patch *find_patch (unsigned int cpu) {struct ucode_cpu_info *uci = ucode_cpu_info + cpu; -u32 rev, dummy__always_unused ;u16 equiv_id =0 ; -/* fetch rev if not populated yet: */ -if (!uci->cpu_sig.rev) { -rdmsr (MSR_AMD64_PATCH_LEVEL , rev, dummy); - uci->cpu_sig.rev = rev; - } + uci->cpu_sig.rev =get_patch_level ();if (x86_family (bsp_cpuid_1_eax) <0x17 ) { equiv_id =find_equiv_id (&equiv_table, uci->cpu_sig.sig);
@@ -723,22 +727,20 @@ void reload_ucode_amd(unsigned int cpu) mc = p->data; -rdmsr (MSR_AMD64_PATCH_LEVEL , rev, dummy); - + rev =get_patch_level ();if (rev < mc->hdr.patch_id) { -if (__apply_microcode_amd (mc, p->size)) -pr_info_once ("reload revision: 0x%08x\n" , mc->hdr.patch_id); +if (__apply_microcode_amd (mc, &rev, p->size)) +pr_info_once ("reload revision: 0x%08x\n" , rev); } }static int collect_cpu_info_amd (int cpu,struct cpu_signature *csig) { -struct cpuinfo_x86 *c = &cpu_data (cpu);struct ucode_cpu_info *uci = ucode_cpu_info + cpu;struct ucode_patch *p; csig->sig =cpuid_eax (0x00000001 ); - csig->rev = c->microcode; + csig->rev =get_patch_level ();/* * a patch could have been loaded early, set uci->mc so that
@@ -779,7 +781,7 @@ static enum ucode_state apply_microcode_ goto out; } -if (!__apply_microcode_amd (mc_amd, p->size)) { +if (!__apply_microcode_amd (mc_amd, &rev, p->size)) {pr_err ("CPU%d: update failed for patch_level=0x%08x\n" , cpu, mc_amd->hdr.patch_id);return UCODE_ERROR ;
Greg Kroah-Hartman
maintainerPATCH 150/150 x86/microcode/AMD: Load only SHA256-checksummed patches
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Borislav Petkov (AMD)" <[email protected]>
commit 50cef76d5cb0e199cda19f026842560f6eedc4f7 upstream.
Load patches for which the driver carries a SHA256 checksum of the patch blob.
This can be disabled by adding "microcode.amd_sha_check=off" on the kernel cmdline. But it is highly NOT recommended.
--- arch/x86/Kconfig | 1 arch/x86/kernel/cpu/microcode/amd.c | 111 +++++++ arch/x86/kernel/cpu/microcode/amd_shas.c | 444 +++++++++++++++++++++++++++++++ 3 files changed, 554 insertions(+), 2 deletions(-) create mode 100644 arch/x86/kernel/cpu/microcode/amd_shas.c
arch/x86/Kconfig +1 -0
@@ -1333,6 +1333,7 @@ config X86_REBOOTFIXUPS config MICROCODE def_bool y depends on CPU_SUP_AMD || CPU_SUP_INTEL + select CRYPTO_LIB_SHA256 if CPU_SUP_AMD config MICROCODE_INITRD32 def_bool y
arch/x86/kernel/cpu/microcode/amd.c +109 -2
151 lines not on this page · raw message
arch/x86/kernel/cpu/microcode/amd_shas.c new file +444 -0
444 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 144/150 x86/microcode/AMD: Have __apply_microcode_amd() return bool
In reply to Greg Kroah-Hartman6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Borislav Petkov (AMD)" <[email protected]>
commit 78e0aadbd4c6807a06a9d25bc190fe515d3f3c42 upstream
This is the natural thing to do anyway.
No functional changes.
--- arch/x86/kernel/cpu/microcode/amd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/x86/kernel/cpu/microcode/amd.c +6 -6
@@ -484,7 +484,7 @@ static void scan_containers(u8 *ucode, s } } -static int __apply_microcode_amd (struct microcode_amd *mc,unsigned int psize) +static bool __apply_microcode_amd (struct microcode_amd *mc,unsigned int psize) {unsigned long p_addr = (unsigned long )&mc->hdr.data_code;u32 rev, dummy;
@@ -508,9 +508,9 @@ static int __apply_microcode_amd(structnative_rdmsr (MSR_AMD64_PATCH_LEVEL , rev, dummy);if (rev != mc->hdr.patch_id) -return -1 ; +return false; -return 0 ; +return true; }/*
@@ -544,7 +544,7 @@ static bool early_apply_microcode(u32 olif (old_rev > mc->hdr.patch_id)return ret; -return !__apply_microcode_amd (mc, desc.psize); +return __apply_microcode_amd (mc, desc.psize); }static bool get_builtin_microcode (struct cpio_data *cp)
@@ -763,7 +763,7 @@ void reload_ucode_amd(unsigned int cpu)rdmsr (MSR_AMD64_PATCH_LEVEL , rev, dummy);if (rev < mc->hdr.patch_id) { -if (!__apply_microcode_amd (mc, p->size)) +if (__apply_microcode_amd (mc, p->size))pr_info_once ("reload revision: 0x%08x\n" , mc->hdr.patch_id); } }
@@ -816,7 +816,7 @@ static enum ucode_state apply_microcode_ goto out; } -if (__apply_microcode_amd (mc_amd, p->size)) { +if (!__apply_microcode_amd (mc_amd, p->size)) {pr_err ("CPU%d: update failed for patch_level=0x%08x\n" , cpu, mc_amd->hdr.patch_id);return UCODE_ERROR ;
Hello,
Quoted 7 lines · On Wed, 5 Mar 2025 18:47:09 +0100 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 6.12.18 release. There are 150 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 07 Mar 2025 17:44:26 +0000. Anything received after that time might be too late.
This rc kernel passes DAMON functionality test[1] on my test machine. Attaching the test results summary below. Please note that I retrieved the kernel from linux-stable-rc tree[2].
[1] https://github.com/damonitor/damon-tests/tree/next/corr
[2] 43639cc57b22 ("Linux 6.12.18-rc1")
Thanks,
SJ
[...]
---
ok 9 selftests: damon: damos_tried_regions.py
ok 10 selftests: damon: damon_nr_regions.py
ok 11 selftests: damon: reclaim.sh
ok 12 selftests: damon: lru_sort.sh
ok 13 selftests: damon: debugfs_empty_targets.sh
ok 14 selftests: damon: debugfs_huge_count_read_write.sh
ok 15 selftests: damon: debugfs_duplicate_context_creation.sh ok 16 selftests: damon: debugfs_rm_non_contexts.sh
ok 17 selftests: damon: debugfs_target_ids_read_before_terminate_race.sh ok 18 selftests: damon: debugfs_target_ids_pid_leak.sh
ok 19 selftests: damon: sysfs_update_removed_scheme_dir.sh
ok 20 selftests: damon: sysfs_update_schemes_tried_regions_hang.py ok 1 selftests: damon-tests: kunit.sh
ok 2 selftests: damon-tests: huge_count_read_write.sh
ok 3 selftests: damon-tests: buffer_overflow.sh
ok 4 selftests: damon-tests: rm_contexts.sh
ok 5 selftests: damon-tests: record_null_deref.sh
ok 6 selftests: damon-tests: dbgfs_target_ids_read_before_terminate_race.sh ok 7 selftests: damon-tests: dbgfs_target_ids_pid_leak.sh
ok 8 selftests: damon-tests: damo_tests.sh
ok 9 selftests: damon-tests: masim-record.sh
ok 10 selftests: damon-tests: build_i386.sh
ok 11 selftests: damon-tests: build_arm64.sh # SKIP
ok 12 selftests: damon-tests: build_m68k.sh # SKIP
ok 13 selftests: damon-tests: build_i386_idle_flag.sh
ok 14 selftests: damon-tests: build_i386_highpte.sh
ok 15 selftests: damon-tests: build_nomemcg.sh
[33m
[92mPASS [39m
Am 05.03.2025 um 18:47 schrieb Greg Kroah-Hartman:
Quoted 4 lines
This is the start of the stable review cycle for the 6.12.18 release. There are 150 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Builds, boots and works on my 2-socket Ivy Bridge Xeon E5-2697 v2 server. No dmesg oddities or regressions found.
Beste Grüße,
Peter Schneider
Signature · 8 lines
Climb the mountain not to plant your flag, but to embrace the challenge, enjoy the air and behold the view. Climb it so you can see the world, not so the world can see you. -- David McCullough Jr. OpenPGP: 0xA3828BD796CCE11A8CADE8866E3A92C92C3FF244 Download: https://www.peters-netzplatz.de/download/pschneider1968_pub.asc https://keys.mailvelope.com/pks/lookup?op=get&[email protected] https://keys.mailvelope.com/pks/lookup?op=get&[email protected]
Re: [PATCH 6.12 058/150] drm/xe: cancel pending job timer before freeing scheduler
In reply to Greg Kroah-HartmanQuoted 2 lines · Greg Kroah-Hartman
6.12-stable review patch. If anyone has any objections, please let me know.
We just got CI report on this patch, can you please hold off on backporting this.
Thanks!
Matt
Quoted 46 lines
------------------
From: Tejas Upadhyay <[email protected]>
[ Upstream commit
12c2f962fe71f390951d9242725bc7e608f55927]The async call to
__guc_exec_queue_fini_asyncfrees the scheduler while a submission may time out and restart. To prevent this race condition, the pending job timer should be canceled before freeing the scheduler.V3(MattB):
- Adjust position of cancel pending job
- Remove gitlab issue# from commit message
V2(MattB):
- Cancel pending jobs before scheduler finishFixes a20c75dba192 ("drm/xe: Call __guc_exec_queue_fini_async direct for KERNEL exec_queues")Reviewed-by Matthew Brost <[email protected]>Signed-off-by Tejas Upadhyay <[email protected]>(cherry picked from commit 18fbd567e75f9b97b699b2ab4f1fa76b7cf268f6)Signed-off-by Rodrigo Vivi <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- drivers/gpu/drm/xe/xe_guc_submit.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/xe/xe_guc_submit.c +2
-0@@ -1215,6 +1215,8 @@ static void __guc_exec_queue_fini_async(struct work_struct *w)if (xe_exec_queue_is_lr (q))cancel_work_sync (&ge->lr_tdr); +/* Confirm no work left behind accessing device structures */ +cancel_delayed_work_sync (&ge->sched.base.work_tdr);release_guc_id (guc, q);xe_sched_entity_fini (&ge->entity);xe_sched_fini (&ge->sched);Signature · 1 line
2.39.5
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.18 release. There are 150 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 07 Mar 2025 17:44:26 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.12.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.18 release. There are 150 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 07 Mar 2025 17:44:26 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.12.y
and the diffstat can be found below.thanks,
greg k-h
Regressions on arm64 the defconfig builds failed with clang-20 and gcc-13 the stable-rc 6.12.18-rc1 and 6.13.6-rc1.
First seen on the 6.12.18-rc1
Good: v6.12.14
Bad: 6.12.18-rc1
* arm64, build
- clang-20-defconfig
- clang-nightly-defconfig
- gcc-13-defconfig
- gcc-8-defconfig
Regression Analysis:
- New regression? yes
- Reproducibility? Yes
This commmit is causing build regressions,
arm64: hugetlb: Fix huge_ptep_get_and_clear() for non-present ptes commit 49c87f7677746f3c5bd16c81b23700bb6b88bfd4 upstream.
Build regression: arm64 hugetlbpage.c undeclared identifier 'sz'
## Build logarch/arm64/mm/hugetlbpage.c:386:28: error: use of undeclared identifier 'sz'
386 | ncontig = num_contig_ptes(sz, &pgsize);
| ^
1 error generated.
## Source
* Kernel version: 6.12.18-rc1
* Git tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* Git sha: 43639cc57b2273fce42874dd7f6e0b872f4984c5
* Git describe: v6.12.15-531-g43639cc57b22
* Project details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.12.y/build/v6.12.15-531-g43639cc57b22
## Build
* Build log: https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.12.y/build/v6.12.15-531-g43639cc57b22/testrun/27516239/suite/build/test/clang-20-defconfig/log
* Build history:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.12.y/build/v6.12.15-531-g43639cc57b22/testrun/27514393/suite/build/test/clang-20-defconfig/history/
* Build details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.12.y/build/v6.12.15-531-g43639cc57b22/testrun/27516239/suite/build/test/clang-20-defconfig/
* Build link: https://storage.tuxsuite.com/public/linaro/lkft/builds/2tuR9WQOit4WjRC1XVxLJKTcQia/
* Kernel config:
https://storage.tuxsuite.com/public/linaro/lkft/builds/2tuR9WQOit4WjRC1XVxLJKTcQia/config
## Steps to reproduce
- tuxmake --runtime podman --target-arch arm64 --toolchain clang-20
--kconfig defconfig LLVM=1 LLVM_IAS=1
--
Linaro LKFT
https://lkft.linaro.org
Jon Hunter
maintainerHi Greg,
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.18 release. There are 150 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 07 Mar 2025 17:44:26 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.12.y
and the diffstat can be found below.
Quoted 6 lines
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
...
The ARM64 build is failing with ...
kernel/arch/arm64/mm/hugetlbpage.c: In function ‘huge_ptep_get_and_clear’:kernel/arch/arm64/mm/hugetlbpage.c:386:35: error: ‘sz’ undeclared (first use in this function); did you mean ‘s8’?
386 | ncontig = num_contig_ptes(sz, &pgsize);
| ^~
| s8Quoted 2 lines
Ryan Roberts <[email protected]>
arm64: hugetlb: Fixhuge_ptep_get_and_clear()for non-present ptes
Bisect is point to the above commit. I am seeing the same build failure on both linux-6.12.y and linux-6.13.y.
Cheers
Jon
Signature · 1 line
nvpublic
Quoted 42 lines · Naresh Kamboju
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.18 release. There are 150 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 07 Mar 2025 17:44:26 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.12.y
and the diffstat can be found below.thanks,
greg k-h
Regressions on arm64 the defconfig builds failed with clang-20 and gcc-13 the stable-rc 6.12.18-rc1 and 6.13.6-rc1.
First seen on the 6.12.18-rc1
Good: v6.12.14
Bad: 6.12.18-rc1* arm64, build
- clang-20-defconfig
- clang-nightly-defconfig
- gcc-13-defconfig
- gcc-8-defconfigRegression Analysis:
- New regression? yes
- Reproducibility? YesThis commmit is causing build regressions,
arm64: hugetlb: Fixhuge_ptep_get_and_clear()for non-present ptes commit49c87f7677746f3c5bd16c81b23700bb6b88bfd4upstream.
Quoted 8 lines
Build regression: arm64
hugetlbpage.cundeclared identifier 'sz'## Build log
arch/arm64/mm/hugetlbpage.c:386:28: error: use of undeclared identifier 'sz'
386 | ncontig =num_contig_ptes(sz, &pgsize);
| ^
1 error generated.
This is the same problem we were discussing againt the 6.13 backport. This patch depends on a patch that conflicted so wasn't auto-backported. I'll send out the manual backports in due course.
Quoted 28 lines
## Source
* Kernel version: 6.12.18-rc1
* Git tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* Git sha:43639cc57b2273fce42874dd7f6e0b872f4984c5
* Git describe: v6.12.15-531-g43639cc57b22
* Project details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.12.y/build/v6.12.15-531-g43639cc57b22## Build
* Build log: https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.12.y/build/v6.12.15-531-g43639cc57b22/testrun/27516239/suite/build/test/clang-20-defconfig/log
* Build history:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.12.y/build/v6.12.15-531-g43639cc57b22/testrun/27514393/suite/build/test/clang-20-defconfig/history/
* Build details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.12.y/build/v6.12.15-531-g43639cc57b22/testrun/27516239/suite/build/test/clang-20-defconfig/
* Build link: https://storage.tuxsuite.com/public/linaro/lkft/builds/2tuR9WQOit4WjRC1XVxLJKTcQia/
* Kernel config:
https://storage.tuxsuite.com/public/linaro/lkft/builds/2tuR9WQOit4WjRC1XVxLJKTcQia/config## Steps to reproduce
- tuxmake --runtime podman --target-arch arm64 --toolchain clang-20
--kconfig defconfig LLVM=1 LLVM_IAS=1--
Linaro LKFT
https://lkft.linaro.org
Greg Kroah-Hartman
maintainerRe: [PATCH 6.12 058/150] drm/xe: cancel pending job timer before freeing scheduler
In reply to Matthew BrostQuoted 5 lines · Matthew Brost
Quoted 2 lines · Greg Kroah-Hartman
6.12-stable review patch. If anyone has any objections, please let me know.
We just got CI report on this patch, can you please hold off on backporting this.
Ok, but note you all better revert this upstream as well soon, otherwise our tools have a tendancy to want to drag stuff like this back into stable kernels to remain in sync with Linus's tree.
thanks,
greg k-h
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.12.18 release. There are 150 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 07 Mar 2025 17:44:26 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.12.18-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.12.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
The kernel, bpf tool, perf tool, and kselftest builds fine for v6.12.18-rc1 on x86 Azure VM.
Kernel binary size for x86 build:
text data bss dec hex filename 27755354 17713522 6397952 51866828 3176ccc vmlinux
arm64 build on Azure VM fails with the following error:
CC arch/arm64/kernel/vdso.oarch/arm64/mm/hugetlbpage.c: In function 'huge_ptep_get_and_clear':arch/arm64/mm/hugetlbpage.c:386:35: error: 'sz' undeclared (first use in this function); did you mean 's8'?
386 | ncontig = num_contig_ptes(sz, &pgsize);
| ^~
| s8arch/arm64/mm/hugetlbpage.c:386:35: note: each undeclared identifier is reported only once for each function it appears in
Same issue with v6.13.6-rc1
Thanks,
Hardik
Re: [PATCH 6.12 058/150] drm/xe: cancel pending job timer before freeing scheduler
In reply to Greg Kroah-HartmanQuoted 11 lines · Greg Kroah-Hartman
Quoted 5 lines · Matthew Brost
Quoted 2 lines · Greg Kroah-Hartman
6.12-stable review patch. If anyone has any objections, please let me know.
We just got CI report on this patch, can you please hold off on backporting this.
Ok, but note you all better revert this upstream as well soon, otherwise our tools have a tendancy to want to drag stuff like this back into stable kernels to remain in sync with Linus's tree.
Thank you for the information on the workflow for issues like this.
I'm pretty sure the follow-up in [1] will fix this and be merged any minute now—I just saw this email after reviewing [1]. Is the correct flow here to let the tools pick up the original offending patch and the subsequent fix, or is there something else we should do? Please advise.
Matt
[1] https://patchwork.freedesktop.org/series/145907/
Quoted 3 lines
thanks,
greg k-h
Greg Kroah-Hartman
maintainerRe: [PATCH 6.12 058/150] drm/xe: cancel pending job timer before freeing scheduler
Quoted 13 lines · Matthew Brost
Quoted 11 lines · Greg Kroah-Hartman
Quoted 5 lines · Matthew Brost
Quoted 2 lines · Greg Kroah-Hartman
6.12-stable review patch. If anyone has any objections, please let me know.
We just got CI report on this patch, can you please hold off on backporting this.
Ok, but note you all better revert this upstream as well soon, otherwise our tools have a tendancy to want to drag stuff like this back into stable kernels to remain in sync with Linus's tree.
Quoted 6 lines
Thank you for the information on the workflow for issues like this.
I'm pretty sure the follow-up in [1] will fix this and be merged any minute now—I just saw this email after reviewing [1]. Is the correct flow here to let the tools pick up the original offending patch and the subsequent fix, or is there something else we should do? Please advise.
Please let us know when the fix hits Linus's tree and what the git commit ids are that should be added to the stable tree at that time.
thanks,
greg k-h