qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 0/9] Trivial patches for 2024-04-29
@ 2024-04-29  6:45 Michael Tokarev
  2024-04-29  6:45 ` [PULL 1/9] target/i386/cpu: Remove "x86" prefix from the CPU list Michael Tokarev
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Michael Tokarev @ 2024-04-29  6:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Tokarev, qemu-trivial

The following changes since commit fd87be1dada5672f877e03c2ca8504458292c479:

  Merge tag 'accel-20240426' of https://github.com/philmd/qemu into staging (2024-04-26 15:28:13 -0700)

are available in the Git repository at:

  https://gitlab.com/mjt0k/qemu.git tags/pull-trivial-patches

for you to fetch changes up to d2f20c25281908a07bcb8c3dea8292abf68e5c8b:

  checkpatch.pl: forbid strerrorname_np() (2024-04-29 09:37:26 +0300)

----------------------------------------------------------------
trivial patches for 2024-04-29

----------------------------------------------------------------
Daniel Henrique Barboza (2):
      target/riscv/kvm: remove sneaky strerrorname_np() instance
      checkpatch.pl: forbid strerrorname_np()

Li Zhijian via (1):
      backends/cryptodev-builtin: Fix local_error leaks

Michael Tokarev (1):
      target/loongarch/cpu.c: typo fix: expection

Philippe Mathieu-Daudé (2):
      scripts/checkpatch: Avoid author email mangled by qemu-*@nongnu.org
      scripts/checkpatch: Do not use mailmap

Thomas Huth (3):
      target/i386/cpu: Remove "x86" prefix from the CPU list
      target/s390x/cpu_models: Rework the output of "-cpu help"
      target/ppc/cpu_init: Remove "PowerPC" prefix from the CPU list

 backends/cryptodev-builtin.c |  9 +++++----
 scripts/checkpatch.pl        | 11 +++++++----
 target/i386/cpu.c            |  2 +-
 target/loongarch/cpu.c       |  2 +-
 target/ppc/cpu_init.c        |  9 +++++----
 target/riscv/kvm/kvm-cpu.c   |  4 ++--
 target/s390x/cpu_models.c    |  9 +++++----
 7 files changed, 26 insertions(+), 20 deletions(-)


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PULL 1/9] target/i386/cpu: Remove "x86" prefix from the CPU list
  2024-04-29  6:45 [PULL 0/9] Trivial patches for 2024-04-29 Michael Tokarev
@ 2024-04-29  6:45 ` Michael Tokarev
  2024-04-29  6:45 ` [PULL 2/9] target/s390x/cpu_models: Rework the output of "-cpu help" Michael Tokarev
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Michael Tokarev @ 2024-04-29  6:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Thomas Huth, qemu-trivial, Michael Tokarev

From: Thomas Huth <thuth@redhat.com>

Printing an "x86" in front of each CPU name is not helpful at all:
It is confusing for the users since they don't know whether they
have to specify these letters for the "-cpu" parameter, too, and
it also takes some precious space in the dense output of the CPU
entries. Let's simply remove this now and use two spaces at the
beginning of the lines for the indentation of the entries instead,
like most other target architectures are doing it for their CPU help
output already.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target/i386/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index fa1ea3735d..aa3b2d8391 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5708,7 +5708,7 @@ static void x86_cpu_list_entry(gpointer data, gpointer user_data)
         desc = g_strdup_printf("%s (deprecated)", olddesc);
     }
 
-    qemu_printf("x86 %-20s  %s\n", name, desc);
+    qemu_printf("  %-20s  %s\n", name, desc);
 }
 
 /* list available CPU models and flags */
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 2/9] target/s390x/cpu_models: Rework the output of "-cpu help"
  2024-04-29  6:45 [PULL 0/9] Trivial patches for 2024-04-29 Michael Tokarev
  2024-04-29  6:45 ` [PULL 1/9] target/i386/cpu: Remove "x86" prefix from the CPU list Michael Tokarev
@ 2024-04-29  6:45 ` Michael Tokarev
  2024-04-29  6:45 ` [PULL 3/9] target/ppc/cpu_init: Remove "PowerPC" prefix from the CPU list Michael Tokarev
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Michael Tokarev @ 2024-04-29  6:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Thomas Huth, qemu-trivial, Michael Tokarev

From: Thomas Huth <thuth@redhat.com>

Printing an "s390x" in front of each CPU name is not helpful at all:
It is confusing for the users since they don't know whether they
have to specify these letters for the "-cpu" parameter, too, and
it also takes some precious space in the dense output of the CPU
entries. Let's simply remove this now!

While we're at it, use two spaces at the beginning of the lines for
the indentation of the entries, and add a "Available CPUs" in the
very first line, like most other target architectures are doing it
for their "-cpu help" output already.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target/s390x/cpu_models.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index 8ed3bb6a27..58c58f05a0 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -355,9 +355,9 @@ static void s390_print_cpu_model_list_entry(gpointer data, gpointer user_data)
     /* strip off the -s390x-cpu */
     g_strrstr(name, "-" TYPE_S390_CPU)[0] = 0;
     if (details->len) {
-        qemu_printf("s390 %-15s %-35s (%s)\n", name, scc->desc, details->str);
+        qemu_printf("  %-15s %-35s (%s)\n", name, scc->desc, details->str);
     } else {
-        qemu_printf("s390 %-15s %-35s\n", name, scc->desc);
+        qemu_printf("  %-15s %-35s\n", name, scc->desc);
     }
     g_free(name);
 }
@@ -402,6 +402,7 @@ void s390_cpu_list(void)
     S390Feat feat;
     GSList *list;
 
+    qemu_printf("Available CPUs:\n");
     list = object_class_get_list(TYPE_S390_CPU, false);
     list = g_slist_sort(list, s390_cpu_list_compare);
     g_slist_foreach(list, s390_print_cpu_model_list_entry, NULL);
@@ -411,14 +412,14 @@ void s390_cpu_list(void)
     for (feat = 0; feat < S390_FEAT_MAX; feat++) {
         const S390FeatDef *def = s390_feat_def(feat);
 
-        qemu_printf("%-20s %s\n", def->name, def->desc);
+        qemu_printf("  %-20s %s\n", def->name, def->desc);
     }
 
     qemu_printf("\nRecognized feature groups:\n");
     for (group = 0; group < S390_FEAT_GROUP_MAX; group++) {
         const S390FeatGroupDef *def = s390_feat_group_def(group);
 
-        qemu_printf("%-20s %s\n", def->name, def->desc);
+        qemu_printf("  %-20s %s\n", def->name, def->desc);
     }
 }
 
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 3/9] target/ppc/cpu_init: Remove "PowerPC" prefix from the CPU list
  2024-04-29  6:45 [PULL 0/9] Trivial patches for 2024-04-29 Michael Tokarev
  2024-04-29  6:45 ` [PULL 1/9] target/i386/cpu: Remove "x86" prefix from the CPU list Michael Tokarev
  2024-04-29  6:45 ` [PULL 2/9] target/s390x/cpu_models: Rework the output of "-cpu help" Michael Tokarev
@ 2024-04-29  6:45 ` Michael Tokarev
  2024-04-29  6:45 ` [PULL 4/9] scripts/checkpatch: Avoid author email mangled by qemu-*@nongnu.org Michael Tokarev
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Michael Tokarev @ 2024-04-29  6:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Thomas Huth, qemu-trivial, Michael Tokarev

From: Thomas Huth <thuth@redhat.com>

Printing a "PowerPC" in front of each CPU name is not helpful at all:
It is confusing for the users since they don't know whether they
have to specify these letters for the "-cpu" parameter, too, and
it also takes some precious space in the dense output of the CPU
entries. Let's simply remove this now and use two spaces at the
beginning of the lines for the indentation of the entries instead,
and add a "Available CPUs" in the very first line, like most other
target architectures are doing it for their CPU help output already.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target/ppc/cpu_init.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index 6d82f24c87..c11a69fd90 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -7063,7 +7063,7 @@ static void ppc_cpu_list_entry(gpointer data, gpointer user_data)
     }
 
     name = cpu_model_from_type(typename);
-    qemu_printf("PowerPC %-16s PVR %08x\n", name, pcc->pvr);
+    qemu_printf("  %-16s PVR %08x\n", name, pcc->pvr);
     for (i = 0; ppc_cpu_aliases[i].alias != NULL; i++) {
         PowerPCCPUAlias *alias = &ppc_cpu_aliases[i];
         ObjectClass *alias_oc = ppc_cpu_class_by_name(alias->model);
@@ -7076,10 +7076,10 @@ static void ppc_cpu_list_entry(gpointer data, gpointer user_data)
          * avoid printing the wrong alias here and use "preferred" instead
          */
         if (strcmp(alias->alias, family->desc) == 0) {
-            qemu_printf("PowerPC %-16s (alias for preferred %s CPU)\n",
+            qemu_printf("  %-16s (alias for preferred %s CPU)\n",
                         alias->alias, family->desc);
         } else {
-            qemu_printf("PowerPC %-16s (alias for %s)\n",
+            qemu_printf("  %-16s (alias for %s)\n",
                         alias->alias, name);
         }
     }
@@ -7090,6 +7090,7 @@ void ppc_cpu_list(void)
 {
     GSList *list;
 
+    qemu_printf("Available CPUs:\n");
     list = object_class_get_list(TYPE_POWERPC_CPU, false);
     list = g_slist_sort(list, ppc_cpu_list_compare);
     g_slist_foreach(list, ppc_cpu_list_entry, NULL);
@@ -7097,7 +7098,7 @@ void ppc_cpu_list(void)
 
 #ifdef CONFIG_KVM
     qemu_printf("\n");
-    qemu_printf("PowerPC %s\n", "host");
+    qemu_printf("  %s\n", "host");
 #endif
 }
 
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 4/9] scripts/checkpatch: Avoid author email mangled by qemu-*@nongnu.org
  2024-04-29  6:45 [PULL 0/9] Trivial patches for 2024-04-29 Michael Tokarev
                   ` (2 preceding siblings ...)
  2024-04-29  6:45 ` [PULL 3/9] target/ppc/cpu_init: Remove "PowerPC" prefix from the CPU list Michael Tokarev
@ 2024-04-29  6:45 ` Michael Tokarev
  2024-04-29  6:45 ` [PULL 5/9] scripts/checkpatch: Do not use mailmap Michael Tokarev
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Michael Tokarev @ 2024-04-29  6:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé, qemu-trivial, Michael Tokarev

From: Philippe Mathieu-Daudé <philmd@linaro.org>

Commit f5177798d8 ("scripts: report on author emails
that are mangled by the mailing list") added a check
for qemu-devel@ list, extend the regexp to cover more
such qemu-trivial@, qemu-block@ and qemu-ppc@.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 7026895074..12e9028b10 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1573,7 +1573,7 @@ sub process {
 			$is_patch = 1;
 		}
 
-		if ($line =~ /^(Author|From): .* via .*<qemu-devel\@nongnu.org>/) {
+		if ($line =~ /^(Author|From): .* via .*<qemu-\w+\@nongnu\.org>/) {
 		    ERROR("Author email address is mangled by the mailing list\n" . $herecurr);
 		}
 
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 5/9] scripts/checkpatch: Do not use mailmap
  2024-04-29  6:45 [PULL 0/9] Trivial patches for 2024-04-29 Michael Tokarev
                   ` (3 preceding siblings ...)
  2024-04-29  6:45 ` [PULL 4/9] scripts/checkpatch: Avoid author email mangled by qemu-*@nongnu.org Michael Tokarev
@ 2024-04-29  6:45 ` Michael Tokarev
  2024-04-29  6:45 ` [PULL 6/9] backends/cryptodev-builtin: Fix local_error leaks Michael Tokarev
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Michael Tokarev @ 2024-04-29  6:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé, qemu-trivial, Michael Tokarev

From: Philippe Mathieu-Daudé <philmd@linaro.org>

The .mailmap file fixes mistake we already did.
Do not use it when running checkpatch.pl, otherwise
we might commit the very same mistakes.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 scripts/checkpatch.pl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 12e9028b10..76a0b79266 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -435,8 +435,8 @@ if ($chk_branch) {
 	my @patches;
 	my %git_commits = ();
 	my $HASH;
-	open($HASH, "-|", "git", "log", "--reverse", "--no-merges", "--format=%H %s", $ARGV[0]) ||
-		die "$P: git log --reverse --no-merges --format='%H %s' $ARGV[0] failed - $!\n";
+	open($HASH, "-|", "git", "log", "--reverse", "--no-merges", "--no-mailmap", "--format=%H %s", $ARGV[0]) ||
+		die "$P: git log --reverse --no-merges --no-mailmap --format='%H %s' $ARGV[0] failed - $!\n";
 
 	for my $line (<$HASH>) {
 		$line =~ /^([0-9a-fA-F]{40,40}) (.*)$/;
@@ -460,7 +460,7 @@ if ($chk_branch) {
                      "-c", "diff.renamelimit=0",
                      "-c", "diff.renames=True",
                      "-c", "diff.algorithm=histogram",
-                     "show",
+                     "show", "--no-mailmap",
                      "--patch-with-stat", $hash) ||
 			die "$P: git show $hash - $!\n";
 		while (<$FILE>) {
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 6/9] backends/cryptodev-builtin: Fix local_error leaks
  2024-04-29  6:45 [PULL 0/9] Trivial patches for 2024-04-29 Michael Tokarev
                   ` (4 preceding siblings ...)
  2024-04-29  6:45 ` [PULL 5/9] scripts/checkpatch: Do not use mailmap Michael Tokarev
@ 2024-04-29  6:45 ` Michael Tokarev
  2024-04-29 12:13   ` Richard Henderson
  2024-04-29  6:45 ` [PULL 7/9] target/loongarch/cpu.c: typo fix: expection Michael Tokarev
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 11+ messages in thread
From: Michael Tokarev @ 2024-04-29  6:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev

From: Li Zhijian via <qemu-devel@nongnu.org>

It seems that this error does not need to be propagated to the upper,
directly output the error to avoid the leaks

Closes: https://gitlab.com/qemu-project/qemu/-/issues/2283
Fixes: 2fda101de07 ("virtio-crypto: Support asynchronous mode")
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: zhenwei pi <pizhenwei@bytedance.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 backends/cryptodev-builtin.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/backends/cryptodev-builtin.c b/backends/cryptodev-builtin.c
index a514bbb310..940104ee55 100644
--- a/backends/cryptodev-builtin.c
+++ b/backends/cryptodev-builtin.c
@@ -23,6 +23,7 @@
 
 #include "qemu/osdep.h"
 #include "sysemu/cryptodev.h"
+#include "qemu/error-report.h"
 #include "qapi/error.h"
 #include "standard-headers/linux/virtio_crypto.h"
 #include "crypto/cipher.h"
@@ -396,8 +397,8 @@ static int cryptodev_builtin_create_session(
     case VIRTIO_CRYPTO_HASH_CREATE_SESSION:
     case VIRTIO_CRYPTO_MAC_CREATE_SESSION:
     default:
-        error_setg(&local_error, "Unsupported opcode :%" PRIu32 "",
-                   sess_info->op_code);
+        error_report("Unsupported opcode :%" PRIu32 "",
+                     sess_info->op_code);
         return -VIRTIO_CRYPTO_NOTSUPP;
     }
 
@@ -554,8 +555,8 @@ static int cryptodev_builtin_operation(
 
     if (op_info->session_id >= MAX_NUM_SESSIONS ||
               builtin->sessions[op_info->session_id] == NULL) {
-        error_setg(&local_error, "Cannot find a valid session id: %" PRIu64 "",
-                   op_info->session_id);
+        error_report("Cannot find a valid session id: %" PRIu64 "",
+                     op_info->session_id);
         return -VIRTIO_CRYPTO_INVSESS;
     }
 
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 7/9] target/loongarch/cpu.c: typo fix: expection
  2024-04-29  6:45 [PULL 0/9] Trivial patches for 2024-04-29 Michael Tokarev
                   ` (5 preceding siblings ...)
  2024-04-29  6:45 ` [PULL 6/9] backends/cryptodev-builtin: Fix local_error leaks Michael Tokarev
@ 2024-04-29  6:45 ` Michael Tokarev
  2024-04-29  6:45 ` [PULL 8/9] target/riscv/kvm: remove sneaky strerrorname_np() instance Michael Tokarev
  2024-04-29  6:45 ` [PULL 9/9] checkpatch.pl: forbid strerrorname_np() Michael Tokarev
  8 siblings, 0 replies; 11+ messages in thread
From: Michael Tokarev @ 2024-04-29  6:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Tokarev, qemu-trivial

Fixes: 1590154ee437 ("target/loongarch: Fix qemu-system-loongarch64 assert failed with the option '-d int'")
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/loongarch/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
index bac84dca7a..1ebba043f4 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -92,7 +92,7 @@ void G_NORETURN do_raise_exception(CPULoongArchState *env,
 {
     CPUState *cs = env_cpu(env);
 
-    qemu_log_mask(CPU_LOG_INT, "%s: expection: %d (%s)\n",
+    qemu_log_mask(CPU_LOG_INT, "%s: exception: %d (%s)\n",
                   __func__,
                   exception,
                   loongarch_exception_name(exception));
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 8/9] target/riscv/kvm: remove sneaky strerrorname_np() instance
  2024-04-29  6:45 [PULL 0/9] Trivial patches for 2024-04-29 Michael Tokarev
                   ` (6 preceding siblings ...)
  2024-04-29  6:45 ` [PULL 7/9] target/loongarch/cpu.c: typo fix: expection Michael Tokarev
@ 2024-04-29  6:45 ` Michael Tokarev
  2024-04-29  6:45 ` [PULL 9/9] checkpatch.pl: forbid strerrorname_np() Michael Tokarev
  8 siblings, 0 replies; 11+ messages in thread
From: Michael Tokarev @ 2024-04-29  6:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel Henrique Barboza, qemu-trivial, Michael Tokarev

From: Daniel Henrique Barboza <dbarboza@ventanamicro.com>

Commit d424db2354 excluded some strerrorname_np() instances because they
break musl libc builds. Another instance happened to slip by via commit
d4ff3da8f4.

Remove it before it causes trouble again.

Fixes: d4ff3da8f4 (target/riscv/kvm: initialize 'vlenb' via get-reg-list)
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 target/riscv/kvm/kvm-cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c
index 49d2f3ad58..eaa36121c7 100644
--- a/target/riscv/kvm/kvm-cpu.c
+++ b/target/riscv/kvm/kvm-cpu.c
@@ -1054,8 +1054,8 @@ static void kvm_riscv_read_vlenb(RISCVCPU *cpu, KVMScratchCPU *kvmcpu,
 
         ret = ioctl(kvmcpu->cpufd, KVM_GET_ONE_REG, &reg);
         if (ret != 0) {
-            error_report("Unable to read vlenb register, error code: %s",
-                         strerrorname_np(errno));
+            error_report("Unable to read vlenb register, error code: %d",
+                         errno);
             exit(EXIT_FAILURE);
         }
 
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PULL 9/9] checkpatch.pl: forbid strerrorname_np()
  2024-04-29  6:45 [PULL 0/9] Trivial patches for 2024-04-29 Michael Tokarev
                   ` (7 preceding siblings ...)
  2024-04-29  6:45 ` [PULL 8/9] target/riscv/kvm: remove sneaky strerrorname_np() instance Michael Tokarev
@ 2024-04-29  6:45 ` Michael Tokarev
  8 siblings, 0 replies; 11+ messages in thread
From: Michael Tokarev @ 2024-04-29  6:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel Henrique Barboza, qemu-trivial, Michael Tokarev

From: Daniel Henrique Barboza <dbarboza@ventanamicro.com>

Commit d424db2354 removed an instance of strerrorname_np() because it
was breaking building with musl libc. A recent RISC-V patch ended up
re-introducing it again by accident.

Put this function in the baddies list in checkpatch.pl to avoid this
situation again. This is what it will look like next time:

 $ ./scripts/checkpatch.pl 0001-temp-test.patch
 ERROR: use strerror() instead of strerrorname_np()
 #22: FILE: target/riscv/kvm/kvm-cpu.c:1058:
 +                         strerrorname_np(errno));

 total: 1 errors, 0 warnings, 10 lines checked

Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 scripts/checkpatch.pl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 76a0b79266..ff373a7083 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3078,6 +3078,9 @@ sub process {
 		if ($line =~ /\b(g_)?assert\(0\)/) {
 			ERROR("use g_assert_not_reached() instead of assert(0)\n" . $herecurr);
 		}
+		if ($line =~ /\bstrerrorname_np\(/) {
+			ERROR("use strerror() instead of strerrorname_np()\n" . $herecurr);
+		}
 		my $non_exit_glib_asserts = qr{g_assert_cmpstr|
 						g_assert_cmpint|
 						g_assert_cmpuint|
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PULL 6/9] backends/cryptodev-builtin: Fix local_error leaks
  2024-04-29  6:45 ` [PULL 6/9] backends/cryptodev-builtin: Fix local_error leaks Michael Tokarev
@ 2024-04-29 12:13   ` Richard Henderson
  0 siblings, 0 replies; 11+ messages in thread
From: Richard Henderson @ 2024-04-29 12:13 UTC (permalink / raw)
  To: Michael Tokarev, qemu-devel; +Cc: qemu-trivial

On 4/28/24 23:45, Michael Tokarev wrote:
> From: Li Zhijian via <qemu-devel@nongnu.org>

Please fix the author on this patch.

r~

> 
> It seems that this error does not need to be propagated to the upper,
> directly output the error to avoid the leaks
> 
> Closes: https://gitlab.com/qemu-project/qemu/-/issues/2283
> Fixes: 2fda101de07 ("virtio-crypto: Support asynchronous mode")
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: zhenwei pi <pizhenwei@bytedance.com>
> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> ---
>   backends/cryptodev-builtin.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/backends/cryptodev-builtin.c b/backends/cryptodev-builtin.c
> index a514bbb310..940104ee55 100644
> --- a/backends/cryptodev-builtin.c
> +++ b/backends/cryptodev-builtin.c
> @@ -23,6 +23,7 @@
>   
>   #include "qemu/osdep.h"
>   #include "sysemu/cryptodev.h"
> +#include "qemu/error-report.h"
>   #include "qapi/error.h"
>   #include "standard-headers/linux/virtio_crypto.h"
>   #include "crypto/cipher.h"
> @@ -396,8 +397,8 @@ static int cryptodev_builtin_create_session(
>       case VIRTIO_CRYPTO_HASH_CREATE_SESSION:
>       case VIRTIO_CRYPTO_MAC_CREATE_SESSION:
>       default:
> -        error_setg(&local_error, "Unsupported opcode :%" PRIu32 "",
> -                   sess_info->op_code);
> +        error_report("Unsupported opcode :%" PRIu32 "",
> +                     sess_info->op_code);
>           return -VIRTIO_CRYPTO_NOTSUPP;
>       }
>   
> @@ -554,8 +555,8 @@ static int cryptodev_builtin_operation(
>   
>       if (op_info->session_id >= MAX_NUM_SESSIONS ||
>                 builtin->sessions[op_info->session_id] == NULL) {
> -        error_setg(&local_error, "Cannot find a valid session id: %" PRIu64 "",
> -                   op_info->session_id);
> +        error_report("Cannot find a valid session id: %" PRIu64 "",
> +                     op_info->session_id);
>           return -VIRTIO_CRYPTO_INVSESS;
>       }
>   



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-04-29 12:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-29  6:45 [PULL 0/9] Trivial patches for 2024-04-29 Michael Tokarev
2024-04-29  6:45 ` [PULL 1/9] target/i386/cpu: Remove "x86" prefix from the CPU list Michael Tokarev
2024-04-29  6:45 ` [PULL 2/9] target/s390x/cpu_models: Rework the output of "-cpu help" Michael Tokarev
2024-04-29  6:45 ` [PULL 3/9] target/ppc/cpu_init: Remove "PowerPC" prefix from the CPU list Michael Tokarev
2024-04-29  6:45 ` [PULL 4/9] scripts/checkpatch: Avoid author email mangled by qemu-*@nongnu.org Michael Tokarev
2024-04-29  6:45 ` [PULL 5/9] scripts/checkpatch: Do not use mailmap Michael Tokarev
2024-04-29  6:45 ` [PULL 6/9] backends/cryptodev-builtin: Fix local_error leaks Michael Tokarev
2024-04-29 12:13   ` Richard Henderson
2024-04-29  6:45 ` [PULL 7/9] target/loongarch/cpu.c: typo fix: expection Michael Tokarev
2024-04-29  6:45 ` [PULL 8/9] target/riscv/kvm: remove sneaky strerrorname_np() instance Michael Tokarev
2024-04-29  6:45 ` [PULL 9/9] checkpatch.pl: forbid strerrorname_np() Michael Tokarev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).