target-i386, module, qtest patches for 2014-07-18
The following changes since commit 146ae00192ffcbd78f6b11fa78c72d1b3d628d8a:
Merge remote-tracking branch 'remotes/agraf/tags/signed-ppc-for-upstream' into staging (2014-07-15 15:51:12 +0100)
are available in the git repository at:
git://github.com/bonzini/qemu.git tags/for-upstream
for you to fetch changes up to fa666c10f2f3e15685ff88abd3bc433ddce012d6:
Revert "kvmclock: Ensure time in migration never goes backward" (2014-07-18 15:28:03 +0200)
----------------------------------------------------------------
Andreas's fixes to --enable-modules, two 2.1 regression fixes, and a new qtest. Michael sent a pull request of his own, so I dropped the vhost changes.
----------------------------------------------------------------
Andreas Färber (2):
module: Simplify module_load()
module: Don't complain when a module is absent
Paolo Bonzini (3):
qtest: new test for wdt_ib700
Revert "kvmclock: Ensure proper env->tsc value for kvmclock_current_nsec calculation" Revert "kvmclock: Ensure time in migration never goes backward"
Ricky Zhou (1):
target-i386: Allow execute from user mode when SMEP is enabled.
hw/i386/kvm/clock.c | 52 ------------------- target-i386/helper.c | 3 +- tests/Makefile | 3 ++ tests/wdt_ib700-test.c | 134 +++++++++++++++++++++++++++++++++++++++++++++++++ util/module.c | 9 +--- 5 files changed, 141 insertions(+), 60 deletions(-) create mode 100644 tests/wdt_ib700-test.c
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 1/6] target-i386: Allow execute from user mode when SMEP is enabled.
From: Ricky Zhou <[email protected]>
Previously, execute would be disabled for all pages with SMEP enabled, regardless of what mode the access took place in.
--- target-i386/helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
target-i386/helper.c +2 -1
@@ -750,7 +750,8 @@ do_check_protect_pse36:/* the page can be put in the TLB */ prot =PAGE_READ ;if (!(ptep &PG_NX_MASK ) && - !((env->cr[4 ] &CR4_SMEP_MASK ) && (ptep &PG_USER_MASK ))) { + (mmu_idx ==MMU_USER_IDX || + !((env->cr[4 ] &CR4_SMEP_MASK ) && (ptep &PG_USER_MASK )))) { prot |=PAGE_EXEC ; }if (pte &PG_DIRTY_MASK ) {
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 3/6] module: Simplify module_load()
In reply to Paolo BonziniFrom: Andreas Färber <[email protected]>
The file path is not used for error reporting, so we can free it directly after use.
--- util/module.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
util/module.c +2 -4
@@ -202,18 +202,16 @@ static void module_load(module_init_type type)for (i =0 ; i <ARRAY_SIZE (dirs); i++) { fname =g_strdup_printf ("%s/%s%s" , dirs[i], *mp,HOST_DSOSUF ); ret =module_load_file (fname); +g_free (fname); + fname =NULL ;/* Try loading until loaded a module file */ if (!ret) {break ; } -g_free (fname); - fname =NULL ; }if (ret == -ENOENT ) {fprintf (stderr,"Can't find module: %s\n" , *mp); } - -g_free (fname); }for (i =0 ; i <ARRAY_SIZE (dirs); i++) {
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 4/6] module: Don't complain when a module is absent
In reply to Paolo BonziniFrom: Andreas Färber <[email protected]>
The current implementation depends on a configure-time generated list of block modules. When any of them is absent, module_load() emits a warning.
This is suboptimal because extracting code to modules was mainly done to allow separate packaging of modules with intrusive dependencies. Absence of optional packages then leads to absence of modules and an error message, which users may recognize as new and report as error.
--- util/module.c | 3 --- 1 file changed, 3 deletions(-)
util/module.c +0 -3
@@ -209,9 +209,6 @@ static void module_load(module_init_type type)break ; } } -if (ret == -ENOENT ) { -fprintf (stderr,"Can't find module: %s\n" , *mp); - } }for (i =0 ; i <ARRAY_SIZE (dirs); i++) {
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 5/6] Revert "kvmclock: Ensure proper env->tsc value for kvmclock_current_nsec calculation"
In reply to Paolo BonziniThis reverts commit 9b1786829aefb83f37a8f3135e3ea91c56001b56.
This patch fixed a hang introduced by commit a096b3a (kvmclock: Ensure time in migration never goes backward, 2014-05-16), but it causes a regression in migration whose cause is not quite clear.
Because of this, I'm choosing to revert both patches. This trades a 2.1 regression for a bug that's been there forever.
--- hw/i386/kvm/clock.c | 4 ---- 1 file changed, 4 deletions(-)
hw/i386/kvm/clock.c +0 -4
@@ -17,7 +17,6 @@#include "qemu/host-utils.h" #include "sysemu/sysemu.h" #include "sysemu/kvm.h" -#include "sysemu/cpus.h" #include "hw/sysbus.h" #include "hw/kvm/clock.h"
@@ -66,7 +65,6 @@ static uint64_t kvmclock_current_nsec(KVMClockState *s)cpu_physical_memory_read (kvmclock_struct_pa, &time,sizeof (time)); -assert (time.tsc_timestamp <= migration_tsc); delta = migration_tsc - time.tsc_timestamp;if (time.tsc_shift <0 ) { delta >>= -time.tsc_shift;
@@ -125,8 +123,6 @@ static void kvmclock_vm_state_change(void *opaque, int running,if (s->clock_valid) {return ; } - -cpu_synchronize_all_states (); ret =kvm_vm_ioctl (kvm_state,KVM_GET_CLOCK , &data);if (ret <0 ) {fprintf (stderr,"KVM_GET_CLOCK failed: %s\n" ,strerror (ret));
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 2/6] qtest: new test for wdt_ib700
In reply to Paolo BonziniSince the "pause" watchdog action had a regression and it went unnoticed for a while, let's add a test for it.
--- tests/Makefile | 3 ++ tests/wdt_ib700-test.c | 134 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 tests/wdt_ib700-test.c
tests/Makefile +3 -0
@@ -141,6 +141,8 @@ check-qtest-i386-y += tests/i440fx-test$(EXESUF) check-qtest-i386-y += tests/fw_cfg-test$(EXESUF) check-qtest-i386-y += tests/blockdev-test$(EXESUF) check-qtest-i386-y += tests/qdev-monitor-test$(EXESUF) +check-qtest-i386-y += tests/wdt_ib700-test$(EXESUF) +gcov-files-i386-y += hw/watchdog/watchdog.c hw/watchdog/wdt_ib700.c check-qtest-i386-y += $(check-qtest-pci-y) gcov-files-i386-y += $(gcov-files-pci-y) check-qtest-i386-y += tests/vmxnet3-test$(EXESUF)
@@ -311,6 +313,7 @@ tests/pcnet-test$(EXESUF): tests/pcnet-test.o tests/eepro100-test$(EXESUF): tests/eepro100-test.o tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o tests/ne2000-test$(EXESUF): tests/ne2000-test.o +tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-test.o tests/virtio-blk-test$(EXESUF): tests/virtio-blk-test.o tests/virtio-net-test$(EXESUF): tests/virtio-net-test.o
tests/wdt_ib700-test.c new file +134 -0
134 lines not on this page · raw message
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 6/6] Revert "kvmclock: Ensure time in migration never goes backward"
In reply to Paolo BonziniThis reverts commit a096b3a6732f846ec57dc28b47ee9435aa0609bf.
This patch caused a hang that was fixed by commit 9b17868 (kvmclock:
Ensure proper env->tsc value for kvmclock_current_nsec calculation, 2014-06-03), and we just had to revert that commit. Drop this one too.
--- hw/i386/kvm/clock.c | 48 ------------------------------------------------ 1 file changed, 48 deletions(-)
hw/i386/kvm/clock.c +0 -48
@@ -14,7 +14,6 @@*/ #include "qemu-common.h" -#include "qemu/host-utils.h" #include "sysemu/sysemu.h" #include "sysemu/kvm.h" #include "hw/sysbus.h"
@@ -35,47 +34,6 @@ typedef struct KVMClockState {bool clock_valid; } KVMClockState; -struct pvclock_vcpu_time_info { -uint32_t version; -uint32_t pad0; -uint64_t tsc_timestamp; -uint64_t system_time; -uint32_t tsc_to_system_mul; -int8_t tsc_shift; -uint8_t flags; -uint8_t pad[2 ]; -} __attribute__((__packed__ ));/* 32 bytes */ - -static uint64_t kvmclock_current_nsec (KVMClockState *s) -{ -CPUState *cpu = first_cpu; -CPUX86State *env = cpu->env_ptr; -hwaddr kvmclock_struct_pa = env->system_time_msr & ~1ULL ; -uint64_t migration_tsc = env->tsc; -struct pvclock_vcpu_time_info time; -uint64_t delta; -uint64_t nsec_lo; -uint64_t nsec_hi; -uint64_t nsec; - -if (!(env->system_time_msr &1ULL )) { -/* KVM clock not active */ -return 0 ; - } - -cpu_physical_memory_read (kvmclock_struct_pa, &time,sizeof (time)); - - delta = migration_tsc - time.tsc_timestamp; -if (time.tsc_shift <0 ) { - delta >>= -time.tsc_shift; - }else { - delta <<= time.tsc_shift; - } - -mulu64 (&nsec_lo, &nsec_hi, delta, time.tsc_to_system_mul); - nsec = (nsec_lo >>32 ) | (nsec_hi <<32 ); -return nsec + time.system_time; -}static void kvmclock_vm_state_change (void *opaque,int running,RunState state)
@@ -87,15 +45,9 @@ static void kvmclock_vm_state_change(void *opaque, int running,if (running) {struct kvm_clock_data data; -uint64_t time_at_migration =kvmclock_current_nsec (s); s->clock_valid = false; -/* We can't rely on the migrated clock value, just discard it */ -if (time_at_migration) { - s->clock = time_at_migration; - } - data.clock = s->clock; data.flags =0 ; ret =kvm_vm_ioctl (kvm_state,KVM_SET_CLOCK , &data);
Signature · 1 line
1.9.3
Peter Maydell
AppliedQuoted 9 lines · Paolo Bonzini
The following changes since commit
146ae00192ffcbd78f6b11fa78c72d1b3d628d8a:Merge remote-tracking branch 'remotes/agraf/tags/signed-ppc-for-upstream' into staging (2014-07-15 15:51:12 +0100)
are available in the git repository at:
git://github.com/bonzini/qemu.gittags/for-upstream
Quoted 8 lines
for you to fetch changes up to
fa666c10f2f3e15685ff88abd3bc433ddce012d6:Revert "kvmclock: Ensure time in migration never goes backward" (2014-07-18 15:28:03 +0200)
----------------------------------------------------------------
Andreas's fixes to --enable-modules, two 2.1 regression fixes, and a new qtest. Michael sent a pull request of his own, so I dropped the vhost changes.
Applied, thanks.
-- PMM