]> xenbits.xensource.com Git - qemu-xen-4.5-testing.git/commitdiff
Place pseries vty devices at addresses more similar to existing machines
authorDavid Gibson <david@gibson.dropbear.id.au>
Tue, 19 Apr 2011 01:54:52 +0000 (11:54 +1000)
committerAlexander Graf <agraf@suse.de>
Mon, 9 May 2011 20:31:37 +0000 (22:31 +0200)
Currently the qemu pseries machine numbers its virtual serial devices
from 0.  However, existing pSeries machines running pHyp number them from
0x30000000.

In theory these indices are arbitrary, since everything necessary for the
kernel to find them is advertised in the device tree.  However the debian
installer, at least, incorrectly looks for a device named vty@30... to
determine whether to use the hypervisor console.

Therefore this patch moves the numbers we use to match the existing pHyp
practice, in order to workaround broken userspace apps of this type.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/spapr.c
hw/spapr_rtas.c
hw/spapr_vio.h

index 884c6673ecc4eb4ca59400fa7b1816bddad3790a..109b77459ade17d7f3fdfc76a249722fdf3d1250 100644 (file)
@@ -362,8 +362,9 @@ static void ppc_spapr_init(ram_addr_t ram_size,
 
     for (i = 0; i < MAX_SERIAL_PORTS; i++, irq++) {
         if (serial_hds[i]) {
-            spapr_vty_create(spapr->vio_bus, i, serial_hds[i],
-                             xics_find_qirq(spapr->icp, irq), irq);
+            spapr_vty_create(spapr->vio_bus, SPAPR_VTY_BASE_ADDRESS + i,
+                             serial_hds[i], xics_find_qirq(spapr->icp, irq),
+                             irq);
         }
     }
 
index 16b65422b6dfdb5a52f5e8302d49d4753e16100f..00c8ce5a155fd4ea61b1df8b9e3c5fc465dfed0a 100644 (file)
@@ -44,7 +44,8 @@ static void rtas_display_character(sPAPREnvironment *spapr,
                                    uint32_t nret, target_ulong rets)
 {
     uint8_t c = rtas_ld(args, 0);
-    VIOsPAPRDevice *sdev = spapr_vio_find_by_reg(spapr->vio_bus, 0);
+    VIOsPAPRDevice *sdev = spapr_vio_find_by_reg(spapr->vio_bus,
+                                                 SPAPR_VTY_BASE_ADDRESS);
 
     if (!sdev) {
         rtas_st(rets, 0, -1);
index 841b04351a5c76835e673bdf5de2bc0d9d5e48ec..603a8c43a38bce0c0fb60d950c110116d1114859 100644 (file)
@@ -32,6 +32,8 @@ enum VIOsPAPR_TCEAccess {
     SPAPR_TCE_RW = 3,
 };
 
+#define SPAPR_VTY_BASE_ADDRESS     0x30000000
+
 struct VIOsPAPRDevice;
 
 typedef struct VIOsPAPR_RTCE {