diff options
Diffstat (limited to 'drivers/lguest')
-rw-r--r-- | drivers/lguest/core.c | 1 | ||||
-rw-r--r-- | drivers/lguest/lg.h | 1 | ||||
-rw-r--r-- | drivers/lguest/lguest_device.c | 5 | ||||
-rw-r--r-- | drivers/lguest/lguest_user.c | 1 | ||||
-rw-r--r-- | drivers/lguest/page_tables.c | 1 | ||||
-rw-r--r-- | drivers/lguest/segments.c | 4 | ||||
-rw-r--r-- | drivers/lguest/x86/core.c | 18 |
7 files changed, 25 insertions, 6 deletions
diff --git a/drivers/lguest/core.c b/drivers/lguest/core.c index 8744d24ac6e6..efa202499e37 100644 --- a/drivers/lguest/core.c +++ b/drivers/lguest/core.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/cpu.h> | 12 | #include <linux/cpu.h> |
13 | #include <linux/freezer.h> | 13 | #include <linux/freezer.h> |
14 | #include <linux/highmem.h> | 14 | #include <linux/highmem.h> |
15 | #include <linux/slab.h> | ||
15 | #include <asm/paravirt.h> | 16 | #include <asm/paravirt.h> |
16 | #include <asm/pgtable.h> | 17 | #include <asm/pgtable.h> |
17 | #include <asm/uaccess.h> | 18 | #include <asm/uaccess.h> |
diff --git a/drivers/lguest/lg.h b/drivers/lguest/lg.h index bc28745d05af..9136411fadd5 100644 --- a/drivers/lguest/lg.h +++ b/drivers/lguest/lg.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/wait.h> | 10 | #include <linux/wait.h> |
11 | #include <linux/hrtimer.h> | 11 | #include <linux/hrtimer.h> |
12 | #include <linux/err.h> | 12 | #include <linux/err.h> |
13 | #include <linux/slab.h> | ||
13 | 14 | ||
14 | #include <asm/lguest.h> | 15 | #include <asm/lguest.h> |
15 | 16 | ||
diff --git a/drivers/lguest/lguest_device.c b/drivers/lguest/lguest_device.c index b6200bc39b58..69c84a1d88ea 100644 --- a/drivers/lguest/lguest_device.c +++ b/drivers/lguest/lguest_device.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
16 | #include <linux/virtio_ring.h> | 16 | #include <linux/virtio_ring.h> |
17 | #include <linux/err.h> | 17 | #include <linux/err.h> |
18 | #include <linux/slab.h> | ||
18 | #include <asm/io.h> | 19 | #include <asm/io.h> |
19 | #include <asm/paravirt.h> | 20 | #include <asm/paravirt.h> |
20 | #include <asm/lguest_hcall.h> | 21 | #include <asm/lguest_hcall.h> |
@@ -177,7 +178,7 @@ static void set_status(struct virtio_device *vdev, u8 status) | |||
177 | 178 | ||
178 | /* We set the status. */ | 179 | /* We set the status. */ |
179 | to_lgdev(vdev)->desc->status = status; | 180 | to_lgdev(vdev)->desc->status = status; |
180 | kvm_hypercall1(LHCALL_NOTIFY, (max_pfn << PAGE_SHIFT) + offset); | 181 | hcall(LHCALL_NOTIFY, (max_pfn << PAGE_SHIFT) + offset, 0, 0, 0); |
181 | } | 182 | } |
182 | 183 | ||
183 | static void lg_set_status(struct virtio_device *vdev, u8 status) | 184 | static void lg_set_status(struct virtio_device *vdev, u8 status) |
@@ -228,7 +229,7 @@ static void lg_notify(struct virtqueue *vq) | |||
228 | */ | 229 | */ |
229 | struct lguest_vq_info *lvq = vq->priv; | 230 | struct lguest_vq_info *lvq = vq->priv; |
230 | 231 | ||
231 | kvm_hypercall1(LHCALL_NOTIFY, lvq->config.pfn << PAGE_SHIFT); | 232 | hcall(LHCALL_NOTIFY, lvq->config.pfn << PAGE_SHIFT, 0, 0, 0); |
232 | } | 233 | } |
233 | 234 | ||
234 | /* An extern declaration inside a C file is bad form. Don't do it. */ | 235 | /* An extern declaration inside a C file is bad form. Don't do it. */ |
diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c index bd1632388e4a..85b714df8eae 100644 --- a/drivers/lguest/lguest_user.c +++ b/drivers/lguest/lguest_user.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/sched.h> | 10 | #include <linux/sched.h> |
11 | #include <linux/eventfd.h> | 11 | #include <linux/eventfd.h> |
12 | #include <linux/file.h> | 12 | #include <linux/file.h> |
13 | #include <linux/slab.h> | ||
13 | #include "lg.h" | 14 | #include "lg.h" |
14 | 15 | ||
15 | /*L:056 | 16 | /*L:056 |
diff --git a/drivers/lguest/page_tables.c b/drivers/lguest/page_tables.c index cf94326f1b59..04b22128a474 100644 --- a/drivers/lguest/page_tables.c +++ b/drivers/lguest/page_tables.c | |||
@@ -10,6 +10,7 @@ | |||
10 | /* Copyright (C) Rusty Russell IBM Corporation 2006. | 10 | /* Copyright (C) Rusty Russell IBM Corporation 2006. |
11 | * GPL v2 and any later version */ | 11 | * GPL v2 and any later version */ |
12 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
13 | #include <linux/gfp.h> | ||
13 | #include <linux/types.h> | 14 | #include <linux/types.h> |
14 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
15 | #include <linux/random.h> | 16 | #include <linux/random.h> |
diff --git a/drivers/lguest/segments.c b/drivers/lguest/segments.c index 951c57b0a7e0..ede46581351a 100644 --- a/drivers/lguest/segments.c +++ b/drivers/lguest/segments.c | |||
@@ -179,8 +179,10 @@ void load_guest_gdt_entry(struct lg_cpu *cpu, u32 num, u32 lo, u32 hi) | |||
179 | * We assume the Guest has the same number of GDT entries as the | 179 | * We assume the Guest has the same number of GDT entries as the |
180 | * Host, otherwise we'd have to dynamically allocate the Guest GDT. | 180 | * Host, otherwise we'd have to dynamically allocate the Guest GDT. |
181 | */ | 181 | */ |
182 | if (num >= ARRAY_SIZE(cpu->arch.gdt)) | 182 | if (num >= ARRAY_SIZE(cpu->arch.gdt)) { |
183 | kill_guest(cpu, "too many gdt entries %i", num); | 183 | kill_guest(cpu, "too many gdt entries %i", num); |
184 | return; | ||
185 | } | ||
184 | 186 | ||
185 | /* Set it up, then fix it. */ | 187 | /* Set it up, then fix it. */ |
186 | cpu->arch.gdt[num].a = lo; | 188 | cpu->arch.gdt[num].a = lo; |
diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c index 6ae388849a3b..b4eb675a807e 100644 --- a/drivers/lguest/x86/core.c +++ b/drivers/lguest/x86/core.c | |||
@@ -69,7 +69,7 @@ static struct lguest_pages *lguest_pages(unsigned int cpu) | |||
69 | (SWITCHER_ADDR + SHARED_SWITCHER_PAGES*PAGE_SIZE))[cpu]); | 69 | (SWITCHER_ADDR + SHARED_SWITCHER_PAGES*PAGE_SIZE))[cpu]); |
70 | } | 70 | } |
71 | 71 | ||
72 | static DEFINE_PER_CPU(struct lg_cpu *, last_cpu); | 72 | static DEFINE_PER_CPU(struct lg_cpu *, lg_last_cpu); |
73 | 73 | ||
74 | /*S:010 | 74 | /*S:010 |
75 | * We approach the Switcher. | 75 | * We approach the Switcher. |
@@ -90,8 +90,8 @@ static void copy_in_guest_info(struct lg_cpu *cpu, struct lguest_pages *pages) | |||
90 | * meanwhile). If that's not the case, we pretend everything in the | 90 | * meanwhile). If that's not the case, we pretend everything in the |
91 | * Guest has changed. | 91 | * Guest has changed. |
92 | */ | 92 | */ |
93 | if (__get_cpu_var(last_cpu) != cpu || cpu->last_pages != pages) { | 93 | if (__get_cpu_var(lg_last_cpu) != cpu || cpu->last_pages != pages) { |
94 | __get_cpu_var(last_cpu) = cpu; | 94 | __get_cpu_var(lg_last_cpu) = cpu; |
95 | cpu->last_pages = pages; | 95 | cpu->last_pages = pages; |
96 | cpu->changed = CHANGED_ALL; | 96 | cpu->changed = CHANGED_ALL; |
97 | } | 97 | } |
@@ -288,6 +288,18 @@ static int emulate_insn(struct lg_cpu *cpu) | |||
288 | insn = lgread(cpu, physaddr, u8); | 288 | insn = lgread(cpu, physaddr, u8); |
289 | 289 | ||
290 | /* | 290 | /* |
291 | * Around 2.6.33, the kernel started using an emulation for the | ||
292 | * cmpxchg8b instruction in early boot on many configurations. This | ||
293 | * code isn't paravirtualized, and it tries to disable interrupts. | ||
294 | * Ignore it, which will Mostly Work. | ||
295 | */ | ||
296 | if (insn == 0xfa) { | ||
297 | /* "cli", or Clear Interrupt Enable instruction. Skip it. */ | ||
298 | cpu->regs->eip++; | ||
299 | return 1; | ||
300 | } | ||
301 | |||
302 | /* | ||
291 | * 0x66 is an "operand prefix". It means it's using the upper 16 bits | 303 | * 0x66 is an "operand prefix". It means it's using the upper 16 bits |
292 | * of the eax register. | 304 | * of the eax register. |
293 | */ | 305 | */ |