ia64/xen-unstable

changeset 18188:eb10a50752bc

rombios: Narrow window where BIOS area is writable, and ensure it
really *is* writable in that region. This is almost enough to get S3
working again (read-only firmware-waking-vector is still a problem).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jul 29 13:11:29 2008 +0100 (2008-07-29)
parents 9454fae58cb8
children 5fbcbee355e2
files tools/firmware/rombios/rombios.c
line diff
     1.1 --- a/tools/firmware/rombios/rombios.c	Tue Jul 29 10:42:30 2008 +0100
     1.2 +++ b/tools/firmware/rombios/rombios.c	Tue Jul 29 13:11:29 2008 +0100
     1.3 @@ -1467,17 +1467,18 @@ copy_e820_table()
     1.4  }
     1.5  
     1.6  void
     1.7 -disable_rom_write_access()
     1.8 +set_rom_write_access(action)
     1.9 +  Bit16u action;
    1.10  {
    1.11      Bit16u off = (Bit16u)&((struct bios_info *)0)->xen_pfiob;
    1.12  ASM_START
    1.13 -    mov si,.disable_rom_write_access.off[bp]
    1.14 +    mov si,.set_rom_write_access.off[bp]
    1.15      push ds
    1.16      mov ax,#(ACPI_PHYSICAL_ADDRESS >> 4)
    1.17      mov ds,ax
    1.18      mov dx,[si]
    1.19      pop ds
    1.20 -    mov ax,#PFFLAG_ROM_LOCK
    1.21 +    mov ax,.set_rom_write_access.action[bp]
    1.22      out dx,al
    1.23  ASM_END
    1.24  }
    1.25 @@ -9925,6 +9926,12 @@ normal_post:
    1.26  
    1.27    call _log_bios_start
    1.28  
    1.29 +#ifdef HVMASSIST
    1.30 +  push #0
    1.31 +  call _set_rom_write_access
    1.32 +  add sp,#2
    1.33 +#endif
    1.34 +
    1.35    call _clobber_entry_point
    1.36  
    1.37    ;; set all interrupts to default handler
    1.38 @@ -10121,6 +10128,9 @@ post_default_ints:
    1.39  #ifdef HVMASSIST
    1.40    call _copy_e820_table
    1.41    call smbios_init
    1.42 +  push #PFFLAG_ROM_LOCK
    1.43 +  call _set_rom_write_access
    1.44 +  add sp,#2
    1.45  #endif
    1.46  
    1.47    call _init_boot_vectors
    1.48 @@ -10171,10 +10181,6 @@ post_default_ints:
    1.49    call tcpa_post_part2
    1.50  #endif
    1.51  
    1.52 -#ifdef HVMASSIST
    1.53 -  call _disable_rom_write_access
    1.54 -#endif 
    1.55 -
    1.56    ;; Start the boot sequence.   See the comments in int19_relocated 
    1.57    ;; for why we use INT 18h instead of INT 19h here.
    1.58    int  #0x18