All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0 of 6] powerpc updates to kvm-userspace
@ 2008-12-10 15:45 Christian Ehrhardt
  2008-12-10 15:45 ` [PATCH 1 of 6] [PATCH] kvm-userspace: ppc: fix compatfd build decision Christian Ehrhardt
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Christian Ehrhardt @ 2008-12-10 15:45 UTC (permalink / raw)
  To: avi; +Cc: ehrhardt, c=kvm-ppc, kvm, hollisb

This patch series fixes kvm-userspace to build for powerpc again.
It also aligns some code to match qemu upstream (where some ppc
patches went in).

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1 of 6] [PATCH] kvm-userspace: ppc: fix compatfd build decision
  2008-12-10 15:45 [PATCH 0 of 6] powerpc updates to kvm-userspace Christian Ehrhardt
@ 2008-12-10 15:45 ` Christian Ehrhardt
  2008-12-14 10:45   ` Avi Kivity
  2008-12-10 15:45 ` [PATCH 2 of 6] [PATCH] kvm-userspace: ppc: fix configure enabling kvm for ppc Christian Ehrhardt
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 13+ messages in thread
From: Christian Ehrhardt @ 2008-12-10 15:45 UTC (permalink / raw)
  To: avi; +Cc: ehrhardt, c=kvm-ppc, kvm, hollisb

# HG changeset patch
# User Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
# Date 1228922788 -3600
# Node ID b41f0d6129f51fb86bf799a5fe7b14a9270eeca4
# Parent  3af3fa5e009e143e1167979e55d547c453661059
[PATCH] kvm-userspace: ppc: fix compatfd build decision

From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>

qemu-kvm.c uses qemu_eventfd/qemu_signalfd. The code of compatfd takes care
if CONFIG_eventfd/CONFIG_signalfd is really enabled. But currently compatfd is
not build if --disable-aio is set. This patch lets compatfd.c build if USE_KVM
is set to allow qemu-kvm to be linked in all cases (with/without --disable-aio)

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
---

[diffstat]
 Makefile        |    2 +-
 Makefile.target |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

[diff]

diff --git a/qemu/Makefile b/qemu/Makefile
--- a/qemu/Makefile
+++ b/qemu/Makefile
@@ -59,7 +59,7 @@ BLOCK_OBJS += block-raw-posix.o
 BLOCK_OBJS += block-raw-posix.o
 endif
 
-ifdef CONFIG_AIO
+ifeq ($(USE_KVM), 1)
 BLOCK_OBJS += compatfd.o
 endif
 
diff --git a/qemu/Makefile.target b/qemu/Makefile.target
--- a/qemu/Makefile.target
+++ b/qemu/Makefile.target
@@ -655,7 +655,7 @@ OBJS+=block-raw-posix.o
 OBJS+=block-raw-posix.o
 endif
 
-ifdef CONFIG_AIO
+ifeq ($(USE_KVM), 1)
 OBJS+=compatfd.o
 endif
 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 2 of 6] [PATCH] kvm-userspace: ppc: fix configure enabling kvm for ppc
  2008-12-10 15:45 [PATCH 0 of 6] powerpc updates to kvm-userspace Christian Ehrhardt
  2008-12-10 15:45 ` [PATCH 1 of 6] [PATCH] kvm-userspace: ppc: fix compatfd build decision Christian Ehrhardt
@ 2008-12-10 15:45 ` Christian Ehrhardt
  2008-12-10 15:45 ` [PATCH 3 of 6] [PATCH] kvm-userspace: ppc: align with upstream qemu - breakpoint reset Christian Ehrhardt
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Christian Ehrhardt @ 2008-12-10 15:45 UTC (permalink / raw)
  To: avi; +Cc: ehrhardt, c=kvm-ppc, kvm, hollisb

# HG changeset patch
# User Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
# Date 1228922788 -3600
# Node ID f100b1bfa5f3d084d68bd2c66244271db1f5d084
# Parent  b41f0d6129f51fb86bf799a5fe7b14a9270eeca4
[PATCH] kvm-userspace: ppc: fix configure enabling kvm for ppc

From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>

The configure script is missing the target/host cpu sync for powerpc kvm.

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
---

[diffstat]
 configure |    1 +
 1 file changed, 1 insertion(+)

[diff]

diff --git a/qemu/configure b/qemu/configure
--- a/qemu/configure
+++ b/qemu/configure
@@ -1659,6 +1659,7 @@ if [ use_upstream_kvm = yes ]; then
 
 # Make sure the target and host cpus are compatible
 if test "$kvm" = "yes" -a ! \( "$target_cpu" = "$cpu" -o \
+  \( "$target_cpu" = "ppcemb" -a "$cpu" = "powerpc" \) -o \
   \( "$target_cpu" = "x86_64" -a "$cpu" = "i386"   \) -o \
   \( "$target_cpu" = "i386"   -a "$cpu" = "x86_64" \) \) ; then
   kvm="no"

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 3 of 6] [PATCH] kvm-userspace: ppc: align with upstream qemu - breakpoint reset
  2008-12-10 15:45 [PATCH 0 of 6] powerpc updates to kvm-userspace Christian Ehrhardt
  2008-12-10 15:45 ` [PATCH 1 of 6] [PATCH] kvm-userspace: ppc: fix compatfd build decision Christian Ehrhardt
  2008-12-10 15:45 ` [PATCH 2 of 6] [PATCH] kvm-userspace: ppc: fix configure enabling kvm for ppc Christian Ehrhardt
@ 2008-12-10 15:45 ` Christian Ehrhardt
  2008-12-10 15:45 ` [PATCH 4 of 6] [PATCH] kvm-userpace: ppc: align with upstream qemu - 4xxdevs Christian Ehrhardt
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Christian Ehrhardt @ 2008-12-10 15:45 UTC (permalink / raw)
  To: avi; +Cc: ehrhardt, c=kvm-ppc, kvm, hollisb

# HG changeset patch
# User Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
# Date 1228922788 -3600
# Node ID c032d8555c9494f9812e4d4e0b5ccccb511ae597
# Parent  f100b1bfa5f3d084d68bd2c66244271db1f5d084
[PATCH] kvm-userspace: ppc: align with upstream qemu - breakpoint reset

From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>

The way resettign that changed upstream, adopt new style in kvmppc code.

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
---

[diffstat]
 qemu-kvm-powerpc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

[diff]

diff --git a/qemu/qemu-kvm-powerpc.c b/qemu/qemu-kvm-powerpc.c
--- a/qemu/qemu-kvm-powerpc.c
+++ b/qemu/qemu-kvm-powerpc.c
@@ -31,7 +31,7 @@ extern kvm_context_t kvm_context;
 
 void cpu_reset(CPUState *env)
 {
-	memset(env->breakpoints, 0, sizeof(env->breakpoints));
+	memset(env, 0, offsetof(CPUPPCState, breakpoints));
 	cpu_ppc_reset(env);
 }
 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 4 of 6] [PATCH] kvm-userpace: ppc: align with upstream qemu - 4xxdevs
  2008-12-10 15:45 [PATCH 0 of 6] powerpc updates to kvm-userspace Christian Ehrhardt
                   ` (2 preceding siblings ...)
  2008-12-10 15:45 ` [PATCH 3 of 6] [PATCH] kvm-userspace: ppc: align with upstream qemu - breakpoint reset Christian Ehrhardt
@ 2008-12-10 15:45 ` Christian Ehrhardt
  2008-12-10 15:45 ` [PATCH 5 of 6] [PATCH] kvm-userspace: ppc: use virtio-blk header Christian Ehrhardt
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Christian Ehrhardt @ 2008-12-10 15:45 UTC (permalink / raw)
  To: avi; +Cc: ehrhardt, c=kvm-ppc, kvm, hollisb

# HG changeset patch
# User Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
# Date 1228922788 -3600
# Node ID 214485869c303ab81c9da30b6784d641f58585f4
# Parent  c032d8555c9494f9812e4d4e0b5ccccb511ae597
[PATCH] kvm-userpace: ppc: align with upstream qemu - 4xxdevs

From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>

This was mostly moved to qemu/hw/ppc4xx_pci.c and is no more needed
in hw/ppc4xx_devs.c

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
---

[diffstat]
 ppc4xx_devs.c |  371 ----------------------------------------------------------
 1 file changed, 371 deletions(-)

[diff]

diff --git a/qemu/hw/ppc4xx_devs.c b/qemu/hw/ppc4xx_devs.c
--- a/qemu/hw/ppc4xx_devs.c
+++ b/qemu/hw/ppc4xx_devs.c
@@ -2,9 +2,6 @@
  * QEMU PowerPC 4xx embedded processors shared devices emulation
  *
  * Copyright (c) 2007 Jocelyn Mayer
- *
- * Copyright 2008 IBM Corp.
- * Authors: Hollis Blanchard <hollisb@us.ibm.com>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +26,6 @@
 #include "ppc4xx.h"
 #include "sysemu.h"
 #include "qemu-log.h"
-#include "pci.h"
-#include "bswap.h"
 
 //#define DEBUG_MMIO
 //#define DEBUG_UNASSIGNED
@@ -537,369 +532,3 @@ qemu_irq *ppcuic_init (CPUState *env, qe
 
     return qemu_allocate_irqs(&ppcuic_set_irq, uic, UIC_MAX_IRQ);
 }
-
-
-
-
-#define PCIC0_CFGADDR       0x0
-#define PCIC0_CFGDATA       0x4
-
-#define PCIL0_PMM0LA        0x0
-#define PCIL0_PMM0MA        0x4
-#define PCIL0_PMM0PCILA     0x8
-#define PCIL0_PMM0PCIHA     0xc
-#define PCIL0_PMM1LA        0x10
-#define PCIL0_PMM1MA        0x14
-#define PCIL0_PMM1PCILA     0x18
-#define PCIL0_PMM1PCIHA     0x1c
-#define PCIL0_PMM2LA        0x20
-#define PCIL0_PMM2MA        0x24
-#define PCIL0_PMM2PCILA     0x28
-#define PCIL0_PMM2PCIHA     0x2c
-#define PCIL0_PTM1MS        0x30
-#define PCIL0_PTM1LA        0x34
-#define PCIL0_PTM2MS        0x38
-#define PCIL0_PTM2LA        0x3c
-#define PCI_REG_SIZE        0x40
-
-#define PPC44x_PCI_MA_MASK   0xfffff000
-#define PPC44x_PCI_MA_ENABLE 0x1
-
-
-static uint32_t pci4xx_cfgaddr_read4(void *opaque, target_phys_addr_t addr)
-{
-    ppc4xx_pci_t *ppc4xx_pci = opaque;
-    return cpu_to_le32(ppc4xx_pci->pcic0_cfgaddr);
-}
-
-static CPUReadMemoryFunc *pci4xx_cfgaddr_read[] = {
-    &pci4xx_cfgaddr_read4,
-    &pci4xx_cfgaddr_read4,
-    &pci4xx_cfgaddr_read4,
-};
-
-static void pci4xx_cfgaddr_write4(void *opaque, target_phys_addr_t addr,
-                                  uint32_t value)
-{
-    ppc4xx_pci_t *ppc4xx_pci = opaque;
-
-    value = le32_to_cpu(value);
-
-    ppc4xx_pci->pcic0_cfgaddr = value & ~0x3;
-}
-
-static CPUWriteMemoryFunc *pci4xx_cfgaddr_write[] = {
-    &pci4xx_cfgaddr_write4,
-    &pci4xx_cfgaddr_write4,
-    &pci4xx_cfgaddr_write4,
-};
-
-static uint32_t pci4xx_cfgdata_read1(void *opaque, target_phys_addr_t addr)
-{
-    ppc4xx_pci_t *ppc4xx_pci = opaque;
-    int offset = addr & 0x3;
-    uint32_t cfgaddr = ppc4xx_pci->pcic0_cfgaddr;
-    uint32_t value;
-
-    if (!(cfgaddr & (1<<31)))
-        return 0xffffffff;
-
-    value = pci_data_read(ppc4xx_pci->bus, cfgaddr | offset, 1);
-
-    return value;
-}
-
-static uint32_t pci4xx_cfgdata_read2(void *opaque, target_phys_addr_t addr)
-{
-    ppc4xx_pci_t *ppc4xx_pci = opaque;
-    int offset = addr & 0x3;
-    uint32_t cfgaddr = ppc4xx_pci->pcic0_cfgaddr;
-    uint32_t value;
-
-    if (!(cfgaddr & (1<<31)))
-        return 0xffffffff;
-
-    value = pci_data_read(ppc4xx_pci->bus, cfgaddr | offset, 2);
-
-    return cpu_to_le16(value);
-}
-
-static uint32_t pci4xx_cfgdata_read4(void *opaque, target_phys_addr_t addr)
-{
-    ppc4xx_pci_t *ppc4xx_pci = opaque;
-    int offset = addr & 0x3;
-    uint32_t cfgaddr = ppc4xx_pci->pcic0_cfgaddr;
-    uint32_t value;
-
-    if (!(cfgaddr & (1<<31)))
-        return 0xffffffff;
-
-    value = pci_data_read(ppc4xx_pci->bus, cfgaddr | offset, 4);
-
-    return cpu_to_le32(value);
-}
-
-static CPUReadMemoryFunc *pci4xx_cfgdata_read[] = {
-    &pci4xx_cfgdata_read1,
-    &pci4xx_cfgdata_read2,
-    &pci4xx_cfgdata_read4,
-};
-
-static void pci4xx_cfgdata_write1(void *opaque, target_phys_addr_t addr,
-                                  uint32_t value)
-{
-    ppc4xx_pci_t *ppc4xx_pci = opaque;
-    int offset = addr & 0x3;
-
-    pci_data_write(ppc4xx_pci->bus, ppc4xx_pci->pcic0_cfgaddr | offset,
-                   value, 1);
-}
-
-static void pci4xx_cfgdata_write2(void *opaque, target_phys_addr_t addr,
-                                  uint32_t value)
-{
-    ppc4xx_pci_t *ppc4xx_pci = opaque;
-    int offset = addr & 0x3;
-
-    value = le16_to_cpu(value);
-
-    pci_data_write(ppc4xx_pci->bus, ppc4xx_pci->pcic0_cfgaddr | offset,
-                   value, 2);
-}
-
-static void pci4xx_cfgdata_write4(void *opaque, target_phys_addr_t addr,
-                                  uint32_t value)
-{
-    ppc4xx_pci_t *ppc4xx_pci = opaque;
-    int offset = addr & 0x3;
-
-    value = le32_to_cpu(value);
-
-    pci_data_write(ppc4xx_pci->bus, ppc4xx_pci->pcic0_cfgaddr | offset,
-                   value, 4);
-}
-
-static CPUWriteMemoryFunc *pci4xx_cfgdata_write[] = {
-    &pci4xx_cfgdata_write1,
-    &pci4xx_cfgdata_write2,
-    &pci4xx_cfgdata_write4,
-};
-
-static void pci_reg_write4(void *opaque, target_phys_addr_t addr,
-                           uint32_t value)
-{
-    struct ppc4xx_pci_t *pci = opaque;
-    unsigned long offset = addr - pci->registers;
-
-    value = le32_to_cpu(value);
-
-    switch (offset) {
-    case PCIL0_PMM0LA:
-        pci->pmm[0].la = value;
-        break;
-    case PCIL0_PMM1LA:
-        pci->pmm[0].la = value;
-        break;
-    case PCIL0_PMM2LA:
-        pci->pmm[0].la = value;
-        break;
-    default:
-        //printf("  unhandled PCI internal register 0x%lx\n", offset);
-        break;
-    }
-}
-
-static uint32_t pci_reg_read4(void *opaque, target_phys_addr_t addr)
-{
-    struct ppc4xx_pci_t *pci = opaque;
-    unsigned long offset = addr - pci->registers;
-    uint32_t value;
-
-    switch (offset) {
-    case PCIL0_PMM0LA:
-        value = pci->pmm[0].la;
-        break;
-    case PCIL0_PMM0MA:
-        value = pci->pmm[0].ma;
-        break;
-    case PCIL0_PMM0PCIHA:
-        value = pci->pmm[0].pciha;
-        break;
-    case PCIL0_PMM0PCILA:
-        value = pci->pmm[0].pcila;
-        break;
-
-    case PCIL0_PMM1LA:
-        value = pci->pmm[1].la;
-        break;
-    case PCIL0_PMM1MA:
-        value = pci->pmm[1].ma;
-        break;
-    case PCIL0_PMM1PCIHA:
-        value = pci->pmm[1].pciha;
-        break;
-    case PCIL0_PMM1PCILA:
-        value = pci->pmm[1].pcila;
-        break;
-
-    case PCIL0_PMM2LA:
-        value = pci->pmm[2].la;
-        break;
-    case PCIL0_PMM2MA:
-        value = pci->pmm[2].ma;
-        break;
-    case PCIL0_PMM2PCIHA:
-        value = pci->pmm[2].pciha;
-        break;
-    case PCIL0_PMM2PCILA:
-        value = pci->pmm[2].pcila;
-        break;
-
-    case PCIL0_PTM1MS:
-        value = pci->ptm[0].ms;
-        break;
-    case PCIL0_PTM1LA:
-        value = pci->ptm[0].la;
-        break;
-    case PCIL0_PTM2MS:
-        value = pci->ptm[1].ms;
-        break;
-    case PCIL0_PTM2LA:
-        value = pci->ptm[1].la;
-        break;
-
-    default:
-        //printf("  read from invalid PCI internal register 0x%lx\n", offset);
-        value = 0;
-    }
-
-    value = cpu_to_le32(value);
-
-    return value;
-}
-
-static CPUReadMemoryFunc *pci_reg_read[] = {
-    &pci_reg_read4,
-    &pci_reg_read4,
-    &pci_reg_read4,
-};
-
-static CPUWriteMemoryFunc *pci_reg_write[] = {
-    &pci_reg_write4,
-    &pci_reg_write4,
-    &pci_reg_write4,
-};
-
-static uint32_t pci_int_ack_read4(void *opaque, target_phys_addr_t addr)
-{
-    printf("%s\n", __func__);
-    return 0;
-}
-
-static CPUReadMemoryFunc *pci_int_ack_read[] = {
-    &pci_int_ack_read4,
-    &pci_int_ack_read4,
-    &pci_int_ack_read4,
-};
-
-static void pci_special_write4(void *opaque, target_phys_addr_t addr,
-                               uint32_t value)
-{
-    printf("%s\n", __func__);
-}
-
-static CPUWriteMemoryFunc *pci_special_write[] = {
-    &pci_special_write4,
-    &pci_special_write4,
-    &pci_special_write4,
-};
-
-static int bamboo_pci_map_irq(PCIDevice *pci_dev, int irq_num)
-{
-    int slot = pci_dev->devfn >> 3;
-
-#if 0
-    printf("### %s: devfn %x irq %d -> %d\n", __func__,
-           pci_dev->devfn, irq_num, slot+1);
-#endif
-
-    /* All pins from each slot are tied to a single board IRQ (2-5) */
-    return slot + 1;
-}
-
-static void bamboo_pci_set_irq(qemu_irq *pic, int irq_num, int level)
-{
-#if 0
-    printf("### %s: PCI irq %d, UIC irq %d\n", __func__, irq_num, 30 - irq_num);
-#endif
-
-    /* Board IRQs 2-5 are connected to UIC IRQs 28-25 */
-    qemu_set_irq(pic[30-irq_num], level);
-}
-
-/* XXX Needs some abstracting for boards other than Bamboo. */
-ppc4xx_pci_t *ppc4xx_pci_init(CPUState *env, qemu_irq *pic,
-                              target_phys_addr_t config_space,
-                              target_phys_addr_t int_ack,
-                              target_phys_addr_t special_cycle,
-                              target_phys_addr_t registers)
-{
-    ppc4xx_pci_t *pci;
-    PCIDevice *d;
-    int index;
-
-    pci = qemu_mallocz(sizeof(ppc4xx_pci_t));
-    if (!pci)
-        return NULL;
-
-    pci->config_space = config_space;
-    pci->registers = registers;
-    pci->pic = pic;
-
-    pci->bus = pci_register_bus(bamboo_pci_set_irq, bamboo_pci_map_irq,
-                                pic, 0, 4);
-    d = pci_register_device(pci->bus, "host bridge", sizeof(PCIDevice),
-                            0, NULL, NULL);
-    d->config[0x00] = 0x14; // vendor_id
-    d->config[0x01] = 0x10;
-    d->config[0x02] = 0x7f; // device_id
-    d->config[0x03] = 0x02;
-    d->config[0x0a] = 0x80; // class_sub = other bridge type
-    d->config[0x0b] = 0x06; // class_base = PCI_bridge
-
-    /* CFGADDR */
-    index = cpu_register_io_memory(0, pci4xx_cfgaddr_read,
-                                   pci4xx_cfgaddr_write, pci);
-    if (index < 0)
-        goto free;
-    cpu_register_physical_memory(config_space, 4, index);
-
-    /* CFGDATA */
-    index = cpu_register_io_memory(0, pci4xx_cfgdata_read,
-                                   pci4xx_cfgdata_write, pci);
-    if (index < 0)
-        goto free;
-    cpu_register_physical_memory(config_space + 4, 4, index);
-
-    /* "Special cycle" and interrupt acknowledge */
-    index = cpu_register_io_memory(0, pci_int_ack_read,
-                                   pci_special_write, pci);
-    if (index < 0)
-        goto free;
-    cpu_register_physical_memory(int_ack, 4, index);
-
-    /* Internal registers */
-    index = cpu_register_io_memory(0, pci_reg_read, pci_reg_write, pci);
-    if (index < 0)
-        goto free;
-    cpu_register_physical_memory(registers, PCI_REG_SIZE, index);
-
-    /* XXX register_savevm() */
-
-    return pci;
-
-free:
-    printf("%s error\n", __func__);
-    qemu_free(pci);
-    return NULL;
-}

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 5 of 6] [PATCH] kvm-userspace: ppc: use virtio-blk header
  2008-12-10 15:45 [PATCH 0 of 6] powerpc updates to kvm-userspace Christian Ehrhardt
                   ` (3 preceding siblings ...)
  2008-12-10 15:45 ` [PATCH 4 of 6] [PATCH] kvm-userpace: ppc: align with upstream qemu - 4xxdevs Christian Ehrhardt
@ 2008-12-10 15:45 ` Christian Ehrhardt
  2008-12-10 15:45 ` [PATCH 6 of 6] [PATCH] kvm-userspace: ppc: align with upstream qemu - pcibus Christian Ehrhardt
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Christian Ehrhardt @ 2008-12-10 15:45 UTC (permalink / raw)
  To: avi; +Cc: ehrhardt, c=kvm-ppc, kvm, hollisb

# HG changeset patch
# User Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
# Date 1228922789 -3600
# Node ID 5adc6fbbd4a3b82e1bc8acbcb233c60e89715b61
# Parent  214485869c303ab81c9da30b6784d641f58585f4
[PATCH] kvm-userspace: ppc: use virtio-blk header

From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>

virtio_blk_init now is in a separate header

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
---

[diffstat]
 ppc440_bamboo.c |    1 +
 1 file changed, 1 insertion(+)

[diff]

diff --git a/qemu/hw/ppc440_bamboo.c b/qemu/hw/ppc440_bamboo.c
--- a/qemu/hw/ppc440_bamboo.c
+++ b/qemu/hw/ppc440_bamboo.c
@@ -19,6 +19,7 @@
 #include "ppc440.h"
 #include "qemu-kvm.h"
 #include "device_tree.h"
+#include "virtio-blk.h"
 
 #define BINARY_DEVICE_TREE_FILE "bamboo.dtb"
 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 6 of 6] [PATCH] kvm-userspace: ppc: align with upstream qemu - pcibus
  2008-12-10 15:45 [PATCH 0 of 6] powerpc updates to kvm-userspace Christian Ehrhardt
                   ` (4 preceding siblings ...)
  2008-12-10 15:45 ` [PATCH 5 of 6] [PATCH] kvm-userspace: ppc: use virtio-blk header Christian Ehrhardt
@ 2008-12-10 15:45 ` Christian Ehrhardt
  2008-12-14  8:36 ` [PATCH 0 of 6] powerpc updates to kvm-userspace Avi Kivity
  2008-12-14  8:37   ` Avi Kivity
  7 siblings, 0 replies; 13+ messages in thread
From: Christian Ehrhardt @ 2008-12-10 15:45 UTC (permalink / raw)
  To: avi; +Cc: ehrhardt, c=kvm-ppc, kvm, hollisb

# HG changeset patch
# User Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
# Date 1228922789 -3600
# Node ID 9a7208ca1afab83913ee14c629bf27632ee6326b
# Parent  5adc6fbbd4a3b82e1bc8acbcb233c60e89715b61
[PATCH] kvm-userspace: ppc: align with upstream qemu - pcibus

From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>

ppc initializer now properly use the opaque PCIBus type. This is already
changed in all upstream qemu files. This patch changes kvm ppc440 files
to use the new type too.

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
---

[diffstat]
 ppc440.c        |   11 ++++++-----
 ppc440.h        |    3 ++-
 ppc440_bamboo.c |   10 +++++-----
 3 files changed, 13 insertions(+), 11 deletions(-)

[diff]

diff --git a/qemu/hw/ppc440.c b/qemu/hw/ppc440.c
--- a/qemu/hw/ppc440.c
+++ b/qemu/hw/ppc440.c
@@ -13,6 +13,7 @@
 #include "hw.h"
 #include "hw/isa.h"
 #include "ppc440.h"
+#include "pci.h"
 
 #define PPC440EP_PCI_CONFIG 0xeec00000
 #define PPC440EP_PCI_INTACK 0xeed00000
@@ -29,12 +30,12 @@ void ppc440ep_init(CPUState *env,
 		target_phys_addr_t ram_sizes[PPC440_MAX_RAM_SLOTS],
 		int nbanks,
 		qemu_irq **picp,
-		ppc4xx_pci_t **pcip,
+		PCIBus **pcibusp,
 		int do_init)
 {
 	ppc4xx_mmio_t *mmio;
 	qemu_irq *pic, *irqs;
-	ppc4xx_pci_t *pci;
+	PCIBus *pcibus;
 	int i;
 
 	ppc_dcr_init(env, NULL, NULL);
@@ -59,14 +60,14 @@ void ppc440ep_init(CPUState *env,
 	ppc405_sdram_init(env, pic[14], nbanks, ram_bases, ram_sizes, do_init);
 
 	/* PCI */
-	pci = ppc4xx_pci_init(env, pic,
+	pcibus = ppc4xx_pci_init(env, pic,
 	                      PPC440EP_PCI_CONFIG,
 	                      PPC440EP_PCI_INTACK,
 	                      PPC440EP_PCI_SPECIAL,
 	                      PPC440EP_PCI_REGS);
-	if (!pci)
+	if (!pcibus)
 		printf("couldn't create PCI controller!\n");
-	*pcip = pci;
+	*pcibusp = pcibus;
 
 	isa_mmio_init(PPC440EP_PCI_IO, PPC440EP_PCI_IOLEN);
 
diff --git a/qemu/hw/ppc440.h b/qemu/hw/ppc440.h
--- a/qemu/hw/ppc440.h
+++ b/qemu/hw/ppc440.h
@@ -20,6 +20,7 @@
 #include "sysemu.h"
 #include "exec-all.h"
 #include "boards.h"
+#include "pci.h"
 
 #define PPC440_MAX_RAM_SLOTS 4
 
@@ -28,7 +29,7 @@ void ppc440ep_init(CPUState *env,
 		target_phys_addr_t ram_sizes[PPC440_MAX_RAM_SLOTS],
 		int nbanks,
 		qemu_irq **picp,
-		ppc4xx_pci_t **pcip,
+		PCIBus **pcip,
 		int do_init);
 
 #endif
diff --git a/qemu/hw/ppc440_bamboo.c b/qemu/hw/ppc440_bamboo.c
--- a/qemu/hw/ppc440_bamboo.c
+++ b/qemu/hw/ppc440_bamboo.c
@@ -37,7 +37,7 @@ void bamboo_init(ram_addr_t ram_size, in
 	target_phys_addr_t ram_sizes[PPC440_MAX_RAM_SLOTS];
 	NICInfo *nd;
 	qemu_irq *pic;
-	ppc4xx_pci_t *pci;
+	PCIBus *pcibus;
 	CPUState *env;
     uint64_t elf_entry;
     uint64_t elf_lowaddr;
@@ -102,7 +102,7 @@ void bamboo_init(ram_addr_t ram_size, in
 
 	/* call init */
 	printf("Calling function ppc440_init\n");
-	ppc440ep_init(env, ram_bases, ram_sizes, nbanks, &pic, &pci, 1);
+	ppc440ep_init(env, ram_bases, ram_sizes, nbanks, &pic, &pcibus, 1);
 	printf("Done calling ppc440_init\n");
 
 	/* load kernel with uboot loader */
@@ -197,12 +197,12 @@ void bamboo_init(ram_addr_t ram_size, in
 		env->nip = entry;
 	}
 
-	if (pci) {
+	if (pcibus) {
 		int unit_id = 0;
 
 		/* Add virtio block devices. */
 		while ((i = drive_get_index(IF_VIRTIO, 0, unit_id)) != -1) {
-			virtio_blk_init(pci->bus, 0x1AF4, 0x1001,
+			virtio_blk_init(pcibus, 0x1AF4, 0x1001,
 				drives_table[i].bdrv);
 			unit_id++;
 		}
@@ -212,7 +212,7 @@ void bamboo_init(ram_addr_t ram_size, in
 			nd = &nd_table[i];
 			if (!nd->model)
 				nd->model = "virtio";
-			pci_nic_init(pci->bus, nd, -1);
+			pci_nic_init(pcibus, nd, -1);
 		}
 	}
 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0 of 6] powerpc updates to kvm-userspace
  2008-12-10 15:45 [PATCH 0 of 6] powerpc updates to kvm-userspace Christian Ehrhardt
                   ` (5 preceding siblings ...)
  2008-12-10 15:45 ` [PATCH 6 of 6] [PATCH] kvm-userspace: ppc: align with upstream qemu - pcibus Christian Ehrhardt
@ 2008-12-14  8:36 ` Avi Kivity
  2008-12-14  8:37   ` Avi Kivity
  7 siblings, 0 replies; 13+ messages in thread
From: Avi Kivity @ 2008-12-14  8:36 UTC (permalink / raw)
  To: Christian Ehrhardt; +Cc: c=kvm-ppc, kvm, hollisb

Christian Ehrhardt wrote:
> This patch series fixes kvm-userspace to build for powerpc again.
> It also aligns some code to match qemu upstream (where some ppc
> patches went in).
>   

Applied all, thanks.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0 of 6] powerpc updates to kvm-userspace
  2008-12-10 15:45 [PATCH 0 of 6] powerpc updates to kvm-userspace Christian Ehrhardt
@ 2008-12-14  8:37   ` Avi Kivity
  2008-12-10 15:45 ` [PATCH 2 of 6] [PATCH] kvm-userspace: ppc: fix configure enabling kvm for ppc Christian Ehrhardt
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Avi Kivity @ 2008-12-14  8:37 UTC (permalink / raw)
  To: Christian Ehrhardt
  Cc: kvm-ppc, kvm-u79uwXL29TY76Z2rM5mHXA, hollisb-r/Jw6+rmf7HQT0dZR+AlfA

Christian Ehrhardt wrote:
> This patch series fixes kvm-userspace to build for powerpc again.
> It also aligns some code to match qemu upstream (where some ppc
> patches went in).
>   

Applied all, thanks.



-- 
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0 of 6] powerpc updates to kvm-userspace
@ 2008-12-14  8:37   ` Avi Kivity
  0 siblings, 0 replies; 13+ messages in thread
From: Avi Kivity @ 2008-12-14  8:37 UTC (permalink / raw)
  To: Christian Ehrhardt
  Cc: kvm-ppc, kvm-u79uwXL29TY76Z2rM5mHXA, hollisb-r/Jw6+rmf7HQT0dZR+AlfA

Christian Ehrhardt wrote:
> This patch series fixes kvm-userspace to build for powerpc again.
> It also aligns some code to match qemu upstream (where some ppc
> patches went in).
>   

Applied all, thanks.



-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1 of 6] [PATCH] kvm-userspace: ppc: fix compatfd build decision
  2008-12-10 15:45 ` [PATCH 1 of 6] [PATCH] kvm-userspace: ppc: fix compatfd build decision Christian Ehrhardt
@ 2008-12-14 10:45   ` Avi Kivity
       [not found]     ` <4944E3E0.1050607-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Avi Kivity @ 2008-12-14 10:45 UTC (permalink / raw)
  To: Christian Ehrhardt; +Cc: c=kvm-ppc, kvm, hollisb


> qemu-kvm.c uses qemu_eventfd/qemu_signalfd. The code of compatfd takes care
> if CONFIG_eventfd/CONFIG_signalfd is really enabled. But currently compatfd is
> not build if --disable-aio is set. This patch lets compatfd.c build if USE_KVM
> is set to allow qemu-kvm to be linked in all cases (with/without --disable-aio)
>   

This breaks x86, so I dropped it.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1 of 6] [PATCH] kvm-userspace: ppc: fix compatfd build decision
       [not found]     ` <4944E3E0.1050607-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2008-12-15 12:43         ` Christian Ehrhardt
  0 siblings, 0 replies; 13+ messages in thread
From: Christian Ehrhardt @ 2008-12-15 12:43 UTC (permalink / raw)
  To: Avi Kivity
  Cc: kvm-ppc-u79uwXL29TY76Z2rM5mHXA, kvm-u79uwXL29TY76Z2rM5mHXA,
	hollisb-r/Jw6+rmf7HQT0dZR+AlfA

Avi Kivity wrote:
>
>> qemu-kvm.c uses qemu_eventfd/qemu_signalfd. The code of compatfd 
>> takes care
>> if CONFIG_eventfd/CONFIG_signalfd is really enabled. But currently 
>> compatfd is
>> not build if --disable-aio is set. This patch lets compatfd.c build 
>> if USE_KVM
>> is set to allow qemu-kvm to be linked in all cases (with/without 
>> --disable-aio)
>>   
>
> This breaks x86, so I dropped it.
>
On the other Hand x86 it is broken atm too.
If you compile current upstream for x86 with --disable-aio you'll get 
this too:
  ibqemu.a(qemu-kvm.o): In function `kvm_main_loop':
  
/home/paelzer/Desktop/KVM/ppc_port/kvm-userspace-ppc.hg-testbuild/qemu/qemu-kvm.c:565: 
undefined reference to `qemu_eventfd'
  
/home/paelzer/Desktop/KVM/ppc_port/kvm-userspace-ppc.hg-testbuild/qemu/qemu-kvm.c:580: 
undefined reference to `qemu_signalfd'
  collect2: ld returned 1 exit status

Which was exactly what I had with power :-/

I checked for the error you reported Avi, and the problem seems to be 
that  USE_KVM was not set even if KVM support is enabled (weird?).
However looking at this more in detail I realized that I don't have to 
care about USE_KVM in this csae. As I mentioned before compatfd.c takes 
care if CONFIG_signalfd/CONFIG_eventfd are set. Therefore we can savely 
remove the makefile guard completely and just always build compatfd.c.

This updated patch works for x86&powerpc with/without --disable-aio in 
my tests.
It should appear on the list shortly.

-- 

Grüsse / regards, 
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1 of 6] [PATCH] kvm-userspace: ppc: fix compatfd build
@ 2008-12-15 12:43         ` Christian Ehrhardt
  0 siblings, 0 replies; 13+ messages in thread
From: Christian Ehrhardt @ 2008-12-15 12:43 UTC (permalink / raw)
  To: Avi Kivity
  Cc: kvm-ppc-u79uwXL29TY76Z2rM5mHXA, kvm-u79uwXL29TY76Z2rM5mHXA,
	hollisb-r/Jw6+rmf7HQT0dZR+AlfA

Avi Kivity wrote:
>
>> qemu-kvm.c uses qemu_eventfd/qemu_signalfd. The code of compatfd 
>> takes care
>> if CONFIG_eventfd/CONFIG_signalfd is really enabled. But currently 
>> compatfd is
>> not build if --disable-aio is set. This patch lets compatfd.c build 
>> if USE_KVM
>> is set to allow qemu-kvm to be linked in all cases (with/without 
>> --disable-aio)
>>   
>
> This breaks x86, so I dropped it.
>
On the other Hand x86 it is broken atm too.
If you compile current upstream for x86 with --disable-aio you'll get 
this too:
  ibqemu.a(qemu-kvm.o): In function `kvm_main_loop':
  
/home/paelzer/Desktop/KVM/ppc_port/kvm-userspace-ppc.hg-testbuild/qemu/qemu-kvm.c:565: 
undefined reference to `qemu_eventfd'
  
/home/paelzer/Desktop/KVM/ppc_port/kvm-userspace-ppc.hg-testbuild/qemu/qemu-kvm.c:580: 
undefined reference to `qemu_signalfd'
  collect2: ld returned 1 exit status

Which was exactly what I had with power :-/

I checked for the error you reported Avi, and the problem seems to be 
that  USE_KVM was not set even if KVM support is enabled (weird?).
However looking at this more in detail I realized that I don't have to 
care about USE_KVM in this csae. As I mentioned before compatfd.c takes 
care if CONFIG_signalfd/CONFIG_eventfd are set. Therefore we can savely 
remove the makefile guard completely and just always build compatfd.c.

This updated patch works for x86&powerpc with/without --disable-aio in 
my tests.
It should appear on the list shortly.

-- 

Grüsse / regards, 
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-12-15 12:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-10 15:45 [PATCH 0 of 6] powerpc updates to kvm-userspace Christian Ehrhardt
2008-12-10 15:45 ` [PATCH 1 of 6] [PATCH] kvm-userspace: ppc: fix compatfd build decision Christian Ehrhardt
2008-12-14 10:45   ` Avi Kivity
     [not found]     ` <4944E3E0.1050607-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2008-12-15 12:43       ` Christian Ehrhardt
2008-12-15 12:43         ` [PATCH 1 of 6] [PATCH] kvm-userspace: ppc: fix compatfd build Christian Ehrhardt
2008-12-10 15:45 ` [PATCH 2 of 6] [PATCH] kvm-userspace: ppc: fix configure enabling kvm for ppc Christian Ehrhardt
2008-12-10 15:45 ` [PATCH 3 of 6] [PATCH] kvm-userspace: ppc: align with upstream qemu - breakpoint reset Christian Ehrhardt
2008-12-10 15:45 ` [PATCH 4 of 6] [PATCH] kvm-userpace: ppc: align with upstream qemu - 4xxdevs Christian Ehrhardt
2008-12-10 15:45 ` [PATCH 5 of 6] [PATCH] kvm-userspace: ppc: use virtio-blk header Christian Ehrhardt
2008-12-10 15:45 ` [PATCH 6 of 6] [PATCH] kvm-userspace: ppc: align with upstream qemu - pcibus Christian Ehrhardt
2008-12-14  8:36 ` [PATCH 0 of 6] powerpc updates to kvm-userspace Avi Kivity
2008-12-14  8:37 ` Avi Kivity
2008-12-14  8:37   ` Avi Kivity

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.