Skip to contentSkip to conversation

x86 queue, 2016-09-19

GIT PULL Applied Eduardo Habkost 2 participants 5 messages Sep 19, 2016 – Sep 20, 2016

lore
Share & tools
lore
#0 lore raw

The following changes since commit 33e1666b4289313306371fee0740f5c85517e406:

Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2016-09-19' into staging (2016-09-19 18:06:52 +0100)

are available in the git repository at:

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

for you to fetch changes up to fa5376dd8adb5ad104e5773f09c15af2e8a76738:

linux-user-i386: Fix crash on cpuid (2016-09-19 15:34:35 -0300)

----------------------------------------------------------------
x86 queue, 2016-09-19

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

Marc-André Lureau (1):
linux-user-i386: Fix crash on cpuid

Michael S. Tsirkin (1):
kvm/apic: drop debugging

Richard Henderson (1):
target-i386: Use struct X86XSaveArea in fpu_helper.c

 hw/i386/kvm/apic.c       |   1 -
 qom/cpu.c                |   5 +++
 target-i386/cpu.c        |   7 ++-
 target-i386/cpu.h        |  10 +----
 target-i386/fpu_helper.c | 108 ++++++++++++++++++++++++++---------------------
 5 files changed, 72 insertions(+), 59 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

[Qemu-devel] [PULL 1/3] target-i386: Use struct X86XSaveArea in fpu_helper.c

From: Richard Henderson <[email protected]>

This avoids a double hand-full of magic numbers in the xsave and xrstor helper functions.

---
 target-i386/cpu.c        |   7 ++-
 target-i386/cpu.h        |  10 +----
 target-i386/fpu_helper.c | 108 ++++++++++++++++++++++++++---------------------
 3 files changed, 67 insertions(+), 58 deletions(-)
target-i386/cpu.c +6 -1
index 5a5299a..db12728 100644
@@ -538,7 +538,12 @@ static const X86RegisterInfo32 x86_reg_info_32[CPU_NB_REGS32] = {
 };
 #undef REGISTER
 
-const ExtSaveArea x86_ext_save_areas[] = {
+typedef struct ExtSaveArea {
+    uint32_t feature, bits;
+    uint32_t offset, size;
+} ExtSaveArea;
+
+static const ExtSaveArea x86_ext_save_areas[] = {
     [XSTATE_YMM_BIT] =
           { .feature = FEAT_1_ECX, .bits = CPUID_EXT_AVX,
             .offset = offsetof(X86XSaveArea, avx_state),
target-i386/cpu.h +2 -8
index 58e43b6..27af9c3 100644
@@ -877,7 +877,8 @@ typedef union X86LegacyXSaveArea {
 typedef struct X86XSaveHeader {
     uint64_t xstate_bv;
     uint64_t xcomp_bv;
-    uint8_t reserved[48];
+    uint64_t reserve0;
+    uint8_t reserved[40];
 } X86XSaveHeader;
 
 /* Ext. save area 2: AVX State */
@@ -1392,13 +1393,6 @@ int cpu_x86_signal_handler(int host_signum, void *pinfo,
                            void *puc);
 
 /* cpu.c */
-typedef struct ExtSaveArea {
-    uint32_t feature, bits;
-    uint32_t offset, size;
-} ExtSaveArea;
-
-extern const ExtSaveArea x86_ext_save_areas[];
-
 void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
                    uint32_t *eax, uint32_t *ebx,
                    uint32_t *ecx, uint32_t *edx);
target-i386/fpu_helper.c +59 -49

258 lines not on this page · raw message

Signature · 1 line
2.7.4
#2 lore raw

[Qemu-devel] [PULL 2/3] kvm/apic: drop debugging

In reply to Eduardo Habkost

From: "Michael S. Tsirkin" <[email protected]>

commit 78d6a05d2f69cbfa6e95f0a4a24a2c934969913b
("x86/lapic: Load LAPIC state at post_load")
has some debugging leftovers.

Drop them.

---
 hw/i386/kvm/apic.c | 1 -
 1 file changed, 1 deletion(-)
hw/i386/kvm/apic.c +0 -1
index 5d140b9..feb0002 100644
@@ -141,7 +141,6 @@ static void kvm_apic_put(void *data)
 
 static void kvm_apic_post_load(APICCommonState *s)
 {
-    fprintf(stderr, "%s: Yeh\n", __func__);
     run_on_cpu(CPU(s->cpu), kvm_apic_put, s);
 }
 
Signature · 1 line
2.7.4
#3 lore raw

[Qemu-devel] [PULL 3/3] linux-user-i386: Fix crash on cpuid

In reply to Eduardo Habkost

From: Marc-André Lureau <[email protected]>

Running cpuid instructions with a simple run like:
i386-linux-user/qemu-i386 tests/tcg/sha1-i386

Results in the following assert:

 #0  0x00007ffff64246f5 in raise () from /lib64/libc.so.6
 #1  0x00007ffff64262fa in abort () from /lib64/libc.so.6
 #2  0x00007ffff7937ec5 in g_assertion_message () from /lib64/libglib-2.0.so.0
 #3  0x00007ffff7937f5a in g_assertion_message_expr () from /lib64/libglib-2.0.so.0
 #4  0x000055555561b54c in apicid_bitwidth_for_count (count=0) at /home/elmarco/src/qemu/include/hw/i386/topology.h:58
 #5  0x000055555561b58a in apicid_smt_width (nr_cores=0, nr_threads=0) at /home/elmarco/src/qemu/include/hw/i386/topology.h:67
 #6  0x000055555561b5c3 in apicid_core_offset (nr_cores=0, nr_threads=0) at /home/elmarco/src/qemu/include/hw/i386/topology.h:82
 #7  0x000055555561b5e3 in apicid_pkg_offset (nr_cores=0, nr_threads=0) at /home/elmarco/src/qemu/include/hw/i386/topology.h:89
 #8  0x000055555561dd86 in cpu_x86_cpuid (env=0x555557999550, index=4, count=3, eax=0x7fffffffcae8, ebx=0x7fffffffcaec, ecx=0x7fffffffcaf0, edx=0x7fffffffcaf4) at /home/elmarco/src/qemu/target-i386/cpu.c:2405
 #9  0x0000555555638e8e in helper_cpuid (env=0x555557999550) at /home/elmarco/src/qemu/target-i386/misc_helper.c:106

#10 0x000055555599dc5e in static_code_gen_buffer ()
#11 0x00005555555952f8 in cpu_tb_exec (cpu=0x5555579912d0, itb=0x7ffff4371ab0) at /home/elmarco/src/qemu/cpu-exec.c:166
#12 0x0000555555595c8e in cpu_loop_exec_tb (cpu=0x5555579912d0, tb=0x7ffff4371ab0, last_tb=0x7fffffffd088, tb_exit=0x7fffffffd084, sc=0x7fffffffd0a0) at /home/elmarco/src/qemu/cpu-exec.c:517 #13 0x0000555555595e50 in cpu_exec (cpu=0x5555579912d0) at /home/elmarco/src/qemu/cpu-exec.c:612
#14 0x00005555555c065b in cpu_loop (env=0x555557999550) at /home/elmarco/src/qemu/linux-user/main.c:297
#15 0x00005555555c25b2 in main (argc=2, argv=0x7fffffffd848, envp=0x7fffffffd860) at /home/elmarco/src/qemu/linux-user/main.c:4803

The fields are set in qemu_init_vcpu() with softmmu, but it's a stub with linux-user.

---
 qom/cpu.c | 5 +++++
 1 file changed, 5 insertions(+)
qom/cpu.c +5 -0
index 2553247..f783b5a 100644
@@ -342,6 +342,11 @@ static void cpu_common_initfn(Object *obj)
 
     cpu->cpu_index = UNASSIGNED_CPU_INDEX;
     cpu->gdb_num_regs = cpu->gdb_num_g_regs = cc->gdb_num_core_regs;
+    /* *-user doesn't have configurable SMP topology */
+    /* the default value is changed by qemu_init_vcpu() for softmmu */
+    cpu->nr_cores = 1;
+    cpu->nr_threads = 1;
+
     qemu_mutex_init(&cpu->work_mutex);
     QTAILQ_INIT(&cpu->breakpoints);
     QTAILQ_INIT(&cpu->watchpoints);
Signature · 1 line
2.7.4
#4 lore raw
In reply to Eduardo Habkost
Quoted 6 lines · Eduardo Habkost

The following changes since commit 33e1666b4289313306371fee0740f5c85517e406:

Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2016-09-19' into staging (2016-09-19 18:06:52 +0100)

are available in the git repository at:

Quoted 9 lines

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

for you to fetch changes up to fa5376dd8adb5ad104e5773f09c15af2e8a76738:

linux-user-i386: Fix crash on cpuid (2016-09-19 15:34:35 -0300)

----------------------------------------------------------------
x86 queue, 2016-09-19

Applied, thanks.

-- PMM