cleanup PAM check

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
diff --git a/hwsetup.c b/hwsetup.c
index 617af06..9d51daa 100644
--- a/hwsetup.c
+++ b/hwsetup.c
@@ -99,7 +99,7 @@
 	const int bdf = 0;
 	const uint8_t *bios_start = (void *)((uintptr_t)&stext + 0xfff00000);
 	const uint8_t *init_start = (void *)((uintptr_t)&sinit + 0xfff00000);
-	volatile uint8_t *rom_check = &stext;
+	static volatile uint8_t rom_check;
 	int rom_check_value;
 	int pambase;
 
@@ -116,9 +116,9 @@
 		panic();
 
 	// Make ram from 0xc0000-0xf0000 read-write
-	rom_check_value = *rom_check;
-	*rom_check = rom_check_value + 1;
-	if (*rom_check == rom_check_value)
+	rom_check_value = rom_check;
+	rom_check = rom_check_value + 1;
+	if (rom_check == rom_check_value)
 		setup_pam(bdf, pambase);
 
 	// Shadow BIOS; we're still running from 0xffff0000