mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
* First batch of MAINTAINERS updates * IOAPIC fixes (to pass kvm-unit-tests with -machine kernel_irqchip=off) * NBD API upgrades from Daniel * strtosz fixes from Marc-André * improved support for readonly=on on scsi-generic devices * new "info ioapic" and "info lapic" monitor commands * Peter Crosthwaite's ELF_MACHINE cleanups * docs patches from Thomas and Daniel # gpg: Signature made Fri 25 Sep 2015 11:20:52 BST using RSA key ID 78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" * remotes/bonzini/tags/for-upstream: (52 commits) doc: Refresh URLs in the qemu-tech documentation docs: describe the QEMU build system structure / design typedef: add typedef for QemuOpts i386: interrupt poll processing i386: partial revert of interrupt poll fix ppc: Rename ELF_MACHINE to be PPC specific i386: Rename ELF_MACHINE to be x86 specific alpha: Remove ELF_MACHINE from cpu.h mips: Remove ELF_MACHINE from cpu.h sparc: Remove ELF_MACHINE from cpu.h s390: Remove ELF_MACHINE from cpu.h sh4: Remove ELF_MACHINE from cpu.h xtensa: Remove ELF_MACHINE from cpu.h tricore: Remove ELF_MACHINE from cpu.h or32: Remove ELF_MACHINE from cpu.h lm32: Remove ELF_MACHINE from cpu.h unicore: Remove ELF_MACHINE from cpu.h moxie: Remove ELF_MACHINE from cpu.h cris: Remove ELF_MACHINE from cpu.h m68k: Remove ELF_MACHINE from cpu.h ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
+51
-7
@@ -77,6 +77,7 @@ S: Maintained
|
||||
F: target-alpha/
|
||||
F: hw/alpha/
|
||||
F: tests/tcg/alpha/
|
||||
F: disas/alpha.c
|
||||
|
||||
ARM
|
||||
M: Peter Maydell <peter.maydell@linaro.org>
|
||||
@@ -84,6 +85,9 @@ S: Maintained
|
||||
F: target-arm/
|
||||
F: hw/arm/
|
||||
F: hw/cpu/a*mpcore.c
|
||||
F: disas/arm.c
|
||||
F: disas/arm-a64.cc
|
||||
F: disas/libvixl/
|
||||
|
||||
CRIS
|
||||
M: Edgar E. Iglesias <edgar.iglesias@gmail.com>
|
||||
@@ -91,6 +95,7 @@ S: Maintained
|
||||
F: target-cris/
|
||||
F: hw/cris/
|
||||
F: tests/tcg/cris/
|
||||
F: disas/cris.c
|
||||
|
||||
LM32
|
||||
M: Michael Walle <michael@walle.cc>
|
||||
@@ -114,6 +119,7 @@ M: Edgar E. Iglesias <edgar.iglesias@gmail.com>
|
||||
S: Maintained
|
||||
F: target-microblaze/
|
||||
F: hw/microblaze/
|
||||
F: disas/microblaze.c
|
||||
|
||||
MIPS
|
||||
M: Aurelien Jarno <aurelien@aurel32.net>
|
||||
@@ -122,11 +128,13 @@ S: Maintained
|
||||
F: target-mips/
|
||||
F: hw/mips/
|
||||
F: tests/tcg/mips/
|
||||
F: disas/mips.c
|
||||
|
||||
Moxie
|
||||
M: Anthony Green <green@moxielogic.com>
|
||||
S: Maintained
|
||||
F: target-moxie/
|
||||
F: disas/moxie.c
|
||||
|
||||
OpenRISC
|
||||
M: Jia Liu <proljc@gmail.com>
|
||||
@@ -141,6 +149,7 @@ L: qemu-ppc@nongnu.org
|
||||
S: Maintained
|
||||
F: target-ppc/
|
||||
F: hw/ppc/
|
||||
F: disas/ppc.c
|
||||
|
||||
S390
|
||||
M: Richard Henderson <rth@twiddle.net>
|
||||
@@ -148,12 +157,14 @@ M: Alexander Graf <agraf@suse.de>
|
||||
S: Maintained
|
||||
F: target-s390x/
|
||||
F: hw/s390x/
|
||||
F: disas/s390.c
|
||||
|
||||
SH4
|
||||
M: Aurelien Jarno <aurelien@aurel32.net>
|
||||
S: Odd Fixes
|
||||
F: target-sh4/
|
||||
F: hw/sh4/
|
||||
F: disas/sh4.c
|
||||
|
||||
SPARC
|
||||
M: Blue Swirl <blauwirbel@gmail.com>
|
||||
@@ -162,6 +173,7 @@ S: Maintained
|
||||
F: target-sparc/
|
||||
F: hw/sparc/
|
||||
F: hw/sparc64/
|
||||
F: disas/sparc.c
|
||||
|
||||
UniCore32
|
||||
M: Guan Xuetao <gxt@mprc.pku.edu.cn>
|
||||
@@ -176,6 +188,7 @@ M: Eduardo Habkost <ehabkost@redhat.com>
|
||||
S: Maintained
|
||||
F: target-i386/
|
||||
F: hw/i386/
|
||||
F: disas/i386.c
|
||||
|
||||
Xtensa
|
||||
M: Max Filippov <jcmvbkbc@gmail.com>
|
||||
@@ -564,6 +577,7 @@ M: Cornelia Huck <cornelia.huck@de.ibm.com>
|
||||
M: Christian Borntraeger <borntraeger@de.ibm.com>
|
||||
M: Alexander Graf <agraf@suse.de>
|
||||
S: Supported
|
||||
F: hw/char/sclp*.[hc]
|
||||
F: hw/s390x/s390-virtio-ccw.c
|
||||
F: hw/s390x/css.[hc]
|
||||
F: hw/s390x/sclp*.[hc]
|
||||
@@ -668,6 +682,12 @@ M: Peter Maydell <peter.maydell@linaro.org>
|
||||
S: Maintained
|
||||
F: hw/*/omap*
|
||||
|
||||
IPack
|
||||
M: Alberto Garcia <berto@igalia.com>
|
||||
S: Odd Fixes
|
||||
F: hw/char/ipoctal232.c
|
||||
F: hw/ipack/
|
||||
|
||||
PCI
|
||||
M: Michael S. Tsirkin <mst@redhat.com>
|
||||
S: Supported
|
||||
@@ -704,6 +724,17 @@ L: qemu-ppc@nongnu.org
|
||||
S: Supported
|
||||
F: hw/ppc/e500*
|
||||
|
||||
Character devices
|
||||
M: Paolo Bonzini <pbonzini@redhat.com>
|
||||
S: Odd Fixes
|
||||
F: hw/char/
|
||||
|
||||
Network devices
|
||||
M: Jason Wang <jasowang@redhat.com>
|
||||
S: Odd Fixes
|
||||
F: hw/net/
|
||||
T: git git://github.com/jasowang/qemu.git net
|
||||
|
||||
SCSI
|
||||
M: Paolo Bonzini <pbonzini@redhat.com>
|
||||
S: Supported
|
||||
@@ -888,7 +919,7 @@ F: block/qapi.c
|
||||
F: qapi/block*.json
|
||||
T: git git://repo.or.cz/qemu/armbru.git block-next
|
||||
|
||||
Character Devices
|
||||
Character device backends
|
||||
M: Paolo Bonzini <pbonzini@redhat.com>
|
||||
S: Maintained
|
||||
F: qemu-char.c
|
||||
@@ -983,7 +1014,7 @@ F: hmp.c
|
||||
F: hmp-commands.hx
|
||||
T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
|
||||
|
||||
Network device layer
|
||||
Network device backends
|
||||
M: Jason Wang <jasowang@redhat.com>
|
||||
S: Maintained
|
||||
F: net/
|
||||
@@ -1137,53 +1168,58 @@ M: Claudio Fontana <claudio.fontana@huawei.com>
|
||||
M: Claudio Fontana <claudio.fontana@gmail.com>
|
||||
S: Maintained
|
||||
F: tcg/aarch64/
|
||||
F: disas/arm-a64.cc
|
||||
F: disas/libvixl/
|
||||
|
||||
ARM target
|
||||
M: Andrzej Zaborowski <balrogg@gmail.com>
|
||||
S: Maintained
|
||||
F: tcg/arm/
|
||||
F: disas/arm.c
|
||||
|
||||
i386 target
|
||||
L: qemu-devel@nongnu.org
|
||||
S: Maintained
|
||||
F: tcg/i386/
|
||||
F: disas/i386.c
|
||||
|
||||
IA64 target
|
||||
M: Aurelien Jarno <aurelien@aurel32.net>
|
||||
S: Maintained
|
||||
F: tcg/ia64/
|
||||
F: disas/ia64.c
|
||||
|
||||
MIPS target
|
||||
M: Aurelien Jarno <aurelien@aurel32.net>
|
||||
S: Maintained
|
||||
F: tcg/mips/
|
||||
F: disas/mips.c
|
||||
|
||||
PPC
|
||||
M: Vassili Karpov (malc) <av1474@comtv.ru>
|
||||
S: Maintained
|
||||
F: tcg/ppc/
|
||||
|
||||
PPC64 target
|
||||
M: Vassili Karpov (malc) <av1474@comtv.ru>
|
||||
S: Maintained
|
||||
F: tcg/ppc64/
|
||||
F: disas/ppc.c
|
||||
|
||||
S390 target
|
||||
M: Alexander Graf <agraf@suse.de>
|
||||
M: Richard Henderson <rth@twiddle.net>
|
||||
S: Maintained
|
||||
F: tcg/s390/
|
||||
F: disas/s390.c
|
||||
|
||||
SPARC target
|
||||
M: Blue Swirl <blauwirbel@gmail.com>
|
||||
S: Maintained
|
||||
F: tcg/sparc/
|
||||
F: disas/sparc.c
|
||||
|
||||
TCI target
|
||||
M: Stefan Weil <sw@weilnetz.de>
|
||||
S: Maintained
|
||||
F: tcg/tci/
|
||||
F: tci.c
|
||||
F: disas/tci.c
|
||||
|
||||
Stable branches
|
||||
---------------
|
||||
@@ -1393,3 +1429,11 @@ M: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
L: qemu-block@nongnu.org
|
||||
S: Supported
|
||||
F: tests/image-fuzzer/
|
||||
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
Build system architecture
|
||||
M: Daniel P. Berrange <berrange@redhat.com>
|
||||
S: Odd Fixes
|
||||
F: docs/build-system.txt
|
||||
|
||||
@@ -176,7 +176,6 @@ SOFTMMU_SUBDIR_RULES=$(filter %-softmmu,$(SUBDIR_RULES))
|
||||
|
||||
$(SOFTMMU_SUBDIR_RULES): $(block-obj-y)
|
||||
$(SOFTMMU_SUBDIR_RULES): $(crypto-obj-y)
|
||||
$(SOFTMMU_SUBDIR_RULES): $(qom-obj-y)
|
||||
$(SOFTMMU_SUBDIR_RULES): config-all-devices.mak
|
||||
|
||||
subdir-%:
|
||||
@@ -201,7 +200,7 @@ subdir-dtc:dtc/libfdt dtc/tests
|
||||
dtc/%:
|
||||
mkdir -p $@
|
||||
|
||||
$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y)
|
||||
$(SUBDIR_RULES): libqemuutil.a libqemustub.a $(common-obj-y) $(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY))
|
||||
|
||||
ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
|
||||
romsubdir-%:
|
||||
|
||||
+37
-34
@@ -43,7 +43,6 @@
|
||||
|
||||
typedef struct BDRVNBDState {
|
||||
NbdClientSession client;
|
||||
QemuOpts *socket_opts;
|
||||
} BDRVNBDState;
|
||||
|
||||
static int nbd_parse_uri(const char *filename, QDict *options)
|
||||
@@ -190,10 +189,10 @@ out:
|
||||
g_free(file);
|
||||
}
|
||||
|
||||
static void nbd_config(BDRVNBDState *s, QDict *options, char **export,
|
||||
Error **errp)
|
||||
static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options, char **export,
|
||||
Error **errp)
|
||||
{
|
||||
Error *local_err = NULL;
|
||||
SocketAddress *saddr;
|
||||
|
||||
if (qdict_haskey(options, "path") == qdict_haskey(options, "host")) {
|
||||
if (qdict_haskey(options, "path")) {
|
||||
@@ -201,28 +200,37 @@ static void nbd_config(BDRVNBDState *s, QDict *options, char **export,
|
||||
} else {
|
||||
error_setg(errp, "one of path and host must be specified.");
|
||||
}
|
||||
return;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
s->client.is_unix = qdict_haskey(options, "path");
|
||||
s->socket_opts = qemu_opts_create(&socket_optslist, NULL, 0,
|
||||
&error_abort);
|
||||
saddr = g_new0(SocketAddress, 1);
|
||||
|
||||
qemu_opts_absorb_qdict(s->socket_opts, options, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
if (qdict_haskey(options, "path")) {
|
||||
saddr->kind = SOCKET_ADDRESS_KIND_UNIX;
|
||||
saddr->q_unix = g_new0(UnixSocketAddress, 1);
|
||||
saddr->q_unix->path = g_strdup(qdict_get_str(options, "path"));
|
||||
qdict_del(options, "path");
|
||||
} else {
|
||||
saddr->kind = SOCKET_ADDRESS_KIND_INET;
|
||||
saddr->inet = g_new0(InetSocketAddress, 1);
|
||||
saddr->inet->host = g_strdup(qdict_get_str(options, "host"));
|
||||
if (!qdict_get_try_str(options, "port")) {
|
||||
saddr->inet->port = g_strdup_printf("%d", NBD_DEFAULT_PORT);
|
||||
} else {
|
||||
saddr->inet->port = g_strdup(qdict_get_str(options, "port"));
|
||||
}
|
||||
qdict_del(options, "host");
|
||||
qdict_del(options, "port");
|
||||
}
|
||||
|
||||
if (!qemu_opt_get(s->socket_opts, "port")) {
|
||||
qemu_opt_set_number(s->socket_opts, "port", NBD_DEFAULT_PORT,
|
||||
&error_abort);
|
||||
}
|
||||
s->client.is_unix = saddr->kind == SOCKET_ADDRESS_KIND_UNIX;
|
||||
|
||||
*export = g_strdup(qdict_get_try_str(options, "export"));
|
||||
if (*export) {
|
||||
qdict_del(options, "export");
|
||||
}
|
||||
|
||||
return saddr;
|
||||
}
|
||||
|
||||
NbdClientSession *nbd_get_client_session(BlockDriverState *bs)
|
||||
@@ -231,26 +239,24 @@ NbdClientSession *nbd_get_client_session(BlockDriverState *bs)
|
||||
return &s->client;
|
||||
}
|
||||
|
||||
static int nbd_establish_connection(BlockDriverState *bs, Error **errp)
|
||||
static int nbd_establish_connection(BlockDriverState *bs,
|
||||
SocketAddress *saddr,
|
||||
Error **errp)
|
||||
{
|
||||
BDRVNBDState *s = bs->opaque;
|
||||
int sock;
|
||||
|
||||
if (s->client.is_unix) {
|
||||
sock = unix_connect_opts(s->socket_opts, errp, NULL, NULL);
|
||||
} else {
|
||||
sock = inet_connect_opts(s->socket_opts, errp, NULL, NULL);
|
||||
if (sock >= 0) {
|
||||
socket_set_nodelay(sock);
|
||||
}
|
||||
}
|
||||
sock = socket_connect(saddr, errp, NULL, NULL);
|
||||
|
||||
/* Failed to establish connection */
|
||||
if (sock < 0) {
|
||||
logout("Failed to establish connection to NBD server\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if (!s->client.is_unix) {
|
||||
socket_set_nodelay(sock);
|
||||
}
|
||||
|
||||
return sock;
|
||||
}
|
||||
|
||||
@@ -260,19 +266,19 @@ static int nbd_open(BlockDriverState *bs, QDict *options, int flags,
|
||||
BDRVNBDState *s = bs->opaque;
|
||||
char *export = NULL;
|
||||
int result, sock;
|
||||
Error *local_err = NULL;
|
||||
SocketAddress *saddr;
|
||||
|
||||
/* Pop the config into our state object. Exit if invalid. */
|
||||
nbd_config(s, options, &export, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
saddr = nbd_config(s, options, &export, errp);
|
||||
if (!saddr) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* establish TCP connection, return error if it fails
|
||||
* TODO: Configurable retry-until-timeout behaviour.
|
||||
*/
|
||||
sock = nbd_establish_connection(bs, errp);
|
||||
sock = nbd_establish_connection(bs, saddr, errp);
|
||||
qapi_free_SocketAddress(saddr);
|
||||
if (sock < 0) {
|
||||
g_free(export);
|
||||
return sock;
|
||||
@@ -315,9 +321,6 @@ static int nbd_co_discard(BlockDriverState *bs, int64_t sector_num,
|
||||
|
||||
static void nbd_close(BlockDriverState *bs)
|
||||
{
|
||||
BDRVNBDState *s = bs->opaque;
|
||||
|
||||
qemu_opts_del(s->socket_opts);
|
||||
nbd_client_close(bs);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
#include "exec/address-spaces.h"
|
||||
#include "qemu/rcu.h"
|
||||
#include "exec/tb-hash.h"
|
||||
#if defined(TARGET_I386) && !defined(CONFIG_USER_ONLY)
|
||||
#include "hw/i386/apic.h"
|
||||
#endif
|
||||
|
||||
/* -icount align implementation. */
|
||||
|
||||
@@ -343,6 +346,12 @@ int cpu_exec(CPUState *cpu)
|
||||
SyncClocks sc;
|
||||
|
||||
if (cpu->halted) {
|
||||
#if defined(TARGET_I386) && !defined(CONFIG_USER_ONLY)
|
||||
if (cpu->interrupt_request & CPU_INTERRUPT_POLL) {
|
||||
apic_poll_irq(x86_cpu->apic_state);
|
||||
cpu_reset_interrupt(cpu, CPU_INTERRUPT_POLL);
|
||||
}
|
||||
#endif
|
||||
if (!cpu_has_work(cpu)) {
|
||||
return EXCP_HALTED;
|
||||
}
|
||||
|
||||
@@ -392,16 +392,6 @@ monitor_read_memory (bfd_vma memaddr, bfd_byte *myaddr, int length,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int GCC_FMT_ATTR(2, 3)
|
||||
monitor_fprintf(FILE *stream, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
monitor_vprintf((Monitor *)stream, fmt, ap);
|
||||
va_end(ap);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Disassembler for the monitor.
|
||||
See target_disas for a description of flags. */
|
||||
void monitor_disas(Monitor *mon, CPUState *cpu,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -110,6 +110,38 @@ STEXI
|
||||
@item info registers
|
||||
@findex registers
|
||||
Show the cpu registers.
|
||||
ETEXI
|
||||
|
||||
#if defined(TARGET_I386)
|
||||
{
|
||||
.name = "lapic",
|
||||
.args_type = "",
|
||||
.params = "",
|
||||
.help = "show local apic state",
|
||||
.mhandler.cmd = hmp_info_local_apic,
|
||||
},
|
||||
#endif
|
||||
|
||||
STEXI
|
||||
@item info lapic
|
||||
@findex lapic
|
||||
Show local APIC state
|
||||
ETEXI
|
||||
|
||||
#if defined(TARGET_I386)
|
||||
{
|
||||
.name = "ioapic",
|
||||
.args_type = "",
|
||||
.params = "",
|
||||
.help = "show io apic state",
|
||||
.mhandler.cmd = hmp_info_io_apic,
|
||||
},
|
||||
#endif
|
||||
|
||||
STEXI
|
||||
@item info ioapic
|
||||
@findex ioapic
|
||||
Show io APIC state
|
||||
ETEXI
|
||||
|
||||
{
|
||||
|
||||
+1
-1
@@ -215,7 +215,7 @@ qemu_irq *armv7m_init(MemoryRegion *system_memory, int mem_size, int num_irq,
|
||||
|
||||
if (kernel_filename) {
|
||||
image_size = load_elf(kernel_filename, NULL, NULL, &entry, &lowaddr,
|
||||
NULL, big_endian, ELF_MACHINE, 1);
|
||||
NULL, big_endian, EM_ARM, 1);
|
||||
if (image_size < 0) {
|
||||
image_size = load_image_targphys(kernel_filename, 0, mem_size);
|
||||
lowaddr = 0;
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ void cris_load_image(CRISCPU *cpu, struct cris_load_info *li)
|
||||
/* Boots a kernel elf binary, os/linux-2.6/vmlinux from the axis
|
||||
devboard SDK. */
|
||||
image_size = load_elf(li->image_filename, translate_kernel_address, NULL,
|
||||
&entry, NULL, &high, 0, ELF_MACHINE, 0);
|
||||
&entry, NULL, &high, 0, EM_CRIS, 0);
|
||||
li->entry = entry;
|
||||
if (image_size < 0) {
|
||||
/* Takes a kimage from the axis devboard SDK. */
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
* See the COPYING file in the top-level directory.
|
||||
*/
|
||||
|
||||
#include "monitor/monitor.h"
|
||||
#include "hw/i386/pc.h"
|
||||
#include "hw/i386/ioapic_internal.h"
|
||||
#include "hw/i386/apic_internal.h"
|
||||
@@ -110,6 +111,15 @@ static void kvm_ioapic_put(IOAPICCommonState *s)
|
||||
}
|
||||
}
|
||||
|
||||
void kvm_ioapic_dump_state(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
IOAPICCommonState s;
|
||||
|
||||
kvm_ioapic_get(&s);
|
||||
|
||||
ioapic_print_redtbl(mon, &s);
|
||||
}
|
||||
|
||||
static void kvm_ioapic_reset(DeviceState *dev)
|
||||
{
|
||||
IOAPICCommonState *s = IOAPIC_COMMON(dev);
|
||||
|
||||
+1
-1
@@ -195,7 +195,7 @@ int load_multiboot(FWCfgState *fw_cfg,
|
||||
}
|
||||
|
||||
kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
|
||||
&elf_low, &elf_high, 0, ELF_MACHINE, 0);
|
||||
&elf_low, &elf_high, 0, I386_ELF_MACHINE, 0);
|
||||
if (kernel_size < 0) {
|
||||
fprintf(stderr, "Error while loading elf kernel\n");
|
||||
exit(1);
|
||||
|
||||
+3
-19
@@ -51,14 +51,6 @@ static int apic_ffs_bit(uint32_t value)
|
||||
return ctz32(value);
|
||||
}
|
||||
|
||||
static inline void apic_set_bit(uint32_t *tab, int index)
|
||||
{
|
||||
int i, mask;
|
||||
i = index >> 5;
|
||||
mask = 1 << (index & 0x1f);
|
||||
tab[i] |= mask;
|
||||
}
|
||||
|
||||
static inline void apic_reset_bit(uint32_t *tab, int index)
|
||||
{
|
||||
int i, mask;
|
||||
@@ -67,14 +59,6 @@ static inline void apic_reset_bit(uint32_t *tab, int index)
|
||||
tab[i] &= ~mask;
|
||||
}
|
||||
|
||||
static inline int apic_get_bit(uint32_t *tab, int index)
|
||||
{
|
||||
int i, mask;
|
||||
i = index >> 5;
|
||||
mask = 1 << (index & 0x1f);
|
||||
return !!(tab[i] & mask);
|
||||
}
|
||||
|
||||
/* return -1 if no bit is set */
|
||||
static int get_highest_priority_int(uint32_t *tab)
|
||||
{
|
||||
@@ -318,7 +302,7 @@ static uint8_t apic_get_tpr(APICCommonState *s)
|
||||
return s->tpr >> 4;
|
||||
}
|
||||
|
||||
static int apic_get_ppr(APICCommonState *s)
|
||||
int apic_get_ppr(APICCommonState *s)
|
||||
{
|
||||
int tpr, isrv, ppr;
|
||||
|
||||
@@ -739,7 +723,7 @@ static uint32_t apic_mem_readl(void *opaque, hwaddr addr)
|
||||
val = s->divide_conf;
|
||||
break;
|
||||
default:
|
||||
s->esr |= ESR_ILLEGAL_ADDRESS;
|
||||
s->esr |= APIC_ESR_ILLEGAL_ADDRESS;
|
||||
val = 0;
|
||||
break;
|
||||
}
|
||||
@@ -852,7 +836,7 @@ static void apic_mem_writel(void *opaque, hwaddr addr, uint32_t val)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
s->esr |= ESR_ILLEGAL_ADDRESS;
|
||||
s->esr |= APIC_ESR_ILLEGAL_ADDRESS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+16
-4
@@ -20,6 +20,7 @@
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "monitor/monitor.h"
|
||||
#include "hw/hw.h"
|
||||
#include "hw/i386/pc.h"
|
||||
#include "hw/i386/ioapic.h"
|
||||
@@ -98,7 +99,9 @@ static void ioapic_set_irq(void *opaque, int vector, int level)
|
||||
/* level triggered */
|
||||
if (level) {
|
||||
s->irr |= mask;
|
||||
ioapic_service(s);
|
||||
if (!(entry & IOAPIC_LVT_REMOTE_IRR)) {
|
||||
ioapic_service(s);
|
||||
}
|
||||
} else {
|
||||
s->irr &= ~mask;
|
||||
}
|
||||
@@ -137,6 +140,17 @@ void ioapic_eoi_broadcast(int vector)
|
||||
}
|
||||
}
|
||||
|
||||
void ioapic_dump_state(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_IOAPICS; i++) {
|
||||
if (ioapics[i] != 0) {
|
||||
ioapic_print_redtbl(mon, ioapics[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static uint64_t
|
||||
ioapic_mem_read(void *opaque, hwaddr addr, unsigned int size)
|
||||
{
|
||||
@@ -154,15 +168,13 @@ ioapic_mem_read(void *opaque, hwaddr addr, unsigned int size)
|
||||
}
|
||||
switch (s->ioregsel) {
|
||||
case IOAPIC_REG_ID:
|
||||
case IOAPIC_REG_ARB:
|
||||
val = s->id << IOAPIC_ID_SHIFT;
|
||||
break;
|
||||
case IOAPIC_REG_VER:
|
||||
val = IOAPIC_VERSION |
|
||||
((IOAPIC_NUM_PINS - 1) << IOAPIC_VER_ENTRIES_SHIFT);
|
||||
break;
|
||||
case IOAPIC_REG_ARB:
|
||||
val = 0;
|
||||
break;
|
||||
default:
|
||||
index = (s->ioregsel - IOAPIC_REG_REDTBL_BASE) >> 1;
|
||||
if (index >= 0 && index < IOAPIC_NUM_PINS) {
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "monitor/monitor.h"
|
||||
#include "hw/i386/ioapic.h"
|
||||
#include "hw/i386/ioapic_internal.h"
|
||||
#include "hw/sysbus.h"
|
||||
@@ -31,6 +32,60 @@
|
||||
*/
|
||||
int ioapic_no;
|
||||
|
||||
static void ioapic_irr_dump(Monitor *mon, const char *name, uint32_t bitmap)
|
||||
{
|
||||
int i;
|
||||
|
||||
monitor_printf(mon, "%-10s ", name);
|
||||
if (bitmap == 0) {
|
||||
monitor_printf(mon, "(none)\n");
|
||||
return;
|
||||
}
|
||||
for (i = 0; i < IOAPIC_NUM_PINS; i++) {
|
||||
if (bitmap & (1 << i)) {
|
||||
monitor_printf(mon, "%-2u ", i);
|
||||
}
|
||||
}
|
||||
monitor_printf(mon, "\n");
|
||||
}
|
||||
|
||||
void ioapic_print_redtbl(Monitor *mon, IOAPICCommonState *s)
|
||||
{
|
||||
static const char *delm_str[] = {
|
||||
"fixed", "lowest", "SMI", "...", "NMI", "INIT", "...", "extINT"};
|
||||
uint32_t remote_irr = 0;
|
||||
int i;
|
||||
|
||||
monitor_printf(mon, "ioapic id=0x%02x sel=0x%02x", s->id, s->ioregsel);
|
||||
if (s->ioregsel) {
|
||||
monitor_printf(mon, " (redir[%u])\n",
|
||||
(s->ioregsel - IOAPIC_REG_REDTBL_BASE) >> 1);
|
||||
} else {
|
||||
monitor_printf(mon, "\n");
|
||||
}
|
||||
for (i = 0; i < IOAPIC_NUM_PINS; i++) {
|
||||
uint64_t entry = s->ioredtbl[i];
|
||||
uint32_t delm = (uint32_t)((entry & IOAPIC_LVT_DELIV_MODE) >>
|
||||
IOAPIC_LVT_DELIV_MODE_SHIFT);
|
||||
monitor_printf(mon, "pin %-2u 0x%016"PRIx64" dest=%"PRIx64
|
||||
" vec=%-3"PRIu64" %s %-5s %-6s %-6s %s\n",
|
||||
i, entry,
|
||||
(entry >> IOAPIC_LVT_DEST_SHIFT) &
|
||||
(entry & IOAPIC_LVT_DEST_MODE ? 0xff : 0xf),
|
||||
entry & IOAPIC_VECTOR_MASK,
|
||||
entry & IOAPIC_LVT_POLARITY ? "active-lo" : "active-hi",
|
||||
entry & IOAPIC_LVT_TRIGGER_MODE ? "level" : "edge",
|
||||
entry & IOAPIC_LVT_MASKED ? "masked" : "",
|
||||
delm_str[delm],
|
||||
entry & IOAPIC_LVT_DEST_MODE ? "logical" : "physical");
|
||||
|
||||
remote_irr |= entry & IOAPIC_LVT_TRIGGER_MODE ?
|
||||
(entry & IOAPIC_LVT_REMOTE_IRR ? (1 << i) : 0) : 0;
|
||||
}
|
||||
ioapic_irr_dump(mon, "IRR", s->irr);
|
||||
ioapic_irr_dump(mon, "Remote IRR", remote_irr);
|
||||
}
|
||||
|
||||
void ioapic_reset_common(DeviceState *dev)
|
||||
{
|
||||
IOAPICCommonState *s = IOAPIC_COMMON(dev);
|
||||
|
||||
@@ -142,7 +142,7 @@ static void lm32_evr_init(MachineState *machine)
|
||||
int kernel_size;
|
||||
|
||||
kernel_size = load_elf(kernel_filename, NULL, NULL, &entry, NULL, NULL,
|
||||
1, ELF_MACHINE, 0);
|
||||
1, EM_LATTICEMICO32, 0);
|
||||
reset_info->bootstrap_pc = entry;
|
||||
|
||||
if (kernel_size < 0) {
|
||||
@@ -244,7 +244,7 @@ static void lm32_uclinux_init(MachineState *machine)
|
||||
int kernel_size;
|
||||
|
||||
kernel_size = load_elf(kernel_filename, NULL, NULL, &entry, NULL, NULL,
|
||||
1, ELF_MACHINE, 0);
|
||||
1, EM_LATTICEMICO32, 0);
|
||||
reset_info->bootstrap_pc = entry;
|
||||
|
||||
if (kernel_size < 0) {
|
||||
|
||||
+1
-1
@@ -176,7 +176,7 @@ milkymist_init(MachineState *machine)
|
||||
|
||||
/* Boots a kernel elf binary. */
|
||||
kernel_size = load_elf(kernel_filename, NULL, NULL, &entry, NULL, NULL,
|
||||
1, ELF_MACHINE, 0);
|
||||
1, EM_LATTICEMICO32, 0);
|
||||
reset_info->bootstrap_pc = entry;
|
||||
|
||||
if (kernel_size < 0) {
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ static void an5206_init(MachineState *machine)
|
||||
}
|
||||
|
||||
kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
|
||||
NULL, NULL, 1, ELF_MACHINE, 0);
|
||||
NULL, NULL, 1, EM_68K, 0);
|
||||
entry = elf_entry;
|
||||
if (kernel_size < 0) {
|
||||
kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
|
||||
|
||||
@@ -49,7 +49,7 @@ static void dummy_m68k_init(MachineState *machine)
|
||||
/* Load kernel. */
|
||||
if (kernel_filename) {
|
||||
kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
|
||||
NULL, NULL, 1, ELF_MACHINE, 0);
|
||||
NULL, NULL, 1, EM_68K, 0);
|
||||
entry = elf_entry;
|
||||
if (kernel_size < 0) {
|
||||
kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
|
||||
|
||||
+1
-1
@@ -275,7 +275,7 @@ static void mcf5208evb_init(MachineState *machine)
|
||||
}
|
||||
|
||||
kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
|
||||
NULL, NULL, 1, ELF_MACHINE, 0);
|
||||
NULL, NULL, 1, EM_68K, 0);
|
||||
entry = elf_entry;
|
||||
if (kernel_size < 0) {
|
||||
kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
|
||||
|
||||
@@ -141,12 +141,12 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,
|
||||
/* Boots a kernel elf binary. */
|
||||
kernel_size = load_elf(kernel_filename, NULL, NULL,
|
||||
&entry, &low, &high,
|
||||
big_endian, ELF_MACHINE, 0);
|
||||
big_endian, EM_MICROBLAZE, 0);
|
||||
base32 = entry;
|
||||
if (base32 == 0xc0000000) {
|
||||
kernel_size = load_elf(kernel_filename, translate_kernel_address,
|
||||
NULL, &entry, NULL, NULL,
|
||||
big_endian, ELF_MACHINE, 0);
|
||||
big_endian, EM_MICROBLAZE, 0);
|
||||
}
|
||||
/* Always boot into physical ram. */
|
||||
boot_info.bootstrap_pc = (uint32_t)entry;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user