Commit d6ecb03610dba922cbfde42acb41603e2c658047

Authored by Glauber Costa
Committed by Anthony Liguori
1 parent e28f9884

reset state for load_linux

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 <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Showing 1 changed file with 7 additions and 0 deletions
@@ -579,6 +579,7 @@ static void generate_bootsect(target_phys_addr_t option_rom, @@ -579,6 +579,7 @@ static void generate_bootsect(target_phys_addr_t option_rom,
579 rom[sizeof(rom) - 1] = -sum; 579 rom[sizeof(rom) - 1] = -sum;
580 580
581 cpu_physical_memory_write_rom(option_rom, rom, sizeof(rom)); 581 cpu_physical_memory_write_rom(option_rom, rom, sizeof(rom));
  582 + option_rom_setup_reset(option_rom, sizeof (rom));
582 } 583 }
583 584
584 static long get_file_size(FILE *f) 585 static long get_file_size(FILE *f)
@@ -746,6 +747,12 @@ static void load_linux(target_phys_addr_t option_rom, @@ -746,6 +747,12 @@ static void load_linux(target_phys_addr_t option_rom,
746 memset(gpr, 0, sizeof gpr); 747 memset(gpr, 0, sizeof gpr);
747 gpr[4] = cmdline_addr-real_addr-16; /* SP (-16 is paranoia) */ 748 gpr[4] = cmdline_addr-real_addr-16; /* SP (-16 is paranoia) */
748 749
  750 + option_rom_setup_reset(real_addr, setup_size);
  751 + option_rom_setup_reset(prot_addr, kernel_size);
  752 + option_rom_setup_reset(cmdline_addr, cmdline_size);
  753 + if (initrd_filename)
  754 + option_rom_setup_reset(initrd_addr, initrd_size);
  755 +
749 generate_bootsect(option_rom, gpr, seg, 0); 756 generate_bootsect(option_rom, gpr, seg, 0);
750 } 757 }
751 758