kvm-userspace: ppc: userspace fixes for powerpc
PATCH 1/1 kvm-userspace: ppc: userspace fixes for powerpc
From: Christian Ehrhardt <[email protected]>
This is a set of various fixes in kvm-userspace for powerpc. This time without the split between user/* and the rest and without the qemu patch (sent separate to qemu-devel now).
b/kernel/Makefile | 3 + b/qemu/hw/ppc440.c | 12 +++---- b/qemu/hw/ppc440.h | 8 +++-- b/qemu/hw/ppc440_bamboo.c | 7 ++-- b/qemu/qemu-kvm-powerpc.c | 4 +- b/user/config-powerpc-44x.mak | 14 +++++++++ b/user/config-powerpc.mak | 46 ++++++++++++++++++++--------- b/user/main-ppc.c | 32 +++++++------------- b/user/test/lib/powerpc/44x/map.c | 51 +++++++++++++++++++++++++++++++++ b/user/test/lib/powerpc/44x/timebase.S | 28 ++++++++++++++++++ b/user/test/lib/powerpc/44x/timebase.h | 25 ++++++++++++++++ b/user/test/lib/powerpc/44x/tlbwe.S | 29 ++++++++++++++++++ b/user/test/lib/powerpc/io.c | 35 ++++++++++++++++++++++ b/user/test/powerpc/cstart.S | 38 ++++++++++++++++++++++++ b/user/test/powerpc/exit.c | 23 ++++++++++++++ qemu/hw/ppc440_bamboo.c | 36 +++++++++++++++-------- user/config-powerpc-44x.mak | 3 + user/main-ppc.c | 9 +++++ 18 files changed, 339 insertions(+), 64 deletions(-)
PATCH 1/1 kvm-userspace: powerpc: fix env->xer access
From: Christian Ehrhardt <[email protected]>
Since qemu revision 5500 which was merged with the last qemu merge env->xer is accessed directly.
---
[diffstat]
qemu-kvm-powerpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
[diff]
qemu/qemu-kvm-powerpc.c +2 -2
@@ -57,7 +57,7 @@ regs.ctr = env->ctr; regs.lr = env->lr; - regs.xer =ppc_load_xer (env); + regs.xer = env->xer; regs.msr = env->msr; regs.srr0 = env->spr[SPR_SRR0 ];
@@ -93,7 +93,7 @@ env->ctr =regs.ctr; env->lr = regs.lr; -ppc_store_xer (env,regs.xer); + env->xer = regs.xer; env->msr = regs.msr;/* calculate hflags based on the current msr using the ppc qemu helper */ hreg_compute_hflags (env);
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/1 user: ppc: fix threading bugs in main-ppc.c
In reply to Ehrhardt ChristianFrom: Hollis Blanchard <[email protected]>
- call io_table_register() before any vcpus have started
- wait for all vcpus to exit before exiting the parent thread
---
[diffstat]
main-ppc.c | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-)
[diff]
user/main-ppc.c +12 -20
@@ -51,7 +51,7 @@struct io_table mmio_table;static int ncpus =1 ; -static sem_t init_sem; +static sem_t exited_sem;static __threadint vcpu;static sigset_t kernel_sigmask;static sigset_t ipi_sigmask;
@@ -220,16 +220,8 @@ asmvolatile ("sync; isync" ); } -static void init_vcpu (int n,unsigned long entry) +static void init_vcpu (int n) { -/* XXX must set initial TLB state and stack -struct kvm_regs regs = { -.pc = entry, -}; - -kvm_set_regs(kvm, 0, ®s); -*/ -sigemptyset (&ipi_sigmask);sigaddset (&ipi_sigmask,IPI_SIGNAL );sigprocmask (SIG_UNBLOCK , &ipi_sigmask,NULL );
@@ -237,7 +229,6 @@ vcpus[n].tid =gettid (); vcpu = n;kvm_set_signal_mask (kvm, n, &kernel_sigmask); -sem_post (&init_sem); }static void *do_create_vcpu (void *_n)
@@ -245,8 +236,9 @@int n = (long )_n;kvm_create_vcpu (kvm, n); -init_vcpu (n,0x0 ); +init_vcpu (n);kvm_run (kvm, n); +sem_post (&exited_sem);return NULL ; }
@@ -368,14 +360,14 @@ len =load_file (vm_mem, argv[optind],1 );sync_caches (vm_mem, len); -sem_init (&init_sem,0 ,0 ); -init_vcpu (0 ,0x0 ); -for (i =1 ; i < ncpus; ++i) -start_vcpu (i); -for (i =0 ; i < ncpus; ++i) -sem_wait (&init_sem); -io_table_register (&mmio_table,0xf0000000 ,64 , mmio_handler,NULL ); -return kvm_run (kvm,0 ); +sem_init (&exited_sem,0 ,0 ); +for (i =0 ; i < ncpus; ++i) +start_vcpu (i); +/* Wait for all vcpus to exit. */ +for (i =0 ; i < ncpus; ++i) +sem_wait (&exited_sem); + +return 0 ; }
PATCH 1/1 user: ppc: better error reporting in load_file
In reply to Ehrhardt ChristianFrom: Hollis Blanchard <hollisb-r/[email protected]>
Fancy description.
---
[diffstat]
main-ppc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
[diff]
user/main-ppc.c +2 -1
@@ -183,7 +183,7 @@static unsigned long load_file (void *mem,const char *fname,int inval_icache) { -int r; +ssize_t r;int fd;unsigned long bytes =0 ;
@@ -200,6 +200,7 @@if (r ==-1 ) {perror ("read" ); +printf ("read %d bytes\n" , bytes);exit (1 ); }
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 03 of 10] [PATCH] user: ppc: better error reporting in load_file
Quoted 4 lines · Ehrhardt Christian
From: Hollis Blanchard <hollisb-r/[email protected]>
Fancy description.
Ahem.
Signature · 6 lines
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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 03 of 10] [PATCH] user: ppc: better error reporting in load_file
Quoted 8 lines · Avi Kivity
Quoted 4 lines · Ehrhardt Christian
From: Hollis Blanchard <[email protected]>
Fancy description.
Ahem.
Sorry that is my patch template description :-/
A proper description header should be:
Subject: [PATCH] user: ppc: better error reporting in load_file
From: Hollis Blanchard <[email protected]>
This patch adds a better error reporting for powerpc testcases. It prints the bytes read in load_file so far until an error occured.
---
[diffstat]
main-ppc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
[diff]
Signature · 3 lines
Grüsse / regards, Christian Ehrhardt IBM Linux Technology Center, Open Virtualization
PATCH 1/1 user: ppc: implement PowerPC 44x libcflat
In reply to Ehrhardt ChristianFrom: Hollis Blanchard <hollisb-r/[email protected]>
- Create a 44x-specific makefile.
- Reorganize PowerPC makefiles to separate "simple" tests from those which link with libcflat.
- Create a minimal libcflat testcase (which just exits).
---
[diffstat]
config-powerpc-44x.mak | 14 +++++++++++ config-powerpc.mak | 46 ++++++++++++++++++++++++++------------ test/lib/powerpc/44x/map.c | 51 +++++++++++++++++++++++++++++++++++++++++++ test/lib/powerpc/44x/tlbwe.S | 29 ++++++++++++++++++++++++ test/lib/powerpc/io.c | 35 +++++++++++++++++++++++++++++ test/powerpc/cstart.S | 38 ++++++++++++++++++++++++++++++++ test/powerpc/exit.c | 23 +++++++++++++++++++ 7 files changed, 221 insertions(+), 15 deletions(-)
[diff]
user/config-powerpc-44x.mak new file +14 -0
@@ -0,0 +1,14 @@ + + +# for some reason binutils hates tlbsx unless we say we're 405 :( +CFLAGS += -Wa,-m405 -I test/lib/powerpc/44x + +cflatobjs += \ + test/lib/powerpc/44x/map.o \ + test/lib/powerpc/44x/tlbwe.o + +simpletests += \ + test/powerpc/44x/tlbsx.bin \ + test/powerpc/44x/tlbwe_16KB.bin \ + test/powerpc/44x/tlbwe_hole.bin \ + test/powerpc/44x/tlbwe.bin
user/config-powerpc.mak +31 -15
57 lines not on this page · raw message
user/test/lib/powerpc/44x/map.c new file +51 -0
51 lines not on this page · raw message
user/test/lib/powerpc/44x/tlbwe.S new file +29 -0
@@ -0,0 +1,29 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Copyright IBM Corp. 2008 + * + * Authors: Hollis Blanchard <hollisb-r/[email protected]> + */ + +#define SPRN_MMUCR 0x3b2 + +/* tlbwe(uint index, uint8_t tid, uint word0, uint word1, uint word2) */ +.global tlbwe +tlbwe: + mtspr SPRN_MMUCR, r4 + tlbwe r5, r3, 0 + tlbwe r6, r3, 1 + tlbwe r7, r3, 2 + blr
user/test/lib/powerpc/io.c new file +35 -0
@@ -0,0 +1,35 @@ +/* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License, version 2, as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +* Copyright IBM Corp. 2008 +* +* Authors: Hollis Blanchard <hollisb-r/[email protected]> +*/ + +#include "libcflat.h" + +#define BASE 0xf0000000 +#define _putc ((volatile char *)(BASE)) +#define _exit ((volatile char *)(BASE+1)) + +void puts (const char *s) +{ +while (*s !='\0' ) + *_putc = *s++; +} + +void exit (int code) +{ + *_exit = code; +}
user/test/powerpc/cstart.S new file +38 -0
@@ -0,0 +1,38 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Copyright IBM Corp. 2008 + * + * Authors: Hollis Blanchard <hollisb-r/[email protected]> + */ + +#define OUTPUT_VADDR 0xf0000000 +#define OUTPUT_PADDR 0xf0000000 + +.globl _start +_start: + /* In the future we might need to assign a stack and zero BSS here. */ + + /* Map the debug page 1:1. */ + lis r3, OUTPUT_VADDR@h + ori r3, r3, OUTPUT_VADDR@l + lis r4, OUTPUT_PADDR@h + ori r4, r4, OUTPUT_PADDR@l + bl map + + /* Call main() and pass return code to exit(). */ + bl main + bl exit + + b .
user/test/powerpc/exit.c new file +23 -0
@@ -0,0 +1,23 @@ +/* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License, version 2, as +* published by the Free Software Foundation; +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +* Copyright IBM Corp. 2008 +* +* Authors: Hollis Blanchard <hollisb-r/[email protected]> +*/ + +int main (void ) +{ +return 1 ; +}
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/1 libcflat: ppc: add timebase accessor
In reply to Ehrhardt ChristianProvide a timebase accessor for ppc testcases.
[diffstat]
config-powerpc-44x.mak | 3 ++- test/lib/powerpc/44x/timebase.S | 28 ++++++++++++++++++++++++++++ test/lib/powerpc/44x/timebase.h | 25 +++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-)
[diff]
user/config-powerpc-44x.mak +2 -1
@@ -5,7 +5,8 @@ cflatobjs += \ test/lib/powerpc/44x/map.o \ - test/lib/powerpc/44x/tlbwe.o + test/lib/powerpc/44x/tlbwe.o \ + test/lib/powerpc/44x/timebase.o simpletests += \ test/powerpc/44x/tlbsx.bin \
user/test/lib/powerpc/44x/timebase.S new file +28 -0
@@ -0,0 +1,28 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Copyright IBM Corp. 2008 + * + * Authors: Hollis Blanchard <hollisb-r/[email protected]> + */ + +/* unsigned long long mftb(void); */ +.global mftb +mftb: + mftbu r5 + mftbl r4 + mftbu r3 + cmpw r3, r5 + bne mftb + blr
user/test/lib/powerpc/44x/timebase.h new file +25 -0
@@ -0,0 +1,25 @@ +/* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License, version 2, as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +* +* Copyright IBM Corp. 2008 +* +* Authors: Hollis Blanchard <hollisb-r/[email protected]> +*/ + +#ifndef __TIMEBASE_H__ +#define __TIMEBASE_H__ + +unsigned long long mftb (void ); + +#endif /* __TIMEBASE_H__ */
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/1 user: ppc: add stub nmi handler
In reply to Ehrhardt ChristianFrom: Hollis Blanchard <[email protected]>
Adding a nmi stub handler for user/main-ppc.c
---
[diffstat]
main-ppc.c | 6 ++++++ 1 file changed, 6 insertions(+)
[diff]
user/main-ppc.c +6 -0
@@ -83,6 +83,11 @@ }static int test_try_push_interrupts (void *opaque) +{ +return 0 ; +} + +static int test_try_push_nmi (void *opaque) {return 0 ; }
@@ -175,6 +180,7 @@ .halt = test_halt, .io_window = test_io_window, .try_push_interrupts = test_try_push_interrupts, + .try_push_nmi = test_try_push_nmi, .post_kvm_run = test_post_kvm_run, .pre_kvm_run = test_pre_kvm_run, .powerpc_dcr_read = test_dcr_read,
PATCH 1/1 qemu: ppc: define maximum SMP limit as 1 for Bamboo
In reply to Ehrhardt ChristianFrom: Christian Ehrhardt <[email protected]>
Fix for qemu runtime error. Full error message:
Number of SMP cpus requested (1), exceeds max cpus supported by machine `bamboo' (0)
---
[diffstat]
ppc440_bamboo.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
[diff]
qemu/hw/ppc440_bamboo.c +4 -3
@@ -202,7 +202,8 @@ }QEMUMachine bamboo_machine = { -"bamboo" , -"bamboo" , - bamboo_init, + .name ="bamboo" , + .desc ="bamboo" , + .init = bamboo_init, + .max_cpus =1 , };
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/1 qemu: ppc: if not a uImage, try to load kernel as ELF
In reply to Ehrhardt ChristianFrom: Hollis Blanchard <hollisb-r/[email protected]>
This allows qemu to load "bare metal" ELF kernels, useful for standalone benchmarks and testcases.
We could/should also load the specified file as a flat binary, if both uImage and ELF loaders fail. (See hw/arm_boot.c.)
---
[diffstat]
ppc440_bamboo.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
[diff]
qemu/hw/ppc440_bamboo.c +5 -2
@@ -35,8 +35,8 @@qemu_irq *pic;ppc4xx_pci_t *pci;CPUState *env; -target_ulong ep=0 ; -target_ulong la=0 ; +uint64_t ep=0 ; +uint64_t la=0 ;int is_linux=1 ;/* Will assume allways is Linux for now */ target_long kernel_size=0 ;target_ulong initrd_base=0 ;
@@ -97,6 +97,9 @@/* load kernel with uboot loader */ printf ("%s: load kernel\n" , __func__); ret =load_uimage (kernel_filename, &ep, &la, &kernel_size, &is_linux); +if (ret <0 ) + ret =load_elf (kernel_filename,0 , &ep, &la,NULL ); +if (ret <0 ) {fprintf (stderr,"qemu: could not load kernel '%s'\n" , kernel_filename);
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/1 kvm: external module: Treat NONARCH_CONFIG as a list
In reply to Ehrhardt ChristianFrom: Hollis Blanchard <[email protected]
As discussed on the list the unifdef changes break powerpc (and more ?). A fix is to treat NONARCH_CONFIG as a list instead of a single item.
---
[diffstat]
Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
[diff]
kernel/Makefile +2 -1
@@ -25,8 +25,9 @@ gawk -v version=$(version) -f $(ARCH_DIR)/hack-module.awk $1.orig \ | sed '/\#include/! s/\blapic\b/l_apic/g' > $1 && rm $1.orig +unifdef_uflags = $(foreach arch, $(NONARCH_CONFIG), -UCONFIG_$(arch)) unifdef = mv $1 $1.orig && \ - unifdef -DCONFIG_$(ARCH_CONFIG) -UCONFIG_$(NONARCH_CONFIG) $1.orig > $1; \ + unifdef -DCONFIG_$(ARCH_CONFIG) $(unifdef_uflags) $1.orig > $1; \ [ $$? -le 2 ] && rm $1.orig hack = $(call _hack,$T/$(strip $1))
PATCH 1/1 kvm-userspace: ppc: fix initial ppc memory setup
In reply to Ehrhardt ChristianFrom: Christian Ehrhardt <[email protected]>
The old memory initialization code was broken for all cases not fitting in one ram stick. This patch fixes the ram_stick calculation, now sets the proper base adresses per stick and removes the old workaround.
---
[diffstat]
ppc440.c | 12 +++++------- ppc440.h | 8 ++++++-- ppc440_bamboo.c | 30 ++++++++++++++++++++---------- 3 files changed, 31 insertions(+), 19 deletions(-)
[diff]
qemu/hw/ppc440.c +5 -7
@@ -3,6 +3,7 @@* * Copyright 2007 IBM Corporation. * Authors: Jerone Young <jyoung5-r/[email protected]> +* Christian Ehrhardt <[email protected]> * * This work is licensed under the GNU GPL license version 2 or later. *
@@ -24,15 +25,15 @@void ppc440ep_init (CPUState *env, -target_phys_addr_t ram_bases[2 ], -target_phys_addr_t ram_sizes[2 ], +target_phys_addr_t ram_bases[PPC440_MAX_RAM_SLOTS ], +target_phys_addr_t ram_sizes[PPC440_MAX_RAM_SLOTS ], +int nbanks,qemu_irq **picp,ppc4xx_pci_t **pcip,int do_init) {ppc4xx_mmio_t *mmio;qemu_irq *pic, *irqs; -ram_addr_t offset;ppc4xx_pci_t *pci;int i;
@@ -55,10 +56,7 @@/* SDRAM controller */ printf ("trying to setup sdram controller\n" );/* XXX 440EP's ECC interrupts are on UIC1 */ -ppc405_sdram_init (env, pic[14 ],2 , ram_bases, ram_sizes, do_init); - offset =0 ; -for (i =0 ; i <2 ; i++) - offset += ram_sizes[i]; +ppc405_sdram_init (env, pic[14 ], nbanks, ram_bases, ram_sizes, do_init);/* PCI */ pci = ppc4xx_pci_init(env, pic,
qemu/hw/ppc440.h +6 -2
@@ -3,6 +3,7 @@* * Copyright 2007 IBM Corporation. * Authors: Jerone Young <jyoung5-r/[email protected]> +* Christian Ehrhardt <[email protected]> * * This work is licensed under the GNU GPL licence version 2 or later *
@@ -20,9 +21,12 @@#include "exec-all.h" #include "boards.h" +#define PPC440_MAX_RAM_SLOTS 4 +void ppc440ep_init (CPUState *env, -target_phys_addr_t ram_bases[2 ], -target_phys_addr_t ram_sizes[2 ], +target_phys_addr_t ram_bases[PPC440_MAX_RAM_SLOTS ], +target_phys_addr_t ram_sizes[PPC440_MAX_RAM_SLOTS ], +int nbanks,qemu_irq **picp,ppc4xx_pci_t **pcip,int do_init);
qemu/hw/ppc440_bamboo.c +19 -10
@@ -2,7 +2,9 @@* Qemu PowerPC 440 board emualtion * * Copyright 2007 IBM Corporation. -* Authors: Jerone Young <jyoung5-r/[email protected]> +* Authors: +* Jerone Young <jyoung5-r/[email protected]> +* Christian Ehrhardt <[email protected]> * * This work is licensed under the GNU GPL license version 2 or later. *
@@ -30,7 +32,8 @@ const char *cpu_model) {char *buf=NULL ; -target_phys_addr_t ram_bases[4 ], ram_sizes[4 ]; +target_phys_addr_t ram_bases[PPC440_MAX_RAM_SLOTS ]; +target_phys_addr_t ram_sizes[PPC440_MAX_RAM_SLOTS ];NICInfo *nd;qemu_irq *pic;ppc4xx_pci_t *pci;
@@ -46,6 +49,8 @@int ret;int ram_stick_sizes[] = {256 <<20 ,128 <<20 ,64 <<20 ,32 <<20 ,16 <<20 ,8 <<20 };/* in bytes */ +int nbanks =0 ;/* number of used memory banks */ +int next_bank_offset =0 ;ram_addr_t tmp_ram_size;int i=0 , k=0 ;uint32_t cpu_freq;
@@ -55,15 +60,22 @@printf ("%s: START\n" , __func__);/* Setup Memory */ -printf ("Ram size passed is: %i MB\n" , -bytes_to_mb ((int )ram_size)); +if (ram_size <8 <<20 ) { +printf ("ERROR: ram size too small (min 8mb)\n" ); +exit (1 ); + }else +printf ("Ram size passed is: %i MB\n" , +bytes_to_mb ((int )ram_size)); tmp_ram_size = ram_size; -for (i=0 ; i < (sizeof (ram_sizes)/sizeof (ram_sizes[0 ])); i++) { -for (k=0 ; k < (sizeof (ram_stick_sizes)/sizeof (ram_stick_sizes[0 ])); k++) { +for (i =0 ; i <PPC440_MAX_RAM_SLOTS ; i++) { +for (k =0 ; k < (sizeof (ram_stick_sizes)/sizeof (int )); k++) {if ((tmp_ram_size/ram_stick_sizes[k]) >0 ) { ram_sizes[i] = ram_stick_sizes[k]; + ram_bases[i] = next_bank_offset; + next_bank_offset += ram_stick_sizes[k]; + nbanks++; tmp_ram_size -= ram_stick_sizes[k];break ; }
@@ -88,11 +100,8 @@/* call init */ printf ("Calling function ppc440_init\n" ); -ppc440ep_init (env, ram_bases, ram_sizes, &pic, &pci,1 ); +ppc440ep_init (env, ram_bases, ram_sizes, nbanks, &pic, &pci,1 );printf ("Done calling ppc440_init\n" ); - -/* Register mem */ -cpu_register_physical_memory (0 , ram_size,0 );/* load kernel with uboot loader */ printf ("%s: load kernel\n" , __func__);
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines · Ehrhardt Christian
From: Christian Ehrhardt <[email protected]>
This is a set of various fixes in kvm-userspace for powerpc. This time without the split between user/* and the rest and without the qemu patch (sent separate to qemu-devel now).
Please send me the changelog entry missing from patch 3. No need to resend the patchset, just send me the output of the fancy description generator and I'll splice it in.
Signature · 6 lines
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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 6 lines · Ehrhardt Christian
From: Christian Ehrhardt <[email protected]>
This is a set of various fixes in kvm-userspace for powerpc. This time without the split between user/* and the rest and without the qemu patch (sent separate to qemu-devel now).
All applied, thanks.
Signature · 6 lines
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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html