Skip to contentSkip to conversation

More changes for QEMU 2.3.0-rc2

GIT PULL Applied Paolo Bonzini 2 participants 8 messages Apr 2, 2015 Kbuild

lore
Share & tools
lore
#0 lore raw

The following changes since commit 11f10cf8057dd5392171da061381f6c890b1e21d:

hw/arm/vexpress: Don't double-free flash filename (2015-04-02 12:11:07 +0100)

are available in the git repository at:

git://github.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to fb8597bb65eff5c868db52668d21888e4fe7c27a:

  Use $(MAKE) for recursive make (2015-04-02 15:58:39 +0200)

----------------------------------------------------------------
Another round of small fixes. I am not including the virtio-blk fix, because Wen only posted a prototype and the changes I made were pretty large. It definitely needs another pair of eyes (but it is a 2.3 regression and a blocker).

----------------------------------------------------------------
Ed Maste (1):

      Use $(MAKE) for recursive make

Joseph Hindin (1):
qga: fitering out -fstack-protector-strong

Marcel Apfelbaum (1):
util/qemu-config: fix regression of qmp_query_command_line_options

Nadav Amit (1):
target-i386: clear bsp bit when designating bsp

Paolo Bonzini (1):
target-i386: save 64-bit CR3 in 64-bit SMM state save area

zhanghailiang (1):
kvm-all: Sync dirty-bitmap from kvm before kvm destroy the corresponding dirty_bitmap

 Makefile                    |  6 ++--
 hw/intc/apic_common.c       |  8 +++--
 include/hw/i386/apic.h      |  2 +-
 kvm-all.c                   |  2 +-
 qga/vss-win32/Makefile.objs |  2 +-
 target-i386/cpu.c           |  4 +--
 target-i386/smm_helper.c    |  4 +--
 util/qemu-config.c          | 81 +++++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 96 insertions(+), 13 deletions(-)
Signature · 1 line
2.3.4
#1 lore raw

[Qemu-devel] [PULL 1/6] target-i386: save 64-bit CR3 in 64-bit SMM state save area

The x86_64 CR3 register is 64 bits wide, save all of them!

---
 target-i386/smm_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target-i386/smm_helper.c +2 -2
index 58051d3..c62f468 100644
@@ -101,7 +101,7 @@ void do_smm_enter(X86CPU *cpu)
     stl_phys(cs->as, sm_state + 0x7f60, env->dr[7]);
 
     stl_phys(cs->as, sm_state + 0x7f48, env->cr[4]);
-    stl_phys(cs->as, sm_state + 0x7f50, env->cr[3]);
+    stq_phys(cs->as, sm_state + 0x7f50, env->cr[3]);
     stl_phys(cs->as, sm_state + 0x7f58, env->cr[0]);
 
     stl_phys(cs->as, sm_state + 0x7efc, SMM_REVISION_ID);
@@ -236,7 +236,7 @@ void helper_rsm(CPUX86State *env)
     env->dr[7] = ldl_phys(cs->as, sm_state + 0x7f60);
 
     cpu_x86_update_cr4(env, ldl_phys(cs->as, sm_state + 0x7f48));
-    cpu_x86_update_cr3(env, ldl_phys(cs->as, sm_state + 0x7f50));
+    cpu_x86_update_cr3(env, ldq_phys(cs->as, sm_state + 0x7f50));
     cpu_x86_update_cr0(env, ldl_phys(cs->as, sm_state + 0x7f58));
 
     for (i = 0; i < 6; i++) {
Signature · 1 line
2.3.4
#2 lore raw

[Qemu-devel] [PULL 2/6] qga: fitering out -fstack-protector-strong

In reply to Paolo Bonzini

From: Joseph Hindin <[email protected]>

configure script may add -fstack-protector-strong option instead of -fstack-protector-all, depending on availability ( see commit 63678e17c ). Both options have to by filtered out for qga-vss.dll, otherwise MinGW cross-compilation fails at linking stage.

Message-Id: <[email protected]>

---
 qga/vss-win32/Makefile.objs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qga/vss-win32/Makefile.objs +1 -1
index 6a69d50..7c96c6b 100644
@@ -3,7 +3,7 @@
 qga-vss-dll-obj-y += requester.o provider.o install.o
 
 obj-qga-vss-dll-obj-y = $(addprefix $(obj)/, $(qga-vss-dll-obj-y))
-$(obj-qga-vss-dll-obj-y): QEMU_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wredundant-decls -fstack-protector-all, $(QEMU_CFLAGS)) -Wno-unknown-pragmas -Wno-delete-non-virtual-dtor
+$(obj-qga-vss-dll-obj-y): QEMU_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wredundant-decls -fstack-protector-all -fstack-protector-strong, $(QEMU_CFLAGS)) -Wno-unknown-pragmas -Wno-delete-non-virtual-dtor
 
 $(obj)/qga-vss.dll: LDFLAGS = -shared -Wl,--add-stdcall-alias,--enable-stdcall-fixup -lole32 -loleaut32 -lshlwapi -luuid -static
 $(obj)/qga-vss.dll: $(obj-qga-vss-dll-obj-y) $(SRC_PATH)/$(obj)/qga-vss.def
Signature · 1 line
2.3.4
#3 lore raw

[Qemu-devel] [PULL 4/6] util/qemu-config: fix regression of qmp_query_command_line_options

In reply to Paolo Bonzini

From: Marcel Apfelbaum <[email protected]>

Commit 49d2e64 (machine: remove qemu_machine_opts global list) made machine options specific to machine sub-type, leaving the qemu_machine_opts desc array empty. Sadly this is the place qmp_query_command_line_options is looking for supported options.

As a fix for for 2.3 the machine_qemu_opts (the generic ones) are restored only for qemu-config scope.
We need to find a better fix for 2.4.

Message-Id: <[email protected]>

---
 util/qemu-config.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)
util/qemu-config.c +81 -0
index f3463df..2d32ce7 100644
@@ -6,6 +6,7 @@
 #include "hw/qdev.h"
 #include "qapi/error.h"
 #include "qmp-commands.h"
+#include "hw/i386/pc.h"
 
 static QemuOptsList *vm_config_groups[32];
 static QemuOptsList *drive_config_groups[4];
@@ -148,6 +149,84 @@ static CommandLineParameterInfoList *get_drive_infolist(void)
     return head;
 }
 
+/* restore machine options that are now machine's properties */
+static QemuOptsList machine_opts = {
+    .merge_lists = true,
+    .head = QTAILQ_HEAD_INITIALIZER(machine_opts.head),
+    .desc = {
+        {
+            .name = "type",
+            .type = QEMU_OPT_STRING,
+            .help = "emulated machine"
+        },{
+            .name = "accel",
+            .type = QEMU_OPT_STRING,
+            .help = "accelerator list",
+        },{
+            .name = "kernel_irqchip",
+            .type = QEMU_OPT_BOOL,
+            .help = "use KVM in-kernel irqchip",
+        },{
+            .name = "kvm_shadow_mem",
+            .type = QEMU_OPT_SIZE,
+            .help = "KVM shadow MMU size",
+        },{
+            .name = "kernel",
+            .type = QEMU_OPT_STRING,
+            .help = "Linux kernel image file",
+        },{
+            .name = "initrd",
+            .type = QEMU_OPT_STRING,
+            .help = "Linux initial ramdisk file",
+        },{
+            .name = "append",
+            .type = QEMU_OPT_STRING,
+            .help = "Linux kernel command line",
+        },{
+            .name = "dtb",
+            .type = QEMU_OPT_STRING,
+            .help = "Linux kernel device tree file",
+        },{
+            .name = "dumpdtb",
+            .type = QEMU_OPT_STRING,
+            .help = "Dump current dtb to a file and quit",
+        },{
+            .name = "phandle_start",
+            .type = QEMU_OPT_NUMBER,
+            .help = "The first phandle ID we may generate dynamically",
+        },{
+            .name = "dt_compatible",
+            .type = QEMU_OPT_STRING,
+            .help = "Overrides the \"compatible\" property of the dt root node",
+        },{
+            .name = "dump-guest-core",
+            .type = QEMU_OPT_BOOL,
+            .help = "Include guest memory in  a core dump",
+        },{
+            .name = "mem-merge",
+            .type = QEMU_OPT_BOOL,
+            .help = "enable/disable memory merge support",
+        },{
+            .name = "usb",
+            .type = QEMU_OPT_BOOL,
+            .help = "Set on/off to enable/disable usb",
+        },{
+            .name = "firmware",
+            .type = QEMU_OPT_STRING,
+            .help = "firmware image",
+        },{
+            .name = "iommu",
+            .type = QEMU_OPT_BOOL,
+            .help = "Set on/off to enable/disable Intel IOMMU (VT-d)",
+        },{
+            .name = "suppress-vmdesc",
+            .type = QEMU_OPT_BOOL,
+            .help = "Set on to disable self-describing migration",
+        },
+        { /* End of list */ }
+    }
+};
+
 CommandLineOptionInfoList *qmp_query_command_line_options(bool has_option,
                                                           const char *option,
                                                           Error **errp)
@@ -162,6 +241,8 @@ CommandLineOptionInfoList *qmp_query_command_line_options(bool has_option,
             info->option = g_strdup(vm_config_groups[i]->name);
             if (!strcmp("drive", vm_config_groups[i]->name)) {
                 info->parameters = get_drive_infolist();
+            } else if (!strcmp("machine", vm_config_groups[i]->name)) {
+                info->parameters = query_option_descs(machine_opts.desc);
             } else {
                 info->parameters =
                     query_option_descs(vm_config_groups[i]->desc);
Signature · 1 line
2.3.4
#4 lore raw

[Qemu-devel] [PULL 3/6] target-i386: clear bsp bit when designating bsp

In reply to Paolo Bonzini

From: Nadav Amit <[email protected]>

Since the BSP bit is writable on real hardware, during reset all the CPUs which were not chosen to be the BSP should have their BSP bit cleared. This fix is required for KVM to work correctly when it changes the BSP bit.

An additional fix is required for QEMU tcg to allow software to change the BSP bit.

Message-Id: <[email protected]>

---
 hw/intc/apic_common.c  | 8 ++++++--
 include/hw/i386/apic.h | 2 +-
 target-i386/cpu.c      | 4 +---
 3 files changed, 8 insertions(+), 6 deletions(-)
hw/intc/apic_common.c +6 -2
index 0858b45..042e960 100644
@@ -215,14 +215,18 @@ void apic_init_reset(DeviceState *dev)
     }
 }
 
-void apic_designate_bsp(DeviceState *dev)
+void apic_designate_bsp(DeviceState *dev, bool bsp)
 {
     if (dev == NULL) {
         return;
     }
 
     APICCommonState *s = APIC_COMMON(dev);
-    s->apicbase |= MSR_IA32_APICBASE_BSP;
+    if (bsp) {
+        s->apicbase |= MSR_IA32_APICBASE_BSP;
+    } else {
+        s->apicbase &= ~MSR_IA32_APICBASE_BSP;
+    }
 }
 
 static void apic_reset_common(DeviceState *dev)
include/hw/i386/apic.h +1 -1
index 1d48e02..51eb6d3 100644
@@ -21,7 +21,7 @@ void apic_sipi(DeviceState *s);
 void apic_handle_tpr_access_report(DeviceState *d, target_ulong ip,
                                    TPRAccess access);
 void apic_poll_irq(DeviceState *d);
-void apic_designate_bsp(DeviceState *d);
+void apic_designate_bsp(DeviceState *d, bool bsp);
 
 /* pc.c */
 DeviceState *cpu_get_current_apic(void);
target-i386/cpu.c +1 -3
index b2d1c95..03b33cf 100644
@@ -2714,9 +2714,7 @@ static void x86_cpu_reset(CPUState *s)
 
 #if !defined(CONFIG_USER_ONLY)
     /* We hard-wire the BSP to the first CPU. */
-    if (s->cpu_index == 0) {
-        apic_designate_bsp(cpu->apic_state);
-    }
+    apic_designate_bsp(cpu->apic_state, s->cpu_index == 0);
 
     s->halted = !cpu_is_bsp(cpu);
 
Signature · 1 line
2.3.4
#5 lore raw

[Qemu-devel] [PULL 5/6] kvm-all: Sync dirty-bitmap from kvm before kvm destroy the corresponding dirty_bitmap

In reply to Paolo Bonzini

From: zhanghailiang <[email protected]>

Sometimes, we destroy the dirty_bitmap in kvm_memory_slot before any sync action occur, this bit in dirty_bitmap will be missed, and which will lead the corresponding dirty pages to be missed in migration.

This usually happens when do migration during VM's Start-up or Reboot.

[Use s->migration_log instead of exec.c's in_migration. - Paolo]
---
 kvm-all.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kvm-all.c +1 -1
index 335438a..dd44f8c 100644
@@ -715,7 +715,7 @@ static void kvm_set_phys_mem(MemoryRegionSection *section, bool add)
 
         old = *mem;
 
-        if (mem->flags & KVM_MEM_LOG_DIRTY_PAGES) {
+        if ((mem->flags & KVM_MEM_LOG_DIRTY_PAGES) || s->migration_log) {
             kvm_physical_sync_dirty_bitmap(section);
         }
 
Signature · 1 line
2.3.4
#6 lore raw

[Qemu-devel] [PULL 6/6] Use $(MAKE) for recursive make

In reply to Paolo Bonzini

From: Ed Maste <[email protected]>

On BSDs "make" is typically BSD make, while "gmake" is GNU make.

Message-Id: <[email protected]>

[Fix $(INSTALLER) too as reported by Fam Zheng. - Paolo]
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Makefile +3 -3
index 88bce56..93af871 100644
@@ -331,8 +331,8 @@ distclean: clean
 	rm -rf $$d || exit 1 ; \
         done
 	rm -Rf .sdk
-	if test -f pixman/config.log; then make -C pixman distclean; fi
-	if test -f dtc/version_gen.h; then make $(DTC_MAKE_ARGS) clean; fi
+	if test -f pixman/config.log; then $(MAKE) -C pixman distclean; fi
+	if test -f dtc/version_gen.h; then $(MAKE) $(DTC_MAKE_ARGS) clean; fi
 
 KEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
 ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
@@ -532,7 +532,7 @@ installer: $(INSTALLER)
 INSTDIR=/tmp/qemu-nsis
 
 $(INSTALLER): $(SRC_PATH)/qemu.nsi
-	make install prefix=${INSTDIR}
+	$(MAKE) install prefix=${INSTDIR}
 ifdef SIGNCODE
 	(cd ${INSTDIR}; \
          for i in *.exe; do \
Signature · 1 line
2.3.4
#7 lore raw
In reply to Paolo Bonzini
Quoted 12 lines · Paolo Bonzini

The following changes since commit 11f10cf8057dd5392171da061381f6c890b1e21d:

hw/arm/vexpress: Don't double-free flash filename (2015-04-02 12:11:07 +0100)

are available in the git repository at:

git://github.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to fb8597bb65eff5c868db52668d21888e4fe7c27a:

  Use $(MAKE) for recursive make (2015-04-02 15:58:39 +0200)
Quoted 7 lines

----------------------------------------------------------------
Another round of small fixes. I am not including the virtio-blk fix, because Wen only posted a prototype and the changes I made were pretty large. It definitely needs another pair of eyes (but it is a 2.3 regression and a blocker).

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

Applied, thanks.

-- PMM