ia64/xen-unstable

changeset 6747:21cbdb20ff4c

An FC4/i386 install inside VMX on an x86_64 system fails because byte
size is not handled by __set_reg_value. This patch adds that support.

This patch also reindents Chengyuan Li cmpb patch so that is aligns
with the rest of the code in that block.

Signed-Off-By: Leendert van Doorn <leendert@watson.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Sun Sep 11 09:28:21 2005 +0000 (2005-09-11)
parents 9ead08216805
children 5721657e8130
files xen/arch/x86/vmx_io.c xen/arch/x86/vmx_platform.c
line diff
     1.1 --- a/xen/arch/x86/vmx_io.c	Sat Sep 10 20:14:50 2005 +0000
     1.2 +++ b/xen/arch/x86/vmx_io.c	Sun Sep 11 09:28:21 2005 +0000
     1.3 @@ -99,7 +99,6 @@ static void set_reg_value (int size, int
     1.4              printk("Error: size:%x, index:%x are invalid!\n", size, index);
     1.5              domain_crash_synchronous();
     1.6              break;
     1.7 -
     1.8          }
     1.9          break;
    1.10      case WORD:
    1.11 @@ -199,6 +198,7 @@ void load_cpu_user_regs(struct cpu_user_
    1.12  static inline void __set_reg_value(unsigned long *reg, int size, long value)
    1.13  {
    1.14      switch (size) {
    1.15 +        case BYTE:
    1.16          case BYTE_64:
    1.17              *reg &= ~0xFF;
    1.18              *reg |= (value & 0xFF);
    1.19 @@ -215,7 +215,7 @@ static inline void __set_reg_value(unsig
    1.20              *reg = value;
    1.21              break;
    1.22          default:
    1.23 -            printk("Error: <__set_reg_value> : Unknown size for register\n");
    1.24 +	    printk("Error: <__set_reg_value>: size:%x is invalid\n", size);
    1.25              domain_crash_synchronous();
    1.26      }
    1.27  }
     2.1 --- a/xen/arch/x86/vmx_platform.c	Sat Sep 10 20:14:50 2005 +0000
     2.2 +++ b/xen/arch/x86/vmx_platform.c	Sun Sep 11 09:28:21 2005 +0000
     2.3 @@ -55,6 +55,7 @@ void store_cpu_user_regs(struct cpu_user
     2.4  static inline long __get_reg_value(unsigned long reg, int size)
     2.5  {
     2.6      switch(size) {
     2.7 +        case BYTE:
     2.8          case BYTE_64:
     2.9              return (char)(reg & 0xFF);
    2.10          case WORD:
    2.11 @@ -430,10 +431,10 @@ static int vmx_decode(unsigned char *opc
    2.12  	if (((opcode[1] >> 3) & 7) == 7) { /* cmp $imm, m32/16 */
    2.13  	    instr->instr = INSTR_CMP;
    2.14  
    2.15 -        if (opcode[0] == 0x80)
    2.16 -            GET_OP_SIZE_FOR_BYTE(instr->op_size);
    2.17 -        else
    2.18 -            GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
    2.19 +	    if (opcode[0] == 0x80)
    2.20 +		GET_OP_SIZE_FOR_BYTE(instr->op_size);
    2.21 +            else
    2.22 +		GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
    2.23  
    2.24  	    instr->operand[0] = mk_operand(instr->op_size, 0, 0, IMMEDIATE);
    2.25  	    instr->immediate = get_immediate(vm86, opcode+1, BYTE);