diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2010-08-26 21:09:48 -0300 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-08-26 21:09:48 -0300 |
commit | ad76760eb4a5191d12a01992f0761438b7d42d75 (patch) | |
tree | a5e933b07161a1130d6082db3efad65225b8db89 | |
parent | e268078f55e5c3d0ffadded8e322bb45c785f403 (diff) | |
parent | 9e84a4708f820976afd825745d4110dbaf58f431 (diff) |
Merge commit '9e84a4708f820976afd825745d4110dbaf58f431' into upstream-merge
* commit '9e84a4708f820976afd825745d4110dbaf58f431':
etraxfs_eth: correct use of ! and &
Sparc: update OpenBIOS images to r859
ppc4xx: load Bamboo kernel, initrd, and fdt at fixed addresses
ppc4xx: don't unregister RAM at reset
ppc4xx: correct SDRAM controller warning message condition
Fix "make install" with a cross toolchain
PPC: Update openbios binary to r859
PPC: Add PV hypercall transport through fw_cfg
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r-- | Makefile.target | 5 | ||||
-rwxr-xr-x | configure | 4 | ||||
-rw-r--r-- | hw/etraxfs_eth.c | 2 | ||||
-rw-r--r-- | hw/ppc.h | 3 | ||||
-rw-r--r-- | hw/ppc440_bamboo.c | 39 | ||||
-rw-r--r-- | hw/ppc4xx_devs.c | 3 | ||||
-rw-r--r-- | hw/ppc_newworld.c | 7 | ||||
-rw-r--r-- | hw/ppc_oldworld.c | 7 | ||||
-rw-r--r-- | pc-bios/README | 2 | ||||
-rw-r--r-- | pc-bios/openbios-ppc | bin | 320324 -> 320328 bytes | |||
-rw-r--r-- | pc-bios/openbios-sparc32 | bin | 217692 -> 217660 bytes | |||
-rw-r--r-- | pc-bios/openbios-sparc64 | bin | 1065864 -> 1065864 bytes | |||
-rw-r--r-- | target-ppc/kvm.c | 32 | ||||
-rw-r--r-- | target-ppc/kvm_ppc.h | 1 |
14 files changed, 78 insertions, 27 deletions
diff --git a/Makefile.target b/Makefile.target index 9643f88ec..9bec218a1 100644 --- a/Makefile.target +++ b/Makefile.target @@ -365,7 +365,10 @@ clean: install: all ifneq ($(PROGS),) - $(INSTALL) -m 755 $(STRIP_OPT) $(PROGS) "$(DESTDIR)$(bindir)" + $(INSTALL) -m 755 $(PROGS) "$(DESTDIR)$(bindir)" +ifneq ($(STRIP),) + $(STRIP) $(patsubst %,"$(DESTDIR)$(bindir)/%",$(PROGS)) +endif endif # Include automatically generated dependency files @@ -80,6 +80,7 @@ make="make" install="install" objcopy="objcopy" ld="ld" +strip="strip" helper_cflags="" libs_softmmu="" libs_tools="" @@ -125,6 +126,7 @@ cc="${cross_prefix}${cc}" ar="${cross_prefix}${ar}" objcopy="${cross_prefix}${objcopy}" ld="${cross_prefix}${ld}" +strip="${cross_prefix}${strip}" # default flags for all hosts QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS" @@ -2366,7 +2368,7 @@ if test "$debug" = "yes" ; then echo "CONFIG_DEBUG_EXEC=y" >> $config_host_mak fi if test "$strip_opt" = "yes" ; then - echo "STRIP_OPT=-s" >> $config_host_mak + echo "STRIP=${strip}" >> $config_host_mak fi if test "$bigendian" = "yes" ; then echo "HOST_WORDS_BIGENDIAN=y" >> $config_host_mak diff --git a/hw/etraxfs_eth.c b/hw/etraxfs_eth.c index b897c9c16..ade96f14a 100644 --- a/hw/etraxfs_eth.c +++ b/hw/etraxfs_eth.c @@ -464,7 +464,7 @@ static int eth_match_groupaddr(struct fs_eth *eth, const unsigned char *sa) /* First bit on the wire of a MAC address signals multicast or physical address. */ - if (!m_individual && !sa[0] & 1) + if (!m_individual && !(sa[0] & 1)) return 0; /* Calculate the hash index for the GA registers. */ @@ -47,5 +47,8 @@ enum { #define FW_CFG_PPC_HEIGHT (FW_CFG_ARCH_LOCAL + 0x01) #define FW_CFG_PPC_DEPTH (FW_CFG_ARCH_LOCAL + 0x02) #define FW_CFG_PPC_TBFREQ (FW_CFG_ARCH_LOCAL + 0x03) +#define FW_CFG_PPC_IS_KVM (FW_CFG_ARCH_LOCAL + 0x05) +#define FW_CFG_PPC_KVM_HC (FW_CFG_ARCH_LOCAL + 0x06) +#define FW_CFG_PPC_KVM_PID (FW_CFG_ARCH_LOCAL + 0x07) #define PPC_SERIAL_MM_BAUDBASE 399193 diff --git a/hw/ppc440_bamboo.c b/hw/ppc440_bamboo.c index 74cc56a34..b16864f9b 100644 --- a/hw/ppc440_bamboo.c +++ b/hw/ppc440_bamboo.c @@ -28,6 +28,11 @@ #define BINARY_DEVICE_TREE_FILE "bamboo.dtb" +/* from u-boot */ +#define KERNEL_ADDR 0x1000000 +#define FDT_ADDR 0x1800000 +#define RAMDISK_ADDR 0x1900000 + static int bamboo_load_device_tree(target_phys_addr_t addr, uint32_t ramsize, target_phys_addr_t initrd_base, @@ -99,10 +104,8 @@ static void bamboo_init(ram_addr_t ram_size, uint64_t elf_lowaddr; target_phys_addr_t entry = 0; target_phys_addr_t loadaddr = 0; - target_long kernel_size = 0; - target_ulong initrd_base = 0; target_long initrd_size = 0; - target_ulong dt_base = 0; + int success; int i; /* Setup CPU. */ @@ -119,15 +122,15 @@ static void bamboo_init(ram_addr_t ram_size, /* Load kernel. */ if (kernel_filename) { - kernel_size = load_uimage(kernel_filename, &entry, &loadaddr, NULL); - if (kernel_size < 0) { - kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry, - &elf_lowaddr, NULL, 1, ELF_MACHINE, 0); + success = load_uimage(kernel_filename, &entry, &loadaddr, NULL); + if (success < 0) { + success = load_elf(kernel_filename, NULL, NULL, &elf_entry, + &elf_lowaddr, NULL, 1, ELF_MACHINE, 0); entry = elf_entry; loadaddr = elf_lowaddr; } /* XXX try again as binary */ - if (kernel_size < 0) { + if (success < 0) { fprintf(stderr, "qemu: could not load kernel '%s'\n", kernel_filename); exit(1); @@ -136,26 +139,20 @@ static void bamboo_init(ram_addr_t ram_size, /* Load initrd. */ if (initrd_filename) { - initrd_base = kernel_size + loadaddr; - initrd_size = load_image_targphys(initrd_filename, initrd_base, - ram_size - initrd_base); + initrd_size = load_image_targphys(initrd_filename, RAMDISK_ADDR, + ram_size - RAMDISK_ADDR); if (initrd_size < 0) { - fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", - initrd_filename); + fprintf(stderr, "qemu: could not load ram disk '%s' at %x\n", + initrd_filename, RAMDISK_ADDR); exit(1); } } /* If we're loading a kernel directly, we must load the device tree too. */ if (kernel_filename) { - if (initrd_base) - dt_base = initrd_base + initrd_size; - else - dt_base = kernel_size + loadaddr; - - if (bamboo_load_device_tree(dt_base, ram_size, - initrd_base, initrd_size, kernel_cmdline) < 0) { + if (bamboo_load_device_tree(FDT_ADDR, ram_size, RAMDISK_ADDR, + initrd_size, kernel_cmdline) < 0) { fprintf(stderr, "couldn't load device tree\n"); exit(1); } @@ -164,7 +161,7 @@ static void bamboo_init(ram_addr_t ram_size, /* Set initial guest state. */ env->gpr[1] = (16<<20) - 8; - env->gpr[3] = dt_base; + env->gpr[3] = FDT_ADDR; env->nip = entry; /* XXX we currently depend on KVM to create some initial TLB entries. */ } diff --git a/hw/ppc4xx_devs.c b/hw/ppc4xx_devs.c index b15db81b6..7f698b826 100644 --- a/hw/ppc4xx_devs.c +++ b/hw/ppc4xx_devs.c @@ -619,7 +619,6 @@ static void sdram_reset (void *opaque) /* We pre-initialize RAM banks */ sdram->status = 0x00000000; sdram->cfg = 0x00800000; - sdram_unmap_bcr(sdram); } void ppc4xx_sdram_init (CPUState *env, qemu_irq irq, int nbanks, @@ -684,7 +683,7 @@ ram_addr_t ppc4xx_sdram_adjust(ram_addr_t ram_size, int nr_banks, } ram_size -= size_left; - if (ram_size) + if (size_left) printf("Truncating memory to %d MiB to fit SDRAM controller limits.\n", (int)(ram_size >> 20)); diff --git a/hw/ppc_newworld.c b/hw/ppc_newworld.c index 639dcde00..809a1cfcb 100644 --- a/hw/ppc_newworld.c +++ b/hw/ppc_newworld.c @@ -427,9 +427,16 @@ static void ppc_core99_init (ram_addr_t ram_size, fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_HEIGHT, graphic_height); fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_DEPTH, graphic_depth); + fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_IS_KVM, kvm_enabled()); if (kvm_enabled()) { #ifdef CONFIG_KVM + uint8_t *hypercall; + fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_TBFREQ, kvmppc_get_tbfreq()); + hypercall = qemu_malloc(16); + kvmppc_get_hypercall(env, hypercall, 16); + fw_cfg_add_bytes(fw_cfg, FW_CFG_PPC_KVM_HC, hypercall, 16); + fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_KVM_PID, getpid()); #endif } else { fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_TBFREQ, get_ticks_per_sec()); diff --git a/hw/ppc_oldworld.c b/hw/ppc_oldworld.c index de6005e35..a12a81297 100644 --- a/hw/ppc_oldworld.c +++ b/hw/ppc_oldworld.c @@ -399,9 +399,16 @@ static void ppc_heathrow_init (ram_addr_t ram_size, fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_HEIGHT, graphic_height); fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_DEPTH, graphic_depth); + fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_IS_KVM, kvm_enabled()); if (kvm_enabled()) { #ifdef CONFIG_KVM + uint8_t *hypercall; + fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_TBFREQ, kvmppc_get_tbfreq()); + hypercall = qemu_malloc(16); + kvmppc_get_hypercall(env, hypercall, 16); + fw_cfg_add_bytes(fw_cfg, FW_CFG_PPC_KVM_HC, hypercall, 16); + fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_KVM_PID, getpid()); #endif } else { fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_TBFREQ, get_ticks_per_sec()); diff --git a/pc-bios/README b/pc-bios/README index 7c872bcb4..ec5e2e1c8 100644 --- a/pc-bios/README +++ b/pc-bios/README @@ -15,7 +15,7 @@ firmware implementation. The goal is to implement a 100% IEEE 1275-1994 (referred to as Open Firmware) compliant firmware. The included image for PowerPC (for 32 and 64 bit PPC CPUs), Sparc32 - and Sparc64 are built from OpenBIOS SVN revision 821. + and Sparc64 are built from OpenBIOS SVN revision 859. - The PXE roms come from Rom-o-Matic gPXE 0.9.9 with BANNER_TIMEOUT=0 diff --git a/pc-bios/openbios-ppc b/pc-bios/openbios-ppc Binary files differindex 9a749c8ff..cb0af0557 100644 --- a/pc-bios/openbios-ppc +++ b/pc-bios/openbios-ppc diff --git a/pc-bios/openbios-sparc32 b/pc-bios/openbios-sparc32 Binary files differindex 2eee1a660..aaff1f00c 100644 --- a/pc-bios/openbios-sparc32 +++ b/pc-bios/openbios-sparc32 diff --git a/pc-bios/openbios-sparc64 b/pc-bios/openbios-sparc64 Binary files differindex 1270ef614..a1b692e7e 100644 --- a/pc-bios/openbios-sparc64 +++ b/pc-bios/openbios-sparc64 diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index 1079ce1e6..14d6365ee 100644 --- a/target-ppc/kvm.c +++ b/target-ppc/kvm.c @@ -327,6 +327,38 @@ uint32_t kvmppc_get_tbfreq(void) return retval; } +int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len) +{ + uint32_t *hc = (uint32_t*)buf; + +#ifdef KVM_CAP_PPC_GET_PVINFO + struct kvm_ppc_pvinfo pvinfo; + + if (kvm_check_extension(env->kvm_state, KVM_CAP_PPC_GET_PVINFO) && + !kvm_vm_ioctl(env->kvm_state, KVM_PPC_GET_PVINFO, &pvinfo)) { + memcpy(buf, pvinfo.hcall, buf_len); + + return 0; + } +#endif + + /* + * Fallback to always fail hypercalls: + * + * li r3, -1 + * nop + * nop + * nop + */ + + hc[0] = 0x3860ffff; + hc[1] = 0x60000000; + hc[2] = 0x60000000; + hc[3] = 0x60000000; + + return 0; +} + bool kvm_arch_stop_on_emulation_error(CPUState *env) { return true; diff --git a/target-ppc/kvm_ppc.h b/target-ppc/kvm_ppc.h index e8d66e88e..65e31c9b9 100644 --- a/target-ppc/kvm_ppc.h +++ b/target-ppc/kvm_ppc.h @@ -15,5 +15,6 @@ int kvmppc_read_host_property(const char *node_path, const char *prop, void *val, size_t len); uint32_t kvmppc_get_tbfreq(void); +int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len); #endif /* __KVM_PPC_H__ */ |