Skip to content

Commit 45a505d

Browse files
committed
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
Bug fixes. # gpg: Signature made Mon 30 Jul 2018 13:00:39 BST # gpg: using RSA key BFFBD25F78C7AE83 # gpg: Good signature from "Paolo Bonzini <[email protected]>" # gpg: aka "Paolo Bonzini <[email protected]>" # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: backends/cryptodev: remove dead code timer: remove replay clock probe in deadline calculation i386: implement MSR_SMI_COUNT for TCG i386: do not migrate MSR_SMI_COUNT on machine types <2.12 Signed-off-by: Peter Maydell <[email protected]>
2 parents fd76fef + cc4c77e commit 45a505d

File tree

8 files changed

+14
-15
lines changed

8 files changed

+14
-15
lines changed

backends/cryptodev-vhost-user.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ static void cryptodev_vhost_user_event(void *opaque, int event)
157157
{
158158
CryptoDevBackendVhostUser *s = opaque;
159159
CryptoDevBackend *b = CRYPTODEV_BACKEND(s);
160-
Error *err = NULL;
161160
int queues = b->conf.peers.queues;
162161

163162
assert(queues < MAX_CRYPTO_QUEUE_NUM);
@@ -174,10 +173,6 @@ static void cryptodev_vhost_user_event(void *opaque, int event)
174173
cryptodev_vhost_user_stop(queues, s);
175174
break;
176175
}
177-
178-
if (err) {
179-
error_report_err(err);
180-
}
181176
}
182177

183178
static void cryptodev_vhost_user_init(

include/hw/i386/pc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
317317
#define PC_COMPAT_2_11 \
318318
HW_COMPAT_2_11 \
319319
{\
320+
.driver = TYPE_X86_CPU,\
321+
.property = "x-migrate-smi-count",\
322+
.value = "off",\
323+
},{\
320324
.driver = "Skylake-Server" "-" TYPE_X86_CPU,\
321325
.property = "clflushopt",\
322326
.value = "off",\

target/i386/cpu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5435,6 +5435,8 @@ static Property x86_cpu_properties[] = {
54355435
false),
54365436
DEFINE_PROP_BOOL("vmware-cpuid-freq", X86CPU, vmware_cpuid_freq, true),
54375437
DEFINE_PROP_BOOL("tcg-cpuid", X86CPU, expose_tcg, true),
5438+
DEFINE_PROP_BOOL("x-migrate-smi-count", X86CPU, migrate_smi_count,
5439+
true),
54385440
/*
54395441
* lecacy_cache defaults to true unless the CPU model provides its
54405442
* own cache information (see x86_cpu_load_def()).

target/i386/cpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,6 +1379,7 @@ struct X86CPU {
13791379
bool expose_kvm;
13801380
bool expose_tcg;
13811381
bool migratable;
1382+
bool migrate_smi_count;
13821383
bool max_features; /* Enable all supported features automatically */
13831384
uint32_t apic_id;
13841385

target/i386/machine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ static bool msr_smi_count_needed(void *opaque)
400400
X86CPU *cpu = opaque;
401401
CPUX86State *env = &cpu->env;
402402

403-
return env->msr_smi_count != 0;
403+
return cpu->migrate_smi_count && env->msr_smi_count != 0;
404404
}
405405

406406
static const VMStateDescription vmstate_msr_smi_count = {

target/i386/misc_helper.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,9 @@ void helper_rdmsr(CPUX86State *env)
447447
val = env->tsc_aux;
448448
break;
449449
#endif
450+
case MSR_SMI_COUNT:
451+
val = env->msr_smi_count;
452+
break;
450453
case MSR_MTRRphysBase(0):
451454
case MSR_MTRRphysBase(1):
452455
case MSR_MTRRphysBase(2):

target/i386/smm_helper.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ void do_smm_enter(X86CPU *cpu)
5454
qemu_log_mask(CPU_LOG_INT, "SMM: enter\n");
5555
log_cpu_state_mask(CPU_LOG_INT, CPU(cpu), CPU_DUMP_CCOP);
5656

57+
env->msr_smi_count++;
5758
env->hflags |= HF_SMM_MASK;
5859
if (env->hflags2 & HF2_NMI_MASK) {
5960
env->hflags2 |= HF2_SMM_INSIDE_NMI_MASK;

util/qemu-timer.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -578,17 +578,10 @@ int64_t timerlistgroup_deadline_ns(QEMUTimerListGroup *tlg)
578578
{
579579
int64_t deadline = -1;
580580
QEMUClockType type;
581-
bool play = replay_mode == REPLAY_MODE_PLAY;
582581
for (type = 0; type < QEMU_CLOCK_MAX; type++) {
583582
if (qemu_clock_use_for_deadline(type)) {
584-
if (!play || type == QEMU_CLOCK_REALTIME) {
585-
deadline = qemu_soonest_timeout(deadline,
586-
timerlist_deadline_ns(tlg->tl[type]));
587-
} else {
588-
/* Read clock from the replay file and
589-
do not calculate the deadline, based on virtual clock. */
590-
qemu_clock_get_ns(type);
591-
}
583+
deadline = qemu_soonest_timeout(deadline,
584+
timerlist_deadline_ns(tlg->tl[type]));
592585
}
593586
}
594587
return deadline;

0 commit comments

Comments
 (0)