kvm-userspace: ppc: Fix for guest load address
PATCH 1/1 kvm-userspace: ppc: Fix for guest load address
# HG changeset patch
# User Deepa Srinivasan <[email protected]>
# Date 1226682073 21600
# Node ID c7f077a848cb4e80704450397f2f9bb300b9ee20 # Parent d175d293f2bff5bf882ef45286c973c094cfed1e [PATCH] kvm-userspace: ppc: Fix for guest load address
From: Deepa Srinivasan <[email protected]>
Fix to ensure that guest test code is loaded at 1 MB.
---
[diffstat]
main-ppc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
[diff]
user/main-ppc.c +9 -2
@@ -62,6 +62,9 @@ struct vcpu_info { };struct vcpu_info *vcpus; + +/* Load the guest binary at 1 MB since the flat.lds linker script sets the base address to this value. */ +#define VM_TEST_LOAD_ADDRESS 0x100000static int test_debug (void *opaque,int vcpu) {
@@ -241,9 +244,13 @@ static void *do_create_vcpu(void *_n)static void *do_create_vcpu (void *_n) {int n = (long )_n; +struct kvm_regs regs;kvm_create_vcpu (kvm, n);init_vcpu (n); +kvm_get_regs (kvm, n, ®s); + regs.pc =VM_TEST_LOAD_ADDRESS ; +kvm_set_regs (kvm, n, ®s);kvm_run (kvm, n);sem_post (&exited_sem);return NULL ;
@@ -364,8 +371,8 @@ int main(int argc, char **argv) vm_mem =kvm_create_phys_mem (kvm,0 , memory_size,0 ,1 ); - len =load_file (vm_mem, argv[optind],1 ); -sync_caches (vm_mem, len); + len =load_file (vm_mem +VM_TEST_LOAD_ADDRESS , argv[optind],1 ); +sync_caches (vm_mem +VM_TEST_LOAD_ADDRESS , len);io_table_register (&mmio_table,0xf0000000 ,64 , mmio_handler,NULL );
Re: [PATCH 2 of 2] [PATCH] kvm-userspace: ppc: Fix for guest load
Quoted 10 lines · Deepa Srinivasan
# HG changeset patch
# User Deepa Srinivasan <[email protected]>
# Date 1226682073 21600
# Node IDc7f077a848cb4e80704450397f2f9bb300b9ee20# Parentd175d293f2bff5bf882ef45286c973c094cfed1e[PATCH] kvm-userspace: ppc: Fix for guest load addressFrom: Deepa Srinivasan <[email protected]>
Fix to ensure that guest test code is loaded at 1 MB.
Looks good; thanks.
Signature · 2 lines
Hollis Blanchard IBM Linux Technology Center