aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--host-utils.h2
-rw-r--r--hw/pci.c29
-rw-r--r--hw/pci.h1
-rw-r--r--hw/s390-virtio-bus.c2
-rw-r--r--hw/s390-virtio.c15
-rw-r--r--osdep.c18
-rw-r--r--target-mips/translate.c8
-rw-r--r--target-mips/translate_init.c8
-rw-r--r--target-ppc/kvm.c2
-rw-r--r--target-s390x/kvm.c2
-rw-r--r--vl.c2
12 files changed, 43 insertions, 48 deletions
diff --git a/Makefile b/Makefile
index 0c2834de0..8e3498b70 100644
--- a/Makefile
+++ b/Makefile
@@ -82,7 +82,7 @@ $(filter %-softmmu,$(SUBDIR_RULES)): libqemu_common.a
$(filter %-user,$(SUBDIR_RULES)): libuser.a
-libuser.a:
+libuser.a: $(GENERATED_HEADERS)
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libuser V="$(V)" TARGET_DIR="libuser/" all,)
ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
diff --git a/host-utils.h b/host-utils.h
index e335c5cb6..0ddc17658 100644
--- a/host-utils.h
+++ b/host-utils.h
@@ -164,7 +164,7 @@ static inline int ctz64(uint64_t val)
{
#if QEMU_GNUC_PREREQ(3, 4)
if (val)
- return __builtin_ctz(val);
+ return __builtin_ctzll(val);
else
return 64;
#else
diff --git a/hw/pci.c b/hw/pci.c
index 0c5476098..832df47b9 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -571,8 +571,7 @@ static void pci_init_wmask(PCIDevice *dev)
dev->wmask[PCI_CACHE_LINE_SIZE] = 0xff;
dev->wmask[PCI_INTERRUPT_LINE] = 0xff;
pci_set_word(dev->wmask + PCI_COMMAND,
- PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |
- PCI_COMMAND_INTX_DISABLE);
+ PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
memset(dev->wmask + PCI_CONFIG_HEADER_SIZE, 0xff,
config_size - PCI_CONFIG_HEADER_SIZE);
@@ -997,25 +996,6 @@ static void pci_update_mappings(PCIDevice *d)
}
}
-static inline int pci_irq_disabled(PCIDevice *d)
-{
- return pci_get_word(d->config + PCI_COMMAND) & PCI_COMMAND_INTX_DISABLE;
-}
-
-/* Called after interrupt disabled field update in config space,
- * assert/deassert interrupts if necessary.
- * Gets original interrupt disable bit value (before update). */
-static void pci_update_irq_disabled(PCIDevice *d, int was_irq_disabled)
-{
- int i, disabled = pci_irq_disabled(d);
- if (disabled == was_irq_disabled)
- return;
- for (i = 0; i < PCI_NUM_PINS; ++i) {
- int state = pci_irq_state(d, i);
- pci_change_irq_level(d, i, disabled ? -state : state);
- }
-}
-
static uint32_t pci_read_config(PCIDevice *d,
uint32_t address, int len)
{
@@ -1070,7 +1050,7 @@ void pci_default_cap_write_config(PCIDevice *pci_dev,
void pci_default_write_config(PCIDevice *d, uint32_t addr, uint32_t val, int l)
{
- int i, was_irq_disabled = pci_irq_disabled(d);
+ int i;
uint32_t config_size = pci_config_size(d);
if (pci_access_cap_config(d, addr, l)) {
@@ -1095,9 +1075,6 @@ void pci_default_write_config(PCIDevice *d, uint32_t addr, uint32_t val, int l)
ranges_overlap(addr, l, PCI_ROM_ADDRESS1, 4) ||
range_covers_byte(addr, l, PCI_COMMAND))
pci_update_mappings(d);
-
- if (range_covers_byte(addr, l, PCI_COMMAND))
- pci_update_irq_disabled(d, was_irq_disabled);
}
/***********************************************************/
@@ -1119,8 +1096,6 @@ static void pci_set_irq(void *opaque, int irq_num, int level)
pci_set_irq_state(pci_dev, irq_num, level);
pci_update_irq_status(pci_dev);
- if (pci_irq_disabled(pci_dev))
- return;
pci_change_irq_level(pci_dev, irq_num, change);
}
diff --git a/hw/pci.h b/hw/pci.h
index 737a2e6e8..6eede57a0 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -112,7 +112,6 @@ typedef struct PCIIORegion {
#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */
#define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */
#define PCI_COMMAND_MASTER 0x4 /* Enable bus master */
-#define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */
#define PCI_STATUS 0x06 /* 16 bits */
#define PCI_STATUS_INTERRUPT 0x08
#define PCI_REVISION_ID 0x08 /* 8 bits */
diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c
index 493e4dae4..dc154edb8 100644
--- a/hw/s390-virtio-bus.c
+++ b/hw/s390-virtio-bus.c
@@ -307,7 +307,7 @@ static void virtio_s390_notify(void *opaque, uint16_t vector)
uint64_t token = s390_virtio_device_vq_token(dev, vector);
/* XXX kvm dependency! */
- kvm_s390_virtio_irq(s390_cpu_addr2state(0), 1, token);
+ kvm_s390_virtio_irq(s390_cpu_addr2state(0), 0, token);
}
/**************** S390 Virtio Bus Device Descriptions *******************/
diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c
index b56788652..0fa6ba68c 100644
--- a/hw/s390-virtio.c
+++ b/hw/s390-virtio.c
@@ -142,6 +142,13 @@ static void s390_init(ram_addr_t ram_size,
ram_addr_t initrd_size = 0;
int i;
+ /* XXX we only work on KVM for now */
+
+ if (!kvm_enabled()) {
+ fprintf(stderr, "The S390 target only works with KVM enabled\n");
+ exit(1);
+ }
+
/* get a BUS */
s390_bus = s390_virtio_bus_init(&ram_size);
@@ -201,7 +208,11 @@ static void s390_init(ram_addr_t ram_size,
}
/* Create VirtIO console */
- qdev_init_nofail(qdev_create((BusState *)s390_bus, "virtio-console-s390"));
+ for(i = 0; i < MAX_VIRTIO_CONSOLES; i++) {
+ if (virtcon_hds[i]) {
+ qdev_init_nofail(qdev_create((BusState *)s390_bus, "virtio-console-s390"));
+ }
+ }
/* Create VirtIO network adapters */
for(i = 0; i < nb_nics; i++) {
@@ -209,7 +220,7 @@ static void s390_init(ram_addr_t ram_size,
DeviceState *dev;
if (!nd->model) {
- nd->model = (char*)"virtio";
+ nd->model = qemu_strdup("virtio");
}
if (strcmp(nd->model, "virtio")) {
diff --git a/osdep.c b/osdep.c
index 0706fcd4e..b7b441107 100644
--- a/osdep.c
+++ b/osdep.c
@@ -266,13 +266,15 @@ int qemu_pipe(int pipefd[2])
#ifdef CONFIG_PIPE2
ret = pipe2(pipefd, O_CLOEXEC);
-#else
+ if (ret != -1 || errno != ENOSYS) {
+ return ret;
+ }
+#endif
ret = pipe(pipefd);
if (ret == 0) {
qemu_set_cloexec(pipefd[0]);
qemu_set_cloexec(pipefd[1]);
}
-#endif
return ret;
}
@@ -287,12 +289,14 @@ int qemu_socket(int domain, int type, int protocol)
#ifdef SOCK_CLOEXEC
ret = socket(domain, type | SOCK_CLOEXEC, protocol);
-#else
+ if (ret != -1 || errno != EINVAL) {
+ return ret;
+ }
+#endif
ret = socket(domain, type, protocol);
if (ret >= 0) {
qemu_set_cloexec(ret);
}
-#endif
return ret;
}
@@ -306,12 +310,14 @@ int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
#ifdef CONFIG_ACCEPT4
ret = accept4(s, addr, addrlen, SOCK_CLOEXEC);
-#else
+ if (ret != -1 || errno != EINVAL) {
+ return ret;
+ }
+#endif
ret = accept(s, addr, addrlen);
if (ret >= 0) {
qemu_set_cloexec(ret);
}
-#endif
return ret;
}
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 9d62b64b5..f756ab9db 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -8652,6 +8652,14 @@ void cpu_reset (CPUMIPSState *env)
env->hflags = MIPS_HFLAG_UM;
/* Enable access to the SYNCI_Step register. */
env->CP0_HWREna |= (1 << 1);
+ if (env->CP0_Config1 & (1 << CP0C1_FP)) {
+ env->hflags |= MIPS_HFLAG_FPU;
+ }
+#ifdef TARGET_MIPS64
+ if (env->active_fpu.fcr0 & (1 << FCR0_F64)) {
+ env->hflags |= MIPS_HFLAG_F64;
+ }
+#endif
#else
if (env->hflags & MIPS_HFLAG_BMASK) {
/* If the exception was raised from a delay slot,
diff --git a/target-mips/translate_init.c b/target-mips/translate_init.c
index c950eab1a..397890865 100644
--- a/target-mips/translate_init.c
+++ b/target-mips/translate_init.c
@@ -524,14 +524,6 @@ static void fpu_init (CPUMIPSState *env, const mips_def_t *def)
env->fpus[i].fcr0 = def->CP1_fcr0;
memcpy(&env->active_fpu, &env->fpus[0], sizeof(env->active_fpu));
-#if defined(CONFIG_USER_ONLY)
- if (env->CP0_Config1 & (1 << CP0C1_FP))
- env->hflags |= MIPS_HFLAG_FPU;
-#ifdef TARGET_MIPS64
- if (env->active_fpu.fcr0 & (1 << FCR0_F64))
- env->hflags |= MIPS_HFLAG_F64;
-#endif
-#endif
}
static void mvp_init (CPUMIPSState *env, const mips_def_t *def)
diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index 2b5abf430..0424a7842 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -135,10 +135,12 @@ int kvm_arch_get_registers(CPUState *env)
env->sdr1 = sregs.u.s.sdr1;
/* Sync SLB */
+#ifdef TARGET_PPC64
for (i = 0; i < 64; i++) {
ppc_store_slb(env, sregs.u.s.ppc64.slb[i].slbe,
sregs.u.s.ppc64.slb[i].slbv);
}
+#endif
/* Sync SRs */
for (i = 0; i < 16; i++) {
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index b6aac424d..099256392 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -405,7 +405,7 @@ static int handle_instruction(CPUState *env, struct kvm_run *run)
unsigned int ipa0 = (run->s390_sieic.ipa & 0xff00);
uint8_t ipa1 = run->s390_sieic.ipa & 0x00ff;
int ipb_code = (run->s390_sieic.ipb & 0x0fff0000) >> 16;
- int r = 0;
+ int r = -1;
dprintf("handle_instruction 0x%x 0x%x\n", run->s390_sieic.ipa, run->s390_sieic.ipb);
switch (ipa0) {
diff --git a/vl.c b/vl.c
index 7f9a91f6a..6c1d1343c 100644
--- a/vl.c
+++ b/vl.c
@@ -5821,6 +5821,8 @@ int main(int argc, char **argv, char **envp)
add_device_config(DEV_PARALLEL, "vc:80Cx24C");
if (default_monitor)
monitor_parse("vc:80Cx24C", "readline");
+ if (default_virtcon)
+ add_device_config(DEV_VIRTCON, "vc:80Cx24C");
}
if (default_vga)
vga_interface_type = VGA_CIRRUS;