5.19.9-rc1 review
Subsystems (4)
Greg Kroah-Hartman
maintainerPATCH 153/192 perf dlfilter dlfilter-show-cycles: Fix types for print format
In reply to Greg Kroah-HartmanFrom: Adrian Hunter <[email protected]>
[ Upstream commit 1706623e940347ad23fdf77910eca4905dc37f91 ]
Avoid compiler warning about format %llu that expects long long unsigned int but argument has type __u64.
--- tools/perf/dlfilters/dlfilter-show-cycles.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/perf/dlfilters/dlfilter-show-cycles.c +2 -2
@@ -98,9 +98,9 @@ int filter_event_early(void *data, const struct perf_dlfilter_sample *sample, vostatic void print_vals (__u64 cycles,__u64 delta) {if (delta) -printf ("%10llu %10llu " , cycles, delta); +printf ("%10llu %10llu " , (unsigned long long )cycles, (unsigned long long )delta);else -printf ("%10llu %10s " , cycles,"" ); +printf ("%10llu %10s " , (unsigned long long )cycles,"" ); }int filter_event (void *data,const struct perf_dlfilter_sample *sample,void *ctx)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 154/192 perf script: Fix Cannot print iregs field for hybrid systems
In reply to Greg Kroah-HartmanFrom: Zhengjun Xing <[email protected]>
[ Upstream commit 82b2425fad2dd47204b3da589b679220f8aacc0e ]
Commit b91e5492f9d7ca89 ("perf record: Add a dummy event on hybrid systems to collect metadata records") adds a dummy event on hybrid systems to fix the symbol "unknown" issue when the workload is created in a P-core but runs on an E-core. The added dummy event will cause "perf script -F iregs" to fail. Dummy events do not have "iregs" attribute set, so when we do evsel__check_attr, the "iregs" attribute check will fail, so the issue happened.
The following commit [1] has fixed a similar issue by skipping the attr check for the dummy event because it does not have any samples anyway. It works okay for the normal mode, but the issue still happened when running the test in the pipe mode. In the pipe mode, it calls process_attr() which still checks the attr for the dummy event. This commit fixed the issue by skipping the attr check for the dummy event in the API evsel__check_attr, Otherwise, we have to patch everywhere when evsel__check_attr() is called.
Before:
#./perf record -o - --intr-regs=di,r8,dx,cx -e br_inst_retired.near_call:p -c 1000 --per-thread true 2>/dev/null|./perf script -F iregs |head -5 Samples for 'dummy:HG' event do not have IREGS attribute set. Cannot print 'iregs' field.
0x120 [0x90]: failed to process type: 64
#
After:
# ./perf record -o - --intr-regs=di,r8,dx,cx -e br_inst_retired.near_call:p -c 1000 --per-thread true 2>/dev/null|./perf script -F iregs |head -5 ABI:2 CX:0x55b8efa87000 DX:0x55b8efa7e000 DI:0xffffba5e625efbb0 R8:0xffff90e51f8ae100 ABI:2 CX:0x7f1dae1e4000 DX:0xd0 DI:0xffff90e18c675ac0 R8:0x71 ABI:2 CX:0xcc0 DX:0x1 DI:0xffff90e199880240 R8:0x0 ABI:2 CX:0xffff90e180dd7500 DX:0xffff90e180dd7500 DI:0xffff90e180043500 R8:0x1 ABI:2 CX:0x50 DX:0xffff90e18c583bd0 DI:0xffff90e1998803c0 R8:0x58 #
[1]https://lore.kernel.org/lkml/[email protected]/
--- tools/perf/builtin-script.c | 3 +++ 1 file changed, 3 insertions(+)
tools/perf/builtin-script.c +3 -0
@@ -441,6 +441,9 @@ static int evsel__check_attr(struct evsel *evsel, struct perf_session *session)struct perf_event_attr *attr = &evsel->core.attr;bool allow_user_set; +if (evsel__is_dummy_event (evsel)) +return 0 ; +if (perf_header__has_feat (&session->header,HEADER_STAT ))return 0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 155/192 perf record: Fix synthesis failure warnings
In reply to Greg Kroah-HartmanFrom: Adrian Hunter <[email protected]>
[ Upstream commit faf59ec8c3c3708c64ff76b50e6f757c6b4a1054 ]
Some calls to synthesis functions set err < 0 but only warn about the failure and continue. However they do not set err back to zero, relying on subsequent code to do that.
That changed with the introduction of option --synth. When --synth=no subsequent functions that set err back to zero are not called.
Fix by setting err = 0 in those cases.
Example:
Before:
$ perf record --no-bpf-event --synth=all -o /tmp/huh uname Couldn't synthesize bpf events. Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.014 MB /tmp/huh (7 samples) ] $ perf record --no-bpf-event --synth=no -o /tmp/huh uname Couldn't synthesize bpf events.
After:
$ perf record --no-bpf-event --synth=no -o /tmp/huh uname Couldn't synthesize bpf events. Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.014 MB /tmp/huh (7 samples) ]
--- tools/perf/builtin-record.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
tools/perf/builtin-record.c +6 -2
@@ -1892,14 +1892,18 @@ static int record__synthesize(struct record *rec, bool tail) err =perf_event__synthesize_bpf_events (session, process_synthesized_event, machine, opts); -if (err <0 ) +if (err <0 ) {pr_warning ("Couldn't synthesize bpf events.\n" ); + err =0 ; + }if (rec->opts.synth &PERF_SYNTH_CGROUP ) { err =perf_event__synthesize_cgroups (tool, process_synthesized_event, machine); -if (err <0 ) +if (err <0 ) {pr_warning ("Couldn't synthesize cgroup events.\n" ); + err =0 ; + } }if (rec->opts.nr_threads_synthesize >1 ) {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 156/192 hwmon: (tps23861) fix byte order in resistance register
In reply to Greg Kroah-HartmanFrom: Alexandru Gagniuc <[email protected]>
commit 1f05f65bddd6958d25b133f886da49c1d4bff3fa upstream.
The tps23861 registers are little-endian, and regmap_read_bulk() does not do byte order conversion. On BE machines, the bytes were swapped, and the interpretation of the resistance value was incorrect.
To make it work on both big and little-endian machines, use le16_to_cpu() to convert the resitance register to host byte order.
--- drivers/hwmon/tps23861.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/hwmon/tps23861.c +6 -4
@@ -489,18 +489,20 @@ static char *tps23861_port_poe_plus_statstatic int tps23861_port_resistance (struct tps23861_data *data,int port) { -u16 regval; +unsigned int raw_val; +__le16 regval;regmap_bulk_read (data->regmap,PORT_1_RESISTANCE_LSB +PORT_N_RESISTANCE_LSB_OFFSET * (port -1 ), ®val,2 ); -switch (FIELD_GET (PORT_RESISTANCE_RSN_MASK , regval)) { + raw_val =le16_to_cpu (regval); +switch (FIELD_GET (PORT_RESISTANCE_RSN_MASK , raw_val)) {case PORT_RESISTANCE_RSN_OTHER : -return (FIELD_GET (PORT_RESISTANCE_MASK , regval) *RESISTANCE_LSB ) /10000 ; +return (FIELD_GET (PORT_RESISTANCE_MASK , raw_val) *RESISTANCE_LSB ) /10000 ;case PORT_RESISTANCE_RSN_LOW : -return (FIELD_GET (PORT_RESISTANCE_MASK , regval) *RESISTANCE_LSB_LOW ) /10000 ; +return (FIELD_GET (PORT_RESISTANCE_MASK , raw_val) *RESISTANCE_LSB_LOW ) /10000 ;case PORT_RESISTANCE_RSN_SHORT :case PORT_RESISTANCE_RSN_OPEN :default :
Greg Kroah-Hartman
maintainerPATCH 157/192 ASoC: mchp-spdiftx: remove references to mchp_i2s_caps
In reply to Greg Kroah-HartmanFrom: Claudiu Beznea <[email protected]>
commit 403fcb5118a0f4091001a537e76923031fb45eaf upstream.
Remove references to struct mchp_i2s_caps as they are not used.
--- sound/soc/atmel/mchp-spdiftx.c | 8 -------- 1 file changed, 8 deletions(-)
sound/soc/atmel/mchp-spdiftx.c +0 -8
@@ -196,7 +196,6 @@ struct mchp_spdiftx_dev {struct clk *pclk;struct clk *gclk;unsigned int fmt; -const struct mchp_i2s_caps *caps; int gclk_enabled:1; };
@@ -766,8 +765,6 @@ static const struct of_device_id mchp_spMODULE_DEVICE_TABLE (of, mchp_spdiftx_dt_ids);static int mchp_spdiftx_probe (struct platform_device *pdev) { -struct device_node *np = pdev->dev.of_node; -const struct of_device_id *match;struct mchp_spdiftx_dev *dev;struct resource *mem;struct regmap *regmap;
@@ -781,11 +778,6 @@ static int mchp_spdiftx_probe(struct plaif (!dev)return -ENOMEM ; -/* Get hardware capabilities. */ - match =of_match_node (mchp_spdiftx_dt_ids, np); -if (match) - dev->caps = match->data; -/* Map I/O registers. */ base =devm_platform_get_and_ioremap_resource (pdev,0 , &mem);if (IS_ERR (base))
Greg Kroah-Hartman
maintainerPATCH 158/192 ASoC: mchp-spdiftx: Fix clang -Wbitfield-constant-conversion
In reply to Greg Kroah-HartmanFrom: Nathan Chancellor <[email protected]>
commit 5c5c2baad2b55cc0a4b190266889959642298f79 upstream.
A recent change in clang strengthened its -Wbitfield-constant-conversion to warn when 1 is assigned to a 1-bit signed integer bitfield, as it can only be 0 or -1, not 1:
sound/soc/atmel/mchp-spdiftx.c:505:20: error: implicit truncation from 'int' to bit-field changes value from 1 to -1 [-Werror,-Wbitfield-constant-conversion]
dev->gclk_enabled = 1;
^ ~1 error generated.
The actual value of the field is never checked, just that it is not zero, so there is not a real bug here. However, it is simple enough to silence the warning by making the bitfield unsigned, which matches the mchp-spdifrx driver.
--- sound/soc/atmel/mchp-spdiftx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/atmel/mchp-spdiftx.c +1 -1
@@ -196,7 +196,7 @@ struct mchp_spdiftx_dev {struct clk *pclk;struct clk *gclk;unsigned int fmt; - int gclk_enabled:1; + unsigned int gclk_enabled:1; };static inline int mchp_spdiftx_is_running (struct mchp_spdiftx_dev *dev)
Greg Kroah-Hartman
maintainerPATCH 159/192 lsm,io_uring: add LSM hooks for the new uring_cmd file op
In reply to Greg Kroah-HartmanFrom: Luis Chamberlain <[email protected]>
commit 2a5840124009f133bd09fd855963551fb2cefe22 upstream.
io-uring cmd support was added through ee692a21e9bf ("fs,io_uring:
add infrastructure for uring-cmd"), this extended the struct file_operations to allow a new command which each subsystem can use to enable command passthrough. Add an LSM specific for the command passthrough which enables LSMs to inspect the command details.
This was discussed long ago without no clear pointer for something conclusive, so this enables LSMs to at least reject this new file operation.
[0] https://lkml.kernel.org/r/[email protected]
--- include/linux/lsm_hook_defs.h | 1 + include/linux/lsm_hooks.h | 3 +++ include/linux/security.h | 5 +++++ io_uring/io_uring.c | 4 ++++ security/security.c | 4 ++++ 5 files changed, 17 insertions(+)
include/linux/lsm_hook_defs.h +1 -0
@@ -406,4 +406,5 @@ LSM_HOOK(int, 0, perf_event_write, struc#ifdef CONFIG_IO_URING LSM_HOOK(int, 0, uring_override_creds, const struct cred *new) LSM_HOOK(int, 0, uring_sqpoll, void) +LSM_HOOK(int, 0, uring_cmd, struct io_uring_cmd *ioucmd)#endif /* CONFIG_IO_URING */
include/linux/lsm_hooks.h +3 -0
@@ -1575,6 +1575,9 @@* Check whether the current task is allowed to spawn a io_uring polling * thread (IORING_SETUP_SQPOLL). * +* @uring_cmd: +* Check whether the file_operations uring_cmd is allowed to run. +* */ union security_list_options {#define LSM_HOOK (RET ,DEFAULT ,NAME , ...) RET (*NAME)(__VA_ARGS__);
include/linux/security.h +5 -0
@@ -2051,6 +2051,7 @@ static inline int security_perf_event_wr#ifdef CONFIG_SECURITY extern int security_uring_override_creds (const struct cred *new);extern int security_uring_sqpoll (void ); +extern int security_uring_cmd (struct io_uring_cmd *ioucmd);#else static inline int security_uring_override_creds (const struct cred *new) {
@@ -2060,6 +2061,10 @@ static inline int security_uring_sqpoll( {return 0 ; } +static inline int security_uring_cmd (struct io_uring_cmd *ioucmd) +{ +return 0 ; +}#endif /* CONFIG_SECURITY */ #endif /* CONFIG_IO_URING */
io_uring/io_uring.c +4 -0
@@ -4878,6 +4878,10 @@ static int io_uring_cmd(struct io_kiocbif (!req->file->f_op->uring_cmd)return -EOPNOTSUPP ; + ret =security_uring_cmd (ioucmd); +if (ret) +return ret; +if (ctx->flags &IORING_SETUP_SQE128 ) issue_flags |=IO_URING_F_SQE128 ;if (ctx->flags &IORING_SETUP_CQE32 )
security/security.c +4 -0
@@ -2654,4 +2654,8 @@ int security_uring_sqpoll(void) {return call_int_hook (uring_sqpoll,0 ); } +int security_uring_cmd (struct io_uring_cmd *ioucmd) +{ +return call_int_hook (uring_cmd,0 , ioucmd); +}#endif /* CONFIG_IO_URING */
Greg Kroah-Hartman
maintainerPATCH 160/192 selinux: implement the security_uring_cmd() LSM hook
In reply to Greg Kroah-HartmanFrom: Paul Moore <[email protected]>
commit f4d653dcaa4e4056e1630423e6a8ece4869b544f upstream.
Add a SELinux access control for the iouring IORING_OP_URING_CMD command. This includes the addition of a new permission in the existing "io_uring" object class: "cmd". The subject of the new permission check is the domain of the process requesting access, the object is the open file which points to the device/file that is the target of the IORING_OP_URING_CMD operation. A sample policy rule is shown below:
allow <domain> <file>:io_uring { cmd };
--- security/selinux/hooks.c | 24 ++++++++++++++++++++++++ security/selinux/include/classmap.h | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-)
security/selinux/hooks.c +24 -0
@@ -91,6 +91,7 @@#include <uapi/linux/mount.h> #include <linux/fsnotify.h> #include <linux/fanotify.h> +#include <linux/io_uring.h> #include "avc.h" #include "objsec.h"
@@ -6990,6 +6991,28 @@ static int selinux_uring_sqpoll(void)return avc_has_perm (&selinux_state, sid, sid, SECCLASS_IO_URING, IO_URING__SQPOLL, NULL); } + +/** +* selinux_uring_cmd - check if IORING_OP_URING_CMD is allowed +* @ioucmd: the io_uring command structure +* +* Check to see if the current domain is allowed to execute an +* IORING_OP_URING_CMD against the device/file specified in @ioucmd. +* +*/ +static int selinux_uring_cmd (struct io_uring_cmd *ioucmd) +{ +struct file *file = ioucmd->file; +struct inode *inode =file_inode (file); +struct inode_security_struct *isec =selinux_inode (inode); +struct common_audit_data ad; + + ad.type =LSM_AUDIT_DATA_FILE ; + ad.u.file = file; + +return avc_has_perm (&selinux_state,current_sid (), isec->sid, +SECCLASS_IO_URING ,IO_URING__CMD , &ad); +}#endif /* CONFIG_IO_URING */ /*
@@ -7234,6 +7257,7 @@ static struct security_hook_list selinux#ifdef CONFIG_IO_URING LSM_HOOK_INIT (uring_override_creds, selinux_uring_override_creds),LSM_HOOK_INIT (uring_sqpoll, selinux_uring_sqpoll), + LSM_HOOK_INIT(uring_cmd, selinux_uring_cmd), #endif/*
security/selinux/include/classmap.h +1 -1
@@ -253,7 +253,7 @@ const struct security_class_mapping secc {"anon_inode" , { COMMON_FILE_PERMS, NULL } }, {"io_uring" , - { "override_creds", "sqpoll", NULL } }, + { "override_creds", "sqpoll", "cmd", NULL } }, { NULL } };
Greg Kroah-Hartman
maintainerPATCH 161/192 Smack: Provide read control for io_uring_cmd
In reply to Greg Kroah-HartmanFrom: Casey Schaufler <[email protected]>
commit dd9373402280cf4715fdc8fd5070f7d039e43511 upstream.
Limit io_uring "cmd" options to files for which the caller has Smack read access. There may be cases where the cmd option may be closer to a write access than a read, but there is no way to make that determination.
--- security/smack/smack_lsm.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
security/smack/smack_lsm.c +32 -0
@@ -42,6 +42,7 @@#include <linux/fs_context.h> #include <linux/fs_parser.h> #include <linux/watch_queue.h> +#include <linux/io_uring.h> #include "smack.h" #define TRANS_TRUE "TRUE"
@@ -4739,6 +4740,36 @@ static int smack_uring_sqpoll(void) return -EPERM; } +/** +* smack_uring_cmd - check on file operations for io_uring +* @ioucmd: the command in question +* +* Make a best guess about whether a io_uring "command" should +* be allowed. Use the same logic used for determining if the +* file could be opened for read in the absence of better criteria. +*/ +static int smack_uring_cmd (struct io_uring_cmd *ioucmd) +{ +struct file *file = ioucmd->file; +struct smk_audit_info ad; +struct task_smack *tsp; +struct inode *inode; +int rc; + +if (!file) +return -EINVAL ; + + tsp =smack_cred (file->f_cred); + inode =file_inode (file); + +smk_ad_init (&ad, __func__,LSM_AUDIT_DATA_PATH ); +smk_ad_setfield_u_fs_path (&ad, file->f_path); + rc =smk_tskacc (tsp,smk_of_inode (inode),MAY_READ , &ad); + rc =smk_bu_credfile (file->f_cred, file,MAY_READ , rc); + +return rc; +} +#endif /* CONFIG_IO_URING */ struct lsm_blob_sizes smack_blob_sizes __lsm_ro_after_init = {
@@ -4896,6 +4927,7 @@ static struct security_hook_list smack_h#ifdef CONFIG_IO_URING LSM_HOOK_INIT (uring_override_creds, smack_uring_override_creds),LSM_HOOK_INIT (uring_sqpoll, smack_uring_sqpoll), + LSM_HOOK_INIT(uring_cmd, smack_uring_cmd), #endif };
Greg Kroah-Hartman
maintainerPATCH 162/192 MIPS: loongson32: ls1c: Fix hang during startup
In reply to Greg Kroah-HartmanFrom: Yang Ling <[email protected]>
[ Upstream commit 35508d2424097f9b6a1a17aac94f702767035616 ]
The RTCCTRL reg of LS1C is obselete.
Writing this reg will cause system hang.
--- arch/mips/loongson32/ls1c/board.c | 1 - 1 file changed, 1 deletion(-)
arch/mips/loongson32/ls1c/board.c +0 -1
@@ -15,7 +15,6 @@ static struct platform_device *ls1c_platform_devices[] __initdata = {static int __init ls1c_platform_init (void ) {ls1x_serial_set_uartclk (&ls1x_uart_pdev); -ls1x_rtc_set_extclk (&ls1x_rtc_pdev);return platform_add_devices (ls1c_platform_devices,ARRAY_SIZE (ls1c_platform_devices));
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 163/192 kbuild: disable header exports for UML in a straightforward way
In reply to Greg Kroah-HartmanFrom: Masahiro Yamada <[email protected]>
[ Upstream commit 1b620d539ccc18a1aca1613d9ff078115a7891a1 ]
Previously 'make ARCH=um headers' stopped because of missing arch/um/include/uapi/asm/Kbuild.
The error is not shown since commit ed102bf2afed ("um: Fix W=1 missing-include-dirs warnings") added arch/um/include/uapi/asm/Kbuild.
Hard-code the unsupported architecture, so it works like before.
--- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Makefile +1 -2
@@ -1286,8 +1286,7 @@ hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj PHONY += headers headers: $(version_h) scripts_unifdef uapi-asm-generic archheaders archscripts - $(if $(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/Kbuild),, \ - $(error Headers not exportable for the $(SRCARCH) architecture)) + $(if $(filter um, $(SRCARCH)), $(error Headers not exportable for UML)) $(Q)$(MAKE) $(hdr-inst)=include/uapi $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 164/192 i40e: Refactor tc mqprio checks
In reply to Greg Kroah-HartmanFrom: Przemyslaw Patynowski <[email protected]>
[ Upstream commit 2313e69c84c024a85d017a60ae925085de47530a ]
Refactor bitwise checks for whether TC MQPRIO is enabled into one single method for improved readability.
Stable-dep-of: 45bb006d3c92 ("i40e: Fix ADQ rate limiting for PF")
--- drivers/net/ethernet/intel/i40e/i40e.h | 14 +++++++++++++ .../net/ethernet/intel/i40e/i40e_ethtool.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 20 +++++++++---------- 3 files changed, 25 insertions(+), 11 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +14 -0
@@ -1291,4 +1291,18 @@ int i40e_add_del_cloud_filter(struct i40e_vsi *vsi,int i40e_add_del_cloud_filter_big_buf (struct i40e_vsi *vsi,struct i40e_cloud_filter *filter,bool add); + +/** +* i40e_is_tc_mqprio_enabled - check if TC MQPRIO is enabled on PF +* @pf: pointer to a pf. +* +* Check and return value of flag I40E_FLAG_TC_MQPRIO. +* +* Return: I40E_FLAG_TC_MQPRIO set state. +**/ +static inline u32 i40e_is_tc_mqprio_enabled (struct i40e_pf *pf) +{ +return pf->flags &I40E_FLAG_TC_MQPRIO ; +} +#endif /* _I40E_H_ */
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +1 -1
@@ -4931,7 +4931,7 @@ static int i40e_set_channels(struct net_device *dev,/* We do not support setting channels via ethtool when TCs are * configured through mqprio */ -if (pf->flags &I40E_FLAG_TC_MQPRIO ) +if (i40e_is_tc_mqprio_enabled (pf))return -EINVAL ;/* verify they are not requesting separate vectors */
drivers/net/ethernet/intel/i40e/i40e_main.c +10 -10
@@ -5339,7 +5339,7 @@ static u8 i40e_pf_get_num_tc(struct i40e_pf *pf)u8 num_tc =0 ;struct i40e_dcbx_config *dcbcfg = &hw->local_dcbx_config; -if (pf->flags &I40E_FLAG_TC_MQPRIO ) +if (i40e_is_tc_mqprio_enabled (pf))return pf->vsi[pf->lan_vsi]->mqprio_qopt.qopt.num_tc;/* If neither MQPRIO nor DCB is enabled, then always use single TC */
@@ -5371,7 +5371,7 @@ static u8 i40e_pf_get_num_tc(struct i40e_pf *pf)**/ static u8 i40e_pf_get_tc_map (struct i40e_pf *pf) { -if (pf->flags &I40E_FLAG_TC_MQPRIO ) +if (i40e_is_tc_mqprio_enabled (pf))return i40e_mqprio_get_enabled_tc (pf);/* If neither MQPRIO nor DCB is enabled for this PF then just return
@@ -5468,7 +5468,7 @@ static int i40e_vsi_configure_bw_alloc(struct i40e_vsi *vsi, u8 enabled_tc,int i;/* There is no need to reset BW when mqprio mode is on. */ -if (pf->flags &I40E_FLAG_TC_MQPRIO ) +if (i40e_is_tc_mqprio_enabled (pf))return 0 ;if (!vsi->mqprio_qopt.qopt.hw && !(pf->flags &I40E_FLAG_DCB_ENABLED )) { ret =i40e_set_bw_limit (vsi, vsi->seid,0 );
@@ -5540,7 +5540,7 @@ static void i40e_vsi_config_netdev_tc(struct i40e_vsi *vsi, u8 enabled_tc) vsi->tc_config.tc_info[i].qoffset); } -if (pf->flags &I40E_FLAG_TC_MQPRIO ) +if (i40e_is_tc_mqprio_enabled (pf))return ;/* Assign UP2TC map for the VSI */
@@ -5701,7 +5701,7 @@ static int i40e_vsi_config_tc(struct i40e_vsi *vsi, u8 enabled_tc) ctxt.vf_num =0 ; ctxt.uplink_seid = vsi->uplink_seid; ctxt.info = vsi->info; -if (vsi->back->flags &I40E_FLAG_TC_MQPRIO ) { +if (i40e_is_tc_mqprio_enabled (pf)) { ret =i40e_vsi_setup_queue_map_mqprio (vsi, &ctxt, enabled_tc);if (ret) goto out;
@@ -6425,7 +6425,7 @@ int i40e_create_queue_channel(struct i40e_vsi *vsi, pf->flags |=I40E_FLAG_VEB_MODE_ENABLED ;if (vsi->type ==I40E_VSI_MAIN ) { -if (pf->flags &I40E_FLAG_TC_MQPRIO ) +if (i40e_is_tc_mqprio_enabled (pf))i40e_do_reset (pf,I40E_PF_RESET_FLAG , true);else i40e_do_reset_safe (pf,I40E_PF_RESET_FLAG );
@@ -7819,7 +7819,7 @@ static void *i40e_fwd_add(struct net_device *netdev, struct net_device *vdev)netdev_info (netdev,"Macvlans are not supported when DCB is enabled\n" );return ERR_PTR (-EINVAL ); } -if ((pf->flags &I40E_FLAG_TC_MQPRIO )) { +if (i40e_is_tc_mqprio_enabled (pf)) {netdev_info (netdev,"Macvlans are not supported when HW TC offload is on\n" );return ERR_PTR (-EINVAL ); }
@@ -8072,7 +8072,7 @@ static int i40e_setup_tc(struct net_device *netdev, void *type_data)/* Quiesce VSI queues */ i40e_quiesce_vsi (vsi); -if (!hw && !(pf->flags &I40E_FLAG_TC_MQPRIO )) +if (!hw && !i40e_is_tc_mqprio_enabled (pf))i40e_remove_queue_channels (vsi);/* Configure VSI for enabled TCs */
@@ -8096,7 +8096,7 @@ static int i40e_setup_tc(struct net_device *netdev, void *type_data)"Setup channel (id:%u) utilizing num_queues %d\n" , vsi->seid, vsi->tc_config.tc_info[0].qcount); -if (pf->flags &I40E_FLAG_TC_MQPRIO ) { +if (i40e_is_tc_mqprio_enabled (pf)) {if (vsi->mqprio_qopt.max_rate[0 ]) {u64 max_tx_rate = vsi->mqprio_qopt.max_rate[0 ];
@@ -10750,7 +10750,7 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)* unless I40E_FLAG_TC_MQPRIO was enabled or DCB * is not supported with new link speed */ -if (pf->flags &I40E_FLAG_TC_MQPRIO ) { +if (i40e_is_tc_mqprio_enabled (pf)) {i40e_aq_set_dcb_parameters (hw, false,NULL ); }else { if (I40E_IS_X710TL_DEVICE(hw->device_id) &&
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 165/192 i40e: Fix ADQ rate limiting for PF
In reply to Greg Kroah-HartmanFrom: Przemyslaw Patynowski <[email protected]>
[ Upstream commit 45bb006d3c924b1201ed43c87a96b437662dcaa8 ]
Fix HW rate limiting for ADQ.
Fallback to kernel queue selection for ADQ, as it is network stack that decides which queue to use for transmit with ADQ configured. Reset PF after creation of VMDq2 VSIs required for ADQ, as to reprogram TX queue contexts in i40e_configure_tx_ring. Without this patch PF would limit TX rate only according to TC0.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 3 +++ drivers/net/ethernet/intel/i40e/i40e_txrx.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +3 -0
@@ -6536,6 +6536,9 @@ static int i40e_configure_queue_channels(struct i40e_vsi *vsi) vsi->tc_seid_map[i] = ch->seid; } } + +/* reset to reconfigure TX queue contexts */ +i40e_do_reset (vsi->back,I40E_PF_RESET_FLAG , true);return ret; err_free:
drivers/net/ethernet/intel/i40e/i40e_txrx.c +2 -1
@@ -3689,7 +3689,8 @@ u16 i40e_lan_select_queue(struct net_device *netdev,u8 prio;/* is DCB enabled at all? */ -if (vsi->tc_config.numtc ==1 ) +if (vsi->tc_config.numtc ==1 || +i40e_is_tc_mqprio_enabled (vsi->back))return netdev_pick_tx (netdev, skb, sb_dev); prio = skb->priority;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 166/192 net: bonding: replace dev_trans_start() with the jiffies of the last ARP/NS
In reply to Greg Kroah-HartmanFrom: Vladimir Oltean <[email protected]>
[ Upstream commit 06799a9085e12a778fe2851db550ab5911ad28fe ]
The bonding driver piggybacks on time stamps kept by the network stack for the purpose of the netdev TX watchdog, and this is problematic because it does not work with NETIF_F_LLTX devices.
It is hard to say why the driver looks at dev_trans_start() of the slave->dev, considering that this is updated even by non-ARP/NS probes sent by us, and even by traffic not sent by us at all (for example PTP on physical slave devices). ARP monitoring in active-backup mode appears to still work even if we track only the last TX time of actual ARP probes.
Stable-dep-of: 592335a4164c ("bonding: accept unsolicited NA message")
--- drivers/net/bonding/bond_main.c | 35 +++++++++++++++++++-------------- include/net/bonding.h | 13 +++++++++++- 2 files changed, 32 insertions(+), 16 deletions(-)
drivers/net/bonding/bond_main.c +20 -15
@@ -1974,6 +1974,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,for (i =0 ; i <BOND_MAX_ARP_TARGETS ; i++) new_slave->target_last_arp_rx[i] = new_slave->last_rx; + new_slave->last_tx = new_slave->last_rx; +if (bond->params.miimon && !bond->params.use_carrier) { link_reporting =bond_check_dev_link (bond, slave_dev,1 );
@@ -2857,8 +2859,11 @@ static void bond_arp_send(struct slave *slave, int arp_op, __be32 dest_ip,return ; } -if (bond_handle_vlan (slave, tags, skb)) +if (bond_handle_vlan (slave, tags, skb)) { +slave_update_last_tx (slave);arp_xmit (skb); + } +return ; }
@@ -3047,8 +3052,7 @@ static int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, curr_active_slave->last_link_up))bond_validate_arp (bond, slave, tip, sip); else if (curr_arp_slave && (arp->ar_op == htons(ARPOP_REPLY)) && - bond_time_in_interval(bond, - dev_trans_start(curr_arp_slave->dev), 1)) + bond_time_in_interval(bond, slave_last_tx(curr_arp_slave), 1))bond_validate_arp (bond ,slave ,sip ,tip ); out_unlock:
@@ -3076,8 +3080,10 @@ static void bond_ns_send(struct slave *slave, const struct in6_addr *daddr, }addrconf_addr_solict_mult (daddr, &mcaddr); -if (bond_handle_vlan (slave, tags, skb)) +if (bond_handle_vlan (slave, tags, skb)) { +slave_update_last_tx (slave);ndisc_send_skb (skb, &mcaddr, saddr); + } }static void bond_ns_send_all (struct bonding *bond,struct slave *slave)
@@ -3222,8 +3228,7 @@ static int bond_na_rcv(const struct sk_buff *skb, struct bonding *bond, curr_active_slave->last_link_up))bond_validate_ns (bond, slave, saddr, daddr); else if (curr_arp_slave && - bond_time_in_interval(bond, - dev_trans_start(curr_arp_slave->dev), 1)) + bond_time_in_interval(bond, slave_last_tx(curr_arp_slave), 1)) bond_validate_ns(bond, slave, saddr, daddr); out:
@@ -3311,12 +3316,12 @@ static void bond_loadbalance_arp_mon(struct bonding *bond)* so it can wait */ bond_for_each_slave_rcu (bond, slave, iter) { -unsigned long trans_start =dev_trans_start (slave->dev); +unsigned long last_tx =slave_last_tx (slave);bond_propose_link_state (slave,BOND_LINK_NOCHANGE );if (slave->link !=BOND_LINK_UP ) { -if (bond_time_in_interval (bond, trans_start,1 ) && +if (bond_time_in_interval (bond, last_tx,1 ) &&bond_time_in_interval (bond, slave->last_rx,1 )) {bond_propose_link_state (slave,BOND_LINK_UP );
@@ -3341,7 +3346,7 @@ static void bond_loadbalance_arp_mon(struct bonding *bond)* when the source ip is 0, so don't take the link down * if we don't know our ip yet */ -if (!bond_time_in_interval (bond, trans_start, bond->params.missed_max) || +if (!bond_time_in_interval (bond, last_tx, bond->params.missed_max) || !bond_time_in_interval (bond, slave->last_rx, bond->params.missed_max)) {bond_propose_link_state (slave,BOND_LINK_DOWN );
@@ -3407,7 +3412,7 @@ static void bond_loadbalance_arp_mon(struct bonding *bond)*/ static int bond_ab_arp_inspect (struct bonding *bond) { -unsigned long trans_start, last_rx; +unsigned long last_tx, last_rx;struct list_head *iter;struct slave *slave;int commit =0 ;
@@ -3458,9 +3463,9 @@ static int bond_ab_arp_inspect(struct bonding *bond)* - (more than missed_max*delta since receive AND * the bond has an IP address) */ - trans_start =dev_trans_start (slave->dev); + last_tx =slave_last_tx (slave);if (bond_is_active_slave (slave) && - (!bond_time_in_interval (bond, trans_start, bond->params.missed_max) || + (!bond_time_in_interval (bond, last_tx, bond->params.missed_max) || !bond_time_in_interval (bond, last_rx, bond->params.missed_max))) {bond_propose_link_state (slave,BOND_LINK_DOWN ); commit++;
@@ -3477,8 +3482,8 @@ static int bond_ab_arp_inspect(struct bonding *bond)*/ static void bond_ab_arp_commit (struct bonding *bond) { -unsigned long trans_start;struct list_head *iter; +unsigned long last_tx;struct slave *slave;bond_for_each_slave (bond, slave, iter) {
@@ -3487,10 +3492,10 @@ static void bond_ab_arp_commit(struct bonding *bond)continue ;case BOND_LINK_UP : - trans_start =dev_trans_start (slave->dev); + last_tx =slave_last_tx (slave);if (rtnl_dereference (bond->curr_active_slave) != slave || (!rtnl_dereference (bond->curr_active_slave) && -bond_time_in_interval (bond, trans_start,1 ))) { +bond_time_in_interval (bond, last_tx,1 ))) {struct slave *current_arp_slave; current_arp_slave =rtnl_dereference (bond->current_arp_slave);
include/net/bonding.h +12 -1
@@ -161,8 +161,9 @@ struct slave {struct net_device *dev;/* first - useful for panic debug */ struct bonding *bond;/* our master */ int delay; -/* all three in jiffies */ +/* all 4 in jiffies */ unsigned long last_link_up; +unsigned long last_tx;unsigned long last_rx;unsigned long target_last_arp_rx[BOND_MAX_ARP_TARGETS ];s8 link;/* one of BOND_LINK_XXXX */
@@ -539,6 +540,16 @@ static inline unsigned long slave_last_rx(struct bonding *bond,return slave->last_rx; } +static inline void slave_update_last_tx (struct slave *slave) +{ +WRITE_ONCE (slave->last_tx, jiffies); +} + +static inline unsigned long slave_last_tx (struct slave *slave) +{ +return READ_ONCE (slave->last_tx); +} +#ifdef CONFIG_NET_POLL_CONTROLLER static inline netdev_tx_t bond_netpoll_send_skb (const struct slave *slave,struct sk_buff *skb)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 167/192 bonding: accept unsolicited NA message
In reply to Greg Kroah-HartmanFrom: Hangbin Liu <[email protected]>
[ Upstream commit 592335a4164c3c41f57967223a1e1efe3a0c6eb3 ]
The unsolicited NA message with all-nodes multicast dest address should be valid, as this also means the link could reach the target.
Also rename bond_validate_ns() to bond_validate_na().
--- drivers/net/bonding/bond_main.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
drivers/net/bonding/bond_main.c +12 -5
@@ -3174,12 +3174,19 @@ static bool bond_has_this_ip6(struct bonding *bond, struct in6_addr *addr)return ret; } -static void bond_validate_ns (struct bonding *bond,struct slave *slave, +static void bond_validate_na (struct bonding *bond,struct slave *slave,struct in6_addr *saddr,struct in6_addr *daddr) {int i; -if (ipv6_addr_any (saddr) || !bond_has_this_ip6 (bond, daddr)) { +/* Ignore NAs that: +* 1. Source address is unspecified address. +* 2. Dest address is neither all-nodes multicast address nor +* exist on bond interface. +*/ +if (ipv6_addr_any (saddr) || + (!ipv6_addr_equal (daddr, &in6addr_linklocal_allnodes) && + !bond_has_this_ip6 (bond, daddr))) {slave_dbg (bond->dev, slave->dev,"%s: sip %pI6c tip %pI6c not found\n" , __func__, saddr, daddr);return ;
@@ -3222,14 +3229,14 @@ static int bond_na_rcv(const struct sk_buff *skb, struct bonding *bond,* see bond_arp_rcv(). */ if (bond_is_active_slave (slave)) -bond_validate_ns (bond, slave, saddr, daddr); +bond_validate_na (bond, slave, saddr, daddr);else if (curr_active_slave &&time_after (slave_last_rx (bond, curr_active_slave), curr_active_slave->last_link_up)) -bond_validate_ns (bond, slave, saddr, daddr); +bond_validate_na (bond, slave, saddr, daddr);else if (curr_arp_slave &&bond_time_in_interval (bond,slave_last_tx (curr_arp_slave),1 )) -bond_validate_ns (bond, slave, saddr, daddr); +bond_validate_na (bond, slave, saddr, daddr); out:return RX_HANDLER_ANOTHER ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 168/192 swiotlb: avoid potential left shift overflow
In reply to Greg Kroah-HartmanFrom: Chao Gao <[email protected]>
[ Upstream commit 3f0461613ebcdc8c4073e235053d06d5aa58750f ]
The second operand passed to slot_addr() is declared as int or unsigned int in all call sites. The left-shift to get the offset of a slot can overflow if swiotlb size is larger than 4G.
Convert the macro to an inline function and declare the second argument as phys_addr_t to avoid the potential overflow.
--- kernel/dma/swiotlb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
kernel/dma/swiotlb.c +4 -1
@@ -464,7 +464,10 @@ static void swiotlb_bounce(struct device *dev, phys_addr_t tlb_addr, size_t size } } -#define slot_addr (start, idx) ((start) + ((idx) << IO_TLB_SHIFT)) +static inline phys_addr_t slot_addr (phys_addr_t start,phys_addr_t idx) +{ +return start + (idx <<IO_TLB_SHIFT ); +}/* * Carefully handle integer overflow which can occur when boundary_mask == ~0UL.
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 169/192 iommu/amd: use full 64-bit value in build_completion_wait()
In reply to Greg Kroah-HartmanFrom: John Sperbeck <[email protected]>
[ Upstream commit 94a568ce32038d8ff9257004bb4632e60eb43a49 ]
We started using a 64 bit completion value. Unfortunately, we only stored the low 32-bits, so a very large completion value would never be matched in iommu_completion_wait().
--- drivers/iommu/amd/iommu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iommu/amd/iommu.c +2 -1
@@ -874,7 +874,8 @@ static void build_completion_wait(struct iommu_cmd *cmd,memset (cmd,0 ,sizeof (*cmd)); cmd->data[0 ] =lower_32_bits (paddr) |CMD_COMPL_WAIT_STORE_MASK ; cmd->data[1 ] =upper_32_bits (paddr); - cmd->data[2 ] = data; + cmd->data[2 ] =lower_32_bits (data); + cmd->data[3 ] =upper_32_bits (data);CMD_SET_TYPE (cmd,CMD_COMPL_WAIT ); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 170/192 s390/boot: fix absolute zero lowcore corruption on boot
In reply to Greg Kroah-HartmanFrom: Alexander Gordeev <[email protected]>
[ Upstream commit 12dd19c159659ec9050f45dc8a2ff3c3917f4be3 ]
Crash dump always starts on CPU0. In case CPU0 is offline the prefix page is not installed and the absolute zero lowcore is used. However, struct lowcore::mcesad is never assigned and stays zero. That leads to __machine_kdump() -> save_vx_regs() call silently stores vector registers to the absolute lowcore at 0x11b0 offset.
--- arch/s390/kernel/nmi.c | 2 +- arch/s390/kernel/setup.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
arch/s390/kernel/nmi.c +1 -1
@@ -63,7 +63,7 @@ static inline unsigned long nmi_get_mcesa_size(void)* structure. The structure is required for machine check happening * early in the boot process. */ -static struct mcesa boot_mcesa__initdata __aligned(MCESA_MAX_SIZE) ; +static struct mcesa boot_mcesa__aligned(MCESA_MAX_SIZE) ;void __init nmi_alloc_mcesa_early (u64 *mcesad) {
arch/s390/kernel/setup.c +1 -0
@@ -486,6 +486,7 @@ static void __init setup_lowcore_dat_off(void)put_abs_lowcore (restart_data, lc->restart_data);put_abs_lowcore (restart_source, lc->restart_source);put_abs_lowcore (restart_psw, lc->restart_psw); +put_abs_lowcore (mcesad, lc->mcesad); lc->spinlock_lockval =arch_spin_lockval (0 ); lc->spinlock_index =0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 171/192 time64.h: consolidate uses of PSEC_PER_NSEC
In reply to Greg Kroah-HartmanFrom: Vladimir Oltean <[email protected]>
[ Upstream commit 837ced3a1a5d8bb1a637dd584711f31ae6b54d93 ]
Time-sensitive networking code needs to work with PTP times expressed in nanoseconds, and with packet transmission times expressed in picoseconds, since those would be fractional at higher than gigabit speed when expressed in nanoseconds.
Convert the existing uses in tc-taprio and the ocelot/felix DSA driver to a PSEC_PER_NSEC macro. This macro is placed in include/linux/time64.h as opposed to its relatives (PSEC_PER_SEC etc) from include/vdso/time64.h because the vDSO library does not (yet) need/use it.
Stable-dep-of: 11afdc6526de ("net: dsa: felix: tc-taprio intervals smaller than MTU should send at least one packet")
--- drivers/net/dsa/ocelot/felix_vsc9959.c | 5 +++-- include/linux/time64.h | 3 +++ net/sched/sch_taprio.c | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-)
drivers/net/dsa/ocelot/felix_vsc9959.c +3 -2
@@ -16,6 +16,7 @@#include <linux/iopoll.h> #include <linux/mdio.h> #include <linux/pci.h> +#include <linux/time.h> #include "felix.h" #define VSC9959_NUM_PORTS 6
@@ -1592,7 +1593,7 @@ static void vsc9959_tas_guard_bands_update(struct ocelot *ocelot, int port)u32 max_sdu;if (min_gate_len[tc] ==U64_MAX /* Gate always open */ || - min_gate_len[tc] *1000 > needed_bit_time_ps) { + min_gate_len[tc] *PSEC_PER_NSEC > needed_bit_time_ps) {/* Setting QMAXSDU_CFG to 0 disables oversized frame * dropping. */
@@ -1606,7 +1607,7 @@ static void vsc9959_tas_guard_bands_update(struct ocelot *ocelot, int port)* frame, make sure to enable oversize frame dropping * for frames larger than the smallest that would fit. */ - max_sdu =div_u64 (min_gate_len[tc] *1000 , + max_sdu =div_u64 (min_gate_len[tc] *PSEC_PER_NSEC , picos_per_byte);/* A TC gate may be completely closed, which is a * special case where all packets are oversized.
include/linux/time64.h +3 -0
@@ -20,6 +20,9 @@ struct itimerspec64 {struct timespec64 it_value; }; +/* Parameters used to convert the timespec values: */ +#define PSEC_PER_NSEC 1000L +/* Located here for timespec[64]_valid_strict */ #define TIME64_MAX ((s64)~((u64)1 << 63))#define TIME64_MIN (-TIME64_MAX - 1)
net/sched/sch_taprio.c +3 -2
@@ -18,6 +18,7 @@#include <linux/module.h> #include <linux/spinlock.h> #include <linux/rcupdate.h> +#include <linux/time.h> #include <net/netlink.h> #include <net/pkt_sched.h> #include <net/pkt_cls.h>
@@ -176,7 +177,7 @@ static ktime_t get_interval_end_time(struct sched_gate_list *sched,static int length_to_duration (struct taprio_sched *q,int len) { -return div_u64 (len *atomic64_read (&q->picos_per_byte),1000 ); +return div_u64 (len *atomic64_read (&q->picos_per_byte),PSEC_PER_NSEC ); }/* Returns the entry corresponding to next available interval. If
@@ -551,7 +552,7 @@ static struct sk_buff *taprio_peek(struct Qdisc *sch)static void taprio_set_budget (struct taprio_sched *q,struct sched_entry *entry) {atomic_set (&entry->budget, -div64_u64 ((u64 )entry->interval *1000 , +div64_u64 ((u64 )entry->interval *PSEC_PER_NSEC ,atomic64_read (&q->picos_per_byte))); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 172/192 net: dsa: felix: tc-taprio intervals smaller than MTU should send at least one packet
In reply to Greg Kroah-HartmanFrom: Vladimir Oltean <[email protected]>
[ Upstream commit 11afdc6526de0e0368c05da632a8c0d29fc60bb8 ]
The blamed commit broke tc-taprio schedules such as this one:
tc qdisc replace dev $swp1 root taprio \
num_tc 8 \
map 0 1 2 3 4 5 6 7 \
queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 \
base-time 0 \
sched-entry S 0x7f 990000 \
sched-entry S 0x80 10000 \
flags 0x2because the gate entry for TC 7 (S 0x80 10000 ns) now has a static guard band added earlier than its 'gate close' event, such that packet overruns won't occur in the worst case of the largest packet possible.
Since guard bands are statically determined based on the per-tc QSYS_QMAXSDU_CFG_* with a fallback on the port-based QSYS_PORT_MAX_SDU, we need to discuss what happens with TC 7 depending on kernel version, since the driver, prior to commit 55a515b1f5a9 ("net: dsa: felix: drop oversized frames with tc-taprio instead of hanging the port"), did not touch QSYS_QMAXSDU_CFG_*, and therefore relied on QSYS_PORT_MAX_SDU.
1 (before vsc9959_tas_guard_bands_update): QSYS_PORT_MAX_SDU defaults to
1518, and at gigabit this introduces a static guard band (independent of packet sizes) of 12144 ns, plus QSYS::HSCH_MISC_CFG.FRM_ADJ (bit time of 20 octets => 160 ns). But this is larger than the time window itself, of 10000 ns. So, the queue system never considers a frame with TC 7 as eligible for transmission, since the gate practically never opens, and these frames are forever stuck in the TX queues and hang the port.
2 (after vsc9959_tas_guard_bands_update): Under the sole goal of
enabling oversized frame dropping, we make an effort to set QSYS_QMAXSDU_CFG_7 to 1230 bytes. But QSYS_QMAXSDU_CFG_7 plays one more role, which we did not take into account: per-tc static guard band, expressed in L2 byte time (auto-adjusted for FCS and L1 overhead). There is a discrepancy between what the driver thinks (that there is no guard band, and 100% of min_gate_len[tc] is available for egress scheduling) and what the hardware actually does (crops the equivalent of QSYS_QMAXSDU_CFG_7 ns out of min_gate_len[tc]). In practice, this means that the hardware thinks it has exactly 0 ns for scheduling tc 7.
In both cases, even minimum sized Ethernet frames are stuck on egress rather than being considered for scheduling on TC 7, even if they would fit given a proper configuration. Considering the current situation, with vsc9959_tas_guard_bands_update(), frames between 60 octets and 1230 octets in size are not eligible for oversized dropping (because they are smaller than QSYS_QMAXSDU_CFG_7), but won't be considered as eligible for scheduling either, because the min_gate_len[7] (10000 ns) minus the guard band determined by QSYS_QMAXSDU_CFG_7 (1230 octets * 8 ns per octet == 9840 ns) minus the guard band auto-added for L1 overhead by QSYS::HSCH_MISC_CFG.FRM_ADJ (20 octets * 8 ns per octet == 160 octets) leaves 0 ns for scheduling in the queue system proper.
Investigating the hardware behavior, it becomes apparent that the queue system needs precisely 33 ns of 'gate open' time in order to consider a frame as eligible for scheduling to a tc. So the solution to this problem is to amend vsc9959_tas_guard_bands_update(), by giving the per-tc guard bands less space by exactly 33 ns, just enough for one frame to be scheduled in that interval. This allows the queue system to make forward progress for that port-tc, and prevents it from hanging.
--- drivers/net/dsa/ocelot/felix_vsc9959.c | 35 +++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-)
drivers/net/dsa/ocelot/felix_vsc9959.c +31 -4
@@ -22,6 +22,7 @@#define VSC9959_NUM_PORTS 6#define VSC9959_TAS_GCL_ENTRY_MAX 63 +#define VSC9959_TAS_MIN_GATE_LEN_NS 33#define VSC9959_VCAP_POLICER_BASE 63#define VSC9959_VCAP_POLICER_MAX 383#define VSC9959_SWITCH_PCI_BAR 4
@@ -1411,6 +1412,23 @@ static void vsc9959_mdio_bus_free(struct ocelot *ocelot)mdiobus_free (felix->imdio); } +/* The switch considers any frame (regardless of size) as eligible for +* transmission if the traffic class gate is open for at least 33 ns. +* Overruns are prevented by cropping an interval at the end of the gate time +* slot for which egress scheduling is blocked, but we need to still keep 33 ns +* available for one packet to be transmitted, otherwise the port tc will hang. +* This function returns the size of a gate interval that remains available for +* setting the guard band, after reserving the space for one egress frame. +*/ +static u64 vsc9959_tas_remaining_gate_len_ps (u64 gate_len_ns) +{ +/* Gate always open */ +if (gate_len_ns ==U64_MAX ) +return U64_MAX ; + +return (gate_len_ns -VSC9959_TAS_MIN_GATE_LEN_NS ) *PSEC_PER_NSEC ; +} +/* Extract shortest continuous gate open intervals in ns for each traffic class * of a cyclic tc-taprio schedule. If a gate is always open, the duration is * considered U64_MAX. If the gate is always closed, it is considered 0.
@@ -1590,10 +1608,13 @@ static void vsc9959_tas_guard_bands_update(struct ocelot *ocelot, int port)mutex_lock (&ocelot->fwd_domain_lock);for (tc =0 ; tc <OCELOT_NUM_TC ; tc++) { +u64 remaining_gate_len_ps;u32 max_sdu; -if (min_gate_len[tc] ==U64_MAX /* Gate always open */ || - min_gate_len[tc] *PSEC_PER_NSEC > needed_bit_time_ps) { + remaining_gate_len_ps = +vsc9959_tas_remaining_gate_len_ps (min_gate_len[tc]); + +if (remaining_gate_len_ps > needed_bit_time_ps) {/* Setting QMAXSDU_CFG to 0 disables oversized frame * dropping. */
@@ -1606,9 +1627,15 @@ static void vsc9959_tas_guard_bands_update(struct ocelot *ocelot, int port)/* If traffic class doesn't support a full MTU sized * frame, make sure to enable oversize frame dropping * for frames larger than the smallest that would fit. +* +* However, the exact same register, QSYS_QMAXSDU_CFG_*, +* controls not only oversized frame dropping, but also +* per-tc static guard band lengths, so it reduces the +* useful gate interval length. Therefore, be careful +* to calculate a guard band (and therefore max_sdu) +* that still leaves 33 ns available in the time slot. */ - max_sdu =div_u64 (min_gate_len[tc] *PSEC_PER_NSEC , - picos_per_byte); + max_sdu =div_u64 (remaining_gate_len_ps, picos_per_byte);/* A TC gate may be completely closed, which is a * special case where all packets are oversized. * Any limit smaller than 64 octets accomplishes this
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 173/192 hwmon: (mr75203) fix VM sensor allocation when "intel,vm-map" not defined
In reply to Greg Kroah-HartmanFrom: Eliav Farber <[email protected]>
[ Upstream commit 81114fc3d27bf5b06b2137d2fd2b63da656a8b90 ]
Bug - in case "intel,vm-map" is missing in device-tree ,'num' is set to 0, and no voltage channel infos are allocated.
The reason num is set to 0 when "intel,vm-map" is missing is to set the entire pvt->vm_idx[] with incremental channel numbers, but it didn't take into consideration that same num is used later in devm_kcalloc().
If "intel,vm-map" does exist there is no need to set the unspecified channels with incremental numbers, because the unspecified channels can't be accessed in pvt_read_in() which is the only other place besides the probe functions that uses pvt->vm_idx[].
This change fixes the bug by moving the incremental channel numbers setting to be done only if "intel,vm-map" property is defined (starting loop from 0), and removing 'num = 0'.
--- drivers/hwmon/mr75203.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/hwmon/mr75203.c +6 -8
@@ -584,7 +584,12 @@ static int mr75203_probe(struct platform_device *pdev) ret =device_property_read_u8_array (dev,"intel,vm-map" , pvt->vm_idx, vm_num);if (ret) { - num =0 ; +/* +* Incase intel,vm-map property is not defined, we +* assume incremental channel numbers. +*/ +for (i =0 ; i < vm_num; i++) + pvt->vm_idx[i] = i; }else {for (i =0 ; i < vm_num; i++) if (pvt->vm_idx[i] >= vm_num ||
@@ -594,13 +599,6 @@ static int mr75203_probe(struct platform_device *pdev) } } -/* -* Incase intel,vm-map property is not defined, we assume -* incremental channel numbers. -*/ -for (i = num; i < vm_num; i++) - pvt->vm_idx[i] = i; - in_config =devm_kcalloc (dev, num +1 ,sizeof (*in_config),GFP_KERNEL );if (!in_config)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 174/192 hwmon: (mr75203) update pvt->v_num and vm_num to the actual number of used sensors
In reply to Greg Kroah-HartmanFrom: Eliav Farber <[email protected]>
[ Upstream commit bb9195bd6664d94d71647631593e09f705ff5edd ]
This issue is relevant when "intel,vm-map" is set in device-tree, and defines a lower number of VMs than actually supported.
This change is needed for all places that use pvt->v_num or vm_num later on in the code.
--- drivers/hwmon/mr75203.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/hwmon/mr75203.c +2 -0
@@ -595,6 +595,8 @@ static int mr75203_probe(struct platform_device *pdev)if (pvt->vm_idx[i] >= vm_num || pvt->vm_idx[i] ==0xff ) { num = i; + pvt->v_num = i; + vm_num = i;break ; } }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 175/192 hwmon: (mr75203) fix voltage equation for negative source input
In reply to Greg Kroah-HartmanFrom: Eliav Farber <[email protected]>
[ Upstream commit 227a3a2fc31d8e4bb9c88d4804e19530af245b1b ]
According to Moortec Embedded Voltage Monitor (MEVM) series 3 data sheet, the minimum input signal is -100mv and maximum input signal is +1000mv.
The equation used to convert the digital word to voltage uses mixed types (*val signed and n unsigned), and on 64 bit machines also has different size, since sizeof(u32) = 4 and sizeof(long) = 8.
So when measuring a negative input, n will be small enough, such that PVT_N_CONST * n < PVT_R_CONST, and the result of (PVT_N_CONST * n - PVT_R_CONST) will overflow to a very big positive 32 bit number. Then when storing the result in *val it will be the same value just in 64 bit (instead of it representing a negative number which will what happen when sizeof(long) = 4).
When -1023 <= (PVT_N_CONST * n - PVT_R_CONST) <= -1
dividing the number by 1024 should result of in 0, but because ">> 10" is used, and the sign bit is used to fill the vacated bit positions, it results in -1 (0xf...fffff) which is wrong.
This change fixes the sign problem and supports negative values by casting n to long and replacing the shift right with div operation.
--- drivers/hwmon/mr75203.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/hwmon/mr75203.c +12 -2
@@ -201,8 +201,18 @@ static int pvt_read_in(struct device *dev, u32 attr, int channel, long *val)return ret; n &=SAMPLE_DATA_MSK ; -/* Convert the N bitstream count into voltage */ - *val = (PVT_N_CONST * n -PVT_R_CONST ) >>PVT_CONV_BITS ; +/* +* Convert the N bitstream count into voltage. +* To support negative voltage calculation for 64bit machines +* n must be cast to long, since n and *val differ both in +* signedness and in size. +* Division is used instead of right shift, because for signed +* numbers, the sign bit is used to fill the vacated bit +* positions, and if the number is negative, 1 is used. +* BIT(x) may not be used instead of (1 << x) because it's +* unsigned. +*/ + *val = (PVT_N_CONST * (long )n -PVT_R_CONST ) / (1 <<PVT_CONV_BITS );return 0 ;default :
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 176/192 hwmon: (mr75203) fix multi-channel voltage reading
In reply to Greg Kroah-HartmanFrom: Eliav Farber <[email protected]>
[ Upstream commit 91a9e063cdcfca8fe642b078d6fae4ce49187975 ]
Fix voltage allocation and reading to support all channels in all VMs. Prior to this change allocation and reading were done only for the first channel in each VM.
This change counts the total number of channels for allocation, and takes into account the channel offset when reading the sample data register.
--- drivers/hwmon/mr75203.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-)
drivers/hwmon/mr75203.c +17 -12
@@ -68,8 +68,9 @@/* VM Individual Macro Register */ #define VM_COM_REG_SIZE 0x200 -#define VM_SDIF_DONE (n) (VM_COM_REG_SIZE + 0x34 + 0x200 * (n)) -#define VM_SDIF_DATA (n) (VM_COM_REG_SIZE + 0x40 + 0x200 * (n)) +#define VM_SDIF_DONE (vm) (VM_COM_REG_SIZE + 0x34 + 0x200 * (vm)) +#define VM_SDIF_DATA (vm, ch) \ + (VM_COM_REG_SIZE + 0x40 + 0x200 * (vm) + 0x4 * (ch))/* SDA Slave Register */ #define IP_CTRL 0x00
@@ -115,6 +116,7 @@ struct pvt_device {u32 t_num;u32 p_num;u32 v_num; +u32 c_num;u32 ip_freq;u8 *vm_idx; };
@@ -178,14 +180,15 @@ static int pvt_read_in(struct device *dev, u32 attr, int channel, long *val) {struct pvt_device *pvt =dev_get_drvdata (dev);struct regmap *v_map = pvt->v_map; +u8 vm_idx, ch_idx;u32 n, stat; -u8 vm_idx;int ret; -if (channel >= pvt->v_num) +if (channel >= pvt->v_num * pvt->c_num)return -EINVAL ; - vm_idx = pvt->vm_idx[channel]; + vm_idx = pvt->vm_idx[channel / pvt->c_num]; + ch_idx = channel % pvt->c_num;switch (attr) {case hwmon_in_input:
@@ -196,7 +199,7 @@ static int pvt_read_in(struct device *dev, u32 attr, int channel, long *val)if (ret)return ret; - ret =regmap_read (v_map,VM_SDIF_DATA (vm_idx), &n); + ret =regmap_read (v_map,VM_SDIF_DATA (vm_idx, ch_idx), &n);if (ret <0 )return ret;
@@ -499,8 +502,8 @@ static int pvt_reset_control_deassert(struct device *dev, struct pvt_device *pvtstatic int mr75203_probe (struct platform_device *pdev) { +u32 ts_num, vm_num, pd_num, ch_num, val, index, i;const struct hwmon_channel_info **pvt_info; -u32 ts_num, vm_num, pd_num, val, index, i;struct device *dev = &pdev->dev;u32 *temp_config, *in_config;struct device *hwmon_dev;
@@ -541,9 +544,11 @@ static int mr75203_probe(struct platform_device *pdev) ts_num = (val &TS_NUM_MSK ) >>TS_NUM_SFT ; pd_num = (val &PD_NUM_MSK ) >>PD_NUM_SFT ; vm_num = (val &VM_NUM_MSK ) >>VM_NUM_SFT ; + ch_num = (val &CH_NUM_MSK ) >>CH_NUM_SFT ; pvt->t_num = ts_num; pvt->p_num = pd_num; pvt->v_num = vm_num; + pvt->c_num = ch_num; val =0 ;if (ts_num) val++;
@@ -580,7 +585,7 @@ static int mr75203_probe(struct platform_device *pdev) }if (vm_num) { -u32 num = vm_num; +u32 total_ch; ret =pvt_get_regmap (pdev,"vm" , pvt);if (ret)
@@ -604,20 +609,20 @@ static int mr75203_probe(struct platform_device *pdev)for (i =0 ; i < vm_num; i++)if (pvt->vm_idx[i] >= vm_num || pvt->vm_idx[i] ==0xff ) { - num = i; pvt->v_num = i; vm_num = i;break ; } } - in_config =devm_kcalloc (dev, num +1 , + total_ch = ch_num * vm_num; + in_config =devm_kcalloc (dev, total_ch +1 ,sizeof (*in_config),GFP_KERNEL );if (!in_config)return -ENOMEM ; -memset32 (in_config,HWMON_I_INPUT , num); - in_config[num] =0 ; +memset32 (in_config,HWMON_I_INPUT , total_ch); + in_config[total_ch] =0 ; pvt_in.config = in_config; pvt_info[index++] = &pvt_in;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 177/192 hwmon: (mr75203) enable polling for all VM channels
In reply to Greg Kroah-HartmanFrom: Eliav Farber <[email protected]>
[ Upstream commit e43212e0f55dc2d6b15d6c174cc0a64b25fab5e7 ]
Configure ip-polling register to enable polling for all voltage monitor channels.
This enables reading the voltage values for all inputs other than just input 0.
--- drivers/hwmon/mr75203.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/hwmon/mr75203.c +13 -0
@@ -388,6 +388,19 @@ static int pvt_init(struct pvt_device *pvt)if (ret)return ret; + val = (BIT (pvt->c_num) -1 ) |VM_CH_INIT | +IP_POLL <<SDIF_ADDR_SFT |SDIF_WRN_W |SDIF_PROG ; + ret =regmap_write (v_map,SDIF_W , val); +if (ret <0 ) +return ret; + + ret =regmap_read_poll_timeout (v_map,SDIF_STAT , + val, !(val &SDIF_BUSY ), +PVT_POLL_DELAY_US , +PVT_POLL_TIMEOUT_US ); +if (ret) +return ret; + val =CFG1_VOL_MEAS_MODE |CFG1_PARALLEL_OUT |CFG1_14_BIT |IP_CFG <<SDIF_ADDR_SFT |SDIF_WRN_W |SDIF_PROG ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 178/192 iommu/vt-d: Fix possible recursive locking in intel_iommu_init()
In reply to Greg Kroah-HartmanFrom: Lu Baolu <[email protected]>
[ Upstream commit 9cd4f1434479f1ac25c440c421fbf52069079914 ]
The global rwsem dmar_global_lock was introduced by commit 3a5670e8ac932 ("iommu/vt-d: Introduce a rwsem to protect global data structures"). It is used to protect DMAR related global data from DMAR hotplug operations.
The dmar_global_lock used in the intel_iommu_init() might cause recursive locking issue, for example, intel_iommu_get_resv_regions() is taking the dmar_global_lock from within a section where intel_iommu_init() already holds it via probe_acpi_namespace_devices().
Using dmar_global_lock in intel_iommu_init() could be relaxed since it is unlikely that any IO board must be hot added before the IOMMU subsystem is initialized. This eliminates the possible recursive locking issue by moving down DMAR hotplug support after the IOMMU is initialized and removing the uses of dmar_global_lock in intel_iommu_init().
--- drivers/iommu/intel/dmar.c | 7 +++++++ drivers/iommu/intel/iommu.c | 27 ++------------------------- include/linux/dmar.h | 4 +++- 3 files changed, 12 insertions(+), 26 deletions(-)
drivers/iommu/intel/dmar.c +7 -0
@@ -2368,6 +2368,13 @@ static int dmar_device_hotplug(acpi_handle handle, bool insert)if (!dmar_in_use ())return 0 ; +/* +* It's unlikely that any I/O board is hot added before the IOMMU +* subsystem is initialized. +*/ +if (IS_ENABLED (CONFIG_INTEL_IOMMU ) && !intel_iommu_enabled) +return -EOPNOTSUPP ; +if (dmar_detect_dsm (handle,DMAR_DSM_FUNC_DRHD )) { tmp = handle; }else {
drivers/iommu/intel/iommu.c +2 -25
@@ -3123,13 +3123,7 @@ static int __init init_dmars(void)#ifdef CONFIG_INTEL_IOMMU_SVM if (pasid_supported (iommu) &&ecap_prs (iommu->ecap)) { -/* -* Call dmar_alloc_hwirq() with dmar_global_lock held, -* could cause possible lock race condition. -*/ -up_write (&dmar_global_lock); ret =intel_svm_enable_prq (iommu); -down_write (&dmar_global_lock);if (ret) goto free_iommu; }
@@ -4035,7 +4029,6 @@ int __init intel_iommu_init(void) force_on = (!intel_iommu_tboot_noforce &&tboot_force_iommu ()) ||platform_optin_force_iommu (); -down_write (&dmar_global_lock);if (dmar_table_init ()) {if (force_on)panic ("tboot: Failed to initialize DMAR table\n" );
@@ -4048,16 +4041,6 @@ int __init intel_iommu_init(void) goto out_free_dmar; } -up_write (&dmar_global_lock); - -/* -* The bus notifier takes the dmar_global_lock, so lockdep will -* complain later when we register it under the lock. -*/ -dmar_register_bus_notifier (); - -down_write (&dmar_global_lock); -if (!no_iommu)intel_iommu_debugfs_init ();
@@ -4105,11 +4088,9 @@ int __init intel_iommu_init(void)pr_err ("Initialization failed\n" ); goto out_free_dmar; } -up_write (&dmar_global_lock);init_iommu_pm_ops (); -down_read (&dmar_global_lock);for_each_active_iommu (iommu, drhd) {/* * The flush queue implementation does not perform
@@ -4127,13 +4108,11 @@ int __init intel_iommu_init(void) "%s", iommu->name);iommu_device_register (&iommu->iommu, &intel_iommu_ops,NULL ); } -up_read (&dmar_global_lock);bus_set_iommu (&pci_bus_type, &intel_iommu_ops);if (si_domain && !hw_pass_through)register_memory_notifier (&intel_iommu_memory_nb); -down_read (&dmar_global_lock);if (probe_acpi_namespace_devices ())pr_warn ("ACPI name space devices didn't probe correctly\n" );
@@ -4144,17 +4123,15 @@ int __init intel_iommu_init(void)iommu_disable_protect_mem_regions (iommu); } -up_read (&dmar_global_lock); - -pr_info ("Intel(R) Virtualization Technology for Directed I/O\n" ); intel_iommu_enabled =1 ; +dmar_register_bus_notifier (); +pr_info ("Intel(R) Virtualization Technology for Directed I/O\n" );return 0 ; out_free_dmar:intel_iommu_free_dmars (); -up_write (&dmar_global_lock);return ret; }
include/linux/dmar.h +3 -1
@@ -69,6 +69,7 @@ struct dmar_pci_notify_info {extern struct rw_semaphore dmar_global_lock;extern struct list_head dmar_drhd_units; +extern int intel_iommu_enabled;#define for_each_drhd_unit (drhd) \ list_for_each_entry_rcu(drhd, &dmar_drhd_units, list, \
@@ -92,7 +93,8 @@ extern struct list_head dmar_drhd_units;static inline bool dmar_rcu_check (void ) {return rwsem_is_locked (&dmar_global_lock) || - system_state ==SYSTEM_BOOTING ; + system_state ==SYSTEM_BOOTING || + (IS_ENABLED (CONFIG_INTEL_IOMMU ) && !intel_iommu_enabled); }#define dmar_rcu_dereference (p) rcu_dereference_check((p), dmar_rcu_check())
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 179/192 perf evlist: Always use arch_evlist__add_default_attrs()
In reply to Greg Kroah-HartmanFrom: Kan Liang <[email protected]>
[ Upstream commit a9c1ecdabc4f2ef04ef5334b8deb3a5c5910136d ]
Current perf stat uses the evlist__add_default_attrs() to add the generic default attrs, and uses arch_evlist__add_default_attrs() to add the Arch specific default attrs, e.g., Topdown for x86.
It works well for the non-hybrid platforms. However, for a hybrid platform, the hard code generic default attrs don't work.
Uses arch_evlist__add_default_attrs() to replace the evlist__add_default_attrs(). The arch_evlist__add_default_attrs() is modified to invoke the same __evlist__add_default_attrs() for the generic default attrs. No functional change.
Add default_null_attrs[] to indicate the arch specific attrs. No functional change for the arch specific default attrs either.
Stable-dep-of: f0c86a2bae4f ("perf stat: Fix L2 Topdown metrics disappear for raw events")
--- tools/perf/arch/x86/util/evlist.c | 7 ++++++- tools/perf/builtin-stat.c | 6 +++++- tools/perf/util/evlist.c | 9 +++++++-- tools/perf/util/evlist.h | 7 +++++-- 4 files changed, 23 insertions(+), 6 deletions(-)
tools/perf/arch/x86/util/evlist.c +6 -1
@@ -8,8 +8,13 @@#define TOPDOWN_L1_EVENTS "{slots,topdown-retiring,topdown-bad-spec,topdown-fe-bound,topdown-be-bound}"#define TOPDOWN_L2_EVENTS "{slots,topdown-retiring,topdown-bad-spec,topdown-fe-bound,topdown-be-bound,topdown-heavy-ops,topdown-br-mispredict,topdown-fetch-lat,topdown-mem-bound}" -int arch_evlist__add_default_attrs (struct evlist *evlist) +int arch_evlist__add_default_attrs (struct evlist *evlist, +struct perf_event_attr *attrs, +size_t nr_attrs) { +if (nr_attrs) +return __evlist__add_default_attrs (evlist, attrs, nr_attrs); +if (!pmu_have_event ("cpu" ,"slots" ))return 0 ;
tools/perf/builtin-stat.c +5 -1
@@ -1778,6 +1778,9 @@ static int add_default_attributes(void) (PERF_COUNT_HW_CACHE_OP_PREFETCH << 8) | (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) }, }; + +struct perf_event_attr default_null_attrs[] = {}; +/* Set attrs if no event is selected and !null_run: */ if (stat_config.null_run)return 0 ;
@@ -1959,7 +1962,8 @@ static int add_default_attributes(void)return -1 ; stat_config.topdown_level =TOPDOWN_MAX_LEVEL ; -if (arch_evlist__add_default_attrs (evsel_list) <0 ) +/* Platform specific attrs */ +if (evlist__add_default_attrs (evsel_list, default_null_attrs) <0 )return -1 ; }
tools/perf/util/evlist.c +7 -2
@@ -342,9 +342,14 @@ int __evlist__add_default_attrs(struct evlist *evlist, struct perf_event_attr *areturn evlist__add_attrs (evlist, attrs, nr_attrs); } -__weak int arch_evlist__add_default_attrs (struct evlist *evlist__maybe_unused ) +__weak int arch_evlist__add_default_attrs (struct evlist *evlist, +struct perf_event_attr *attrs, +size_t nr_attrs) { -return 0 ; +if (!nr_attrs) +return 0 ; + +return __evlist__add_default_attrs (evlist, attrs, nr_attrs); }struct evsel *evlist__find_tracepoint_by_id (struct evlist *evlist,int id)
tools/perf/util/evlist.h +5 -2
@@ -107,10 +107,13 @@ static inline int evlist__add_default(struct evlist *evlist)int __evlist__add_default_attrs (struct evlist *evlist,struct perf_event_attr *attrs,size_t nr_attrs); +int arch_evlist__add_default_attrs (struct evlist *evlist, +struct perf_event_attr *attrs, +size_t nr_attrs); +#define evlist__add_default_attrs (evlist, array) \ - __evlist__add_default_attrs(evlist, array, ARRAY_SIZE(array)) + arch_evlist__add_default_attrs(evlist, array, ARRAY_SIZE(array)) -int arch_evlist__add_default_attrs (struct evlist *evlist);struct evsel *arch_evlist__leader (struct list_head *list);int evlist__add_dummy (struct evlist *evlist);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 180/192 perf stat: Fix L2 Topdown metrics disappear for raw events
In reply to Greg Kroah-HartmanFrom: Zhengjun Xing <[email protected]>
[ Upstream commit f0c86a2bae4fd12bfa8bad4d43fb59fb498cdd14 ]
In perf/Documentation/perf-stat.txt, for "--td-level" the default "0" means the max level that the current hardware support.
So we need initialize the stat_config.topdown_level to TOPDOWN_MAX_LEVEL when “--td-level=0” or no “--td-level” option. Otherwise, for the hardware with a max level is 2, the 2nd level metrics disappear for raw events in this case.
The issue cannot be observed for the perf stat default or "--topdown" options. This commit fixes the raw events issue and removes the duplicated code for the perf stat default.
Before:
# ./perf stat -e "cpu-clock,context-switches,cpu-migrations,page-faults,instructions,cycles,ref-cycles,branches,branch-misses,{slots,topdown-retiring,topdown-bad-spec,topdown-fe-bound,topdown-be-bound,topdown-heavy-ops,topdown-br-mispredict,topdown-fetch-lat,topdown-mem-bound}" sleep 1Performance counter stats for 'sleep 1':
1.03 msec cpu-clock # 0.001 CPUs utilized
1 context-switches # 966.216 /sec
0 cpu-migrations # 0.000 /sec
60 page-faults # 57.973 K/sec
1,132,112 instructions # 1.41 insn per cycle
803,872 cycles # 0.777 GHz
1,909,120 ref-cycles # 1.845 G/sec
236,634 branches # 228.640 M/sec
6,367 branch-misses # 2.69% of all branches
4,823,232 slots # 4.660 G/sec
1,210,536 topdown-retiring # 25.1% Retiring
699,841 topdown-bad-spec # 14.5% Bad Speculation
1,777,975 topdown-fe-bound # 36.9% Frontend Bound
1,134,878 topdown-be-bound # 23.5% Backend Bound
189,146 topdown-heavy-ops # 182.756 M/sec
662,012 topdown-br-mispredict # 639.647 M/sec
1,097,048 topdown-fetch-lat # 1.060 G/sec
416,121 topdown-mem-bound # 402.063 M/sec 1.002423690 seconds time elapsed
0.002494000 seconds user
0.000000000 seconds sysAfter:
# ./perf stat -e "cpu-clock,context-switches,cpu-migrations,page-faults,instructions,cycles,ref-cycles,branches,branch-misses,{slots,topdown-retiring,topdown-bad-spec,topdown-fe-bound,topdown-be-bound,topdown-heavy-ops,topdown-br-mispredict,topdown-fetch-lat,topdown-mem-bound}" sleep 1Performance counter stats for 'sleep 1':
1.13 msec cpu-clock # 0.001 CPUs utilized
1 context-switches # 882.128 /sec
0 cpu-migrations # 0.000 /sec
61 page-faults # 53.810 K/sec
1,137,612 instructions # 1.29 insn per cycle
881,477 cycles # 0.778 GHz
2,093,496 ref-cycles # 1.847 G/sec
236,356 branches # 208.496 M/sec
7,090 branch-misses # 3.00% of all branches
5,288,862 slots # 4.665 G/sec
1,223,697 topdown-retiring # 23.1% Retiring
767,403 topdown-bad-spec # 14.5% Bad Speculation
2,053,322 topdown-fe-bound # 38.8% Frontend Bound
1,244,438 topdown-be-bound # 23.5% Backend Bound
186,665 topdown-heavy-ops # 3.5% Heavy Operations # 19.6% Light Operations
725,922 topdown-br-mispredict # 13.7% Branch Mispredict # 0.8% Machine Clears
1,327,400 topdown-fetch-lat # 25.1% Fetch Latency # 13.7% Fetch Bandwidth
497,775 topdown-mem-bound # 9.4% Memory Bound # 14.1% Core Bound 1.002701530 seconds time elapsed
0.002744000 seconds user
0.000000000 seconds sys--- tools/perf/builtin-stat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
tools/perf/builtin-stat.c +3 -2
@@ -1944,6 +1944,9 @@ static int add_default_attributes(void)free (str); } +if (!stat_config.topdown_level) + stat_config.topdown_level =TOPDOWN_MAX_LEVEL ; +if (!evsel_list->core.nr_entries) {if (target__has_cpu (&target)) default_attrs0[0 ].config =PERF_COUNT_SW_CPU_CLOCK ;
@@ -1960,8 +1963,6 @@ static int add_default_attributes(void) }if (evlist__add_default_attrs (evsel_list, default_attrs1) <0 )return -1 ; - - stat_config.topdown_level =TOPDOWN_MAX_LEVEL ;/* Platform specific attrs */ if (evlist__add_default_attrs (evsel_list, default_null_attrs) <0 )return -1 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 181/192 Revert "arm64: kasan: Revert "arm64: mte: reset the page tag in page->flags""
In reply to Greg Kroah-HartmanThis reverts commit add4bc9281e8704e5ab15616b429576c84f453a2.
Quoted 11 lines · Catalin Marinas
I missed this (holidays) and it looks like it's in stable already. On its own it will likely break
kasan_hwif used together with user-space MTE as this change relies on two previous commits:
70c248aca9e7("mm: kasan: Skip unpoisoning of user pages")6d05141a3930("mm: kasan: Skip page unpoisoning only if__GFP_SKIP_KASAN_UNPOISON")The reason I did not cc stable is that there are other dependencies in this area. The potential issues without the above commits were rather theoretical, so take these patches rather as clean-ups/refactoring than fixes.
--- arch/arm64/kernel/hibernate.c | 5 +++++ arch/arm64/kernel/mte.c | 9 +++++++++ arch/arm64/mm/copypage.c | 9 +++++++++ arch/arm64/mm/mteswap.c | 9 +++++++++ 4 files changed, 32 insertions(+)
arch/arm64/kernel/hibernate.c +5 -0
@@ -300,6 +300,11 @@ static void swsusp_mte_restore_tags(void)unsigned long pfn = xa_state.xa_index;struct page *page =pfn_to_online_page (pfn); +/* +* It is not required to invoke page_kasan_tag_reset(page) +* at this point since the tags stored in page->flags are +* already restored. +*/ mte_restore_page_tags (page_address (page), tags);mte_free_tag_storage (tags);
arch/arm64/kernel/mte.c +9 -0
@@ -48,6 +48,15 @@ static void mte_sync_page_tags(struct page *page, pte_t old_pte,if (!pte_is_tagged)return ; +page_kasan_tag_reset (page); +/* +* We need smp_wmb() in between setting the flags and clearing the +* tags because if another thread reads page->flags and builds a +* tagged address out of it, there is an actual dependency to the +* memory access, but on the current thread we do not guarantee that +* the new page->flags are visible before the tags were updated. +*/ +smp_wmb ();mte_clear_page_tags (page_address (page)); }
arch/arm64/mm/copypage.c +9 -0
@@ -23,6 +23,15 @@ void copy_highpage(struct page *to, struct page *from)if (system_supports_mte () &&test_bit (PG_mte_tagged, &from->flags)) {set_bit (PG_mte_tagged, &to->flags); +page_kasan_tag_reset (to); +/* +* We need smp_wmb() in between setting the flags and clearing the +* tags because if another thread reads page->flags and builds a +* tagged address out of it, there is an actual dependency to the +* memory access, but on the current thread we do not guarantee that +* the new page->flags are visible before the tags were updated. +*/ +smp_wmb ();mte_copy_page_tags (kto, kfrom); } }
arch/arm64/mm/mteswap.c +9 -0
@@ -53,6 +53,15 @@ bool mte_restore_tags(swp_entry_t entry, struct page *page)if (!tags)return false; +page_kasan_tag_reset (page); +/* +* We need smp_wmb() in between setting the flags and clearing the +* tags because if another thread reads page->flags and builds a +* tagged address out of it, there is an actual dependency to the +* memory access, but on the current thread we do not guarantee that +* the new page->flags are visible before the tags were updated. +*/ +smp_wmb ();mte_restore_page_tags (page_address (page), tags);return true;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 182/192 hwmon: (asus-ec-sensors) add support for Strix Z690-a D4
In reply to Greg Kroah-HartmanFrom: Shady Nawara <[email protected]>
[ Upstream commit bae26b801f98bc902ab4a43c96947f3a0ce4f3a0 ]
adds T_Sensor and VRM Temp sensors for the Asus Strix z690-a D4 motherboard
Stable-dep-of: 88700d1396ba ("hwmon: (asus-ec-sensors) autoload module via DMI data")
--- Documentation/hwmon/asus_ec_sensors.rst | 1 + drivers/hwmon/asus-ec-sensors.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+)
Documentation/hwmon/asus_ec_sensors.rst +1 -0
@@ -19,6 +19,7 @@ Supported boards: * ROG STRIX X570-E GAMING WIFI II * ROG STRIX X570-F GAMING * ROG STRIX X570-I GAMING + * ROG STRIX Z690-A GAMING WIFI D4 Authors: - Eugene Shalygin <[email protected]>
drivers/hwmon/asus-ec-sensors.c +18 -0
@@ -54,6 +54,8 @@ static char *mutex_path_override;/* ACPI mutex for locking access to the EC for the firmware */ #define ASUS_HW_ACCESS_MUTEX_ASMX "\\AMW0.ASMX" +#define ASUS_HW_ACCESS_MUTEX_RMTW_ASMX "\\RMTW.ASMX" +#define MAX_IDENTICAL_BOARD_VARIATIONS 3/* Moniker for the ACPI global lock (':' is not allowed in ASL identifiers) */
@@ -139,6 +141,7 @@ enum board_family { family_unknown, family_amd_400_series, family_amd_500_series, + family_intel_600_series };/* All the known sensors for ASUS EC controllers */
@@ -197,6 +200,12 @@ static const struct ec_sensor_info sensors_family_amd_500[] = { EC_SENSOR("Water_Out", hwmon_temp, 1, 0x01, 0x01), }; +static const struct ec_sensor_info sensors_family_intel_600[] = { + [ec_sensor_temp_t_sensor] = +EC_SENSOR ("T_Sensor" , hwmon_temp,1 ,0x00 ,0x3d ), + [ec_sensor_temp_vrm] =EC_SENSOR ("VRM" , hwmon_temp,1 ,0x00 ,0x3e ), +}; +/* Shortcuts for common combinations */ #define SENSOR_SET_TEMP_CHIPSET_CPU_MB \ (SENSOR_TEMP_CHIPSET | SENSOR_TEMP_CPU | SENSOR_TEMP_MB)
@@ -330,6 +339,12 @@ static const struct ec_board_info board_info[] = { .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX, .family = family_amd_500_series, }, + { + .board_names = {"ROG STRIX Z690-A GAMING WIFI D4"}, + .sensors = SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM, + .mutex_path = ASUS_HW_ACCESS_MUTEX_RMTW_ASMX, + .family = family_intel_600_series, + }, {} };
@@ -799,6 +814,9 @@ static int __init asus_ec_probe(struct platform_device *pdev)case family_amd_500_series: ec_data->sensors_info = sensors_family_amd_500;break ; +case family_intel_600_series: + ec_data->sensors_info = sensors_family_intel_600; +break ;default :dev_err (dev,"Unknown board family: %d" , ec_data->board_info->family);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 183/192 hwmon: (asus-ec-sensors) add support for Maximus XI Hero
In reply to Greg Kroah-HartmanFrom: Michael Carns <[email protected]>
[ Upstream commit 8f9eb10ff71d8e3beeee3f8d19050223600faf85 ]
Add definitions for ROG MAXIMUS XI HERO and ROG MAXIMUS XI HERO (WI-FI) boards.
Stable-dep-of: 88700d1396ba ("hwmon: (asus-ec-sensors) autoload module via DMI data")
--- Documentation/hwmon/asus_ec_sensors.rst | 2 ++ drivers/hwmon/asus-ec-sensors.c | 36 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+)
Documentation/hwmon/asus_ec_sensors.rst +2 -0
@@ -13,6 +13,8 @@ Supported boards: * ROG CROSSHAIR VIII FORMULA * ROG CROSSHAIR VIII HERO * ROG CROSSHAIR VIII IMPACT + * ROG MAXIMUS XI HERO + * ROG MAXIMUS XI HERO (WI-FI) * ROG STRIX B550-E GAMING * ROG STRIX B550-I GAMING * ROG STRIX X570-E GAMING
drivers/hwmon/asus-ec-sensors.c +36 -0
@@ -141,6 +141,7 @@ enum board_family { family_unknown, family_amd_400_series, family_amd_500_series, + family_intel_300_series, family_intel_600_series };
@@ -200,6 +201,26 @@ static const struct ec_sensor_info sensors_family_amd_500[] = { EC_SENSOR("Water_Out", hwmon_temp, 1, 0x01, 0x01), }; +static const struct ec_sensor_info sensors_family_intel_300[] = { + [ec_sensor_temp_chipset] = +EC_SENSOR ("Chipset" , hwmon_temp,1 ,0x00 ,0x3a ), + [ec_sensor_temp_cpu] =EC_SENSOR ("CPU" , hwmon_temp,1 ,0x00 ,0x3b ), + [ec_sensor_temp_mb] = +EC_SENSOR ("Motherboard" , hwmon_temp,1 ,0x00 ,0x3c ), + [ec_sensor_temp_t_sensor] = +EC_SENSOR ("T_Sensor" , hwmon_temp,1 ,0x00 ,0x3d ), + [ec_sensor_temp_vrm] =EC_SENSOR ("VRM" , hwmon_temp,1 ,0x00 ,0x3e ), + [ec_sensor_fan_cpu_opt] = +EC_SENSOR ("CPU_Opt" , hwmon_fan,2 ,0x00 ,0xb0 ), + [ec_sensor_fan_vrm_hs] =EC_SENSOR ("VRM HS" , hwmon_fan,2 ,0x00 ,0xb2 ), + [ec_sensor_fan_water_flow] = +EC_SENSOR ("Water_Flow" , hwmon_fan,2 ,0x00 ,0xbc ), + [ec_sensor_temp_water_in] = +EC_SENSOR ("Water_In" , hwmon_temp,1 ,0x01 ,0x00 ), + [ec_sensor_temp_water_out] = +EC_SENSOR ("Water_Out" , hwmon_temp,1 ,0x01 ,0x01 ), +}; +static const struct ec_sensor_info sensors_family_intel_600[] = { [ec_sensor_temp_t_sensor] =EC_SENSOR ("T_Sensor" , hwmon_temp,1 ,0x00 ,0x3d ),
@@ -281,6 +302,18 @@ static const struct ec_board_info board_info[] = { .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX, .family = family_amd_500_series, }, + { + .board_names = { +"ROG MAXIMUS XI HERO" , + "ROG MAXIMUS XI HERO (WI-FI)", + }, + .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | +SENSOR_TEMP_T_SENSOR | +SENSOR_TEMP_VRM |SENSOR_SET_TEMP_WATER | +SENSOR_FAN_CPU_OPT |SENSOR_FAN_WATER_FLOW , + .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX, + .family = family_intel_300_series, + }, { .board_names = {"ROG CROSSHAIR VIII IMPACT"}, .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
@@ -814,6 +847,9 @@ static int __init asus_ec_probe(struct platform_device *pdev)case family_amd_500_series: ec_data->sensors_info = sensors_family_amd_500;break ; +case family_intel_300_series: + ec_data->sensors_info = sensors_family_intel_300; +break ;case family_intel_600_series: ec_data->sensors_info = sensors_family_intel_600;break ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 184/192 hwmon: (asus-ec-sensors) add missing sensors for X570-I GAMING
In reply to Greg Kroah-HartmanFrom: Eugene Shalygin <[email protected]>
[ Upstream commit 1c4e4f4a0e8d9ebe8be1c838fec4fb7053a989d9 ]
VRM and chipset temperature for ROG STRIX X570-I GAMING were missing according to a user contribution to the LHM project [1].
[1] https://github.com/LibreHardwareMonitor/LibreHardwareMonitor/pull/767
Stable-dep-of: 88700d1396ba ("hwmon: (asus-ec-sensors) autoload module via DMI data")
--- drivers/hwmon/asus-ec-sensors.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/hwmon/asus-ec-sensors.c +4 -3
@@ -366,9 +366,10 @@ static const struct ec_board_info board_info[] = { }, { .board_names = {"ROG STRIX X570-I GAMING"}, - .sensors = SENSOR_TEMP_T_SENSOR | SENSOR_FAN_VRM_HS | - SENSOR_FAN_CHIPSET | SENSOR_CURR_CPU | - SENSOR_IN_CPU_CORE, + .sensors = SENSOR_TEMP_CHIPSET | SENSOR_TEMP_VRM | + SENSOR_TEMP_T_SENSOR | + SENSOR_FAN_VRM_HS | SENSOR_FAN_CHIPSET | + SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE, .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX, .family = family_amd_500_series, },
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 185/192 hwmon: (asus-ec-sensors) add definitions for ROG ZENITH II EXTREME
In reply to Greg Kroah-HartmanFrom: Urs Schroffenegger <[email protected]>
[ Upstream commit 9992b19d756ab8f0889fcaf3e71ff93852e74694 ]
Add definitions for ROG ZENITH II EXTREME and some unknown yet temperature sensors in the second EC bank. Details are available at [1, 2].
[1] https://github.com/zeule/asus-ec-sensors/pull/26
[2] https://github.com/zeule/asus-ec-sensors/issues/16
Stable-dep-of: 88700d1396ba ("hwmon: (asus-ec-sensors) autoload module via DMI data")
--- Documentation/hwmon/asus_ec_sensors.rst | 1 + drivers/hwmon/asus-ec-sensors.c | 47 +++++++++++++++++++++++++ 2 files changed, 48 insertions(+)
Documentation/hwmon/asus_ec_sensors.rst +1 -0
@@ -22,6 +22,7 @@ Supported boards: * ROG STRIX X570-F GAMING * ROG STRIX X570-I GAMING * ROG STRIX Z690-A GAMING WIFI D4 + * ROG ZENITH II EXTREME Authors: - Eugene Shalygin <[email protected]>
drivers/hwmon/asus-ec-sensors.c +47 -0
83 lines not on this page · raw message
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 186/192 hwmon: (asus-ec-sensors) autoload module via DMI data
In reply to Greg Kroah-HartmanFrom: Eugene Shalygin <[email protected]>
[ Upstream commit 88700d1396bae72d9a4c23a48bbd98c1c2f53f3d ]
Replace autoloading data based on the ACPI EC device with the DMI records for motherboards models. The ACPI method created a bug that when this driver returns error from the probe function because of the unsupported motherboard model, the ACPI subsystem concludes that the EC device does not work properly.
--- drivers/hwmon/asus-ec-sensors.c | 408 +++++++++++++++++--------------- 1 file changed, 222 insertions(+), 186 deletions(-)
drivers/hwmon/asus-ec-sensors.c +222 -186
@@ -266,9 +266,7 @@ static const struct ec_sensor_info sensors_family_intel_600[] = {#define SENSOR_SET_WATER_BLOCK \ (SENSOR_TEMP_WATER_BLOCK_IN | SENSOR_TEMP_WATER_BLOCK_OUT) -struct ec_board_info { -const char *board_names[MAX_IDENTICAL_BOARD_VARIATIONS ];unsigned long sensors;/* * Defines which mutex to use for guarding access to the state and the
@@ -281,152 +279,194 @@ struct ec_board_info {enum board_family family; }; -static const struct ec_board_info board_info[] = { - { - .board_names = {"PRIME X470-PRO" }, - .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | -SENSOR_TEMP_T_SENSOR |SENSOR_TEMP_VRM | -SENSOR_FAN_CPU_OPT | -SENSOR_CURR_CPU |SENSOR_IN_CPU_CORE , - .mutex_path =ACPI_GLOBAL_LOCK_PSEUDO_PATH , - .family = family_amd_400_series, - }, - { - .board_names = {"PRIME X570-PRO" }, - .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB |SENSOR_TEMP_VRM | -SENSOR_TEMP_T_SENSOR |SENSOR_FAN_CHIPSET , - .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , - .family = family_amd_500_series, - }, - { - .board_names = {"ProArt X570-CREATOR WIFI" }, - .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB |SENSOR_TEMP_VRM | -SENSOR_TEMP_T_SENSOR |SENSOR_FAN_CPU_OPT | -SENSOR_CURR_CPU |SENSOR_IN_CPU_CORE , - }, - { - .board_names = {"Pro WS X570-ACE" }, - .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB |SENSOR_TEMP_VRM | -SENSOR_TEMP_T_SENSOR |SENSOR_FAN_CHIPSET | -SENSOR_CURR_CPU |SENSOR_IN_CPU_CORE , - .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , - .family = family_amd_500_series, - }, - { - .board_names = {"ROG CROSSHAIR VIII DARK HERO" }, - .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | -SENSOR_TEMP_T_SENSOR | -SENSOR_TEMP_VRM |SENSOR_SET_TEMP_WATER | -SENSOR_FAN_CPU_OPT |SENSOR_FAN_WATER_FLOW | -SENSOR_CURR_CPU |SENSOR_IN_CPU_CORE , - .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , - .family = family_amd_500_series, - }, - { - .board_names = { -"ROG CROSSHAIR VIII FORMULA" , -"ROG CROSSHAIR VIII HERO" , -"ROG CROSSHAIR VIII HERO (WI-FI)" , - }, - .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | -SENSOR_TEMP_T_SENSOR | -SENSOR_TEMP_VRM |SENSOR_SET_TEMP_WATER | -SENSOR_FAN_CPU_OPT |SENSOR_FAN_CHIPSET | -SENSOR_FAN_WATER_FLOW |SENSOR_CURR_CPU | -SENSOR_IN_CPU_CORE , - .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , - .family = family_amd_500_series, - }, - { - .board_names = { -"ROG MAXIMUS XI HERO" , -"ROG MAXIMUS XI HERO (WI-FI)" , - }, - .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | -SENSOR_TEMP_T_SENSOR | -SENSOR_TEMP_VRM |SENSOR_SET_TEMP_WATER | -SENSOR_FAN_CPU_OPT |SENSOR_FAN_WATER_FLOW , - .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , - .family = family_intel_300_series, - }, - { - .board_names = {"ROG CROSSHAIR VIII IMPACT" }, - .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | -SENSOR_TEMP_T_SENSOR |SENSOR_TEMP_VRM | -SENSOR_FAN_CHIPSET |SENSOR_CURR_CPU | -SENSOR_IN_CPU_CORE , - .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , - .family = family_amd_500_series, - }, - { - .board_names = {"ROG STRIX B550-E GAMING" }, - .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | -SENSOR_TEMP_T_SENSOR |SENSOR_TEMP_VRM | -SENSOR_FAN_CPU_OPT , - .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , - .family = family_amd_500_series, - }, - { - .board_names = {"ROG STRIX B550-I GAMING" }, - .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | -SENSOR_TEMP_T_SENSOR |SENSOR_TEMP_VRM | -SENSOR_FAN_VRM_HS |SENSOR_CURR_CPU | -SENSOR_IN_CPU_CORE , - .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , - .family = family_amd_500_series, - }, - { - .board_names = {"ROG STRIX X570-E GAMING" }, - .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | -SENSOR_TEMP_T_SENSOR |SENSOR_TEMP_VRM | -SENSOR_FAN_CHIPSET |SENSOR_CURR_CPU | -SENSOR_IN_CPU_CORE , - .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , - .family = family_amd_500_series, - }, - { - .board_names = {"ROG STRIX X570-E GAMING WIFI II" }, - .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | -SENSOR_TEMP_T_SENSOR |SENSOR_CURR_CPU | -SENSOR_IN_CPU_CORE , - .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , - .family = family_amd_500_series, - }, - { - .board_names = {"ROG STRIX X570-F GAMING" }, - .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | -SENSOR_TEMP_T_SENSOR |SENSOR_FAN_CHIPSET , - .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , - .family = family_amd_500_series, - }, - { - .board_names = {"ROG STRIX X570-I GAMING" }, - .sensors =SENSOR_TEMP_CHIPSET |SENSOR_TEMP_VRM | -SENSOR_TEMP_T_SENSOR | -SENSOR_FAN_VRM_HS |SENSOR_FAN_CHIPSET | -SENSOR_CURR_CPU |SENSOR_IN_CPU_CORE , - .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , - .family = family_amd_500_series, - }, - { - .board_names = {"ROG STRIX Z690-A GAMING WIFI D4" }, - .sensors =SENSOR_TEMP_T_SENSOR |SENSOR_TEMP_VRM , - .mutex_path =ASUS_HW_ACCESS_MUTEX_RMTW_ASMX , - .family = family_intel_600_series, - }, - { - .board_names = {"ROG ZENITH II EXTREME" }, - .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB |SENSOR_TEMP_T_SENSOR | -SENSOR_TEMP_VRM |SENSOR_SET_TEMP_WATER | -SENSOR_FAN_CPU_OPT |SENSOR_FAN_CHIPSET |SENSOR_FAN_VRM_HS | -SENSOR_FAN_WATER_FLOW |SENSOR_CURR_CPU |SENSOR_IN_CPU_CORE | -SENSOR_SET_WATER_BLOCK | -SENSOR_TEMP_T_SENSOR_2 |SENSOR_TEMP_SENSOR_EXTRA_1 | -SENSOR_TEMP_SENSOR_EXTRA_2 |SENSOR_TEMP_SENSOR_EXTRA_3 , - .mutex_path =ASUS_HW_ACCESS_MUTEX_SB_PCI0_SBRG_SIO1_MUT0 , - .family = family_amd_500_series, - }, - {} +static const struct ec_board_info board_info_prime_x470_pro = { + .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | +SENSOR_TEMP_T_SENSOR |SENSOR_TEMP_VRM | +SENSOR_FAN_CPU_OPT | +SENSOR_CURR_CPU |SENSOR_IN_CPU_CORE , + .mutex_path =ACPI_GLOBAL_LOCK_PSEUDO_PATH , + .family = family_amd_400_series, +}; + +static const struct ec_board_info board_info_prime_x570_pro = { + .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB |SENSOR_TEMP_VRM | +SENSOR_TEMP_T_SENSOR |SENSOR_FAN_CHIPSET , + .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , + .family = family_amd_500_series, +}; + +static const struct ec_board_info board_info_pro_art_x570_creator_wifi = { + .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB |SENSOR_TEMP_VRM | +SENSOR_TEMP_T_SENSOR |SENSOR_FAN_CPU_OPT | +SENSOR_CURR_CPU |SENSOR_IN_CPU_CORE , + .family = family_amd_500_series, +}; + +static const struct ec_board_info board_info_pro_ws_x570_ace = { + .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB |SENSOR_TEMP_VRM | +SENSOR_TEMP_T_SENSOR |SENSOR_FAN_CHIPSET | +SENSOR_CURR_CPU |SENSOR_IN_CPU_CORE , + .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , + .family = family_amd_500_series, +}; + +static const struct ec_board_info board_info_crosshair_viii_dark_hero = { + .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | +SENSOR_TEMP_T_SENSOR | +SENSOR_TEMP_VRM |SENSOR_SET_TEMP_WATER | +SENSOR_FAN_CPU_OPT |SENSOR_FAN_WATER_FLOW | +SENSOR_CURR_CPU |SENSOR_IN_CPU_CORE , + .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , + .family = family_amd_500_series, +}; + +static const struct ec_board_info board_info_crosshair_viii_hero = { + .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | +SENSOR_TEMP_T_SENSOR | +SENSOR_TEMP_VRM |SENSOR_SET_TEMP_WATER | +SENSOR_FAN_CPU_OPT |SENSOR_FAN_CHIPSET | +SENSOR_FAN_WATER_FLOW |SENSOR_CURR_CPU | +SENSOR_IN_CPU_CORE , + .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , + .family = family_amd_500_series, +}; + +static const struct ec_board_info board_info_maximus_xi_hero = { + .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | +SENSOR_TEMP_T_SENSOR | +SENSOR_TEMP_VRM |SENSOR_SET_TEMP_WATER | +SENSOR_FAN_CPU_OPT |SENSOR_FAN_WATER_FLOW , + .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , + .family = family_intel_300_series, +}; + +static const struct ec_board_info board_info_crosshair_viii_impact = { + .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | +SENSOR_TEMP_T_SENSOR |SENSOR_TEMP_VRM | +SENSOR_FAN_CHIPSET |SENSOR_CURR_CPU | +SENSOR_IN_CPU_CORE , + .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , + .family = family_amd_500_series, +}; + +static const struct ec_board_info board_info_strix_b550_e_gaming = { + .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | +SENSOR_TEMP_T_SENSOR |SENSOR_TEMP_VRM | +SENSOR_FAN_CPU_OPT , + .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , + .family = family_amd_500_series, +}; + +static const struct ec_board_info board_info_strix_b550_i_gaming = { + .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | +SENSOR_TEMP_T_SENSOR |SENSOR_TEMP_VRM | +SENSOR_FAN_VRM_HS |SENSOR_CURR_CPU | +SENSOR_IN_CPU_CORE , + .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , + .family = family_amd_500_series, +}; + +static const struct ec_board_info board_info_strix_x570_e_gaming = { + .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | +SENSOR_TEMP_T_SENSOR |SENSOR_TEMP_VRM | +SENSOR_FAN_CHIPSET |SENSOR_CURR_CPU | +SENSOR_IN_CPU_CORE , + .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , + .family = family_amd_500_series, +}; + +static const struct ec_board_info board_info_strix_x570_e_gaming_wifi_ii = { + .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | +SENSOR_TEMP_T_SENSOR |SENSOR_CURR_CPU | +SENSOR_IN_CPU_CORE , + .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , + .family = family_amd_500_series, +}; + +static const struct ec_board_info board_info_strix_x570_f_gaming = { + .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB | +SENSOR_TEMP_T_SENSOR |SENSOR_FAN_CHIPSET , + .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , + .family = family_amd_500_series, +}; + +static const struct ec_board_info board_info_strix_x570_i_gaming = { + .sensors =SENSOR_TEMP_CHIPSET |SENSOR_TEMP_VRM | +SENSOR_TEMP_T_SENSOR | +SENSOR_FAN_VRM_HS |SENSOR_FAN_CHIPSET | +SENSOR_CURR_CPU |SENSOR_IN_CPU_CORE , + .mutex_path =ASUS_HW_ACCESS_MUTEX_ASMX , + .family = family_amd_500_series, +}; + +static const struct ec_board_info board_info_strix_z690_a_gaming_wifi_d4 = { + .sensors =SENSOR_TEMP_T_SENSOR |SENSOR_TEMP_VRM , + .mutex_path =ASUS_HW_ACCESS_MUTEX_RMTW_ASMX , + .family = family_intel_600_series, +}; + +static const struct ec_board_info board_info_zenith_ii_extreme = { + .sensors =SENSOR_SET_TEMP_CHIPSET_CPU_MB |SENSOR_TEMP_T_SENSOR | +SENSOR_TEMP_VRM |SENSOR_SET_TEMP_WATER | +SENSOR_FAN_CPU_OPT |SENSOR_FAN_CHIPSET |SENSOR_FAN_VRM_HS | +SENSOR_FAN_WATER_FLOW |SENSOR_CURR_CPU |SENSOR_IN_CPU_CORE | +SENSOR_SET_WATER_BLOCK | +SENSOR_TEMP_T_SENSOR_2 |SENSOR_TEMP_SENSOR_EXTRA_1 | +SENSOR_TEMP_SENSOR_EXTRA_2 |SENSOR_TEMP_SENSOR_EXTRA_3 , + .mutex_path =ASUS_HW_ACCESS_MUTEX_SB_PCI0_SBRG_SIO1_MUT0 , + .family = family_amd_500_series, +}; + +#define DMI_EXACT_MATCH_ASUS_BOARD_NAME (name, board_info) \ + { \ + .matches = { \ + DMI_EXACT_MATCH(DMI_BOARD_VENDOR, \ + "ASUSTeK COMPUTER INC."), \ + DMI_EXACT_MATCH(DMI_BOARD_NAME, name), \ + }, \ + .driver_data = (void *)board_info, \ + } + +static const struct dmi_system_id dmi_table[] = { +DMI_EXACT_MATCH_ASUS_BOARD_NAME ("PRIME X470-PRO" , + &board_info_prime_x470_pro), +DMI_EXACT_MATCH_ASUS_BOARD_NAME ("PRIME X570-PRO" , + &board_info_prime_x570_pro), +DMI_EXACT_MATCH_ASUS_BOARD_NAME ("ProArt X570-CREATOR WIFI" , + &board_info_pro_art_x570_creator_wifi), +DMI_EXACT_MATCH_ASUS_BOARD_NAME ("Pro WS X570-ACE" , + &board_info_pro_ws_x570_ace), +DMI_EXACT_MATCH_ASUS_BOARD_NAME ("ROG CROSSHAIR VIII DARK HERO" , + &board_info_crosshair_viii_dark_hero), +DMI_EXACT_MATCH_ASUS_BOARD_NAME ("ROG CROSSHAIR VIII FORMULA" , + &board_info_crosshair_viii_hero), +DMI_EXACT_MATCH_ASUS_BOARD_NAME ("ROG CROSSHAIR VIII HERO" , + &board_info_crosshair_viii_hero), +DMI_EXACT_MATCH_ASUS_BOARD_NAME ("ROG CROSSHAIR VIII HERO (WI-FI)" , + &board_info_crosshair_viii_hero), +DMI_EXACT_MATCH_ASUS_BOARD_NAME ("ROG MAXIMUS XI HERO" , + &board_info_maximus_xi_hero), +DMI_EXACT_MATCH_ASUS_BOARD_NAME ("ROG MAXIMUS XI HERO (WI-FI)" , + &board_info_maximus_xi_hero), +DMI_EXACT_MATCH_ASUS_BOARD_NAME ("ROG CROSSHAIR VIII IMPACT" , + &board_info_crosshair_viii_impact), +DMI_EXACT_MATCH_ASUS_BOARD_NAME ("ROG STRIX B550-E GAMING" , + &board_info_strix_b550_e_gaming), +DMI_EXACT_MATCH_ASUS_BOARD_NAME ("ROG STRIX B550-I GAMING" , + &board_info_strix_b550_i_gaming), +DMI_EXACT_MATCH_ASUS_BOARD_NAME ("ROG STRIX X570-E GAMING" , + &board_info_strix_x570_e_gaming), +DMI_EXACT_MATCH_ASUS_BOARD_NAME ("ROG STRIX X570-E GAMING WIFI II" , + &board_info_strix_x570_e_gaming_wifi_ii), +DMI_EXACT_MATCH_ASUS_BOARD_NAME ("ROG STRIX X570-F GAMING" , + &board_info_strix_x570_f_gaming), +DMI_EXACT_MATCH_ASUS_BOARD_NAME ("ROG STRIX X570-I GAMING" , + &board_info_strix_x570_i_gaming), +DMI_EXACT_MATCH_ASUS_BOARD_NAME ("ROG STRIX Z690-A GAMING WIFI D4" , + &board_info_strix_z690_a_gaming_wifi_d4), +DMI_EXACT_MATCH_ASUS_BOARD_NAME ("ROG ZENITH II EXTREME" , + &board_info_zenith_ii_extreme), + {}, };struct ec_sensor {
@@ -537,12 +577,12 @@ static int find_ec_sensor_index(const struct ec_sensors_data *ec,return -ENOENT ; } -static int __init bank_compare (const void *a,const void *b) +static int bank_compare (const void *a,const void *b) {return *((const s8 *)a) - *((const s8 *)b); } -static void __init setup_sensor_data (struct ec_sensors_data *ec) +static void setup_sensor_data (struct ec_sensors_data *ec) {struct ec_sensor *s = ec->sensors;bool bank_found;
@@ -574,7 +614,7 @@ static void __init setup_sensor_data(struct ec_sensors_data *ec)sort (ec->banks, ec->nr_banks,1 , bank_compare,NULL ); } -static void __init fill_ec_registers (struct ec_sensors_data *ec) +static void fill_ec_registers (struct ec_sensors_data *ec) {const struct ec_sensor_info *si;unsigned int i, j, register_idx =0 ;
@@ -589,7 +629,7 @@ static void __init fill_ec_registers(struct ec_sensors_data *ec) } } -static int __init setup_lock_data (struct device *dev) +static int setup_lock_data (struct device *dev) {const char *mutex_path;int status;
@@ -812,7 +852,7 @@ static umode_t asus_ec_hwmon_is_visible(const void *drvdata,return find_ec_sensor_index (state, type, channel) >=0 ?S_IRUGO :0 ; } -static int __init +static int asus_ec_hwmon_add_chan_info (struct hwmon_channel_info *asus_ec_hwmon_chan,struct device *dev,int num,enum hwmon_sensor_types type,u32 config)
@@ -841,27 +881,15 @@ static struct hwmon_chip_info asus_ec_chip_info = { .ops = &asus_ec_hwmon_ops, }; -static const struct ec_board_info *__init get_board_info (void ) +static const struct ec_board_info *get_board_info (void ) { -const char *dmi_board_vendor =dmi_get_system_info (DMI_BOARD_VENDOR ); -const char *dmi_board_name =dmi_get_system_info (DMI_BOARD_NAME ); -const struct ec_board_info *board; - -if (!dmi_board_vendor || !dmi_board_name || -strcasecmp (dmi_board_vendor,"ASUSTeK COMPUTER INC." )) -return NULL ; - -for (board = board_info; board->sensors; board++) { -if (match_string (board->board_names, -MAX_IDENTICAL_BOARD_VARIATIONS , - dmi_board_name) >=0 ) -return board; - } +const struct dmi_system_id *dmi_entry; -return NULL ; + dmi_entry =dmi_first_match (dmi_table); +return dmi_entry ? dmi_entry->driver_data :NULL ; } -static int __init asus_ec_probe (struct platform_device *pdev) +static int asus_ec_probe (struct platform_device *pdev) {const struct hwmon_channel_info **ptr_asus_ec_ci;int nr_count[hwmon_max] = {0 }, nr_types =0 ;
@@ -970,29 +998,37 @@ static int __init asus_ec_probe(struct platform_device *pdev)return PTR_ERR_OR_ZERO (hwdev); } - -static const struct acpi_device_id acpi_ec_ids[] = { -/* Embedded Controller Device */ - {"PNP0C09" ,0 }, - {} -}; +MODULE_DEVICE_TABLE (dmi, dmi_table);static struct platform_driver asus_ec_sensors_platform_driver = { .driver = { .name ="asus-ec-sensors" , - .acpi_match_table = acpi_ec_ids, }, + .probe = asus_ec_probe, }; -MODULE_DEVICE_TABLE (acpi, acpi_ec_ids); -/* -* we use module_platform_driver_probe() rather than module_platform_driver() -* because the probe function (and its dependants) are marked with __init, which -* means we can't put it into the .probe member of the platform_driver struct -* above, and we can't mark the asus_ec_sensors_platform_driver object as __init -* because the object is referenced from the module exit code. -*/ -module_platform_driver_probe (asus_ec_sensors_platform_driver, asus_ec_probe); +static struct platform_device *asus_ec_sensors_platform_device; + +static int __init asus_ec_init (void ) +{ + asus_ec_sensors_platform_device = +platform_create_bundle (&asus_ec_sensors_platform_driver, + asus_ec_probe,NULL ,0 ,NULL ,0 ); + +if (IS_ERR (asus_ec_sensors_platform_device)) +return PTR_ERR (asus_ec_sensors_platform_device); + +return 0 ; +} + +static void __exit asus_ec_exit(void) +{ +platform_device_unregister (asus_ec_sensors_platform_device); +platform_driver_unregister (&asus_ec_sensors_platform_driver); +} + +module_init (asus_ec_init); +module_exit (asus_ec_exit);module_param_named (mutex_path, mutex_path_override, charp,0 ); MODULE_PARM_DESC(mutex_path,
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 187/192 arm64/bti: Disable in kernel BTI when cross section thunks are broken
In reply to Greg Kroah-HartmanFrom: Mark Brown <[email protected]>
commit c0a454b9044fdc99486853aa424e5b3be2107078 upstream.
GCC does not insert a bti c instruction at the beginning of a function when it believes that all callers reach the function through a direct branch[1]. Unfortunately the logic it uses to determine this is not sufficiently robust, for example not taking account of functions being placed in different sections which may be loaded separately, so we may still see thunks being generated to these functions. If that happens, the first instruction in the callee function will result in a Branch Target Exception due to the missing landing pad.
While this has currently only been observed in the case of modules having their main code loaded sufficiently far from their init section to require thunks it could potentially happen for other cases so the safest thing is to disable BTI for the kernel when building with an affected toolchain.
[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106671
--- arch/arm64/Kconfig | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/Kconfig +2 -0
@@ -1884,6 +1884,8 @@ config ARM64_BTI_KERNEL depends on CC_HAS_BRANCH_PROT_PAC_RET_BTI # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94697 depends on !CC_IS_GCC || GCC_VERSION >= 100100 + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106671 + depends on !CC_IS_GCC # https://github.com/llvm/llvm-project/commit/a88c722e687e6780dcd6a58718350dc76fcc4cc9 depends on !CC_IS_CLANG || CLANG_VERSION >= 120000 depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_REGS)
Greg Kroah-Hartman
maintainerPATCH 188/192 iommu/vt-d: Correctly calculate sagaw value of IOMMU
In reply to Greg Kroah-HartmanFrom: Lu Baolu <[email protected]>
commit 53fc7ad6edf210b497230ce74b61b322a202470c upstream.
The Intel IOMMU driver possibly selects between the first-level and the second-level translation tables for DMA address translation. However, the levels of page-table walks for the 4KB base page size are calculated from the SAGAW field of the capability register, which is only valid for the second-level page table. This causes the IOMMU driver to stop working if the hardware (or the emulated IOMMU) advertises only first-level translation capability and reports the SAGAW field as 0.
This solves the above problem by considering both the first level and the second level when calculating the supported page table levels.
--- drivers/iommu/intel/iommu.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-)
drivers/iommu/intel/iommu.c +25 -3
@@ -422,14 +422,36 @@ static inline int domain_pfn_supported(sreturn !(addr_width <BITS_PER_LONG && pfn >> addr_width); } +/* +* Calculate the Supported Adjusted Guest Address Widths of an IOMMU. +* Refer to 11.4.2 of the VT-d spec for the encoding of each bit of +* the returned SAGAW. +*/ +static unsigned long __iommu_calculate_sagaw (struct intel_iommu *iommu) +{ +unsigned long fl_sagaw, sl_sagaw; + + fl_sagaw =BIT (2 ) | (cap_fl1gp_support (iommu->cap) ?BIT (3 ) :0 ); + sl_sagaw =cap_sagaw (iommu->cap); + +/* Second level only. */ +if (!sm_supported (iommu) || !ecap_flts (iommu->ecap)) +return sl_sagaw; + +/* First level only. */ +if (!ecap_slts (iommu->ecap)) +return fl_sagaw; + +return fl_sagaw & sl_sagaw; +} +static int __iommu_calculate_agaw (struct intel_iommu *iommu,int max_gaw) {unsigned long sagaw;int agaw; - sagaw =cap_sagaw (iommu->cap); -for (agaw =width_to_agaw (max_gaw); - agaw >=0 ; agaw--) { + sagaw =__iommu_calculate_sagaw (iommu); +for (agaw =width_to_agaw (max_gaw); agaw >=0 ; agaw--) {if (test_bit (agaw, &sagaw))break ; }
Greg Kroah-Hartman
maintainerPATCH 189/192 iommu/virtio: Fix interaction with VFIO
In reply to Greg Kroah-HartmanFrom: Jean-Philippe Brucker <[email protected]>
commit 91c98fe7941499e4127cdc359c30841b873dd43a upstream.
Commit e8ae0e140c05 ("vfio: Require that devices support DMA cache coherence") requires IOMMU drivers to advertise IOMMU_CAP_CACHE_COHERENCY, in order to be used by VFIO. Since VFIO does not provide to userspace the ability to maintain coherency through cache invalidations, it requires hardware coherency. Advertise the capability in order to restore VFIO support.
The meaning of IOMMU_CAP_CACHE_COHERENCY also changed from "IOMMU can enforce cache coherent DMA transactions" to "IOMMU_CACHE is supported". While virtio-iommu cannot enforce coherency (of PCIe no-snoop transactions), it does support IOMMU_CACHE.
We can distinguish different cases of non-coherent DMA:
(1) When accesses from a hardware endpoint are not coherent. The host would describe such a device using firmware methods ('dma-coherent' in device-tree, '_CCA' in ACPI), since they are also needed without a vIOMMU. In this case mappings are created without IOMMU_CACHE. virtio-iommu doesn't need any additional support. It sends the same requests as for coherent devices.
(2) When the physical IOMMU supports non-cacheable mappings. Supporting those would require a new feature in virtio-iommu, new PROBE request property and MAP flags. Device drivers would use a new API to discover this since it depends on the architecture and the physical IOMMU.
(3) When the hardware supports PCIe no-snoop. It is possible for assigned PCIe devices to issue no-snoop transactions, and the virtio-iommu specification is lacking any mention of this.
Arm platforms don't necessarily support no-snoop, and those that do cannot enforce coherency of no-snoop transactions. Device drivers must be careful about assuming that no-snoop transactions won't end up cached; see commit e02f5c1bb228 ("drm: disable uncached DMA optimization for ARM and arm64"). On x86 platforms, the host may or may not enforce coherency of no-snoop transactions with the physical IOMMU. But according to the above commit, on x86 a driver which assumes that no-snoop DMA is compatible with uncached CPU mappings will also work if the host enforces coherency.
Although these issues are not specific to virtio-iommu, it could be used to facilitate discovery and configuration of no-snoop. This would require a new feature bit, PROBE property and ATTACH/MAP flags.
--- drivers/iommu/virtio-iommu.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/iommu/virtio-iommu.c +11 -0
@@ -1006,7 +1006,18 @@ static int viommu_of_xlate(struct device *dev, struct of_phandle_args *args)return iommu_fwspec_add_ids (dev, args->args,1 ); } +static bool viommu_capable (enum iommu_cap cap) +{ +switch (cap) { +case IOMMU_CAP_CACHE_COHERENCY : +return true; +default : +return false; + } +} +static struct iommu_ops viommu_ops = { + .capable = viommu_capable, .domain_alloc = viommu_domain_alloc, .probe_device = viommu_probe_device, .probe_finalize = viommu_probe_finalize,
Signature · 1 line
2.37.3
Greg Kroah-Hartman
maintainerPATCH 190/192 iommu: Fix false ownership failure on AMD systems with PASID activated
In reply to Greg Kroah-HartmanFrom: Jason Gunthorpe <[email protected]>
commit 2380f1e8195ef612deea1dc7a3d611c5d2b9b56a upstream.
The AMD IOMMU driver cannot activate PASID mode on a RID without the RID's translation being set to IDENTITY. Further it requires changing the RID's page table layout from the normal v1 IOMMU_DOMAIN_IDENTITY layout to a different v2 layout.
It does this by creating a new iommu_domain, configuring that domain for v2 identity operation and then attaching it to the group, from within the driver. This logic assumes the group is already set to the IDENTITY domain and is being used by the DMA API.
However, since the ownership logic is based on the group's domain pointer equaling the default domain to detect DMA API ownership, this causes it to look like the group is not attached to the DMA API any more. This blocks attaching drivers to any other devices in the group.
In a real system this manifests itself as the HD-audio devices on some AMD platforms losing their device drivers.
Work around this unique behavior of the AMD driver by checking for equality of IDENTITY domains based on their type, not their pointer value. This allows the AMD driver to have two IDENTITY domains for internal purposes without breaking the check.
Have the AMD driver properly declare that the special domain it created is actually an IDENTITY domain.
--- drivers/iommu/amd/iommu_v2.c | 2 ++ drivers/iommu/iommu.c | 21 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-)
drivers/iommu/amd/iommu_v2.c +2 -0
@@ -786,6 +786,8 @@ int amd_iommu_init_device(struct pci_devif (dev_state->domain ==NULL ) goto out_free_states; +/* See iommu_is_default_domain() */ + dev_state->domain->type =IOMMU_DOMAIN_IDENTITY ;amd_iommu_domain_direct_map (dev_state->domain); ret =amd_iommu_domain_enable_v2 (dev_state->domain, pasids);
drivers/iommu/iommu.c +19 -2
@@ -3089,6 +3089,24 @@ out:return ret; } +static bool iommu_is_default_domain (struct iommu_group *group) +{ +if (group->domain == group->default_domain) +return true; + +/* +* If the default domain was set to identity and it is still an identity +* domain then we consider this a pass. This happens because of +* amd_iommu_init_device() replacing the default idenytity domain with an +* identity domain that has a different configuration for AMDGPU. +*/ +if (group->default_domain && + group->default_domain->type ==IOMMU_DOMAIN_IDENTITY && + group->domain && group->domain->type ==IOMMU_DOMAIN_IDENTITY ) +return true; +return false; +} +/** * iommu_device_use_default_domain() - Device driver wants to handle device * DMA through the kernel DMA API.
@@ -3107,8 +3125,7 @@ int iommu_device_use_default_domain(strumutex_lock (&group->mutex);if (group->owner_cnt) { -if (group->domain != group->default_domain || - group->owner) { +if (group->owner || !iommu_is_default_domain (group)) { ret = -EBUSY ; goto unlock_out; }
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.19.9 release. There are 192 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 Thu, 15 Sep 2022 14:03:27 +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/v5.x/stable-review/patch-5.19.9-rc1.gz
404: no popcorn
Some of the others are available, some are not. Mirrors acting up again?
thanks,
Holger
Greg Kroah-Hartman
maintainerQuoted 9 lines · Holger Hoffstätte
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.19.9 release. There are 192 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 Thu, 15 Sep 2022 14:03:27 +0000. Anything received after that time might be too late.
Quoted 6 lines
Quoted 2 lines
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.19.9-rc1.gz404: no popcorn
Some of the others are available, some are not. Mirrors acting up again?
Nope, my fault, sorry, new laptop, had to add another perl dependency that I had missed. I'll go upload them all again...
thanks,
greg k-h
Greg Kroah-Hartman
maintainerQuoted 13 lines · Greg Kroah-Hartman
Quoted 12 lines · Holger Hoffstätte
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.19.9 release. There are 192 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 Thu, 15 Sep 2022 14:03:27 +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/v5.x/stable-review/patch-5.19.9-rc1.gz
Quoted 6 lines
Quoted 3 lines
404: no popcorn
Some of the others are available, some are not. Mirrors acting up again?
Nope, my fault, sorry, new laptop, had to add another perl dependency that I had missed. I'll go upload them all again...
Ok, all uploaded again, should hit the mirrors in a bit, let me know if that didn't work in an hour or so.
thanks,
greg k-h
Greg Kroah-Hartman
maintainerPATCH 191/192 drm/amd/display: Add SMU logging code
In reply to Greg Kroah-HartmanFrom: Saaem Rizvi <[email protected]>
commit 4b33b5ffcf68de3a43e7dddc91c5dc86e6ed8587 upstream.
[WHY]
Logging for SMU response value after the wait allows us to know immediately what the response value was. Makes it easier to debug should the value be anything other than OK.
[HOW]
Using the the already available DC SMU logging functions.
--- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c | 12 ++++++++++ drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/dcn301_smu.c | 12 ++++++++++ drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_smu.c | 8 ++++++ drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c | 8 ++++++ drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_smu.c | 8 ++++++ 5 files changed, 48 insertions(+)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c +12 -0
@@ -41,6 +41,12 @@#define FN (reg_name, field) \ FD(reg_name##__##field) +#include "logger_types.h" +#undef DC_LOGGER +#define DC_LOGGER \ + CTX->logger +#define smu_print (str, ...) {DC_LOG_SMU(str, ##__VA_ARGS__); } +#define VBIOSSMC_MSG_TestMessage 0x1#define VBIOSSMC_MSG_GetSmuVersion 0x2#define VBIOSSMC_MSG_PowerUpGfx 0x3
@@ -97,6 +103,12 @@ static int rn_vbios_smu_send_msg_with_pa result =rn_smu_wait_for_response (clk_mgr,10 ,200000 );ASSERT (result == VBIOSSMC_Result_OK); +smu_print ("SMU response after wait: %d\n" , result); + +if (result == VBIOSSMC_Status_BUSY) { +return -1 ; + } +/* First clear response register */ REG_WRITE (MP1_SMN_C2PMSG_91 , VBIOSSMC_Status_BUSY);
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/dcn301_smu.c +12 -0
@@ -41,6 +41,12 @@#define FN (reg_name, field) \ FD(reg_name##__##field) +#include "logger_types.h" +#undef DC_LOGGER +#define DC_LOGGER \ + CTX->logger +#define smu_print (str, ...) {DC_LOG_SMU(str, ##__VA_ARGS__); } +#define VBIOSSMC_MSG_GetSmuVersion 0x2#define VBIOSSMC_MSG_SetDispclkFreq 0x4#define VBIOSSMC_MSG_SetDprefclkFreq 0x5
@@ -96,6 +102,12 @@ static int dcn301_smu_send_msg_with_para result =dcn301_smu_wait_for_response (clk_mgr,10 ,200000 ); +smu_print ("SMU response after wait: %d\n" , result); + +if (result == VBIOSSMC_Status_BUSY) { +return -1 ; + } +/* First clear response register */ REG_WRITE (MP1_SMN_C2PMSG_91 , VBIOSSMC_Status_BUSY);
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_smu.c +8 -0
@@ -40,6 +40,12 @@#define FN (reg_name, field) \ FD(reg_name##__##field) +#include "logger_types.h" +#undef DC_LOGGER +#define DC_LOGGER \ + CTX->logger +#define smu_print (str, ...) {DC_LOG_SMU(str, ##__VA_ARGS__); } +#define VBIOSSMC_MSG_TestMessage 0x1#define VBIOSSMC_MSG_GetSmuVersion 0x2#define VBIOSSMC_MSG_PowerUpGfx 0x3
@@ -104,6 +110,8 @@ static int dcn31_smu_send_msg_with_param result =dcn31_smu_wait_for_response (clk_mgr,10 ,200000 );ASSERT (result == VBIOSSMC_Result_OK); +smu_print ("SMU response after wait: %d\n" , result); +if (result == VBIOSSMC_Status_BUSY) {return -1 ; }
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c +8 -0
@@ -70,6 +70,12 @@ static const struct IP_BASE NBIO_BASE =#define REG_NBIO (reg_name) \ (NBIO_BASE.instance[0].segment[regBIF_BX_PF2_ ## reg_name ## _BASE_IDX] + regBIF_BX_PF2_ ## reg_name) +#include "logger_types.h" +#undef DC_LOGGER +#define DC_LOGGER \ + CTX->logger +#define smu_print (str, ...) {DC_LOG_SMU(str, ##__VA_ARGS__); } +#define mmMP1_C2PMSG_3 0x3B1050C#define VBIOSSMC_MSG_TestMessage 0x01 ///< To check if PMFW is alive and responding. Requirement specified by PMFW team
@@ -132,6 +138,8 @@ static int dcn315_smu_send_msg_with_para result =dcn315_smu_wait_for_response (clk_mgr,10 ,200000 );ASSERT (result == VBIOSSMC_Result_OK); +smu_print ("SMU response after wait: %d\n" , result); +if (result == VBIOSSMC_Status_BUSY) {return -1 ; }
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_smu.c +8 -0
@@ -58,6 +58,12 @@ static const struct IP_BASE MP0_BASE = {#define FN (reg_name, field) \ FD(reg_name##__##field) +#include "logger_types.h" +#undef DC_LOGGER +#define DC_LOGGER \ + CTX->logger +#define smu_print (str, ...) {DC_LOG_SMU(str, ##__VA_ARGS__); } +#define VBIOSSMC_MSG_TestMessage 0x01 ///< To check if PMFW is alive and responding. Requirement specified by PMFW team#define VBIOSSMC_MSG_GetPmfwVersion 0x02 ///< Get PMFW version#define VBIOSSMC_MSG_Spare0 0x03 ///< Spare0
@@ -120,6 +126,8 @@ static int dcn316_smu_send_msg_with_para result =dcn316_smu_wait_for_response (clk_mgr,10 ,200000 );ASSERT (result == VBIOSSMC_Result_OK); +smu_print ("SMU response after wait: %d\n" , result); +if (result == VBIOSSMC_Status_BUSY) {return -1 ; }
Greg Kroah-Hartman
maintainerPATCH 192/192 drm/amd/display: Removing assert statements for Linux
In reply to Greg Kroah-HartmanFrom: Saaem Rizvi <[email protected]>
commit 149f6d1a6035a7aa6595ac6eeb9c8f566b2103cd upstream.
[WHY]
Assert statements causing several bugs on Linux DM
[HOW]
Removing assert statement for Linux DM (ASSERT(result == VBIOSSMC_Result_OK)). Also adding logging statements for setting dcfclk.
--- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c | 8 ++++++-- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/dcn301_smu.c | 7 ++++++- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_smu.c | 8 ++++++-- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c | 8 ++++++-- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_smu.c | 8 ++++++-- 5 files changed, 30 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c +6 -2
@@ -101,9 +101,9 @@ static int rn_vbios_smu_send_msg_with_pauint32_t result; result =rn_smu_wait_for_response (clk_mgr,10 ,200000 ); -ASSERT (result == VBIOSSMC_Result_OK); -smu_print ("SMU response after wait: %d\n" , result); +if (result != VBIOSSMC_Result_OK) +smu_print ("SMU Response was not OK. SMU response after wait received is: %d\n" , result);if (result == VBIOSSMC_Status_BUSY) {return -1 ;
@@ -188,6 +188,10 @@ int rn_vbios_smu_set_hard_min_dcfclk(str VBIOSSMC_MSG_SetHardMinDcfclkByFreq, khz_to_mhz_ceil(requested_dcfclk_khz)); +#ifdef DBG +smu_print ("actual_dcfclk_set_mhz %d is set to : %d\n" , actual_dcfclk_set_mhz, actual_dcfclk_set_mhz *1000 ); +#endif +return actual_dcfclk_set_mhz *1000 ; }
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/dcn301_smu.c +6 -1
@@ -102,7 +102,8 @@ static int dcn301_smu_send_msg_with_para result =dcn301_smu_wait_for_response (clk_mgr,10 ,200000 ); -smu_print ("SMU response after wait: %d\n" , result); +if (result != VBIOSSMC_Result_OK) +smu_print ("SMU Response was not OK. SMU response after wait received is: %d\n" , result);if (result == VBIOSSMC_Status_BUSY) {return -1 ;
@@ -179,6 +180,10 @@ int dcn301_smu_set_hard_min_dcfclk(struc VBIOSSMC_MSG_SetHardMinDcfclkByFreq, khz_to_mhz_ceil(requested_dcfclk_khz)); +#ifdef DBG +smu_print ("actual_dcfclk_set_mhz %d is set to : %d\n" , actual_dcfclk_set_mhz, actual_dcfclk_set_mhz *1000 ); +#endif +return actual_dcfclk_set_mhz *1000 ; }
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_smu.c +6 -2
@@ -108,9 +108,9 @@ static int dcn31_smu_send_msg_with_paramuint32_t result; result =dcn31_smu_wait_for_response (clk_mgr,10 ,200000 ); -ASSERT (result == VBIOSSMC_Result_OK); -smu_print ("SMU response after wait: %d\n" , result); +if (result != VBIOSSMC_Result_OK) +smu_print ("SMU Response was not OK. SMU response after wait received is: %d\n" , result);if (result == VBIOSSMC_Status_BUSY) {return -1 ;
@@ -202,6 +202,10 @@ int dcn31_smu_set_hard_min_dcfclk(struct VBIOSSMC_MSG_SetHardMinDcfclkByFreq, khz_to_mhz_ceil(requested_dcfclk_khz)); +#ifdef DBG +smu_print ("actual_dcfclk_set_mhz %d is set to : %d\n" , actual_dcfclk_set_mhz, actual_dcfclk_set_mhz *1000 ); +#endif +return actual_dcfclk_set_mhz *1000 ; }
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c +6 -2
@@ -136,9 +136,9 @@ static int dcn315_smu_send_msg_with_parauint32_t result; result =dcn315_smu_wait_for_response (clk_mgr,10 ,200000 ); -ASSERT (result == VBIOSSMC_Result_OK); -smu_print ("SMU response after wait: %d\n" , result); +if (result != VBIOSSMC_Result_OK) +smu_print ("SMU Response was not OK. SMU response after wait received is: %d\n" , result);if (result == VBIOSSMC_Status_BUSY) {return -1 ;
@@ -205,6 +205,10 @@ int dcn315_smu_set_hard_min_dcfclk(struc VBIOSSMC_MSG_SetHardMinDcfclkByFreq, khz_to_mhz_ceil(requested_dcfclk_khz)); +#ifdef DBG +smu_print ("actual_dcfclk_set_mhz %d is set to : %d\n" , actual_dcfclk_set_mhz, actual_dcfclk_set_mhz *1000 ); +#endif +return actual_dcfclk_set_mhz *1000 ; }
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_smu.c +6 -2
@@ -124,9 +124,9 @@ static int dcn316_smu_send_msg_with_parauint32_t result; result =dcn316_smu_wait_for_response (clk_mgr,10 ,200000 ); -ASSERT (result == VBIOSSMC_Result_OK); -smu_print ("SMU response after wait: %d\n" , result); +if (result != VBIOSSMC_Result_OK) +smu_print ("SMU Response was not OK. SMU response after wait received is: %d\n" , result);if (result == VBIOSSMC_Status_BUSY) {return -1 ;
@@ -191,6 +191,10 @@ int dcn316_smu_set_hard_min_dcfclk(struc VBIOSSMC_MSG_SetHardMinDcfclkByFreq, khz_to_mhz_ceil(requested_dcfclk_khz)); +#ifdef DBG +smu_print ("actual_dcfclk_set_mhz %d is set to : %d\n" , actual_dcfclk_set_mhz, actual_dcfclk_set_mhz *1000 ); +#endif +return actual_dcfclk_set_mhz *1000 ; }
Hey Greg,
Ran tests and boot tested on my system, no regressions found
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.19.9 release. There are 192 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 Thu, 15 Sep 2022 14:03:27 +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/v5.x/stable-review/patch-5.19.9-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.19.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro's test farm.
No regressions on arm64, arm, x86_64, and i386.
NOTE:
Following Warning noticed on bcm2711-rpi-4-b while running LTP fs iogen01 tests and this kernel built with 64k Page size with NFS mounted file system.
- CONFIG_ARM64_64K_PAGES=y
This warning is not always reproducible.
[ 1152.014544] ------------[ cut here ]------------ [ 1152.019249] WARNING: CPU: 3 PID: 56 at net/sunrpc/clnt.c:2521 call_decode+0x210/0x240 [ 1152.027211] Modules linked in: algif_hash aes_neon_bs aes_neon_blk
xhci_pci xhci_pci_renesas snd_soc_hdmi_codec raspberrypi_cpufreq hci_uart brcmfmac btqca brcmutil btbcm bluetooth cfg80211 vc4 raspberrypi_hwmon rfkill cec reset_raspberrypi clk_raspberrypi bcm2711_thermal iproc_rng200 rng_core drm_display_helper i2c_bcm2835 drm_cma_helper pwm_bcm2835 drm_kms_helper pcie_brcmstb crct10dif_ce fuse drm
[ 1152.063204] CPU: 3 PID: 56 Comm: kworker/u8:3 Not tainted 5.19.9-rc1 #1 [ 1152.069920] Hardware name: Raspberry Pi 4 Model B (DT) [ 1152.075131] Workqueue: rpciod rpc_async_schedule [ 1152.079826] pstate: 00000005 (nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 1152.086894] pc : call_decode+0x210/0x240 [ 1152.090874] lr : call_decode+0xd8/0x240 [ 1152.094766] sp : ffff80000bcefca0 [ 1152.098123] x29: ffff80000bcefca0 x28: ffff800009285500 x27: ffff80000aa78a70 [ 1152.105378] x26: 0000000004248160 x25: ffff80000a110008 x24: 0000000000000001 [ 1152.112630] x23: ffff80000a110008 x22: ffff80000aa78000 x21: ffff00004ca1c050 [ 1152.119880] x20: ffff00004ca1c000 x19: ffff00004d270f90 x18: 0000000000000000 [ 1152.127129] x17: 00d0070000000000 x16: 0000000000000000 x15: ffff0000fba2b000 [ 1152.134378] x14: 0000000000000000 x13: 0000000000000002 x12: 0000000000000000 [ 1152.141626] x11: 0000000000000000 x10: 0000000000000be0 x9 : ffff8000092a15ec [ 1152.148874] x8 : fefefefefefefeff x7 : 0000000000000018 x6 : ffff00004d271238 [ 1152.156123] x5 : 800aad4b0000ffff x4 : ffff00004d271238 x3 : 0000000000000000 [ 1152.163371] x2 : 0000000000000008 x1 : ffff00004ca1c160 x0 : 00000000ffffffff [ 1152.170620] Call trace: [ 1152.173098] call_decode+0x210/0x240 [ 1152.176725] __rpc_execute+0xac/0x6a4 [ 1152.180443] rpc_async_schedule+0x34/0x5c [ 1152.184512] process_one_work+0x1dc/0x450 [ 1152.188583] worker_thread+0x154/0x450 [ 1152.192385] kthread+0xfc/0x110 [ 1152.195578] ret_from_fork+0x10/0x20 [ 1152.199207] ---[ end trace 0000000000000000 ]---
https://lkft.validation.linaro.org/scheduler/job/5525031#L1343
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.19.y/build/v5.19.8-193-g318d4f28213a/testrun/11883336/suite/log-parser-test/tests/
## Build
* kernel: 5.19.9-rc1
* git: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
* git branch: linux-5.19.y
* git commit: 318d4f28213a0b7494405e08920cdd5e649199eb
* git describe: v5.19.8-193-g318d4f28213a
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.19.y/build/v5.19.8-193-g318d4f28213a
## No test Regressions (compared to v5.19.8)
## No metric Regressions (compared to v5.19.8)
## No test Fixes (compared to v5.19.8)
## No metric Fixes (compared to v5.19.8)
## Test result summary
total: 113663, pass: 100760, fail: 903, skip: 11686, xfail: 314
## Build Summary
* arc: 10 total, 10 passed, 0 failed
* arm: 333 total, 333 passed, 0 failed
* arm64: 65 total, 63 passed, 2 failed
* i386: 55 total, 53 passed, 2 failed
* mips: 56 total, 56 passed, 0 failed
* parisc: 12 total, 12 passed, 0 failed
* powerpc: 69 total, 63 passed, 6 failed
* riscv: 27 total, 22 passed, 5 failed
* s390: 21 total, 21 passed, 0 failed
* sh: 24 total, 24 passed, 0 failed
* sparc: 12 total, 12 passed, 0 failed
* x86_64: 58 total, 56 passed, 2 failed
## Test suites summary
* fwts
* igt-gpu-tools
* kselftest-android
* kselftest-arm64
* kselftest-arm64/arm64.btitest.bti_c_func
* kselftest-arm64/arm64.btitest.bti_j_func
* kselftest-arm64/arm64.btitest.bti_jc_func
* kselftest-arm64/arm64.btitest.bti_none_func
* kselftest-arm64/arm64.btitest.nohint_func
* kselftest-arm64/arm64.btitest.paciasp_func
* kselftest-arm64/arm64.nobtitest.bti_c_func
* kselftest-arm64/arm64.nobtitest.bti_j_func
* kselftest-arm64/arm64.nobtitest.bti_jc_func
* kselftest-arm64/arm64.nobtitest.bti_none_func
* kselftest-arm64/arm64.nobtitest.nohint_func
* kselftest-arm64/arm64.nobtitest.paciasp_func
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-drivers-dma-buf
* kselftest-efivarfs
* kselftest-filesystems
* kselftest-filesystems-binderfs
* kselftest-firmware
* kselftest-fpu
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-kexec
* kselftest-kvm
* kselftest-lib
* kselftest-livepatch
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mount
* kselftest-mqueue
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-splice
* kselftest-static_keys
* kselftest-sync
* kselftest-sysctl
* kselftest-tc-testing
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-vm
* kselftest-x86
* kselftest-zram
* kunit
* kvm-unit-tests
* libgpiod
* libhugetlbfs
* log-parser-boot
* log-parser-test
* ltp-cap_bounds
* ltp-commands
* ltp-containers
* ltp-controllers
* ltp-cpuhotplug
* ltp-crypto
* ltp-cve
* ltp-dio
* ltp-fcntl-locktests
* ltp-filecaps
* ltp-fs
* ltp-fs_bind
* ltp-fs_perms_simple
* ltp-fsx
* ltp-hugetlb
* ltp-io
* ltp-ipc
* ltp-math
* ltp-mm
* ltp-nptl
* ltp-open-posix-tests
* ltp-pty
* ltp-sched
* ltp-securebits
* ltp-smoke
* ltp-syscalls
* ltp-tracing
* network-basic-tests
* packetdrill
* perf
* perf/Zstd-perf.data-compression
* rcutorture
* v4l2-compliance
* vdso
--
Linaro LKFT
https://lkft.linaro.org
Hi Greg,
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.19.9 release. There are 192 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 Thu, 15 Sep 2022 14:03:27 +0000. Anything received after that time might be too late.
Build test (gcc version 12.2.1 20220819):
mips: 59 configs -> no failure
arm: 99 configs -> no failure
arm64: 3 configs -> no failurex86_64: 4 configs -> no failure
alpha allmodconfig -> no failure
csky allmodconfig -> no failure
powerpc allmodconfig -> no failure
riscv allmodconfig -> no failure
s390 allmodconfig -> no failure
xtensa allmodconfig -> no failure
Boot test:x86_64: Booted on my test laptop. No regression.x86_64: Booted on qemu. No regression. [1]
arm64: Booted on rpi4b (4GB model). No regression. [2]
mips: Booted on ci20 board. No regression. [3]
[1]. https://openqa.qa.codethink.co.uk/tests/1821
[2]. https://openqa.qa.codethink.co.uk/tests/1826
[3]. https://openqa.qa.codethink.co.uk/tests/1828
--
Regards
Sudip
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.19.9 release. There are 192 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.
Successfully cross-compiled for arm64 (bcm2711_defconfig, GCC 10.2.0) and powerpc (ps3_defconfig, GCC 12.1.0).
Signature · 1 line
An old man doll... just what I always wanted! - Clara
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.19.9 release. There are 192 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 Thu, 15 Sep 2022 14:03:27 +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/v5.x/stable-review/patch-5.19.9-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.19.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Quoted 21 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.19.9 release. There are 192 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 Thu, 15 Sep 2022 14:03:27 +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/v5.x/stable-review/patch-5.19.9-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.19.y
and the diffstat can be found below.thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
[ ... ]
Quoted 3 lines
Csókás Bence <[email protected]>
net: fec: Use a spinlock to guard `fep->ptp_clk_on`
This commit is broken, will be reverted upstream, and should not be applied to any stable releases.
Guenter
Greg Kroah-Hartman
maintainerQuoted 22 lines · Guenter Roeck
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.19.9 release. There are 192 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 Thu, 15 Sep 2022 14:03:27 +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/v5.x/stable-review/patch-5.19.9-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.19.y
and the diffstat can be found below.Quoted 7 lines
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Quoted 7 lines
[ ... ]
Quoted 3 lines
Csókás Bence <[email protected]>
net: fec: Use a spinlock to guard `fep->ptp_clk_on`This commit is broken, will be reverted upstream, and should not be applied to any stable releases.
Already dropped from all queues, thanks.
greg k-h
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.19.9 release. There are 192 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 Thu, 15 Sep 2022 14:03:27 +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/v5.x/stable-review/patch-5.19.9-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.19.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:
Signature · 1 line
Florian
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.19.9 release. There are 192 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 Thu, 15 Sep 2022 14:03:27 +0000. Anything received after that time might be too late.
Build results:
total: 150 pass: 150 fail: 0 Qemu test results: total: 490 pass: 490 fail: 0
New runtime warning
BUG: sleeping function called from invalid context at drivers/clk/imx/clk-pllv3.c:68
thanks to:
Quoted 2 lines
Csókás Bence <[email protected]>
net: fec: Use a spinlock to guard `fep->ptp_clk_on`
In the assumption that this patch will be dropped
Guenter
Quoted 19 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.19.9 release. There are 192 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 Thu, 15 Sep 2022 14:03:27 +0000. Anything received after that time might be too late.
Build results:
total: 150 pass: 150 fail: 0 Qemu test results: total: 490 pass: 490 fail: 0New runtime warning
BUG: sleeping function called from invalid context at drivers/clk/imx/clk-pllv3.c:68
Quoted 8 lines
thanks to:
Quoted 2 lines
Csókás Bence <[email protected]>
net: fec: Use a spinlock to guard `fep->ptp_clk_on`In the assumption that this patch will be dropped
Tested-by Guenter Roeck <[email protected]>
It is being reverted upstream:
https://lore.kernel.org/netdev/[email protected]/
So probably best to just drop that patch.
Signature · 1 line
Florian
Greg Kroah-Hartman
maintainerQuoted 29 lines · Florian Fainelli
Quoted 26 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.19.9 release. There are 192 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 Thu, 15 Sep 2022 14:03:27 +0000. Anything received after that time might be too late.
Build results:
total: 150 pass: 150 fail: 0 Qemu test results: total: 490 pass: 490 fail: 0New runtime warning
BUG: sleeping function called from invalid context at drivers/clk/imx/clk-pllv3.c:68thanks to:
Quoted 2 lines
Csókás Bence <[email protected]>
net: fec: Use a spinlock to guard `fep->ptp_clk_on`In the assumption that this patch will be dropped
Quoted 7 lines
Quoted 1 line
Tested-by Guenter Roeck <[email protected]>It is being reverted upstream:
https://lore.kernel.org/netdev/[email protected]/
So probably best to just drop that patch.
It is already dropped, thanks.
greg k-h
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.19.9 release. There are 192 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.
Quoted 8 lines
Responses should be made by Thu, 15 Sep 2022 14:03:27 +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/v5.x/stable-review/patch-5.19.9-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.19.y
and the diffstat can be found below.
openSUSE configs¹⁾ all green.
¹⁾ armv6hl armv7hl arm64 i386 ppc64 ppc64le riscv64 s390x x86_64
Signature · 2 lines
js suse labs