Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into…
Browse files Browse the repository at this point in the history
… staging

* Make checkpatch say 'qemu' instead of 'kernel' (Aleksandar)
* Fix PSE guests with emulated NPT (Alexander B. qemu#1)
* Fix leak (Alexander B. qemu#2)
* HVF fixes (Roman, Cameron)
* New Sapphire Rapids CPUID bits (Cathy)
* cpus.c and softmmu/ cleanups (Claudio)
* TAP driver tweaks (Daniel, Havard)
* object-add bugfix and testcases (Eric A.)
* Fix Coverity MIN_CONST and MAX_CONST (Eric B.)
* "info lapic" improvement (Jan)
* SSE fixes (Joseph)
* "-msg guest-name" option (Mario)
* support for AMD nested live migration (myself)
* Small i386 TCG fixes (myself)
* improved error reporting for Xen (myself)
* fix "-cpu host -overcommit cpu-pm=on" (myself)
* Add accel/Kconfig (Philippe)
* iscsi sense handling fixes (Yongji)
* Misc bugfixes

# gpg: Signature made Sat 11 Jul 2020 00:33:41 BST
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Paolo Bonzini <[email protected]>" [full]
# gpg:                 aka "Paolo Bonzini <[email protected]>" [full]
# 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: (47 commits)
  linux-headers: update again to 5.8
  apic: Report current_count via 'info lapic'
  scripts: improve message when TAP based tests fail
  target/i386: Enable TSX Suspend Load Address Tracking feature
  target/i386: Add SERIALIZE cpu feature
  softmmu/vl: Remove the check for colons in -accel parameters
  cpu-throttle: new module, extracted from cpus.c
  softmmu: move softmmu only files from root
  pc: fix leak in pc_system_flash_cleanup_unused
  cpus: Move CPU code from exec.c to cpus-common.c
  target/i386: Correct the warning message of Intel PT
  checkpatch: Change occurences of 'kernel' to 'qemu' in user messages
  iscsi: return -EIO when sense fields are meaningless
  iscsi: handle check condition status in retry loop
  target/i386: sev: fail query-sev-capabilities if QEMU cannot use SEV
  target/i386: sev: provide proper error reporting for query-sev-capabilities
  KVM: x86: believe what KVM says about WAITPKG
  target/i386: implement undocumented "smsw r32" behavior
  target/i386: remove gen_io_end
  Makefile: simplify MINIKCONF rules
  ...

Signed-off-by: Peter Maydell <[email protected]>
  • Loading branch information
pm215 committed Jul 11, 2020
2 parents d4a6bab + 56908dc commit 2033cc6
Show file tree
Hide file tree
Showing 70 changed files with 1,615 additions and 441 deletions.
4 changes: 4 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source Kconfig.host
source backends/Kconfig
source accel/Kconfig
source hw/Kconfig
7 changes: 0 additions & 7 deletions Kconfig.host
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
# down to Kconfig. See also MINIKCONF_ARGS in the Makefile:
# these two need to be kept in sync.

config KVM
bool

config LINUX
bool

Expand All @@ -31,10 +28,6 @@ config VHOST_KERNEL
bool
select VHOST

config XEN
bool
select FSDEV_9P if VIRTFS

config VIRTFS
bool

Expand Down
29 changes: 22 additions & 7 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Overall TCG CPUs
M: Richard Henderson <[email protected]>
R: Paolo Bonzini <[email protected]>
S: Maintained
F: cpus.c
F: softmmu/cpus.c
F: cpus-common.c
F: exec.c
F: accel/tcg/
Expand Down Expand Up @@ -362,7 +362,7 @@ Overall KVM CPUs
M: Paolo Bonzini <[email protected]>
L: [email protected]
S: Supported
F: */kvm.*
F: */*/kvm*
F: accel/kvm/
F: accel/stubs/kvm-stub.c
F: include/hw/kvm/
Expand Down Expand Up @@ -416,8 +416,21 @@ S: Supported
F: target/i386/kvm.c
F: scripts/kvm/vmxcap

Guest CPU Cores (other accelerators)
------------------------------------
Overall
M: Richard Henderson <[email protected]>
R: Paolo Bonzini <[email protected]>
S: Maintained
F: include/sysemu/accel.h
F: accel/accel.c
F: accel/Makefile.objs
F: accel/stubs/Makefile.objs

X86 HVF CPUs
M: Cameron Esfahani <[email protected]>
M: Roman Bolshakov <[email protected]>
W: https://wiki.qemu.org/Features/HVF
S: Maintained
F: accel/stubs/hvf-stub.c
F: target/i386/hvf/
Expand Down Expand Up @@ -465,6 +478,7 @@ M: Colin Xu <[email protected]>
L: [email protected]
W: https://github.com/intel/haxm/issues
S: Maintained
F: accel/stubs/hax-stub.c
F: include/sysemu/hax.h
F: target/i386/hax-*

Expand Down Expand Up @@ -1710,7 +1724,7 @@ M: David Hildenbrand <[email protected]>
S: Maintained
F: hw/virtio/virtio-balloon*.c
F: include/hw/virtio/virtio-balloon.h
F: balloon.c
F: softmmu/balloon.c
F: include/sysemu/balloon.h

virtio-9p
Expand Down Expand Up @@ -2189,12 +2203,12 @@ Memory API
M: Paolo Bonzini <[email protected]>
S: Supported
F: include/exec/ioport.h
F: ioport.c
F: include/exec/memop.h
F: include/exec/memory.h
F: include/exec/ram_addr.h
F: include/exec/ramblock.h
F: memory.c
F: softmmu/ioport.c
F: softmmu/memory.c
F: include/exec/memory-internal.h
F: exec.c
F: scripts/coccinelle/memory-region-housekeeping.cocci
Expand Down Expand Up @@ -2226,13 +2240,14 @@ F: ui/cocoa.m
Main loop
M: Paolo Bonzini <[email protected]>
S: Maintained
F: cpus.c
F: include/qemu/main-loop.h
F: include/sysemu/runstate.h
F: util/main-loop.c
F: util/qemu-timer.c
F: softmmu/vl.c
F: softmmu/main.c
F: softmmu/cpus.c
F: softmmu/cpu-throttle.c
F: qapi/run-state.json

Human Monitor (HMP)
Expand Down Expand Up @@ -2387,7 +2402,7 @@ M: Thomas Huth <[email protected]>
M: Laurent Vivier <[email protected]>
R: Paolo Bonzini <[email protected]>
S: Maintained
F: qtest.c
F: softmmu/qtest.c
F: accel/qtest.c
F: tests/qtest/
X: tests/qtest/bios-tables-test-allowed-diff.h
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,8 @@ endif
# This has to be kept in sync with Kconfig.host.
MINIKCONF_ARGS = \
$(CONFIG_MINIKCONF_MODE) \
$@ $*/config-devices.mak.d $< $(MINIKCONF_INPUTS) \
$@ $*/config-devices.mak.d $< $(SRC_PATH)/Kconfig \
CONFIG_TCG=$(CONFIG_TCG) \
CONFIG_KVM=$(CONFIG_KVM) \
CONFIG_SPICE=$(CONFIG_SPICE) \
CONFIG_IVSHMEM=$(CONFIG_IVSHMEM) \
Expand All @@ -418,12 +419,11 @@ MINIKCONF_ARGS = \
CONFIG_LINUX=$(CONFIG_LINUX) \
CONFIG_PVRDMA=$(CONFIG_PVRDMA)

MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/backends/Kconfig $(SRC_PATH)/hw/Kconfig
MINIKCONF_DEPS = $(MINIKCONF_INPUTS) $(wildcard $(SRC_PATH)/hw/*/Kconfig)
MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py \
MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py

$(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak $(MINIKCONF_DEPS) $(BUILD_DIR)/config-host.mak
$(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) > $@.tmp, "GEN", "$@.tmp")
$(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak $(SRC_PATH)/Kconfig $(BUILD_DIR)/config-host.mak
$(call quiet-command, $(MINIKCONF) $(MINIKCONF_ARGS) \
> $@.tmp, "GEN", "$@.tmp")
$(call quiet-command, if test -f $@; then \
if cmp -s $@.old $@; then \
mv $@.tmp $@; \
Expand Down
7 changes: 2 additions & 5 deletions Makefile.target
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,13 @@ endif #CONFIG_BSD_USER
#########################################################
# System emulator target
ifdef CONFIG_SOFTMMU
obj-y += arch_init.o cpus.o gdbstub.o balloon.o ioport.o
obj-y += qtest.o
obj-y += softmmu/
obj-y += gdbstub.o
obj-y += dump/
obj-y += hw/
obj-y += monitor/
obj-y += qapi/
obj-y += memory.o
obj-y += memory_mapping.o
obj-y += migration/ram.o
obj-y += softmmu/
LIBS := $(libs_softmmu) $(LIBS)

# Hardware support
Expand Down
9 changes: 9 additions & 0 deletions accel/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
config TCG
bool

config KVM
bool

config XEN
bool
select FSDEV_9P if VIRTFS
7 changes: 7 additions & 0 deletions accel/stubs/tcg-stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@ void tb_flush(CPUState *cpu)
void tlb_set_dirty(CPUState *cpu, target_ulong vaddr)
{
}

void *probe_access(CPUArchState *env, target_ulong addr, int size,
MMUAccessType access_type, int mmu_idx, uintptr_t retaddr)
{
/* Handled by hardware accelerator. */
g_assert_not_reached();
}
22 changes: 12 additions & 10 deletions block/iscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,11 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int status,

iTask->status = status;
iTask->do_retry = 0;
iTask->err_code = 0;
iTask->task = task;

if (status != SCSI_STATUS_GOOD) {
iTask->err_code = -EIO;
if (iTask->retries++ < ISCSI_CMD_RETRIES) {
if (status == SCSI_STATUS_BUSY ||
status == SCSI_STATUS_TIMEOUT ||
Expand All @@ -266,16 +268,16 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int status,
timer_mod(&iTask->retry_timer,
qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + retry_time);
iTask->do_retry = 1;
}
} else if (status == SCSI_STATUS_CHECK_CONDITION) {
int error = iscsi_translate_sense(&task->sense);
if (error == EAGAIN) {
error_report("iSCSI CheckCondition: %s",
iscsi_get_error(iscsi));
iTask->do_retry = 1;
} else {
iTask->err_code = -error;
iTask->err_str = g_strdup(iscsi_get_error(iscsi));
} else if (status == SCSI_STATUS_CHECK_CONDITION) {
int error = iscsi_translate_sense(&task->sense);
if (error == EAGAIN) {
error_report("iSCSI CheckCondition: %s",
iscsi_get_error(iscsi));
iTask->do_retry = 1;
} else {
iTask->err_code = -error;
iTask->err_str = g_strdup(iscsi_get_error(iscsi));
}
}
}
}
Expand Down
18 changes: 18 additions & 0 deletions cpus-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ static int cpu_get_free_index(void)
return max_cpu_index;
}

CPUTailQ cpus = QTAILQ_HEAD_INITIALIZER(cpus);

void cpu_list_add(CPUState *cpu)
{
QEMU_LOCK_GUARD(&qemu_cpu_list_lock);
Expand All @@ -96,6 +98,22 @@ void cpu_list_remove(CPUState *cpu)
cpu->cpu_index = UNASSIGNED_CPU_INDEX;
}

CPUState *qemu_get_cpu(int index)
{
CPUState *cpu;

CPU_FOREACH(cpu) {
if (cpu->cpu_index == index) {
return cpu;
}
}

return NULL;
}

/* current CPU in the current thread. It is only valid inside cpu_exec() */
__thread CPUState *current_cpu;

struct qemu_work_item {
QSIMPLEQ_ENTRY(qemu_work_item) node;
run_on_cpu_func func;
Expand Down
22 changes: 0 additions & 22 deletions exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,6 @@ AddressSpace address_space_memory;
static MemoryRegion io_mem_unassigned;
#endif

CPUTailQ cpus = QTAILQ_HEAD_INITIALIZER(cpus);

/* current CPU in the current thread. It is only valid inside
cpu_exec() */
__thread CPUState *current_cpu;

uintptr_t qemu_host_page_size;
intptr_t qemu_host_page_mask;

Expand Down Expand Up @@ -832,22 +826,6 @@ const VMStateDescription vmstate_cpu_common = {
}
};

#endif

CPUState *qemu_get_cpu(int index)
{
CPUState *cpu;

CPU_FOREACH(cpu) {
if (cpu->cpu_index == index) {
return cpu;
}
}

return NULL;
}

#if !defined(CONFIG_USER_ONLY)
void cpu_address_space_init(CPUState *cpu, int asidx,
const char *prefix, MemoryRegion *mr)
{
Expand Down
5 changes: 5 additions & 0 deletions hw/core/null-machine.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ static void machine_none_machine_init(MachineClass *mc)
mc->max_cpus = 1;
mc->default_ram_size = 0;
mc->default_ram_id = "ram";
mc->no_serial = 1;
mc->no_parallel = 1;
mc->no_floppy = 1;
mc->no_cdrom = 1;
mc->no_sdcard = 1;
}

DEFINE_MACHINE("none", machine_none_machine_init)
5 changes: 5 additions & 0 deletions hw/i386/pc_sysfw.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ static PFlashCFI01 *pc_pflash_create(PCMachineState *pcms,
object_property_add_child(OBJECT(pcms), name, OBJECT(dev));
object_property_add_alias(OBJECT(pcms), alias_prop_name,
OBJECT(dev), "drive");
/*
* The returned reference is tied to the child property and
* will be removed with object_unparent.
*/
object_unref(OBJECT(dev));
return PFLASH_CFI01(dev);
}

Expand Down
18 changes: 0 additions & 18 deletions hw/intc/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,24 +615,6 @@ int apic_accept_pic_intr(DeviceState *dev)
return 0;
}

static uint32_t apic_get_current_count(APICCommonState *s)
{
int64_t d;
uint32_t val;
d = (qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) - s->initial_count_load_time) >>
s->count_shift;
if (s->lvt[APIC_LVT_TIMER] & APIC_LVT_TIMER_PERIODIC) {
/* periodic */
val = s->initial_count - (d % ((uint64_t)s->initial_count + 1));
} else {
if (d >= s->initial_count)
val = 0;
else
val = s->initial_count - d;
}
return val;
}

static void apic_timer_update(APICCommonState *s, int64_t current_time)
{
if (apic_next_timer(s, current_time)) {
Expand Down
19 changes: 19 additions & 0 deletions hw/intc/apic_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,25 @@ bool apic_next_timer(APICCommonState *s, int64_t current_time)
return true;
}

uint32_t apic_get_current_count(APICCommonState *s)
{
int64_t d;
uint32_t val;
d = (qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) - s->initial_count_load_time) >>
s->count_shift;
if (s->lvt[APIC_LVT_TIMER] & APIC_LVT_TIMER_PERIODIC) {
/* periodic */
val = s->initial_count - (d % ((uint64_t)s->initial_count + 1));
} else {
if (d >= s->initial_count) {
val = 0;
} else {
val = s->initial_count - d;
}
}
return val;
}

void apic_init_reset(DeviceState *dev)
{
APICCommonState *s;
Expand Down
Loading

0 comments on commit 2033cc6

Please sign in to comment.