[PATCH 13/14] i386 / Introduce hypervisor ldt hooks

[PATCH 13/14] i386 / Introduce hypervisor ldt hooks

Post by zach » Fri, 12 Aug 2005 14:10:07


Add hooks that the hypervisor can use to establish writable and non-writable
pages for LDT pages. I made these parallel the page flags as defined in
include/linux/page-flags.h, since the flag mechanism is very similar to the
hypercall page flagging, and extended easily later to include PT, PD, PDP,
GDT, etc.

Patch-against: 2.6.13-rc5-mm1
Patch-keys: i386 ldt paravirt xen
Signed-off-by: Zachary Amsden < XXXX@XXXXX.COM >
Index: linux-2.6.13/arch/i386/kernel/ldt.c
===================================================================
--- linux-2.6.13.orig/arch/i386/kernel/ldt.c 2005-08-10 17:06:52.000000000 -0700
+++ linux-2.6.13/arch/i386/kernel/ldt.c 2005-08-10 17:11:38.000000000 -0700
@@ -18,6 +18,7 @@
#include <asm/system.h>
#include <asm/ldt.h>
#include <asm/desc.h>
+#include <mach_pgalloc.h>

#ifdef CONFIG_SMP /* avoids "defined but not used" warning */
static void flush_ldt(void *null)
@@ -59,16 +60,19 @@
#ifdef CONFIG_SMP
cpumask_t mask;
preempt_disable();
+ SetPagesLDT(pc->ldt, (pc->size * LDT_ENTRY_SIZE) / PAGE_SIZE);
load_LDT(pc);
mask = cpumask_of_cpu(smp_processor_id());
if (!cpus_equal(current->mm->cpu_vm_mask, mask))
smp_call_function(flush_ldt, NULL, 1, 1);
preempt_enable();
#else
+ SetPagesLDT(pc->ldt, (pc->size * LDT_ENTRY_SIZE) / PAGE_SIZE);
load_LDT(pc);
#endif
}
if (oldsize) {
+ ClearPagesLDT(oldldt, (oldsize * LDT_ENTRY_SIZE) / PAGE_SIZE);
if (oldsize*LDT_ENTRY_SIZE > PAGE_SIZE)
vfree(oldldt);
else
@@ -83,8 +87,10 @@

down(&old->sem);
err = alloc_ldt(new, 0, old->size, 0);
- if (!err)
+ if (!err) {
memcpy(new->ldt, old->ldt, old->size*LDT_ENTRY_SIZE);
+ SetPagesLDT(new->ldt, (new->size * LDT_ENTRY_SIZE) / PAGE_SIZE);
+ }
up(&old->sem);
return err;
}
@@ -93,6 +99,7 @@
{
if (mm == current->active_mm)
clear_LDT();
+ ClearPagesLDT(mm->context.ldt, (mm->context.size * LDT_ENTRY_SIZE) / PAGE_SIZE);
if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE)
vfree(mm->context.ldt);
else
Index: linux-2.6.13/include/asm-i386/mach-default/mach_pgalloc.h
===================================================================
--- linux-2.6.13.orig/include/asm-i386/mach-default/mach_pgalloc.h 2005-08-10 17:11:38.000000000 -0700
+++ linux-2.6.13/include/asm-i386/mach-default/mach_pgalloc.h 2005-08-10 17:11:38.000000000 -0700
@@ -0,0 +1,7 @@
+#ifndef __ASM_MACH_PGALLOC_H
+#define __ASM_MACH_PGALLOC_H
+
+#define SetPagesLDT(_va, _pages)
+#define ClearPagesLDT(_va, _pages)
+
+#endif
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
 
 
 

1. Why is 13==13 true, but 14==14 false???

2. [PATCH 13/14] [PATCH] w1: clean up W1_CON dependency.

From: Evgeniy Polyakov < XXXX@XXXXX.COM >

If w1 is not enabled, w1_con should not appear in configuration,
even if no logic is turned on without w1.
W1_CON should depend on W1 also.

Signed-off-by: Randy Dunlap < XXXX@XXXXX.COM >
Signed-off-by: Evgeniy Polyakov < XXXX@XXXXX.COM >
Signed-off-by: Greg Kroah-Hartman < XXXX@XXXXX.COM >
---
drivers/w1/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/w1/Kconfig b/drivers/w1/Kconfig
index 0c6c435..f2d9a08 100644
--- a/drivers/w1/Kconfig
+++ b/drivers/w1/Kconfig
@@ -12,7 +12,7 @@ config W1
will be called wire.ko.

config W1_CON
- depends on CONNECTOR
+ depends on CONNECTOR && W1
bool "Userspace communication over connector"
default y
--- help ---
--
1.4.0

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/

3. [PATCH 2.6.13 13/14] sas-class: sas_port.c SAS Port (events, attrs, initialization)

4. [PATCH 13/14] page-replace-init.patch

5. [PATCH] [13/40] i386: Document asm-i386/paravirt.h

6. [PATCH] [14/30] i386: Implement alternative_io for i386

7. [PATCH] [13/35] i386: No need to use -traditional for processing asm in i386/kernel/

8. [PATCH] [14/34] i386: Use safe_apic_wait_icr_idle in safe_apic_wait_icr_idle - i386

9. [PATCH RFP-V4 13/13] RFP prot support: uml, i386, x64 bits

10. [PATCH 2.6.13 14/14] sas-class: SCSI Host glue

11. [PATCH 13/14] ARM: OMAP: TSC2101: add platform init / registration to board files

12. [PATCH 13/14/] Doc. sources: expose mtrr

13. [PATCH 13/14] Rework of IPC auditing

14. [patch 13/14] Convert from class_device to device for UCB1x00

15. [PATCH 13/14] Conversion of nr_bounce to per zone counter