mailweb.openeuler.org
Manage this list

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Kernel

Threads by month
  • ----- 2025 -----
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
kernel@openeuler.org

  • 56 participants
  • 18791 discussions
[openeuler:OLK-6.6 7229/14254] drivers/net/ethernet/mucse/rnp/rnp_sriov.c:304:13: warning: 'check_ari_mode' defined but not used
by kernel test robot 30 Sep '24

30 Sep '24
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: e4fe1cc5cc1a347dec844c60d34f6141780f05af commit: bc0e7c9b35e0290125847e322dce4609f83f2dc9 [7229/14254] RNP: Fix warnings config: loongarch-randconfig-001-20240930 (https://download.01.org/0day-ci/archive/20240930/202409301601.gC4P89Gn-lkp@…) compiler: loongarch64-linux-gcc (GCC) 14.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240930/202409301601.gC4P89Gn-lkp@…) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202409301601.gC4P89Gn-lkp@intel.com/ All warnings (new ones prefixed by >>): drivers/net/ethernet/mucse/rnp/rnp_sriov.c: In function 'rnp_pci_sriov_disable': drivers/net/ethernet/mucse/rnp/rnp_sriov.c:396:13: warning: variable 'err' set but not used [-Wunused-but-set-variable] 396 | int err; | ^~~ drivers/net/ethernet/mucse/rnp/rnp_sriov.c:410:9: warning: no return statement in function returning non-void [-Wreturn-type] 410 | } | ^ drivers/net/ethernet/mucse/rnp/rnp_sriov.c: At top level: drivers/net/ethernet/mucse/rnp/rnp_sriov.c:412:9: error: expected identifier or '(' before 'return' 412 | return err; | ^~~~~~ drivers/net/ethernet/mucse/rnp/rnp_sriov.c:413:1: error: expected identifier or '(' before '}' token 413 | } | ^ >> drivers/net/ethernet/mucse/rnp/rnp_sriov.c:304:13: warning: 'check_ari_mode' defined but not used [-Wunused-function] 304 | static bool check_ari_mode(struct pci_dev *dev) | ^~~~~~~~~~~~~~ vim +/check_ari_mode +304 drivers/net/ethernet/mucse/rnp/rnp_sriov.c 303 > 304 static bool check_ari_mode(struct pci_dev *dev) 305 { 306 struct pci_bus *bus = dev->bus; 307 308 return bus->self && bus->self->ari_enabled; 309 } 310 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[PATCH OLK-5.10] perf cpumap: Wrapper for CPU map indices
by Yushan Wang 30 Sep '24

30 Sep '24
driver inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IAQFZR CVE: NA ---------------------------------------------------------------------- Linux mainline changed the type of perf CPU map into struct perf_cpu to avoid confuses of CPU maps from cpu. The change affects a lot of infrastructures of Perf tool which this patchset depends on to fix perf undesirably scrutinizing events on offline CPUs issue[1]. This patch, with the purpose of adapting of following patches from Linux mainline to openeuler, is a mere copy of the patch [2] which changes the type of perf CPU map with careful refaction of affected code. [1] https://lore.kernel.org/lkml/20240603092812.46616-1-yangyicong@huawei.com/ [2] https://lore.kernel.org/r/20220105061351.120843-49-irogers@google.com Signed-off-by: Yushan Wang <wangyushan12(a)huawei.com> --- tools/lib/perf/cpumap.c | 28 ++++++++-------- tools/lib/perf/evsel.c | 2 +- tools/lib/perf/include/internal/cpumap.h | 3 +- tools/lib/perf/include/perf/cpumap.h | 5 +++ tools/perf/bench/epoll-ctl.c | 2 +- tools/perf/bench/epoll-wait.c | 2 +- tools/perf/bench/futex-hash.c | 2 +- tools/perf/bench/futex-lock-pi.c | 2 +- tools/perf/bench/futex-requeue.c | 2 +- tools/perf/bench/futex-wake-parallel.c | 2 +- tools/perf/bench/futex-wake.c | 2 +- tools/perf/builtin-c2c.c | 6 ++-- tools/perf/builtin-script.c | 2 +- tools/perf/builtin-stat.c | 12 +++---- tools/perf/tests/bitmap.c | 2 +- tools/perf/tests/cpumap.c | 6 ++-- tools/perf/tests/event_update.c | 6 ++-- tools/perf/tests/mem2node.c | 2 +- tools/perf/tests/mmap-basic.c | 4 +-- tools/perf/tests/openat-syscall-all-cpus.c | 14 ++++---- tools/perf/tests/topology.c | 4 +-- tools/perf/util/auxtrace.c | 2 +- tools/perf/util/cpumap.c | 32 +++++++++---------- tools/perf/util/cpumap.h | 2 +- tools/perf/util/cputopo.c | 2 +- tools/perf/util/evlist.c | 2 +- tools/perf/util/evsel.c | 4 +-- tools/perf/util/mmap.c | 2 +- tools/perf/util/perf_api_probe.c | 4 +-- tools/perf/util/record.c | 6 ++-- .../scripting-engines/trace-event-python.c | 2 +- tools/perf/util/session.c | 2 +- tools/perf/util/stat-display.c | 10 +++--- tools/perf/util/svghelper.c | 2 +- tools/perf/util/synthetic-events.c | 6 ++-- 35 files changed, 97 insertions(+), 91 deletions(-) diff --git a/tools/lib/perf/cpumap.c b/tools/lib/perf/cpumap.c index ca0215047c32..778b50f71744 100644 --- a/tools/lib/perf/cpumap.c +++ b/tools/lib/perf/cpumap.c @@ -16,7 +16,7 @@ struct perf_cpu_map *perf_cpu_map__dummy_new(void) if (cpus != NULL) { cpus->nr = 1; - cpus->map[0] = -1; + cpus->map[0].cpu = -1; refcount_set(&cpus->refcnt, 1); } @@ -59,7 +59,7 @@ static struct perf_cpu_map *cpu_map__default_new(void) int i; for (i = 0; i < nr_cpus; ++i) - cpus->map[i] = i; + cpus->map[i].cpu = i; cpus->nr = nr_cpus; refcount_set(&cpus->refcnt, 1); @@ -85,7 +85,7 @@ static struct perf_cpu_map *cpu_map__trim_new(int nr_cpus, int *tmp_cpus) /* Remove dups */ j = 0; for (i = 0; i < nr_cpus; i++) { - if (i == 0 || cpus->map[i] != cpus->map[i - 1]) + if (i == 0 || cpus->map[i].cpu != cpus->map[i - 1].cpu) cpus->map[j++] = cpus->map[i]; } cpus->nr = j; @@ -248,7 +248,7 @@ struct perf_cpu_map *perf_cpu_map__new(const char *cpu_list) int perf_cpu_map__cpu(const struct perf_cpu_map *cpus, int idx) { if (cpus && idx < cpus->nr) - return cpus->map[idx]; + return cpus->map[idx].cpu; return -1; } @@ -260,7 +260,7 @@ int perf_cpu_map__nr(const struct perf_cpu_map *cpus) bool perf_cpu_map__empty(const struct perf_cpu_map *map) { - return map ? map->map[0] == -1 : true; + return map ? map->map[0].cpu == -1 : true; } int perf_cpu_map__idx(struct perf_cpu_map *cpus, int cpu) @@ -268,7 +268,7 @@ int perf_cpu_map__idx(struct perf_cpu_map *cpus, int cpu) int i; for (i = 0; i < cpus->nr; ++i) { - if (cpus->map[i] == cpu) + if (cpus->map[i].cpu == cpu) return i; } @@ -280,8 +280,8 @@ int perf_cpu_map__max(struct perf_cpu_map *map) int i, max = -1; for (i = 0; i < map->nr; i++) { - if (map->map[i] > max) - max = map->map[i]; + if (map->map[i].cpu > max) + max = map->map[i].cpu; } return max; @@ -323,19 +323,19 @@ struct perf_cpu_map *perf_cpu_map__merge(struct perf_cpu_map *orig, /* Standard merge algorithm from wikipedia */ i = j = k = 0; while (i < orig->nr && j < other->nr) { - if (orig->map[i] <= other->map[j]) { - if (orig->map[i] == other->map[j]) + if (orig->map[i].cpu <= other->map[j].cpu) { + if (orig->map[i].cpu == other->map[j].cpu) j++; - tmp_cpus[k++] = orig->map[i++]; + tmp_cpus[k++] = orig->map[i++].cpu; } else - tmp_cpus[k++] = other->map[j++]; + tmp_cpus[k++] = other->map[j++].cpu; } while (i < orig->nr) - tmp_cpus[k++] = orig->map[i++]; + tmp_cpus[k++] = orig->map[i++].cpu; while (j < other->nr) - tmp_cpus[k++] = other->map[j++]; + tmp_cpus[k++] = other->map[j++].cpu; assert(k <= tmp_len); merged = cpu_map__trim_new(k, tmp_cpus); diff --git a/tools/lib/perf/evsel.c b/tools/lib/perf/evsel.c index 4dc06289f4c7..eb8b838c228e 100644 --- a/tools/lib/perf/evsel.c +++ b/tools/lib/perf/evsel.c @@ -102,7 +102,7 @@ int perf_evsel__open(struct perf_evsel *evsel, struct perf_cpu_map *cpus, fd = sys_perf_event_open(&evsel->attr, threads->map[thread].pid, - cpus->map[cpu], -1, 0); + cpus->map[cpu].cpu, -1, 0); if (fd < 0) return -errno; diff --git a/tools/lib/perf/include/internal/cpumap.h b/tools/lib/perf/include/internal/cpumap.h index 840d4032587b..2d30168ee2fc 100644 --- a/tools/lib/perf/include/internal/cpumap.h +++ b/tools/lib/perf/include/internal/cpumap.h @@ -3,11 +3,12 @@ #define __LIBPERF_INTERNAL_CPUMAP_H #include <linux/refcount.h> +#include <perf/cpumap.h> struct perf_cpu_map { refcount_t refcnt; int nr; - int map[]; + struct perf_cpu map[]; }; #ifndef MAX_NR_CPUS diff --git a/tools/lib/perf/include/perf/cpumap.h b/tools/lib/perf/include/perf/cpumap.h index 6a17ad730cbc..101a0f2b7693 100644 --- a/tools/lib/perf/include/perf/cpumap.h +++ b/tools/lib/perf/include/perf/cpumap.h @@ -6,6 +6,11 @@ #include <stdio.h> #include <stdbool.h> +/** A wrapper around a CPU to avoid confusion with the perf_cpu_map's map's indices. */ +struct perf_cpu { + int cpu; +}; + struct perf_cpu_map; LIBPERF_API struct perf_cpu_map *perf_cpu_map__dummy_new(void); diff --git a/tools/perf/bench/epoll-ctl.c b/tools/perf/bench/epoll-ctl.c index ca2d591aad8a..c4e8465017a7 100644 --- a/tools/perf/bench/epoll-ctl.c +++ b/tools/perf/bench/epoll-ctl.c @@ -254,7 +254,7 @@ static int do_threads(struct worker *worker, struct perf_cpu_map *cpu) if (!noaffinity) { CPU_ZERO(&cpuset); - CPU_SET(cpu->map[i % cpu->nr], &cpuset); + CPU_SET(cpu->map[i % cpu->nr].cpu, &cpuset); ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpuset); if (ret) diff --git a/tools/perf/bench/epoll-wait.c b/tools/perf/bench/epoll-wait.c index 75dca9773186..4bcafb10cf95 100644 --- a/tools/perf/bench/epoll-wait.c +++ b/tools/perf/bench/epoll-wait.c @@ -343,7 +343,7 @@ static int do_threads(struct worker *worker, struct perf_cpu_map *cpu) if (!noaffinity) { CPU_ZERO(&cpuset); - CPU_SET(cpu->map[i % cpu->nr], &cpuset); + CPU_SET(cpu->map[i % cpu->nr].cpu, &cpuset); ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpuset); if (ret) diff --git a/tools/perf/bench/futex-hash.c b/tools/perf/bench/futex-hash.c index 915bf3da7ce2..58b1a4f7b2e0 100644 --- a/tools/perf/bench/futex-hash.c +++ b/tools/perf/bench/futex-hash.c @@ -170,7 +170,7 @@ int bench_futex_hash(int argc, const char **argv) goto errmem; CPU_ZERO(&cpuset); - CPU_SET(cpu->map[i % cpu->nr], &cpuset); + CPU_SET(cpu->map[i % cpu->nr].cpu, &cpuset); ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpuset); if (ret) diff --git a/tools/perf/bench/futex-lock-pi.c b/tools/perf/bench/futex-lock-pi.c index 159bc89e6a79..ab97173d94f3 100644 --- a/tools/perf/bench/futex-lock-pi.c +++ b/tools/perf/bench/futex-lock-pi.c @@ -134,7 +134,7 @@ static void create_threads(struct worker *w, pthread_attr_t thread_attr, worker[i].futex = &global_futex; CPU_ZERO(&cpuset); - CPU_SET(cpu->map[i % cpu->nr], &cpuset); + CPU_SET(cpu->map[i % cpu->nr].cpu, &cpuset); if (pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpuset)) err(EXIT_FAILURE, "pthread_attr_setaffinity_np"); diff --git a/tools/perf/bench/futex-requeue.c b/tools/perf/bench/futex-requeue.c index 105b36cdc42d..3543b8d6d108 100644 --- a/tools/perf/bench/futex-requeue.c +++ b/tools/perf/bench/futex-requeue.c @@ -95,7 +95,7 @@ static void block_threads(pthread_t *w, /* create and block all threads */ for (i = 0; i < nthreads; i++) { CPU_ZERO(&cpuset); - CPU_SET(cpu->map[i % cpu->nr], &cpuset); + CPU_SET(cpu->map[i % cpu->nr].cpu, &cpuset); if (pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpuset)) err(EXIT_FAILURE, "pthread_attr_setaffinity_np"); diff --git a/tools/perf/bench/futex-wake-parallel.c b/tools/perf/bench/futex-wake-parallel.c index a129c94eb3fe..930fe67fed3c 100644 --- a/tools/perf/bench/futex-wake-parallel.c +++ b/tools/perf/bench/futex-wake-parallel.c @@ -149,7 +149,7 @@ static void block_threads(pthread_t *w, pthread_attr_t thread_attr, /* create and block all threads */ for (i = 0; i < nblocked_threads; i++) { CPU_ZERO(&cpuset); - CPU_SET(cpu->map[i % cpu->nr], &cpuset); + CPU_SET(cpu->map[i % cpu->nr].cpu, &cpuset); if (pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpuset)) err(EXIT_FAILURE, "pthread_attr_setaffinity_np"); diff --git a/tools/perf/bench/futex-wake.c b/tools/perf/bench/futex-wake.c index 507ff533612c..e43a6664f9a7 100644 --- a/tools/perf/bench/futex-wake.c +++ b/tools/perf/bench/futex-wake.c @@ -101,7 +101,7 @@ static void block_threads(pthread_t *w, /* create and block all threads */ for (i = 0; i < nthreads; i++) { CPU_ZERO(&cpuset); - CPU_SET(cpu->map[i % cpu->nr], &cpuset); + CPU_SET(cpu->map[i % cpu->nr].cpu, &cpuset); if (pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpuset)) err(EXIT_FAILURE, "pthread_attr_setaffinity_np"); diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index cf308b90d671..e12e24ca1eef 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c @@ -2383,12 +2383,12 @@ static int setup_nodes(struct perf_session *session) continue; for (cpu = 0; cpu < map->nr; cpu++) { - set_bit(map->map[cpu], set); + set_bit(map->map[cpu].cpu, set); - if (WARN_ONCE(cpu2node[map->map[cpu]] != -1, "node/cpu topology bug")) + if (WARN_ONCE(cpu2node[map->map[cpu].cpu] != -1, "node/cpu topology bug")) return -EINVAL; - cpu2node[map->map[cpu]] = node; + cpu2node[map->map[cpu].cpu] = node; } } diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 44e3f4a83549..fc6be5d7db10 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -2047,7 +2047,7 @@ static void __process_stat(struct evsel *counter, u64 tstamp) counts = perf_counts(counter->counts, cpu, thread); printf("%3d %8d %15" PRIu64 " %15" PRIu64 " %15" PRIu64 " %15" PRIu64 " %s\n", - counter->core.cpus->map[cpu], + counter->core.cpus->map[cpu].cpu, perf_thread_map__pid(counter->core.threads, thread), counts->val, counts->ena, diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 1f8a23a1b867..a5dafba23d93 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -213,7 +213,7 @@ static bool cpus_map_matched(struct evsel *a, struct evsel *b) return false; for (int i = 0; i < a->core.cpus->nr; i++) { - if (a->core.cpus->map[i] != b->core.cpus->map[i]) + if (a->core.cpus->map[i].cpu != b->core.cpus->map[i].cpu) return false; } @@ -1222,12 +1222,12 @@ static int perf_stat__get_aggr(struct perf_stat_config *config, if (idx >= map->nr) return -1; - cpu = map->map[idx]; + cpu = map->map[idx].cpu; - if (config->cpus_aggr_map->map[cpu] == -1) - config->cpus_aggr_map->map[cpu] = get_id(config, map, idx); + if (config->cpus_aggr_map->map[cpu].cpu == -1) + config->cpus_aggr_map->map[cpu].cpu = get_id(config, map, idx); - return config->cpus_aggr_map->map[cpu]; + return config->cpus_aggr_map->map[cpu].cpu; } static int perf_stat__get_socket_cached(struct perf_stat_config *config, @@ -1341,7 +1341,7 @@ static inline int perf_env__get_cpu(struct perf_env *env, struct perf_cpu_map *m if (idx > map->nr) return -1; - cpu = map->map[idx]; + cpu = map->map[idx].cpu; if (cpu >= env->nr_cpus_avail) return -1; diff --git a/tools/perf/tests/bitmap.c b/tools/perf/tests/bitmap.c index 96c137360918..8717e03924dd 100644 --- a/tools/perf/tests/bitmap.c +++ b/tools/perf/tests/bitmap.c @@ -18,7 +18,7 @@ static unsigned long *get_bitmap(const char *str, int nbits) if (map && bm) { for (i = 0; i < map->nr; i++) - set_bit(map->map[i], bm); + set_bit(map->map[i].cpu, bm); } if (map) diff --git a/tools/perf/tests/cpumap.c b/tools/perf/tests/cpumap.c index 29c793ac7d10..08e0faf3e8a2 100644 --- a/tools/perf/tests/cpumap.c +++ b/tools/perf/tests/cpumap.c @@ -38,7 +38,7 @@ static int process_event_mask(struct perf_tool *tool __maybe_unused, TEST_ASSERT_VAL("wrong nr", map->nr == 20); for (i = 0; i < 20; i++) { - TEST_ASSERT_VAL("wrong cpu", map->map[i] == i); + TEST_ASSERT_VAL("wrong cpu", map->map[i].cpu == i); } perf_cpu_map__put(map); @@ -67,8 +67,8 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused, map = cpu_map__new_data(data); TEST_ASSERT_VAL("wrong nr", map->nr == 2); - TEST_ASSERT_VAL("wrong cpu", map->map[0] == 1); - TEST_ASSERT_VAL("wrong cpu", map->map[1] == 256); + TEST_ASSERT_VAL("wrong cpu", map->map[0].cpu == 1); + TEST_ASSERT_VAL("wrong cpu", map->map[1].cpu == 256); TEST_ASSERT_VAL("wrong refcnt", refcount_read(&map->refcnt) == 1); perf_cpu_map__put(map); return 0; diff --git a/tools/perf/tests/event_update.c b/tools/perf/tests/event_update.c index 1c9a6138fba1..0ffe1ef0f1a7 100644 --- a/tools/perf/tests/event_update.c +++ b/tools/perf/tests/event_update.c @@ -76,9 +76,9 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused, TEST_ASSERT_VAL("wrong id", ev->id == 123); TEST_ASSERT_VAL("wrong type", ev->type == PERF_EVENT_UPDATE__CPUS); TEST_ASSERT_VAL("wrong cpus", map->nr == 3); - TEST_ASSERT_VAL("wrong cpus", map->map[0] == 1); - TEST_ASSERT_VAL("wrong cpus", map->map[1] == 2); - TEST_ASSERT_VAL("wrong cpus", map->map[2] == 3); + TEST_ASSERT_VAL("wrong cpus", map->map[0].cpu == 1); + TEST_ASSERT_VAL("wrong cpus", map->map[1].cpu == 2); + TEST_ASSERT_VAL("wrong cpus", map->map[2].cpu == 3); perf_cpu_map__put(map); return 0; } diff --git a/tools/perf/tests/mem2node.c b/tools/perf/tests/mem2node.c index a258bd51f1a4..96afd0e7599f 100644 --- a/tools/perf/tests/mem2node.c +++ b/tools/perf/tests/mem2node.c @@ -31,7 +31,7 @@ static unsigned long *get_bitmap(const char *str, int nbits) if (map && bm) { for (i = 0; i < map->nr; i++) { - set_bit(map->map[i], bm); + set_bit(map->map[i].cpu, bm); } } diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c index 7b0dbfc0e17d..e2c3aa27c8f1 100644 --- a/tools/perf/tests/mmap-basic.c +++ b/tools/perf/tests/mmap-basic.c @@ -59,11 +59,11 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse } CPU_ZERO(&cpu_set); - CPU_SET(cpus->map[0], &cpu_set); + CPU_SET(cpus->map[0].cpu, &cpu_set); sched_setaffinity(0, sizeof(cpu_set), &cpu_set); if (sched_setaffinity(0, sizeof(cpu_set), &cpu_set) < 0) { pr_debug("sched_setaffinity() failed on CPU %d: %s ", - cpus->map[0], str_error_r(errno, sbuf, sizeof(sbuf))); + cpus->map[0].cpu, str_error_r(errno, sbuf, sizeof(sbuf))); goto out_free_cpus; } diff --git a/tools/perf/tests/openat-syscall-all-cpus.c b/tools/perf/tests/openat-syscall-all-cpus.c index 71f85e2cc127..10279c22ac03 100644 --- a/tools/perf/tests/openat-syscall-all-cpus.c +++ b/tools/perf/tests/openat-syscall-all-cpus.c @@ -66,15 +66,15 @@ int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, int * without CPU_ALLOC. 1024 cpus in 2010 still seems * a reasonable upper limit tho :-) */ - if (cpus->map[cpu] >= CPU_SETSIZE) { - pr_debug("Ignoring CPU %d\n", cpus->map[cpu]); + if (cpus->map[cpu].cpu >= CPU_SETSIZE) { + pr_debug("Ignoring CPU %d\n", cpus->map[cpu].cpu); continue; } - CPU_SET(cpus->map[cpu], &cpu_set); + CPU_SET(cpus->map[cpu].cpu, &cpu_set); if (sched_setaffinity(0, sizeof(cpu_set), &cpu_set) < 0) { pr_debug("sched_setaffinity() failed on CPU %d: %s ", - cpus->map[cpu], + cpus->map[cpu].cpu, str_error_r(errno, sbuf, sizeof(sbuf))); goto out_close_fd; } @@ -82,7 +82,7 @@ int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, int fd = openat(0, "/etc/passwd", O_RDONLY); close(fd); } - CPU_CLR(cpus->map[cpu], &cpu_set); + CPU_CLR(cpus->map[cpu].cpu, &cpu_set); } /* @@ -100,7 +100,7 @@ int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, int for (cpu = 0; cpu < cpus->nr; ++cpu) { unsigned int expected; - if (cpus->map[cpu] >= CPU_SETSIZE) + if (cpus->map[cpu].cpu >= CPU_SETSIZE) continue; if (evsel__read_on_cpu(evsel, cpu, 0) < 0) { @@ -112,7 +112,7 @@ int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, int expected = nr_openat_calls + cpu; if (perf_counts(evsel->counts, cpu, 0)->val != expected) { pr_debug("evsel__read_on_cpu: expected to intercept %d calls on cpu %d, got %" PRIu64 "\n", - expected, cpus->map[cpu], perf_counts(evsel->counts, cpu, 0)->val); + expected, cpus->map[cpu].cpu, perf_counts(evsel->counts, cpu, 0)->val); err = -1; } } diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c index f4a2c0df0954..9913bd5a0734 100644 --- a/tools/perf/tests/topology.c +++ b/tools/perf/tests/topology.c @@ -101,10 +101,10 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map) for (i = 0; i < map->nr; i++) { TEST_ASSERT_VAL("Core ID doesn't match", - (session->header.env.cpu[map->map[i]].core_id == (cpu_map__get_core(map, i, NULL) & 0xffff))); + (session->header.env.cpu[map->map[i].cpu].core_id == (cpu_map__get_core(map, i, NULL) & 0xffff))); TEST_ASSERT_VAL("Socket ID doesn't match", - (session->header.env.cpu[map->map[i]].socket_id == cpu_map__get_socket(map, i, NULL))); + (session->header.env.cpu[map->map[i].cpu].socket_id == cpu_map__get_socket(map, i, NULL))); } perf_session__delete(session); diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 5d58b2f653ed..382d2c96d803 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -189,7 +189,7 @@ void auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp, mp->idx = idx; if (per_cpu) { - mp->cpu = evlist->core.cpus->map[idx]; + mp->cpu = evlist->core.cpus->map[idx].cpu; if (evlist->core.threads) mp->tid = perf_thread_map__pid(evlist->core.threads, 0); else diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c index dc5c5e6fc502..2731356d7192 100644 --- a/tools/perf/util/cpumap.c +++ b/tools/perf/util/cpumap.c @@ -33,9 +33,9 @@ static struct perf_cpu_map *cpu_map__from_entries(struct cpu_map_entries *cpus) * otherwise it would become 65535. */ if (cpus->cpu[i] == (u16) -1) - map->map[i] = -1; + map->map[i].cpu = -1; else - map->map[i] = (int) cpus->cpu[i]; + map->map[i].cpu = (int) cpus->cpu[i]; } } @@ -54,7 +54,7 @@ static struct perf_cpu_map *cpu_map__from_mask(struct perf_record_record_cpu_map int cpu, i = 0; for_each_set_bit(cpu, mask->mask, nbits) - map->map[i++] = cpu; + map->map[i++].cpu = cpu; } return map; @@ -87,7 +87,7 @@ struct perf_cpu_map *perf_cpu_map__empty_new(int nr) cpus->nr = nr; for (i = 0; i < nr; i++) - cpus->map[i] = -1; + cpus->map[i].cpu = -1; refcount_set(&cpus->refcnt, 1); } @@ -118,7 +118,7 @@ int cpu_map__get_socket(struct perf_cpu_map *map, int idx, void *data __maybe_un if (idx > map->nr) return -1; - cpu = map->map[idx]; + cpu = map->map[idx].cpu; return cpu_map__get_socket_id(cpu); } @@ -144,11 +144,11 @@ int cpu_map__build_map(struct perf_cpu_map *cpus, struct perf_cpu_map **res, for (cpu = 0; cpu < nr; cpu++) { s1 = f(cpus, cpu, data); for (s2 = 0; s2 < c->nr; s2++) { - if (s1 == c->map[s2]) + if (s1 == c->map[s2].cpu) break; } if (s2 == c->nr) { - c->map[c->nr] = s1; + c->map[c->nr].cpu = s1; c->nr++; } } @@ -174,7 +174,7 @@ int cpu_map__get_die(struct perf_cpu_map *map, int idx, void *data) if (idx > map->nr) return -1; - cpu = map->map[idx]; + cpu = map->map[idx].cpu; die_id = cpu_map__get_die_id(cpu); /* There is no die_id on legacy system. */ @@ -218,7 +218,7 @@ int cpu_map__get_core(struct perf_cpu_map *map, int idx, void *data) if (idx > map->nr) return -1; - cpu = map->map[idx]; + cpu = map->map[idx].cpu; cpu = cpu_map__get_core_id(cpu); @@ -245,7 +245,7 @@ int cpu_map__get_node(struct perf_cpu_map *map, int idx, void *data __maybe_unus if (idx < 0 || idx >= map->nr) return -1; - return cpu_map__get_node_id(map->map[idx]); + return cpu_map__get_node_id(map->map[idx].cpu); } int cpu_map__build_socket_map(struct perf_cpu_map *cpus, struct perf_cpu_map **sockp) @@ -482,7 +482,7 @@ bool cpu_map__has(struct perf_cpu_map *cpus, int cpu) int cpu_map__cpu(struct perf_cpu_map *cpus, int idx) { - return cpus->map[idx]; + return cpus->map[idx].cpu; } size_t cpu_map__snprint(struct perf_cpu_map *map, char *buf, size_t size) @@ -496,26 +496,26 @@ size_t cpu_map__snprint(struct perf_cpu_map *map, char *buf, size_t size) for (i = 0; i < map->nr + 1; i++) { bool last = i == map->nr; - cpu = last ? INT_MAX : map->map[i]; + cpu = last ? INT_MAX : map->map[i].cpu; if (start == -1) { start = i; if (last) { ret += snprintf(buf + ret, size - ret, "%s%d", COMMA, - map->map[i]); + map->map[i].cpu); } - } else if (((i - start) != (cpu - map->map[start])) || last) { + } else if (((i - start) != (cpu - map->map[start].cpu)) || last) { int end = i - 1; if (start == end) { ret += snprintf(buf + ret, size - ret, "%s%d", COMMA, - map->map[start]); + map->map[start].cpu); } else { ret += snprintf(buf + ret, size - ret, "%s%d-%d", COMMA, - map->map[start], map->map[end]); + map->map[start].cpu, map->map[end].cpu); } first = false; start = i; diff --git a/tools/perf/util/cpumap.h b/tools/perf/util/cpumap.h index 3a442f021468..446c48f18fe2 100644 --- a/tools/perf/util/cpumap.h +++ b/tools/perf/util/cpumap.h @@ -32,7 +32,7 @@ static inline int cpu_map__socket(struct perf_cpu_map *sock, int s) { if (!sock || s > sock->nr || s < 0) return 0; - return sock->map[s]; + return sock->map[s].cpu; } static inline int cpu_map__id_to_socket(int id) diff --git a/tools/perf/util/cputopo.c b/tools/perf/util/cputopo.c index 1b52402a8923..0cf6567da87f 100644 --- a/tools/perf/util/cputopo.c +++ b/tools/perf/util/cputopo.c @@ -328,7 +328,7 @@ struct numa_topology *numa_topology__new(void) tp->nr = nr; for (i = 0; i < nr; i++) { - if (load_numa_node(&tp->nodes[i], node_map->map[i])) { + if (load_numa_node(&tp->nodes[i], node_map->map[i].cpu)) { numa_topology__delete(tp); tp = NULL; break; diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 66b230fe3e26..ad864e032116 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -373,7 +373,7 @@ bool evsel__cpu_iter_skip_no_inc(struct evsel *ev, int cpu) { if (ev->cpu_iter >= ev->core.cpus->nr) return true; - if (cpu >= 0 && ev->core.cpus->map[ev->cpu_iter] != cpu) + if (cpu >= 0 && ev->core.cpus->map[ev->cpu_iter].cpu != cpu) return true; return false; } diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 9fd9c3cb2330..70dbe4d79203 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1792,13 +1792,13 @@ static int evsel__open_cpu(struct evsel *evsel, struct perf_cpu_map *cpus, retry_open: test_attr__ready(); - fd = perf_event_open(evsel, pid, cpus->map[cpu], + fd = perf_event_open(evsel, pid, cpus->map[cpu].cpu, group_fd, flags); FD(evsel, cpu, thread) = fd; if (unlikely(test_attr__enabled)) { - test_attr__open(&evsel->core.attr, pid, cpus->map[cpu], + test_attr__open(&evsel->core.attr, pid, cpus->map[cpu].cpu, fd, group_fd, flags); } diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c index daedd2fc3928..9f184911f754 100644 --- a/tools/perf/util/mmap.c +++ b/tools/perf/util/mmap.c @@ -249,7 +249,7 @@ static void build_node_mask(int node, struct mmap_cpu_mask *mask) nr_cpus = perf_cpu_map__nr(cpu_map); for (c = 0; c < nr_cpus; c++) { - cpu = cpu_map->map[c]; /* map c index to online cpu index */ + cpu = cpu_map->map[c].cpu; /* map c index to online cpu index */ if (cpu__get_node(cpu) == node) set_bit(cpu, mask->bits); } diff --git a/tools/perf/util/perf_api_probe.c b/tools/perf/util/perf_api_probe.c index 3840d02f0f7b..27d6ac6bfd04 100644 --- a/tools/perf/util/perf_api_probe.c +++ b/tools/perf/util/perf_api_probe.c @@ -66,7 +66,7 @@ static bool perf_probe_api(setup_probe_fn_t fn) cpus = perf_cpu_map__new(NULL); if (!cpus) return false; - cpu = cpus->map[0]; + cpu = cpus->map[0].cpu; perf_cpu_map__put(cpus); do { @@ -131,7 +131,7 @@ bool perf_can_record_cpu_wide(void) cpus = perf_cpu_map__new(NULL); if (!cpus) return false; - cpu = cpus->map[0]; + cpu = cpus->map[0].cpu; perf_cpu_map__put(cpus); fd = sys_perf_event_open(&attr, -1, cpu, -1, 0); diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c index 07e4b96a6625..5ca210d73a6d 100644 --- a/tools/perf/util/record.c +++ b/tools/perf/util/record.c @@ -104,7 +104,7 @@ void perf_evlist__config(struct evlist *evlist, struct record_opts *opts, if (opts->group) perf_evlist__set_leader(evlist); - if (evlist->core.cpus->map[0] < 0) + if (evlist->core.cpus->map[0].cpu < 0) opts->no_inherit = true; use_comm_exec = perf_can_comm_exec(); @@ -238,10 +238,10 @@ bool perf_evlist__can_select_event(struct evlist *evlist, const char *str) if (!evlist || perf_cpu_map__empty(evlist->core.cpus)) { struct perf_cpu_map *cpus = perf_cpu_map__new(NULL); - cpu = cpus ? cpus->map[0] : 0; + cpu = cpus ? cpus->map[0].cpu : 0; perf_cpu_map__put(cpus); } else { - cpu = evlist->core.cpus->map[0]; + cpu = evlist->core.cpus->map[0].cpu; } while (1) { diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index 23dc5014e711..dc15f0bf6b7f 100644 --- a/tools/perf/util/scripting-engines/trace-event-python.c +++ b/tools/perf/util/scripting-engines/trace-event-python.c @@ -1425,7 +1425,7 @@ static void python_process_stat(struct perf_stat_config *config, for (thread = 0; thread < threads->nr; thread++) { for (cpu = 0; cpu < cpus->nr; cpu++) { - process_stat(counter, cpus->map[cpu], + process_stat(counter, cpus->map[cpu].cpu, perf_thread_map__pid(threads, thread), tstamp, perf_counts(counter->counts, cpu, thread)); } diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 95cf2e09d443..d621b6dccf05 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -2444,7 +2444,7 @@ int perf_session__cpu_bitmap(struct perf_session *session, } for (i = 0; i < map->nr; i++) { - int cpu = map->map[i]; + int cpu = map->map[i].cpu; if (cpu >= nr_cpus) { pr_err("Requested CPU %d too large. " diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index 4688e39de52a..e84206f957b2 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c @@ -120,7 +120,7 @@ static void aggr_printout(struct perf_stat_config *config, } else if (id > -1) { fprintf(config->output, "CPU%*d%s", config->csv_output ? 0 : -7, - evsel__cpus(evsel)->map[id], + evsel__cpus(evsel)->map[id].cpu, config->csv_sep); } break; @@ -331,7 +331,7 @@ static int first_shadow_cpu(struct perf_stat_config *config, return 0; for (i = 0; i < evsel__nr_cpus(evsel); i++) { - int cpu2 = evsel__cpus(evsel)->map[i]; + int cpu2 = evsel__cpus(evsel)->map[i].cpu; if (config->aggr_get_id(config, evlist->core.cpus, cpu2) == id) return cpu2; @@ -501,7 +501,7 @@ static void aggr_update_shadow(struct perf_stat_config *config, struct evsel *counter; for (s = 0; s < config->aggr_map->nr; s++) { - id = config->aggr_map->map[s]; + id = config->aggr_map->map[s].cpu; evlist__for_each_entry(evlist, counter) { val = 0; for (cpu = 0; cpu < evsel__nr_cpus(counter); cpu++) { @@ -632,7 +632,7 @@ static void print_counter_aggrdata(struct perf_stat_config *config, int id, nr; double uval; - ad.id = id = config->aggr_map->map[s]; + ad.id = id = config->aggr_map->map[s].cpu; ad.val = ad.ena = ad.run = 0; ad.nr = 0; if (!collect_data(config, counter, aggr_cb, &ad)) @@ -1147,7 +1147,7 @@ static void print_percore_thread(struct perf_stat_config *config, for (int i = 0; i < evsel__nr_cpus(counter); i++) { s2 = config->aggr_get_id(config, evsel__cpus(counter), i); for (s = 0; s < config->aggr_map->nr; s++) { - id = config->aggr_map->map[s]; + id = config->aggr_map->map[s].cpu; if (s2 == id) break; } diff --git a/tools/perf/util/svghelper.c b/tools/perf/util/svghelper.c index 96f941e01681..660702eb4d79 100644 --- a/tools/perf/util/svghelper.c +++ b/tools/perf/util/svghelper.c @@ -735,7 +735,7 @@ static int str_to_bitmap(char *s, cpumask_t *b, int nr_cpus) return -1; for (i = 0; i < m->nr; i++) { - c = m->map[i]; + c = m->map[i].cpu; if (c >= nr_cpus) { ret = -1; break; diff --git a/tools/perf/util/synthetic-events.c b/tools/perf/util/synthetic-events.c index b4cf6dd57dd6..3865f0e48374 100644 --- a/tools/perf/util/synthetic-events.c +++ b/tools/perf/util/synthetic-events.c @@ -1101,7 +1101,7 @@ static void synthesize_cpus(struct cpu_map_entries *cpus, cpus->nr = map->nr; for (i = 0; i < map->nr; i++) - cpus->cpu[i] = map->map[i]; + cpus->cpu[i] = map->map[i].cpu; } static void synthesize_mask(struct perf_record_record_cpu_map *mask, @@ -1113,7 +1113,7 @@ static void synthesize_mask(struct perf_record_record_cpu_map *mask, mask->long_size = sizeof(long); for (i = 0; i < map->nr; i++) - set_bit(map->map[i], mask->mask); + set_bit(map->map[i].cpu, mask->mask); } static size_t cpus_size(struct perf_cpu_map *map) @@ -1129,7 +1129,7 @@ static size_t mask_size(struct perf_cpu_map *map, int *max) for (i = 0; i < map->nr; i++) { /* bit possition of the cpu is + 1 */ - int bit = map->map[i] + 1; + int bit = map->map[i].cpu + 1; if (bit > *max) *max = bit; -- 2.33.0
2 1
0 0
[PATCH OLK-5.10] drm/amd/display: Assign linear_pitch_alignment even for VM
by Gu Bowen 30 Sep '24

30 Sep '24
From: Alvin Lee <alvin.lee2(a)amd.com> stable inclusion from stable-v6.1.109 commit d219f902b16d42f0cb8c499ea8f31cf3c0f36349 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IARVIX CVE: CVE-2024-46732 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- [ Upstream commit 984debc133efa05e62f5aa1a7a1dd8ca0ef041f4 ] [Description] Assign linear_pitch_alignment so we don't cause a divide by 0 error in VM environments Reviewed-by: Sohaib Nadeem <sohaib.nadeem(a)amd.com> Acked-by: Wayne Lin <wayne.lin(a)amd.com> Signed-off-by: Alvin Lee <alvin.lee2(a)amd.com> Tested-by: Daniel Wheeler <daniel.wheeler(a)amd.com> Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com> Signed-off-by: Sasha Levin <sashal(a)kernel.org> Conflicts: drivers/gpu/drm/amd/display/dc/core/dc.c [Context conflicts with dc_create().] Signed-off-by: Gu Bowen <gubowen5(a)huawei.com> --- drivers/gpu/drm/amd/display/dc/core/dc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index 050e46741c99..adcf5ba83703 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -938,6 +938,7 @@ struct dc *dc_create(const struct dc_init_data *init_params) goto alloc_fail; if (init_params->dce_environment == DCE_ENV_VIRTUAL_HW) { + dc->caps.linear_pitch_alignment = 64; if (false == dc_construct_ctx(dc, init_params)) { dc_destruct(dc); goto construct_fail; -- 2.25.1
2 1
0 0
[PATCH openEuler-22.03-LTS-SP1 V1] nvmet-tcp: fix kernel crash if commands allocation fails
by Cheng Yu 30 Sep '24

30 Sep '24
From: Maurizio Lombardi <mlombard(a)redhat.com> stable inclusion from stable-v5.10.226 commit 50632b877ce55356f5d276b9add289b1e7ddc683 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IARYBC CVE: CVE-2024-46737 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- [ Upstream commit 5572a55a6f830ee3f3a994b6b962a5c327d28cb3 ] If the commands allocation fails in nvmet_tcp_alloc_cmds() the kernel crashes in nvmet_tcp_release_queue_work() because of a NULL pointer dereference. nvmet: failed to install queue 0 cntlid 1 ret 6 Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 Fix the bug by setting queue->nr_cmds to zero in case nvmet_tcp_alloc_cmd() fails. Fixes: 872d26a391da ("nvmet-tcp: add NVMe over TCP target driver") Signed-off-by: Maurizio Lombardi <mlombard(a)redhat.com> Reviewed-by: Christoph Hellwig <hch(a)lst.de> Signed-off-by: Keith Busch <kbusch(a)kernel.org> Signed-off-by: Sasha Levin <sashal(a)kernel.org> Signed-off-by: Cheng Yu <serein.chengyu(a)huawei.com> --- drivers/nvme/target/tcp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c index dc52372ed7b8..d90f7f249da6 100644 --- a/drivers/nvme/target/tcp.c +++ b/drivers/nvme/target/tcp.c @@ -1787,8 +1787,10 @@ static u16 nvmet_tcp_install_queue(struct nvmet_sq *sq) } queue->nr_cmds = sq->size * 2; - if (nvmet_tcp_alloc_cmds(queue)) + if (nvmet_tcp_alloc_cmds(queue)) { + queue->nr_cmds = 0; return NVME_SC_INTERNAL; + } return 0; } -- 2.25.1
2 1
0 0
[PATCH OLK-6.6 V1] nvmet-tcp: fix kernel crash if commands allocation fails
by Cheng Yu 30 Sep '24

30 Sep '24
From: Maurizio Lombardi <mlombard(a)redhat.com> stable inclusion from stable-v6.6.51 commit 489f2913a63f528cfe3f21722583fb981967ecda category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IARYBC CVE: CVE-2024-46737 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- [ Upstream commit 5572a55a6f830ee3f3a994b6b962a5c327d28cb3 ] If the commands allocation fails in nvmet_tcp_alloc_cmds() the kernel crashes in nvmet_tcp_release_queue_work() because of a NULL pointer dereference. nvmet: failed to install queue 0 cntlid 1 ret 6 Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 Fix the bug by setting queue->nr_cmds to zero in case nvmet_tcp_alloc_cmd() fails. Fixes: 872d26a391da ("nvmet-tcp: add NVMe over TCP target driver") Signed-off-by: Maurizio Lombardi <mlombard(a)redhat.com> Reviewed-by: Christoph Hellwig <hch(a)lst.de> Signed-off-by: Keith Busch <kbusch(a)kernel.org> Signed-off-by: Sasha Levin <sashal(a)kernel.org> Signed-off-by: Cheng Yu <serein.chengyu(a)huawei.com> --- drivers/nvme/target/tcp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c index 3d302815c6f3..f1f6c5fec7b0 100644 --- a/drivers/nvme/target/tcp.c +++ b/drivers/nvme/target/tcp.c @@ -1858,8 +1858,10 @@ static u16 nvmet_tcp_install_queue(struct nvmet_sq *sq) } queue->nr_cmds = sq->size * 2; - if (nvmet_tcp_alloc_cmds(queue)) + if (nvmet_tcp_alloc_cmds(queue)) { + queue->nr_cmds = 0; return NVME_SC_INTERNAL; + } return 0; } -- 2.25.1
2 1
0 0
[PATCH OLK-5.10 V1] nvmet-tcp: fix kernel crash if commands allocation fails
by Cheng Yu 30 Sep '24

30 Sep '24
From: Maurizio Lombardi <mlombard(a)redhat.com> stable inclusion from stable-v5.10.226 commit 50632b877ce55356f5d276b9add289b1e7ddc683 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IARYBC CVE: CVE-2024-46737 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- [ Upstream commit 5572a55a6f830ee3f3a994b6b962a5c327d28cb3 ] If the commands allocation fails in nvmet_tcp_alloc_cmds() the kernel crashes in nvmet_tcp_release_queue_work() because of a NULL pointer dereference. nvmet: failed to install queue 0 cntlid 1 ret 6 Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 Fix the bug by setting queue->nr_cmds to zero in case nvmet_tcp_alloc_cmd() fails. Fixes: 872d26a391da ("nvmet-tcp: add NVMe over TCP target driver") Signed-off-by: Maurizio Lombardi <mlombard(a)redhat.com> Reviewed-by: Christoph Hellwig <hch(a)lst.de> Signed-off-by: Keith Busch <kbusch(a)kernel.org> Signed-off-by: Sasha Levin <sashal(a)kernel.org> Signed-off-by: Cheng Yu <serein.chengyu(a)huawei.com> --- drivers/nvme/target/tcp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c index d70a2fa4ba45..a9b0789d803b 100644 --- a/drivers/nvme/target/tcp.c +++ b/drivers/nvme/target/tcp.c @@ -1786,8 +1786,10 @@ static u16 nvmet_tcp_install_queue(struct nvmet_sq *sq) } queue->nr_cmds = sq->size * 2; - if (nvmet_tcp_alloc_cmds(queue)) + if (nvmet_tcp_alloc_cmds(queue)) { + queue->nr_cmds = 0; return NVME_SC_INTERNAL; + } return 0; } -- 2.25.1
2 1
0 0
[PATCH openEuler-22.03-LTS-SP1] drm/amd/display: Add array index check for hdcp ddc access
by Bowen You 30 Sep '24

30 Sep '24
From: Hersen Wu <hersenxs.wu(a)amd.com> stable inclusion from stable-5.10.226 commit 2a63c90c7a90ab2bd23deebc2814fc5b52abf6d2 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAU9O7 CVE: CVE-2024-46804 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- [ Upstream commit 4e70c0f5251c25885c31ee84a31f99a01f7cf50e ] [Why] Coverity reports OVERRUN warning. Do not check if array index valid. [How] Check msg_id valid and valid array index. Reviewed-by: Alex Hung <alex.hung(a)amd.com> Acked-by: Tom Chung <chiahsuan.chung(a)amd.com> Signed-off-by: Hersen Wu <hersenxs.wu(a)amd.com> Tested-by: Daniel Wheeler <daniel.wheeler(a)amd.com> Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com> Signed-off-by: Sasha Levin <sashal(a)kernel.org> Signed-off-by: Bowen You <youbowen2(a)huawei.com> --- .../drm/amd/display/modules/hdcp/hdcp_ddc.c | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c index 8e9caae7c955..1b2df97226a3 100644 --- a/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c +++ b/drivers/gpu/drm/amd/display/modules/hdcp/hdcp_ddc.c @@ -156,11 +156,16 @@ static enum mod_hdcp_status read(struct mod_hdcp *hdcp, uint32_t cur_size = 0; uint32_t data_offset = 0; - if (msg_id == MOD_HDCP_MESSAGE_ID_INVALID) { + if (msg_id == MOD_HDCP_MESSAGE_ID_INVALID || + msg_id >= MOD_HDCP_MESSAGE_ID_MAX) return MOD_HDCP_STATUS_DDC_FAILURE; - } if (is_dp_hdcp(hdcp)) { + int num_dpcd_addrs = sizeof(hdcp_dpcd_addrs) / + sizeof(hdcp_dpcd_addrs[0]); + if (msg_id >= num_dpcd_addrs) + return MOD_HDCP_STATUS_DDC_FAILURE; + while (buf_len > 0) { cur_size = MIN(buf_len, HDCP_MAX_AUX_TRANSACTION_SIZE); success = hdcp->config.ddc.funcs.read_dpcd(hdcp->config.ddc.handle, @@ -175,6 +180,11 @@ static enum mod_hdcp_status read(struct mod_hdcp *hdcp, data_offset += cur_size; } } else { + int num_i2c_offsets = sizeof(hdcp_i2c_offsets) / + sizeof(hdcp_i2c_offsets[0]); + if (msg_id >= num_i2c_offsets) + return MOD_HDCP_STATUS_DDC_FAILURE; + success = hdcp->config.ddc.funcs.read_i2c( hdcp->config.ddc.handle, HDCP_I2C_ADDR, @@ -219,11 +229,16 @@ static enum mod_hdcp_status write(struct mod_hdcp *hdcp, uint32_t cur_size = 0; uint32_t data_offset = 0; - if (msg_id == MOD_HDCP_MESSAGE_ID_INVALID) { + if (msg_id == MOD_HDCP_MESSAGE_ID_INVALID || + msg_id >= MOD_HDCP_MESSAGE_ID_MAX) return MOD_HDCP_STATUS_DDC_FAILURE; - } if (is_dp_hdcp(hdcp)) { + int num_dpcd_addrs = sizeof(hdcp_dpcd_addrs) / + sizeof(hdcp_dpcd_addrs[0]); + if (msg_id >= num_dpcd_addrs) + return MOD_HDCP_STATUS_DDC_FAILURE; + while (buf_len > 0) { cur_size = MIN(buf_len, HDCP_MAX_AUX_TRANSACTION_SIZE); success = hdcp->config.ddc.funcs.write_dpcd( @@ -239,6 +254,11 @@ static enum mod_hdcp_status write(struct mod_hdcp *hdcp, data_offset += cur_size; } } else { + int num_i2c_offsets = sizeof(hdcp_i2c_offsets) / + sizeof(hdcp_i2c_offsets[0]); + if (msg_id >= num_i2c_offsets) + return MOD_HDCP_STATUS_DDC_FAILURE; + hdcp->buf[0] = hdcp_i2c_offsets[msg_id]; memmove(&hdcp->buf[1], buf, buf_len); success = hdcp->config.ddc.funcs.write_i2c( -- 2.34.1
2 5
0 0
[PATCH OLK-6.6] drm/amd/display: Assign linear_pitch_alignment even for VM
by Gu Bowen 30 Sep '24

30 Sep '24
From: Alvin Lee <alvin.lee2(a)amd.com> stable inclusion from stable-v6.6.50 commit d2fe7ac613a1ea8c346c9f5c89dc6ecc27232997 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IARVIX CVE: CVE-2024-46732 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- [ Upstream commit 984debc133efa05e62f5aa1a7a1dd8ca0ef041f4 ] [Description] Assign linear_pitch_alignment so we don't cause a divide by 0 error in VM environments Reviewed-by: Sohaib Nadeem <sohaib.nadeem(a)amd.com> Acked-by: Wayne Lin <wayne.lin(a)amd.com> Signed-off-by: Alvin Lee <alvin.lee2(a)amd.com> Tested-by: Daniel Wheeler <daniel.wheeler(a)amd.com> Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com> Signed-off-by: Sasha Levin <sashal(a)kernel.org> Signed-off-by: Gu Bowen <gubowen5(a)huawei.com> --- drivers/gpu/drm/amd/display/dc/core/dc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index 72db370e2f21..50e643bfdfba 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -1298,6 +1298,7 @@ struct dc *dc_create(const struct dc_init_data *init_params) return NULL; if (init_params->dce_environment == DCE_ENV_VIRTUAL_HW) { + dc->caps.linear_pitch_alignment = 64; if (!dc_construct_ctx(dc, init_params)) goto destruct_dc; } else { -- 2.25.1
2 1
0 0
[openeuler:OLK-6.6 7044/14254] drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c:1236:6: warning: no previous prototype for 'rnpgbevf_alloc_rx_buffers'
by kernel test robot 30 Sep '24

30 Sep '24
Hi Dong, FYI, the error/warning still remains. tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: e4fe1cc5cc1a347dec844c60d34f6141780f05af commit: bf177ad1d8f72824180b44563c09f37562f645de [7044/14254] drivers: initial support for rnpgbevf drivers from Mucse Technology config: loongarch-randconfig-001-20240930 (https://download.01.org/0day-ci/archive/20240930/202409301357.XJDOWyKd-lkp@…) compiler: loongarch64-linux-gcc (GCC) 14.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240930/202409301357.XJDOWyKd-lkp@…) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202409301357.XJDOWyKd-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from drivers/net/ethernet/mucse/rnpgbevf/vf.h:13, from drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf.h:14, from drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c:27: drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_defines.h: In function '_rnp_skb_dump': drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_defines.h:265:23: warning: variable 'tailroom' set but not used [-Wunused-but-set-variable] 265 | int headroom, tailroom; | ^~~~~~~~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_defines.h:265:13: warning: variable 'headroom' set but not used [-Wunused-but-set-variable] 265 | int headroom, tailroom; | ^~~~~~~~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_defines.h:264:23: warning: variable 'has_trans' set but not used [-Wunused-but-set-variable] 264 | bool has_mac, has_trans; | ^~~~~~~~~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_defines.h:264:14: warning: variable 'has_mac' set but not used [-Wunused-but-set-variable] 264 | bool has_mac, has_trans; | ^~~~~~~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c: At top level: drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c:119:6: warning: no previous prototype for 'rnpgbevf_unmap_and_free_tx_resource' [-Wmissing-prototypes] 119 | void rnpgbevf_unmap_and_free_tx_resource(struct rnpgbevf_ring *ring, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c:1236:6: warning: no previous prototype for 'rnpgbevf_alloc_rx_buffers' [-Wmissing-prototypes] 1236 | void rnpgbevf_alloc_rx_buffers(struct rnpgbevf_ring *rx_ring, u16 cleaned_count) | ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c: In function 'rnpgbevf_clean_rx_irq': drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c:1530:14: warning: variable 'xdp_xmit' set but not used [-Wunused-but-set-variable] 1530 | bool xdp_xmit = false; | ^~~~~~~~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c: At top level: drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c:2263:6: warning: no previous prototype for 'rnpgbevf_write_eitr_rx' [-Wmissing-prototypes] 2263 | void rnpgbevf_write_eitr_rx(struct rnpgbevf_q_vector *q_vector) | ^~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c:2361:6: warning: no previous prototype for 'rnpgbevf_configure_tx_ring' [-Wmissing-prototypes] 2361 | void rnpgbevf_configure_tx_ring(struct rnpgbevf_adapter *adapter, | ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c:2426:6: warning: no previous prototype for 'rnpgbevf_disable_rx_queue' [-Wmissing-prototypes] 2426 | void rnpgbevf_disable_rx_queue(struct rnpgbevf_adapter *adapter, | ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c:2432:6: warning: no previous prototype for 'rnpgbevf_enable_rx_queue' [-Wmissing-prototypes] 2432 | void rnpgbevf_enable_rx_queue(struct rnpgbevf_adapter *adapter, | ^~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c:2438:6: warning: no previous prototype for 'rnpgbevf_configure_rx_ring' [-Wmissing-prototypes] 2438 | void rnpgbevf_configure_rx_ring(struct rnpgbevf_adapter *adapter, | ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c: In function 'rnpgbevf_vlan_rx_kill_vid': drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c:2561:13: warning: variable 'err' set but not used [-Wunused-but-set-variable] 2561 | int err = -EOPNOTSUPP; | ^~~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c: In function 'rnpgbevf_acquire_msix_vectors': drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c:3187:13: warning: variable 'vector_threshold' set but not used [-Wunused-but-set-variable] 3187 | int vector_threshold; | ^~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c: At top level: drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c:4378:6: warning: no previous prototype for 'rnpgbevf_tx_ctxtdesc' [-Wmissing-prototypes] 4378 | void rnpgbevf_tx_ctxtdesc(struct rnpgbevf_ring *tx_ring, u16 mss_seg_len, | ^~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c:4820:6: warning: no previous prototype for 'rnpgbevf_maybe_tx_ctxtdesc' [-Wmissing-prototypes] 4820 | void rnpgbevf_maybe_tx_ctxtdesc(struct rnpgbevf_ring *tx_ring, | ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c:4838:13: warning: no previous prototype for 'rnpgbevf_xmit_frame_ring' [-Wmissing-prototypes] 4838 | netdev_tx_t rnpgbevf_xmit_frame_ring(struct sk_buff *skb, | ^~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c:5311:6: warning: no previous prototype for 'rnpgbevf_assign_netdev_ops' [-Wmissing-prototypes] 5311 | void rnpgbevf_assign_netdev_ops(struct net_device *dev) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c: In function 'rnpgbevf_request_msix_irqs': drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c:1978:44: warning: '%d' directive output may be truncated writing between 1 and 5 bytes into a region of size between 1 and 16 [-Wformat-truncation=] 1978 | "%s-%s-%d-%d", netdev->name, "TxRx", i, | ^~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c:1978:34: note: directive argument in the range [0, 65535] 1978 | "%s-%s-%d-%d", netdev->name, "TxRx", i, | ^~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c:1977:25: note: 'snprintf' output between 10 and 29 bytes into a destination of size 24 1977 | snprintf(q_vector->name, sizeof(q_vector->name) - 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1978 | "%s-%s-%d-%d", netdev->name, "TxRx", i, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1979 | q_vector->v_idx); | ~~~~~~~~~~~~~~~~ vim +/rnpgbevf_alloc_rx_buffers +1236 drivers/net/ethernet/mucse/rnpgbevf/rnpgbevf_main.c 1229 1230 #else 1231 /** 1232 * rnpgbevf_alloc_rx_buffers - Replace used receive buffers 1233 * @rx_ring: ring to place buffers on 1234 * @cleaned_count: number of buffers to replace 1235 **/ > 1236 void rnpgbevf_alloc_rx_buffers(struct rnpgbevf_ring *rx_ring, u16 cleaned_count) 1237 { 1238 union rnp_rx_desc *rx_desc; 1239 struct rnpgbevf_rx_buffer *bi; 1240 u16 i = rx_ring->next_to_use; 1241 u64 fun_id = ((u64)(rx_ring->vfnum) << (32 + 24)); 1242 u16 bufsz; 1243 /* nothing to do */ 1244 if (!cleaned_count) 1245 return; 1246 1247 rx_desc = RNPVF_RX_DESC(rx_ring, i); 1248 1249 BUG_ON(!rx_desc); 1250 1251 bi = &rx_ring->rx_buffer_info[i]; 1252 1253 BUG_ON(!bi); 1254 1255 i -= rx_ring->count; 1256 bufsz = rnpgbevf_rx_bufsz(rx_ring); 1257 1258 do { 1259 if (!rnpgbevf_alloc_mapped_page(rx_ring, bi)) 1260 break; 1261 1262 dma_sync_single_range_for_device(rx_ring->dev, bi->dma, 1263 bi->page_offset, bufsz, 1264 DMA_FROM_DEVICE); 1265 1266 /* Refresh the desc even if buffer_addrs didn't change 1267 * because each write-back erases this info. 1268 */ 1269 rx_desc->pkt_addr = 1270 cpu_to_le64(bi->dma + bi->page_offset + fun_id); 1271 1272 /* clean dd */ 1273 rx_desc->cmd = 0; 1274 1275 rx_desc++; 1276 bi++; 1277 i++; 1278 if (unlikely(!i)) { 1279 rx_desc = RNPVF_RX_DESC(rx_ring, 0); 1280 bi = rx_ring->rx_buffer_info; 1281 i -= rx_ring->count; 1282 } 1283 1284 /* clear the hdr_addr for the next_to_use descriptor */ 1285 cleaned_count--; 1286 } while (cleaned_count); 1287 1288 i += rx_ring->count; 1289 1290 if (rx_ring->next_to_use != i) 1291 rnpgbevf_update_rx_tail(rx_ring, i); 1292 } 1293 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:OLK-6.6 6865/14250] drivers/net/ethernet/mucse/rnpvf/rnpvf_regs.h:21:26: error: called object is not a function or function pointer
by kernel test robot 30 Sep '24

30 Sep '24
Hi Dong, FYI, the error/warning still remains. tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 02590a1a9ea3aa1e89ddb076e71968ef7278fa8b commit: 6adab536d69347a10c2366aaf6b86de963d5994b [6865/14250] drivers: initial support for rnpvf drivers from Mucse Technology config: loongarch-randconfig-001-20240930 (https://download.01.org/0day-ci/archive/20240930/202409301139.po9zoLOB-lkp@…) compiler: loongarch64-linux-gcc (GCC) 14.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240930/202409301139.po9zoLOB-lkp@…) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202409301139.po9zoLOB-lkp@intel.com/ All error/warnings (new ones prefixed by >>): drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:127:6: warning: no previous prototype for 'rnpvf_unmap_and_free_tx_resource' [-Wmissing-prototypes] 127 | void rnpvf_unmap_and_free_tx_resource(struct rnpvf_ring *ring, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:1365:6: warning: no previous prototype for 'rnpvf_alloc_rx_buffers' [-Wmissing-prototypes] 1365 | void rnpvf_alloc_rx_buffers(struct rnpvf_ring *rx_ring, u16 cleaned_count) | ^~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c: In function 'rnpvf_clean_rx_irq': drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:1659:14: warning: variable 'xdp_xmit' set but not used [-Wunused-but-set-variable] 1659 | bool xdp_xmit = false; | ^~~~~~~~ drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c: At top level: drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:1945:6: warning: no previous prototype for 'update_rx_count' [-Wmissing-prototypes] 1945 | void update_rx_count(int cleaned, struct rnpvf_q_vector *q_vector) | ^~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:2420:6: warning: no previous prototype for 'rnpvf_write_eitr_rx' [-Wmissing-prototypes] 2420 | void rnpvf_write_eitr_rx(struct rnpvf_q_vector *q_vector) | ^~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:2523:6: warning: no previous prototype for 'rnpvf_configure_tx_ring' [-Wmissing-prototypes] 2523 | void rnpvf_configure_tx_ring(struct rnpvf_adapter *adapter, | ^~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:2589:6: warning: no previous prototype for 'rnpvf_disable_rx_queue' [-Wmissing-prototypes] 2589 | void rnpvf_disable_rx_queue(struct rnpvf_adapter *adapter, | ^~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:2595:6: warning: no previous prototype for 'rnpvf_enable_rx_queue' [-Wmissing-prototypes] 2595 | void rnpvf_enable_rx_queue(struct rnpvf_adapter *adapter, | ^~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:2601:6: warning: no previous prototype for 'rnpvf_configure_rx_ring' [-Wmissing-prototypes] 2601 | void rnpvf_configure_rx_ring(struct rnpvf_adapter *adapter, | ^~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c: In function 'rnpvf_vlan_rx_kill_vid': drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:2736:13: warning: variable 'err' set but not used [-Wunused-but-set-variable] 2736 | int err = -EOPNOTSUPP; | ^~~ drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c: In function 'rnpvf_acquire_msix_vectors': drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:3307:13: warning: variable 'vector_threshold' set but not used [-Wunused-but-set-variable] 3307 | int vector_threshold; | ^~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c: In function 'irq_miss_check': drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:3456:26: warning: variable 'hw' set but not used [-Wunused-but-set-variable] 3456 | struct rnpvf_hw *hw; | ^~ drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c: At top level: drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:4590:6: warning: no previous prototype for 'rnpvf_tx_ctxtdesc' [-Wmissing-prototypes] 4590 | void rnpvf_tx_ctxtdesc(struct rnpvf_ring *tx_ring, u16 mss_seg_len, | ^~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:5039:6: warning: no previous prototype for 'rnpvf_maybe_tx_ctxtdesc' [-Wmissing-prototypes] 5039 | void rnpvf_maybe_tx_ctxtdesc(struct rnpvf_ring *tx_ring, | ^~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:5089:13: warning: no previous prototype for 'rnpvf_xmit_frame_ring' [-Wmissing-prototypes] 5089 | netdev_tx_t rnpvf_xmit_frame_ring(struct sk_buff *skb, | ^~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:5580:6: warning: no previous prototype for 'rnpvf_assign_netdev_ops' [-Wmissing-prototypes] 5580 | void rnpvf_assign_netdev_ops(struct net_device *dev) | ^~~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/net/ethernet/mucse/rnpvf/vf.h:14, from drivers/net/ethernet/mucse/rnpvf/rnpvf.h:14, from drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:26: drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c: In function 'rnpvf_vfnum': >> drivers/net/ethernet/mucse/rnpvf/rnpvf_regs.h:21:26: error: called object is not a function or function pointer 21 | #define RNP_DMA_RX_START (0x10) | ^ drivers/net/ethernet/mucse/rnpvf/rnpvf_regs.h:104:42: note: in definition of macro 'rnpvf_rd_reg' 104 | #define rnpvf_rd_reg(reg) readl((void *)(reg)) | ^~~ drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:5599:21: note: in expansion of macro 'rd32' 5599 | v = rd32(hw, RNP_DMA_RX_START(ring)); | ^~~~ drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:5599:30: note: in expansion of macro 'RNP_DMA_RX_START' 5599 | v = rd32(hw, RNP_DMA_RX_START(ring)); | ^~~~~~~~~~~~~~~~ >> drivers/net/ethernet/mucse/rnpvf/rnpvf_main.c:5591:13: warning: unused variable 'pfvfnum_reg' [-Wunused-variable] 5591 | u32 pfvfnum_reg; | ^~~~~~~~~~~ vim +21 drivers/net/ethernet/mucse/rnpvf/rnpvf_regs.h 13 14 #define RNP_DMA_RING_BASE 0x8000 15 #define RNP_DMA_RX_DESC_TIMEOUT_TH 0x8000 16 #define RNP_DMA_TX_DESC_FETCH_CTL 0x8004 17 #define RNP_DMA_TX_FLOW_CTRL_TM 0x8008 18 #define RNP_RING_BASE_N10 (0x8000) 19 #define RNP_RING_BASE_N500 (0x1000) 20 #define RNP_RING_OFFSET(i) (0x100 * (i)) > 21 #define RNP_DMA_RX_START (0x10) 22 #define RNP_DMA_RX_READY (0x14) 23 #define RNP_DMA_TX_START (0x18) 24 #define RNP_DMA_TX_READY (0x1c) 25 #define RNP_DMA_INT_STAT (0x20) 26 #define RNP_DMA_INT_MASK (0x24) 27 #define TX_INT_MASK (0x1 << 1) 28 #define RX_INT_MASK (0x1 << 0) 29 #define RNP_DMA_INT_CLR (0x28) 30 #define RNP_DMA_INT_TRIG (0x2c) 31 #define RNP_DMA_REG_RX_DESC_BUF_BASE_ADDR_HI (0x30) 32 #define RNP_DMA_REG_RX_DESC_BUF_BASE_ADDR_LO (0x34) 33 #define RNP_DMA_REG_RX_DESC_BUF_LEN (0x38) 34 #define RNP_DMA_REG_RX_DESC_BUF_HEAD (0x3c) 35 #define RNP_DMA_REG_RX_DESC_BUF_TAIL (0x40) 36 #define RNP_DMA_REG_RX_DESC_FETCH_CTRL (0x44) 37 #define RNP_DMA_REG_RX_INT_DELAY_TIMER (0x48) 38 #define RNP_DMA_REG_RX_INT_DELAY_PKTCNT (0x4c) 39 #define RNP_DMA_REG_RX_ARB_DEF_LVL (0x50) 40 #define PCI_DMA_REG_RX_DESC_TIMEOUT_TH (0x54) 41 #define PCI_DMA_REG_RX_SCATTER_LENGTH (0x58) 42 #define RNP_DMA_REG_TX_DESC_BUF_BASE_ADDR_HI (0x60) 43 #define RNP_DMA_REG_TX_DESC_BUF_BASE_ADDR_LO (0x64) 44 #define RNP_DMA_REG_TX_DESC_BUF_LEN (0x68) 45 #define RNP_DMA_REG_TX_DESC_BUF_HEAD (0x6c) 46 #define RNP_DMA_REG_TX_DESC_BUF_TAIL (0x70) 47 #define RNP_DMA_REG_TX_DESC_FETCH_CTRL (0x74) 48 #define RNP_DMA_REG_TX_INT_DELAY_TIMER (0x78) 49 #define RNP_DMA_REG_TX_INT_DELAY_PKTCNT (0x7c) 50 #define RNP_DMA_REG_TX_ARB_DEF_LVL (0x80) 51 #define RNP_DMA_REG_TX_FLOW_CTRL_TH (0x84) 52 #define RNP_DMA_REG_TX_FLOW_CTRL_TM (0x88) 53 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 562
  • 563
  • 564
  • 565
  • 566
  • 567
  • 568
  • ...
  • 1880
  • Older →

HyperKitty Powered by HyperKitty