[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 04/10] kvm: allow qemu to set EPT identity mapping a
From: |
Marcelo Tosatti |
Subject: |
[Qemu-devel] [PATCH 04/10] kvm: allow qemu to set EPT identity mapping address |
Date: |
Mon, 26 Apr 2010 14:59:00 -0300 |
From: Sheng Yang <address@hidden>
If we use larger BIOS image than current 256KB, we would need move reserved
TSS and EPT identity mapping pages. Currently TSS support this, but not
EPT.
Signed-off-by: Marcelo Tosatti <address@hidden>
Signed-off-by: Avi Kivity <address@hidden>
---
target-i386/kvm.c | 26 +++++++++++++++++++++++++-
1 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index bb6dafa..f73b47b 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -326,6 +326,25 @@ static int kvm_has_msr_star(CPUState *env)
return 0;
}
+static int kvm_init_identity_map_page(KVMState *s)
+{
+#ifdef KVM_CAP_SET_IDENTITY_MAP_ADDR
+ int ret;
+ uint64_t addr = 0xfffbc000;
+
+ if (!kvm_check_extension(s, KVM_CAP_SET_IDENTITY_MAP_ADDR)) {
+ return 0;
+ }
+
+ ret = kvm_vm_ioctl(s, KVM_SET_IDENTITY_MAP_ADDR, &addr);
+ if (ret < 0) {
+ fprintf(stderr, "kvm_set_identity_map_addr: %s\n", strerror(ret));
+ return ret;
+ }
+#endif
+ return 0;
+}
+
int kvm_arch_init(KVMState *s, int smp_cpus)
{
int ret;
@@ -353,7 +372,12 @@ int kvm_arch_init(KVMState *s, int smp_cpus)
perror("e820_add_entry() table is full");
exit(1);
}
- return kvm_vm_ioctl(s, KVM_SET_TSS_ADDR, 0xfffbd000);
+ ret = kvm_vm_ioctl(s, KVM_SET_TSS_ADDR, 0xfffbd000);
+ if (ret < 0) {
+ return ret;
+ }
+
+ return kvm_init_identity_map_page(s);
}
static void set_v8086_seg(struct kvm_segment *lhs, const SegmentCache *rhs)
--
1.6.6.1
- [Qemu-devel] Re: [PATCH 09/10] kvm: port qemu-kvm's bitmap scanning, (continued)
[Qemu-devel] [PATCH 02/10] target-i386: print EFER in cpu_dump_state, Marcelo Tosatti, 2010/04/26
[Qemu-devel] [PATCH 06/10] kvm: remove explicit kvm_arch_reset_vcpu from kvm_init_vcpu, Marcelo Tosatti, 2010/04/26
[Qemu-devel] [PATCH 03/10] kvm: handle internal error, Marcelo Tosatti, 2010/04/26
[Qemu-devel] [PATCH 05/10] kvm_init_vcpu requires global lock held, Marcelo Tosatti, 2010/04/26
[Qemu-devel] [PATCH 04/10] kvm: allow qemu to set EPT identity mapping address,
Marcelo Tosatti <=
[Qemu-devel] [PATCH 08/10] introduce leul_to_cpu, Marcelo Tosatti, 2010/04/26
[Qemu-devel] [PATCH 10/10] introduce qemu_ram_map, Marcelo Tosatti, 2010/04/26
[Qemu-devel] Re: [PATCH 10/10] introduce qemu_ram_map, Anthony Liguori, 2010/04/26