[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Fix x86/64 build.
ChangeSet 1.1354, 2005/03/23 13:43:21+00:00, kaf24@xxxxxxxxxxxxxxxxxxxx Fix x86/64 build. Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> domain.c | 2 ++ traps.c | 26 ++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff -Nru a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c --- a/xen/arch/x86/domain.c 2005-03-23 09:02:58 -05:00 +++ b/xen/arch/x86/domain.c 2005-03-23 09:02:58 -05:00 @@ -733,7 +733,9 @@ void context_switch(struct exec_domain *prev_p, struct exec_domain *next_p) { +#ifdef __i386__ struct tss_struct *tss = init_tss + smp_processor_id(); +#endif execution_context_t *stack_ec = get_execution_context(); __cli(); diff -Nru a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c --- a/xen/arch/x86/traps.c 2005-03-23 09:02:58 -05:00 +++ b/xen/arch/x86/traps.c 2005-03-23 09:02:58 -05:00 @@ -385,12 +385,27 @@ struct exec_domain *ed, struct xen_regs *regs) { u16 x; +#if defined(__x86_64__) + /* If in user mode, switch to kernel mode just to read I/O bitmap. */ + extern void toggle_guest_mode(struct exec_domain *); + int user_mode = !(ed->arch.flags & TF_kernel_mode); +#define TOGGLE_MODE() if ( user_mode ) toggle_guest_mode(ed) +#elif defined(__i386__) +#define TOGGLE_MODE() ((void)0) +#endif + if ( ed->arch.iopl >= (KERNEL_MODE(ed, regs) ? 1 : 3) ) return 1; - if ( (ed->arch.iobmp_limit > (port + bytes)) && - (__get_user(x, (u16 *)(ed->arch.iobmp+(port>>3))) == 0) && - ((x & (((1<<bytes)-1) << (port&7))) == 0) ) - return 1; + + if ( ed->arch.iobmp_limit > (port + bytes) ) + { + TOGGLE_MODE(); + __get_user(x, (u16 *)(ed->arch.iobmp+(port>>3))); + TOGGLE_MODE(); + if ( (x & (((1<<bytes)-1) << (port&7))) == 0 ) + return 1; + } + return 0; } @@ -401,14 +416,17 @@ { struct domain *d = ed->domain; u16 x; + if ( IS_PRIV(d) || (d->arch.max_iopl >= (KERNEL_MODE(ed, regs) ? 1 : 3)) ) return 1; + if ( d->arch.iobmp_mask != NULL ) { x = *(u16 *)(d->arch.iobmp_mask + (port >> 3)); if ( (x & (((1<<bytes)-1) << (port&7))) == 0 ) return 1; } + return 0; } ------------------------------------------------------- This SF.net email is sponsored by: 2005 Windows Mobile Application Contest Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones for the chance to win $25,000 and application distribution. Enter today at http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |