mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
Since the shared info layout is fixed, guests are required to use VCPUOP_register_vcpu_info prior to booting any vCPU beyond the traditional limit of 32. MAX_VIRT_CPUS, being an implemetation detail of the hypervisor, is no longer being exposed in the public headers. The tools changes are clearly incomplete (and done only so things would build again), and the current state of the tools (using scalar variables all over the place to represent vCPU bitmaps) very likely doesn't permit booting DomU-s with more than the traditional number of vCPU-s. Testing of the extended functionality was done with Dom0 (96 vCPU-s, as well as 128 vCPU-s out of which the kernel elected - by way of a simple kernel side patch - to use only some, resulting in a sparse bitmap). ia64 changes only to make things build, and build-tested only (and the tools part only as far as the build would go without encountering unrelated problems in the blktap code). Signed-off-by: Jan Beulich <jbeulich@novell.com>
166 lines
5.9 KiB
C
166 lines
5.9 KiB
C
#ifndef XC_PTRACE_
|
|
#define XC_PTRACE_
|
|
|
|
#define X86_CR0_PE 0x00000001 /* Enable Protected Mode (RW) */
|
|
#define X86_CR0_PG 0x80000000 /* Paging (RW) */
|
|
#define BSD_PAGE_MASK (PAGE_SIZE-1)
|
|
#define PSL_T 0x00000100 /* trace enable bit */
|
|
|
|
#ifdef __x86_64__
|
|
struct gdb_regs
|
|
{
|
|
unsigned long r15;
|
|
unsigned long r14;
|
|
unsigned long r13;
|
|
unsigned long r12;
|
|
unsigned long rbp;
|
|
unsigned long rbx;
|
|
unsigned long r11;
|
|
unsigned long r10;
|
|
unsigned long r9;
|
|
unsigned long r8;
|
|
unsigned long rax;
|
|
unsigned long rcx;
|
|
unsigned long rdx;
|
|
unsigned long rsi;
|
|
unsigned long rdi;
|
|
unsigned long orig_rax;
|
|
unsigned long rip;
|
|
unsigned long xcs;
|
|
unsigned long rflags;
|
|
unsigned long rsp;
|
|
unsigned long xss;
|
|
unsigned long fs_base;
|
|
unsigned long gs_base;
|
|
unsigned long xds;
|
|
unsigned long xes;
|
|
unsigned long xfs;
|
|
unsigned long xgs;
|
|
};
|
|
|
|
#define SET_PT_REGS(pt, xc) \
|
|
{ \
|
|
pt.r8 = xc.r8; \
|
|
pt.r9 = xc.r9; \
|
|
pt.r10 = xc.r10; \
|
|
pt.r11 = xc.r11; \
|
|
pt.r12 = xc.r12; \
|
|
pt.r13 = xc.r13; \
|
|
pt.r14 = xc.r14; \
|
|
pt.r15 = xc.r15; \
|
|
pt.rbx = xc.rbx; \
|
|
pt.rcx = xc.rcx; \
|
|
pt.rdx = xc.rdx; \
|
|
pt.rsi = xc.rsi; \
|
|
pt.rdi = xc.rdi; \
|
|
pt.rbp = xc.rbp; \
|
|
pt.rax = xc.rax; \
|
|
pt.rip = xc.rip; \
|
|
pt.xcs = xc.cs; \
|
|
pt.rflags = xc.rflags; \
|
|
pt.rsp = xc.rsp; \
|
|
pt.xss = xc.ss; \
|
|
pt.xes = xc.es; \
|
|
pt.xds = xc.ds; \
|
|
pt.xfs = xc.fs; \
|
|
pt.xgs = xc.gs; \
|
|
}
|
|
|
|
#define SET_XC_REGS(pt, xc) \
|
|
{ \
|
|
xc.r8 = pt->r8; \
|
|
xc.r9 = pt->r9; \
|
|
xc.r10 = pt->r10; \
|
|
xc.r11 = pt->r11; \
|
|
xc.r12 = pt->r12; \
|
|
xc.r13 = pt->r13; \
|
|
xc.r14 = pt->r14; \
|
|
xc.r15 = pt->r15; \
|
|
xc.rbx = pt->rbx; \
|
|
xc.rcx = pt->rcx; \
|
|
xc.rdx = pt->rdx; \
|
|
xc.rsi = pt->rsi; \
|
|
xc.rdi = pt->rdi; \
|
|
xc.rbp = pt->rbp; \
|
|
xc.rax = pt->rax; \
|
|
xc.rip = pt->rip; \
|
|
xc.cs = pt->xcs; \
|
|
xc.rflags = pt->rflags & 0xffffffff; \
|
|
xc.rsp = pt->rsp; \
|
|
xc.ss = pt->xss; \
|
|
xc.es = pt->xes; \
|
|
xc.ds = pt->xds; \
|
|
xc.fs = pt->xfs; \
|
|
xc.gs = pt->xgs; \
|
|
}
|
|
|
|
#elif __i386__
|
|
|
|
struct gdb_regs {
|
|
long ebx; /* 0 */
|
|
long ecx; /* 4 */
|
|
long edx; /* 8 */
|
|
long esi; /* 12 */
|
|
long edi; /* 16 */
|
|
long ebp; /* 20 */
|
|
long eax; /* 24 */
|
|
int xds; /* 28 */
|
|
int xes; /* 32 */
|
|
int xfs; /* 36 */
|
|
int xgs; /* 40 */
|
|
long orig_eax; /* 44 */
|
|
long eip; /* 48 */
|
|
int xcs; /* 52 */
|
|
long eflags; /* 56 */
|
|
long esp; /* 60 */
|
|
int xss; /* 64 */
|
|
};
|
|
|
|
#define SET_PT_REGS(pt, xc) \
|
|
{ \
|
|
pt.ebx = xc.ebx; \
|
|
pt.ecx = xc.ecx; \
|
|
pt.edx = xc.edx; \
|
|
pt.esi = xc.esi; \
|
|
pt.edi = xc.edi; \
|
|
pt.ebp = xc.ebp; \
|
|
pt.eax = xc.eax; \
|
|
pt.eip = xc.eip; \
|
|
pt.xcs = xc.cs; \
|
|
pt.eflags = xc.eflags; \
|
|
pt.esp = xc.esp; \
|
|
pt.xss = xc.ss; \
|
|
pt.xes = xc.es; \
|
|
pt.xds = xc.ds; \
|
|
pt.xfs = xc.fs; \
|
|
pt.xgs = xc.gs; \
|
|
}
|
|
|
|
#define SET_XC_REGS(pt, xc) \
|
|
{ \
|
|
xc.ebx = pt->ebx; \
|
|
xc.ecx = pt->ecx; \
|
|
xc.edx = pt->edx; \
|
|
xc.esi = pt->esi; \
|
|
xc.edi = pt->edi; \
|
|
xc.ebp = pt->ebp; \
|
|
xc.eax = pt->eax; \
|
|
xc.eip = pt->eip; \
|
|
xc.cs = pt->xcs; \
|
|
xc.eflags = pt->eflags; \
|
|
xc.esp = pt->esp; \
|
|
xc.ss = pt->xss; \
|
|
xc.es = pt->xes; \
|
|
xc.ds = pt->xds; \
|
|
xc.fs = pt->xfs; \
|
|
xc.gs = pt->xgs; \
|
|
}
|
|
#endif
|
|
|
|
void *map_domain_va_core(unsigned long domfd, int cpu, void *guest_va);
|
|
int xc_waitdomain_core(int xc_handle, int domain, int *status, int options);
|
|
vcpu_guest_context_any_t *xc_ptrace_get_vcpu_ctxt(unsigned int nr_cpus);
|
|
|
|
|
|
#endif /* XC_PTRACE */
|