From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M2IXp-0002e6-0G for qemu-devel@nongnu.org; Fri, 08 May 2009 01:22:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M2IXj-0002an-MF for qemu-devel@nongnu.org; Fri, 08 May 2009 01:22:48 -0400 Received: from [199.232.76.173] (port=33192 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M2IXj-0002aZ-BQ for qemu-devel@nongnu.org; Fri, 08 May 2009 01:22:43 -0400 Received: from mx2.redhat.com ([66.187.237.31]:60143) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M2IXi-0002Wq-Su for qemu-devel@nongnu.org; Fri, 08 May 2009 01:22:43 -0400 From: Glauber Costa Date: Fri, 8 May 2009 02:22:13 -0300 Message-Id: <1241760133-4207-3-git-send-email-glommer@redhat.com> In-Reply-To: <1241760133-4207-2-git-send-email-glommer@redhat.com> References: <1241760133-4207-1-git-send-email-glommer@redhat.com> <1241760133-4207-2-git-send-email-glommer@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] reset state for load_linux List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com The linux loader is just an option rom like any other, just with some special requirements. Right now, our option rom resetting mechanism is not being applied to it. As a result, users using -kernel will not be able to successfully reboot their machines This patch fixes it by saving all the data we generated in the load_linux() function, to be used later by the option rom resetting mechanism. Signed-off-by: Glauber Costa --- hw/pc.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index 0025474..6b46427 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -579,6 +579,7 @@ static void generate_bootsect(target_phys_addr_t option_rom, rom[sizeof(rom) - 1] = -sum; cpu_physical_memory_write_rom(option_rom, rom, sizeof(rom)); + option_rom_setup_reset(option_rom, sizeof (rom)); } static long get_file_size(FILE *f) @@ -746,6 +747,12 @@ static void load_linux(target_phys_addr_t option_rom, memset(gpr, 0, sizeof gpr); gpr[4] = cmdline_addr-real_addr-16; /* SP (-16 is paranoia) */ + option_rom_setup_reset(real_addr, setup_size); + option_rom_setup_reset(prot_addr, kernel_size); + option_rom_setup_reset(cmdline_addr, cmdline_size); + if (initrd_filename) + option_rom_setup_reset(initrd_addr, initrd_size); + generate_bootsect(option_rom, gpr, seg, 0); } -- 1.6.2.2