WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] RE: [PATCH] vmx-x86_64-byte.patch

To: <leendert@xxxxxxxxxxxxxx>, "xen-devel" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] RE: [PATCH] vmx-x86_64-byte.patch
From: "Li, Chengyuan" <chengyuan.li@xxxxxxxxx>
Date: Sun, 11 Sep 2005 19:30:20 +0800
Cc: "Mallick, Asit K" <asit.k.mallick@xxxxxxxxx>
Delivery-date: Sun, 11 Sep 2005 11:28:16 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcW2NjkuphA/Rb9UQN6+llclYuSPgAAjLlxg
Thread-topic: [PATCH] vmx-x86_64-byte.patch
Leendert,

The byte size is handled in set_reg_value(), but not in __set_reg_value(), and 
it's true that there is a bug in set_reg_value().
I've send a patch for this bug:

diff -r c8e840ac3019 xen/arch/x86/vmx_io.c
--- a/xen/arch/x86/vmx_io.c     Tue Sep  6 10:11:20 2005
+++ b/xen/arch/x86/vmx_io.c     Fri Sep  9 22:28:25 2005
@@ -261,7 +261,7 @@
                 domain_crash_synchronous();
                 break;
         }
-
+        return ;
     }

     switch (index) {


leendert@xxxxxxxxxxxxxx scribbled on 2005年9月10日 21:36:

> 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@xxxxxxxxxxxxxx>
> 
> diff -r 3f2751c6e721 xen/arch/x86/vmx_io.c
> --- a/xen/arch/x86/vmx_io.c   Sat Sep 10 14:44:31 2005
> +++ b/xen/arch/x86/vmx_io.c   Sat Sep 10 14:23:12 2005
> @@ -99,7 +99,6 @@
>              printk("Error: size:%x, index:%x are invalid!\n", size,
>              index); domain_crash_synchronous();
>              break;
> -
>          }
>          break;
>      case WORD:
> @@ -199,6 +198,7 @@
>  static inline void __set_reg_value(unsigned long *reg, int size,
>  long value) {
>      switch (size) {
> +        case BYTE:
>          case BYTE_64:
>              *reg &= ~0xFF;
>              *reg |= (value & 0xFF);
> @@ -215,7 +215,7 @@
>              *reg = value;
>              break;
>          default:
> -            printk("Error: <__set_reg_value> : Unknown size for
> register\n"); +           printk("Error: <__set_reg_value>: size:%x is
>              invalid\n", size); domain_crash_synchronous();
>      }
>  }
> diff -r 3f2751c6e721 xen/arch/x86/vmx_platform.c
> --- a/xen/arch/x86/vmx_platform.c     Sat Sep 10 14:44:31 2005
> +++ b/xen/arch/x86/vmx_platform.c     Sat Sep 10 14:23:12 2005
> @@ -55,6 +55,7 @@
>  static inline long __get_reg_value(unsigned long reg, int size)
>  {
>      switch(size) {
> +        case BYTE:
>          case BYTE_64:
>              return (char)(reg & 0xFF);
>          case WORD:
> @@ -430,10 +431,10 @@
>       if (((opcode[1] >> 3) & 7) == 7) { /* cmp $imm, m32/16 */
>           instr->instr = INSTR_CMP;
> 
> -        if (opcode[0] == 0x80)
> -            GET_OP_SIZE_FOR_BYTE(instr->op_size);
> -        else
> -            GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
> +         if (opcode[0] == 0x80)
> +             GET_OP_SIZE_FOR_BYTE(instr->op_size);
> +            else
> +             GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
> 
>           instr->operand[0] = mk_operand(instr->op_size, 0, 0, IMMEDIATE);
>           instr->immediate = get_immediate(vm86, opcode+1, BYTE);

Thanks,
Chengyuan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>