kvm, bios: Get rid of buggy int10 handler

At moment any BIOS code using which needs own stack
have to be remade. It's a bit not that easy task.

We're happily may live without int10 handler since we
switch to early_printk interface really early. And
actually we don't scan VGA memory anyway so that even
if there is something written we ignore the result.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
Cyrill Gorcunov
2010-07-07 23:19:34 +04:00
committed by Will Deacon
parent b927116056
commit b2978d44b8
4 changed files with 4 additions and 39 deletions
-8
View File
@@ -18,7 +18,6 @@ OBJS += main.o
OBJS += mmio.o
OBJS += util.o
OBJS += bios/intfake.o
OBJS += bios/int10.o
uname_M := $(shell uname -m | sed -e s/i.86/i386/)
ifeq ($(uname_M),i386)
@@ -70,13 +69,6 @@ bios/intfake.o: bios/intfake.S bios/intfake-real.S
$(Q) objcopy -O binary -j .text bios/intfake-real.o bios/intfake-real.bin
$(Q) $(CC) $(CFLAGS) -c bios/intfake.S -o bios/intfake.o
bios/int10.o: bios/int10.S bios/int10-real.S
$(E) " CC " $@
$(Q) $(CC) $(CFLAGS) -c bios/int10-real.S -o bios/int10-real.o
$(E) " OBJCOPY " $@
$(Q) objcopy -O binary -j .text bios/int10-real.o bios/int10-real.bin
$(Q) $(CC) $(CFLAGS) -c bios/int10.S -o bios/int10.o
check: $(PROGRAM)
$(MAKE) -C tests
./$(PROGRAM) tests/pit/tick.bin
-3
View File
@@ -4,7 +4,4 @@
extern char intfake[0];
extern char intfake_end[0];
extern char int10[0];
extern char int10_end[0];
#endif /* BIOS_EXPORT_H_ */
+3 -16
View File
@@ -2,27 +2,14 @@
#define BIOS_H_
/*
* BIOS data area
* Motherboard BIOS
*/
#define BDA_START 0xf0000
#define BDA_END 0xfffff
#define BDA_SIZE (BDA_END - BDA_START)
#define VIDEO_BASE 0xa0000
#define VIDEO_BASE_SEG 0xa000
#define VIDEO_LIMIT 0xbffff
#define VIDEO_SIZE 0x007d0 /* 80x25 */
#define KVM_BIOS_START 0xf0000
#define KVM_BIOS_END 0xfffff
#define REAL_INTR_BASE 0x0000
#define REAL_INTR_VECTORS 256
#define BIOS_STACK 0xFFF70
#define BIOS_STACK_SEG 0xFFF7
#define BIOS_STACK_SIZE 128
#define ALIGN(x, a) (((x)+((a)-1))&~((a)-1))
#define BIOS_INTR_NEXT(prev, size) \
((prev) + ALIGN(size, 16))
#endif /* BIOS_H_ */
+1 -12
View File
@@ -373,10 +373,8 @@ static bool load_bzimage(struct kvm *self, int fd, const char *kernel_cmdline)
/*
* Setup a *fake* real mode vector table, it has only
* one real hadler which does just iret
*
* This is where the BIOS lives -- BDA area
*/
intr_addr = BIOS_INTR_NEXT(BDA_START + 0, 16);
intr_addr = KVM_BIOS_START;
p = guest_flat_to_host(self, intr_addr);
memcpy(p, intfake, intfake_end - intfake);
intr = (struct real_intr_desc) {
@@ -385,15 +383,6 @@ static bool load_bzimage(struct kvm *self, int fd, const char *kernel_cmdline)
};
interrupt_table__setup(&self->interrupt_table, &intr);
intr_addr = BIOS_INTR_NEXT(BDA_START + (intfake_end - intfake), 16);
p = guest_flat_to_host(self, intr_addr);
memcpy(p, int10, int10_end - int10);
intr = (struct real_intr_desc) {
.segment = REAL_SEGMENT(intr_addr),
.offset = 0,
};
interrupt_table__set(&self->interrupt_table, &intr, 0x10);
p = guest_flat_to_host(self, 0);
interrupt_table__copy(&self->interrupt_table, p, REAL_INTR_SIZE);