All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 0/3] i386, machine patches for QEMU 6.1-rc4
@ 2021-08-13 13:37 Paolo Bonzini
  2021-08-13 13:37 ` [PULL 1/3] target/i386: Fixed size of constant for Windows Paolo Bonzini
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Paolo Bonzini @ 2021-08-13 13:37 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit 703e8cd6189cf699c8d5c094bc68b5f3afa6ad71:

  Update version for v6.1.0-rc3 release (2021-08-10 19:08:09 +0100)

are available in the Git repository at:

  https://gitlab.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to ea0aa1752ca88f7856cbf40eef0db62f90f28dcd:

  hw/core: fix error checking in smp_parse (2021-08-13 14:43:42 +0200)

This is what is in my queue.  The first patch is the one that is
most important, though all three are regressions.

----------------------------------------------------------------
Fixes for -smp, and for x86 TCG on Windows.

----------------------------------------------------------------
Daniel P. Berrangé (1):
      hw/core: fix error checking in smp_parse

Lara Lazier (1):
      target/i386: Fixed size of constant for Windows

Philippe Mathieu-Daudé (1):
      hw/core: Add missing return on error

 hw/core/machine.c                    | 3 ++-
 target/i386/tcg/sysemu/misc_helper.c | 2 +-
 target/i386/tcg/sysemu/svm_helper.c  | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)
-- 
2.31.1



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

* [PULL 1/3] target/i386: Fixed size of constant for Windows
  2021-08-13 13:37 [PULL 0/3] i386, machine patches for QEMU 6.1-rc4 Paolo Bonzini
@ 2021-08-13 13:37 ` Paolo Bonzini
  2021-08-13 13:37 ` [PULL 2/3] hw/core: Add missing return on error Paolo Bonzini
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2021-08-13 13:37 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Volker Rümelin, Lara Lazier,
	Philippe Mathieu-Daudé

From: Lara Lazier <laramglazier@gmail.com>

~0UL has 64 bits on Linux and 32 bits on Windows.

Fixes: https://gitlab.com/qemu-project/qemu/-/issues/512
Reported-by: Volker Rümelin <vr_qemu@t-online.de>
Signed-off-by: Lara Lazier <laramglazier@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210812111056.26926-1-laramglazier@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/i386/tcg/sysemu/misc_helper.c | 2 +-
 target/i386/tcg/sysemu/svm_helper.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/i386/tcg/sysemu/misc_helper.c b/target/i386/tcg/sysemu/misc_helper.c
index d347af2a99..e7a2ebde81 100644
--- a/target/i386/tcg/sysemu/misc_helper.c
+++ b/target/i386/tcg/sysemu/misc_helper.c
@@ -97,7 +97,7 @@ void helper_write_crN(CPUX86State *env, int reg, target_ulong t0)
         break;
     case 3:
         if ((env->efer & MSR_EFER_LMA) &&
-                (t0 & ((~0UL) << env_archcpu(env)->phys_bits))) {
+                (t0 & ((~0ULL) << env_archcpu(env)->phys_bits))) {
             cpu_vmexit(env, SVM_EXIT_ERR, 0, GETPC());
         }
         if (!(env->efer & MSR_EFER_LMA)) {
diff --git a/target/i386/tcg/sysemu/svm_helper.c b/target/i386/tcg/sysemu/svm_helper.c
index e151104b4e..0d549b3d6c 100644
--- a/target/i386/tcg/sysemu/svm_helper.c
+++ b/target/i386/tcg/sysemu/svm_helper.c
@@ -264,7 +264,7 @@ void helper_vmrun(CPUX86State *env, int aflag, int next_eip_addend)
     }
     new_cr3 = x86_ldq_phys(cs, env->vm_vmcb + offsetof(struct vmcb, save.cr3));
     if ((env->efer & MSR_EFER_LMA) &&
-            (new_cr3 & ((~0UL) << cpu->phys_bits))) {
+            (new_cr3 & ((~0ULL) << cpu->phys_bits))) {
         cpu_vmexit(env, SVM_EXIT_ERR, 0, GETPC());
     }
     new_cr4 = x86_ldq_phys(cs, env->vm_vmcb + offsetof(struct vmcb, save.cr4));
-- 
2.31.1




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

* [PULL 2/3] hw/core: Add missing return on error
  2021-08-13 13:37 [PULL 0/3] i386, machine patches for QEMU 6.1-rc4 Paolo Bonzini
  2021-08-13 13:37 ` [PULL 1/3] target/i386: Fixed size of constant for Windows Paolo Bonzini
@ 2021-08-13 13:37 ` Paolo Bonzini
  2021-08-13 13:37 ` [PULL 3/3] hw/core: fix error checking in smp_parse Paolo Bonzini
  2021-08-15 10:13 ` [PULL 0/3] i386, machine patches for QEMU 6.1-rc4 Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2021-08-13 13:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

From: Philippe Mathieu-Daudé <philmd@redhat.com>

If dies is not supported by this machine's CPU topology, don't
keep processing options and return directly.

Fixes: 0aebebb561c ("machine: reject -smp dies!=1 for non-PC machines")
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210813112608.1452541-2-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/core/machine.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/core/machine.c b/hw/core/machine.c
index 943974d411..abaeda589b 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -752,6 +752,7 @@ static void smp_parse(MachineState *ms, SMPConfiguration *config, Error **errp)
 
     if (config->has_dies && config->dies != 0 && config->dies != 1) {
         error_setg(errp, "dies not supported by this machine's CPU topology");
+        return;
     }
 
     /* compute missing values, prefer sockets over cores over threads */
-- 
2.31.1




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

* [PULL 3/3] hw/core: fix error checking in smp_parse
  2021-08-13 13:37 [PULL 0/3] i386, machine patches for QEMU 6.1-rc4 Paolo Bonzini
  2021-08-13 13:37 ` [PULL 1/3] target/i386: Fixed size of constant for Windows Paolo Bonzini
  2021-08-13 13:37 ` [PULL 2/3] hw/core: Add missing return on error Paolo Bonzini
@ 2021-08-13 13:37 ` Paolo Bonzini
  2021-08-15 10:13 ` [PULL 0/3] i386, machine patches for QEMU 6.1-rc4 Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2021-08-13 13:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel P. Berrangé

From: Daniel P. Berrangé <berrange@redhat.com>

machine_set_smp() mistakenly checks 'errp' not '*errp',
and so thinks there is an error every single time it runs.
This causes it to jump to the end of the method, skipping
the max CPUs checks. The caller meanwhile sees no error
and so carries on execution. The result of all this is:

 $ qemu-system-x86_64 -smp -1
 qemu-system-x86_64: GLib: ../glib/gmem.c:142: failed to allocate 481036337048 bytes

instead of

 $ qemu-system-x86_64 -smp -1
 qemu-system-x86_64: Invalid SMP CPUs -1. The max CPUs supported by machine 'pc-i440fx-6.1' is 255

This is a regression from

  commit fe68090e8fbd6e831aaf3fc3bb0459c5cccf14cf
  Author: Paolo Bonzini <pbonzini@redhat.com>
  Date:   Thu May 13 09:03:48 2021 -0400

    machine: add smp compound property

Closes: https://gitlab.com/qemu-project/qemu/-/issues/524
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210812175353.4128471-1-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/core/machine.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/core/machine.c b/hw/core/machine.c
index abaeda589b..54e040587d 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -833,7 +833,7 @@ static void machine_set_smp(Object *obj, Visitor *v, const char *name,
     }
 
     mc->smp_parse(ms, config, errp);
-    if (errp) {
+    if (*errp) {
         goto out_free;
     }
 
-- 
2.31.1



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

* Re: [PULL 0/3] i386, machine patches for QEMU 6.1-rc4
  2021-08-13 13:37 [PULL 0/3] i386, machine patches for QEMU 6.1-rc4 Paolo Bonzini
                   ` (2 preceding siblings ...)
  2021-08-13 13:37 ` [PULL 3/3] hw/core: fix error checking in smp_parse Paolo Bonzini
@ 2021-08-15 10:13 ` Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2021-08-15 10:13 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: QEMU Developers

On Fri, 13 Aug 2021 at 14:40, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> The following changes since commit 703e8cd6189cf699c8d5c094bc68b5f3afa6ad71:
>
>   Update version for v6.1.0-rc3 release (2021-08-10 19:08:09 +0100)
>
> are available in the Git repository at:
>
>   https://gitlab.com/bonzini/qemu.git tags/for-upstream
>
> for you to fetch changes up to ea0aa1752ca88f7856cbf40eef0db62f90f28dcd:
>
>   hw/core: fix error checking in smp_parse (2021-08-13 14:43:42 +0200)
>
> This is what is in my queue.  The first patch is the one that is
> most important, though all three are regressions.
>
> ----------------------------------------------------------------
> Fixes for -smp, and for x86 TCG on Windows.
>
> ----------------------------------------------------------------


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/6.1
for any user-visible changes.

-- PMM


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

end of thread, other threads:[~2021-08-15 10:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-13 13:37 [PULL 0/3] i386, machine patches for QEMU 6.1-rc4 Paolo Bonzini
2021-08-13 13:37 ` [PULL 1/3] target/i386: Fixed size of constant for Windows Paolo Bonzini
2021-08-13 13:37 ` [PULL 2/3] hw/core: Add missing return on error Paolo Bonzini
2021-08-13 13:37 ` [PULL 3/3] hw/core: fix error checking in smp_parse Paolo Bonzini
2021-08-15 10:13 ` [PULL 0/3] i386, machine patches for QEMU 6.1-rc4 Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.