aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-07-22 01:09:50 -0400
committerRusty Russell <rusty@rustcorp.com.au>2011-07-22 01:09:50 -0400
commit9f54288def3f92b7805eb6d4b1ddcd73ecf6e889 (patch)
treebb46242a92e47112c2967354b3be0c6daecae7a7 /drivers
parent3c3ed482dc077a67903a58c9e1aedba1bb18c18a (diff)
lguest: update comments
Also removes a long-unused #define and an extraneous semicolon. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/lguest/core.c2
-rw-r--r--drivers/lguest/interrupts_and_traps.c4
-rw-r--r--drivers/lguest/lguest_user.c17
-rw-r--r--drivers/lguest/page_tables.c4
-rw-r--r--drivers/lguest/x86/core.c10
5 files changed, 19 insertions, 18 deletions
diff --git a/drivers/lguest/core.c b/drivers/lguest/core.c
index efa202499e37..2535933c49f8 100644
--- a/drivers/lguest/core.c
+++ b/drivers/lguest/core.c
@@ -117,7 +117,7 @@ static __init int map_switcher(void)
117 117
118 /* 118 /*
119 * Now the Switcher is mapped at the right address, we can't fail! 119 * Now the Switcher is mapped at the right address, we can't fail!
120 * Copy in the compiled-in Switcher code (from <arch>_switcher.S). 120 * Copy in the compiled-in Switcher code (from x86/switcher_32.S).
121 */ 121 */
122 memcpy(switcher_vma->addr, start_switcher_text, 122 memcpy(switcher_vma->addr, start_switcher_text,
123 end_switcher_text - start_switcher_text); 123 end_switcher_text - start_switcher_text);
diff --git a/drivers/lguest/interrupts_and_traps.c b/drivers/lguest/interrupts_and_traps.c
index f0c171506371..28433a155d67 100644
--- a/drivers/lguest/interrupts_and_traps.c
+++ b/drivers/lguest/interrupts_and_traps.c
@@ -427,8 +427,8 @@ void pin_stack_pages(struct lg_cpu *cpu)
427 427
428/* 428/*
429 * Direct traps also mean that we need to know whenever the Guest wants to use 429 * Direct traps also mean that we need to know whenever the Guest wants to use
430 * a different kernel stack, so we can change the IDT entries to use that 430 * a different kernel stack, so we can change the guest TSS to use that
431 * stack. The IDT entries expect a virtual address, so unlike most addresses 431 * stack. The TSS entries expect a virtual address, so unlike most addresses
432 * the Guest gives us, the "esp" (stack pointer) value here is virtual, not 432 * the Guest gives us, the "esp" (stack pointer) value here is virtual, not
433 * physical. 433 * physical.
434 * 434 *
diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c
index 948c547b8e9e..f97e625241ad 100644
--- a/drivers/lguest/lguest_user.c
+++ b/drivers/lguest/lguest_user.c
@@ -1,8 +1,10 @@
1/*P:200 This contains all the /dev/lguest code, whereby the userspace launcher 1/*P:200 This contains all the /dev/lguest code, whereby the userspace
2 * controls and communicates with the Guest. For example, the first write will 2 * launcher controls and communicates with the Guest. For example,
3 * tell us the Guest's memory layout and entry point. A read will run the 3 * the first write will tell us the Guest's memory layout and entry
4 * Guest until something happens, such as a signal or the Guest doing a NOTIFY 4 * point. A read will run the Guest until something happens, such as
5 * out to the Launcher. 5 * a signal or the Guest doing a NOTIFY out to the Launcher. There is
6 * also a way for the Launcher to attach eventfds to particular NOTIFY
7 * values instead of returning from the read() call.
6:*/ 8:*/
7#include <linux/uaccess.h> 9#include <linux/uaccess.h>
8#include <linux/miscdevice.h> 10#include <linux/miscdevice.h>
@@ -357,8 +359,8 @@ static int initialize(struct file *file, const unsigned long __user *input)
357 goto free_eventfds; 359 goto free_eventfds;
358 360
359 /* 361 /*
360 * Initialize the Guest's shadow page tables, using the toplevel 362 * Initialize the Guest's shadow page tables. This allocates
361 * address the Launcher gave us. This allocates memory, so can fail. 363 * memory, so can fail.
362 */ 364 */
363 err = init_guest_pagetable(lg); 365 err = init_guest_pagetable(lg);
364 if (err) 366 if (err)
@@ -516,6 +518,7 @@ static const struct file_operations lguest_fops = {
516 .read = read, 518 .read = read,
517 .llseek = default_llseek, 519 .llseek = default_llseek,
518}; 520};
521/*:*/
519 522
520/* 523/*
521 * This is a textbook example of a "misc" character device. Populate a "struct 524 * This is a textbook example of a "misc" character device. Populate a "struct
diff --git a/drivers/lguest/page_tables.c b/drivers/lguest/page_tables.c
index 00026222bde8..3b62be160a6e 100644
--- a/drivers/lguest/page_tables.c
+++ b/drivers/lguest/page_tables.c
@@ -155,7 +155,7 @@ static pte_t *spte_addr(struct lg_cpu *cpu, pgd_t spgd, unsigned long vaddr)
155} 155}
156 156
157/* 157/*
158 * These functions are just like the above two, except they access the Guest 158 * These functions are just like the above, except they access the Guest
159 * page tables. Hence they return a Guest address. 159 * page tables. Hence they return a Guest address.
160 */ 160 */
161static unsigned long gpgd_addr(struct lg_cpu *cpu, unsigned long vaddr) 161static unsigned long gpgd_addr(struct lg_cpu *cpu, unsigned long vaddr)
@@ -195,7 +195,7 @@ static unsigned long gpte_addr(struct lg_cpu *cpu,
195#endif 195#endif
196/*:*/ 196/*:*/
197 197
198/*M:014 198/*M:007
199 * get_pfn is slow: we could probably try to grab batches of pages here as 199 * get_pfn is slow: we could probably try to grab batches of pages here as
200 * an optimization (ie. pre-faulting). 200 * an optimization (ie. pre-faulting).
201:*/ 201:*/
diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c
index ec0cdfc04e78..3b9b810cbf28 100644
--- a/drivers/lguest/x86/core.c
+++ b/drivers/lguest/x86/core.c
@@ -272,7 +272,7 @@ static int emulate_insn(struct lg_cpu *cpu)
272 unsigned int insnlen = 0, in = 0, shift = 0; 272 unsigned int insnlen = 0, in = 0, shift = 0;
273 /* 273 /*
274 * The eip contains the *virtual* address of the Guest's instruction: 274 * The eip contains the *virtual* address of the Guest's instruction:
275 * guest_pa just subtracts the Guest's page_offset. 275 * walk the Guest's page tables to find the "physical" address.
276 */ 276 */
277 unsigned long physaddr = guest_pa(cpu, cpu->regs->eip); 277 unsigned long physaddr = guest_pa(cpu, cpu->regs->eip);
278 278
@@ -409,7 +409,7 @@ void lguest_arch_handle_trap(struct lg_cpu *cpu)
409 * These values mean a real interrupt occurred, in which case 409 * These values mean a real interrupt occurred, in which case
410 * the Host handler has already been run. We just do a 410 * the Host handler has already been run. We just do a
411 * friendly check if another process should now be run, then 411 * friendly check if another process should now be run, then
412 * return to run the Guest again 412 * return to run the Guest again.
413 */ 413 */
414 cond_resched(); 414 cond_resched();
415 return; 415 return;
@@ -459,7 +459,7 @@ void __init lguest_arch_host_init(void)
459 int i; 459 int i;
460 460
461 /* 461 /*
462 * Most of the i386/switcher.S doesn't care that it's been moved; on 462 * Most of the x86/switcher_32.S doesn't care that it's been moved; on
463 * Intel, jumps are relative, and it doesn't access any references to 463 * Intel, jumps are relative, and it doesn't access any references to
464 * external code or data. 464 * external code or data.
465 * 465 *
@@ -587,7 +587,7 @@ void __init lguest_arch_host_init(void)
587 clear_cpu_cap(&boot_cpu_data, X86_FEATURE_PGE); 587 clear_cpu_cap(&boot_cpu_data, X86_FEATURE_PGE);
588 } 588 }
589 put_online_cpus(); 589 put_online_cpus();
590}; 590}
591/*:*/ 591/*:*/
592 592
593void __exit lguest_arch_host_fini(void) 593void __exit lguest_arch_host_fini(void)
@@ -670,8 +670,6 @@ int lguest_arch_init_hypercalls(struct lg_cpu *cpu)
670/*:*/ 670/*:*/
671 671
672/*L:030 672/*L:030
673 * lguest_arch_setup_regs()
674 *
675 * Most of the Guest's registers are left alone: we used get_zeroed_page() to 673 * Most of the Guest's registers are left alone: we used get_zeroed_page() to
676 * allocate the structure, so they will be 0. 674 * allocate the structure, so they will be 0.
677 */ 675 */