You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Zachary Amsden
f2f30ebca6
[PATCH] x86: introduce a write acessor for updating the current LDT
Introduce a write acessor for updating the current LDT. This is required
for hypervisors like Xen that do not allow LDT pages to be directly
written.
Testing - here's a fun little LDT test that can be trivially modified to
test limits as well.
/*
* Copyright (c) 2005, Zachary Amsden (zach@vmware.com)
* This is licensed under the GPL.
*/
#include <stdio.h>
#include <signal.h>
#include <asm/ldt.h>
#include <asm/segment.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/mman.h>
#define __KERNEL__
#include <asm/page.h>
void main(void)
{
struct user_desc desc;
char *code;
unsigned long long tsc;
code = (char *)mmap(0, 8192, PROT_EXEC|PROT_READ|PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
desc.entry_number = 0;
desc.base_addr = code;
desc.limit = 1;
desc.seg_32bit = 1;
desc.contents = MODIFY_LDT_CONTENTS_CODE;
desc.read_exec_only = 0;
desc.limit_in_pages = 1;
desc.seg_not_present = 0;
desc.useable = 1;
if (modify_ldt(1, &desc, sizeof(desc)) != 0) {
perror("modify_ldt");
}
printf("code base is 0x%08x\n", (unsigned)code);
code[0x0ffe] = 0x0f; /* rdtsc */
code[0x0fff] = 0x31;
code[0x1000] = 0xcb; /* lret */
__asm__ __volatile("lcall $7,$0xffe" : "=A" (tsc));
printf("TSC is 0x%016llx\n", tsc);
}
Signed-off-by: Zachary Amsden <zach@vmware.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
20 years ago |
.. |
alpha
|
[PATCH] convert signal handling of NODEFER to act like other Unix boxes.
|
20 years ago |
arm
|
[ARM] Fix ARMv6 page table bits
|
20 years ago |
arm26
|
[PATCH] convert signal handling of NODEFER to act like other Unix boxes.
|
20 years ago |
cris
|
[PATCH] convert signal handling of NODEFER to act like other Unix boxes.
|
20 years ago |
frv
|
[PATCH] frv: Remove export of strtok()
|
20 years ago |
h8300
|
[PATCH] convert signal handling of NODEFER to act like other Unix boxes.
|
20 years ago |
i386
|
[PATCH] x86: introduce a write acessor for updating the current LDT
|
20 years ago |
ia64
|
[IA64] uncached allocator: use generic (not sn2 specific) functions
|
20 years ago |
m32r
|
[PATCH] convert signal handling of NODEFER to act like other Unix boxes.
|
20 years ago |
m68k
|
It wasn't just x86-64 that had hardcoded VM_FAULT_xxx numbers
|
20 years ago |
m68knommu
|
[PATCH] m68knommu: update defconfig for m68knommu
|
20 years ago |
mips
|
[PATCH] mips: fix build warnings
|
20 years ago |
parisc
|
[PATCH] convert signal handling of NODEFER to act like other Unix boxes.
|
20 years ago |
ppc
|
[PATCH] ppc32: cpci690 updates
|
20 years ago |
ppc64
|
[PATCH] ppc64: replace schedule_timeout() with msleep_interruptible()
|
20 years ago |
s390
|
[PATCH] convert signal handling of NODEFER to act like other Unix boxes.
|
20 years ago |
sh
|
[PATCH] convert signal handling of NODEFER to act like other Unix boxes.
|
20 years ago |
sh64
|
[PATCH] arch/sh64/Kconfig: doesn't need it's own LOG_BUF_SHIFT
|
20 years ago |
sparc
|
[SPARC]: remove use of asm/segment.h
|
20 years ago |
sparc64
|
[SPARC64]: More fully work around Spitfire Errata 51.
|
20 years ago |
um
|
[PATCH] convert signal handling of NODEFER to act like other Unix boxes.
|
20 years ago |
v850
|
[PATCH] v850: Add show_mem
|
20 years ago |
x86_64
|
[PATCH] convert signal handling of NODEFER to act like other Unix boxes.
|
20 years ago |
xtensa
|
[PATCH] convert signal handling of NODEFER to act like other Unix boxes.
|
20 years ago |