Skip to contentSkip to conversation

target-i386: Finally enable "check" mode by default

GIT PULL Applied Eduardo Habkost 2 participants 4 messages Oct 28, 2015

lore
Share & tools
lore
#0 lore raw

We now have fixed the issues that caused unnecessary warnings in TCG mode and on "make check", and I am applying the check-mode patch again.

The following changes since commit 7e038b94e74e1c2d1b3598e2e4b0b5c8b79a7278:

Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging (2015-10-27 10:10:46 +0000)

are available in the git repository at:

git://github.com/ehabkost/qemu.git tags/x86-pull-request

for you to fetch changes up to 15e41345906d29a319cc9cdf566347bf79134d24:

target-i386: Enable "check" mode by default (2015-10-27 16:12:15 -0200)

----------------------------------------------------------------
target-i386: finally enable "check" mode by default

----------------------------------------------------------------

Eduardo Habkost (2):
target-i386: Don't left shift negative constant
target-i386: Enable "check" mode by default

 target-i386/cpu.c       | 2 +-
 target-i386/translate.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.1.0
#1 lore raw

[Qemu-devel] [PULL 1/2] target-i386: Don't left shift negative constant

Left shift of negative values is undefined behavior. Detected by clang:
qemu/target-i386/translate.c:2423:26: runtime error:
left shift of negative value -8

This changes the code to reverse the sign after the left shift.

---
 target-i386/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-i386/translate.c +1 -1
index 764b1e4..862f8e0 100644
@@ -2432,7 +2432,7 @@ static void gen_pusha(DisasContext *s)
 {
     int i;
     gen_op_movl_A0_reg(R_ESP);
-    gen_op_addl_A0_im(-8 << s->dflag);
+    gen_op_addl_A0_im(-(8 << s->dflag));
     if (!s->ss32)
         tcg_gen_ext16u_tl(cpu_A0, cpu_A0);
     tcg_gen_mov_tl(cpu_T[1], cpu_A0);
Signature · 1 line
2.1.0
#2 lore raw

[Qemu-devel] [PULL 2/2] target-i386: Enable "check" mode by default

In reply to Eduardo Habkost

Current default behavior of QEMU is to silently disable features that are not supported by the host when a CPU model is requested in the command-line. This means that in addition to risking breaking guest ABI by default, we are silent about it.

I would like to enable "enforce" by default, but this can easily break existing production systems because of the way libvirt makes assumptions about CPU models today (this will change in the future, once QEMU provide a proper interface for checking if a CPU model is runnable).

But there's no reason we should be silent about it. So, change target-i386 to enable "check" mode by default so at least we have some warning printed to stderr (and hopefully logged somewhere) when QEMU disables a feature that is not supported by the host system.

---
 target-i386/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-i386/cpu.c +1 -1
index c1a9e09..9280bfc 100644
@@ -3141,7 +3141,7 @@ static Property x86_cpu_properties[] = {
     DEFINE_PROP_BOOL("hv-reset", X86CPU, hyperv_reset, false),
     DEFINE_PROP_BOOL("hv-vpindex", X86CPU, hyperv_vpindex, false),
     DEFINE_PROP_BOOL("hv-runtime", X86CPU, hyperv_runtime, false),
-    DEFINE_PROP_BOOL("check", X86CPU, check_cpuid, false),
+    DEFINE_PROP_BOOL("check", X86CPU, check_cpuid, true),
     DEFINE_PROP_BOOL("enforce", X86CPU, enforce_cpuid, false),
     DEFINE_PROP_BOOL("kvm", X86CPU, expose_kvm, true),
     DEFINE_PROP_UINT32("level", X86CPU, env.cpuid_level, 0),
Signature · 1 line
2.1.0
#3 lore raw
In reply to Eduardo Habkost
Quoted 24 lines · Eduardo Habkost

We now have fixed the issues that caused unnecessary warnings in TCG mode and on "make check", and I am applying the check-mode patch again.

The following changes since commit 7e038b94e74e1c2d1b3598e2e4b0b5c8b79a7278:

Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging (2015-10-27 10:10:46 +0000)

are available in the git repository at:

git://github.com/ehabkost/qemu.git tags/x86-pull-request

for you to fetch changes up to 15e41345906d29a319cc9cdf566347bf79134d24:

target-i386: Enable "check" mode by default (2015-10-27 16:12:15 -0200)

----------------------------------------------------------------
target-i386: finally enable "check" mode by default

----------------------------------------------------------------

Eduardo Habkost (2):
target-i386: Don't left shift negative constant
target-i386: Enable "check" mode by default

Quoted 6 lines
 target-i386/cpu.c       | 2 +-
 target-i386/translate.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--
2.1.0

Applied, thanks.

-- PMM