direct-io.hg

changeset 13737:7d3bb465e938

[XEN] Fix XENVER_capabilities hypercall.

Passing an array to a function turns it into a pointer which confuses
safe_strcat.

Also fix 54->64 typo in ia64 tree.

Thanks to Alex Williamson for pointing out the problem.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Wed Jan 31 10:11:26 2007 +0000 (2007-01-31)
parents 61262143a4b0
children daed6ac9d1f7 ffcd586dbaae
files xen/arch/ia64/xen/xensetup.c xen/arch/powerpc/setup.c xen/arch/x86/setup.c xen/common/kernel.c
line diff
     1.1 --- a/xen/arch/ia64/xen/xensetup.c	Tue Jan 30 18:30:18 2007 +0000
     1.2 +++ b/xen/arch/ia64/xen/xensetup.c	Wed Jan 31 10:11:26 2007 +0000
     1.3 @@ -545,21 +545,21 @@ printk("num_online_cpus=%d, max_cpus=%d\
     1.4      startup_cpu_idle_loop();
     1.5  }
     1.6  
     1.7 -void arch_get_xen_caps(xen_capabilities_info_t info)
     1.8 +void arch_get_xen_caps(xen_capabilities_info_t *info)
     1.9  {
    1.10      int major = xen_major_version();
    1.11      int minor = xen_minor_version();
    1.12      char s[32];
    1.13  
    1.14 -    info[0] = '\0';
    1.15 +    (*info)[0] = '\0';
    1.16  
    1.17 -    snprintf(s, sizeof(s), "xen-%d.%d-ia54 ", major, minor);
    1.18 -    safe_strcat(info, s);
    1.19 +    snprintf(s, sizeof(s), "xen-%d.%d-ia64 ", major, minor);
    1.20 +    safe_strcat(*info, s);
    1.21  
    1.22      if (vmx_enabled)
    1.23      {
    1.24          snprintf(s, sizeof(s), "hvm-%d.%d-ia64 ", major, minor);
    1.25 -        safe_strcat(info, s);
    1.26 +        safe_strcat(*info, s);
    1.27      }
    1.28  }
    1.29  
     2.1 --- a/xen/arch/powerpc/setup.c	Tue Jan 30 18:30:18 2007 +0000
     2.2 +++ b/xen/arch/powerpc/setup.c	Wed Jan 31 10:11:26 2007 +0000
     2.3 @@ -444,8 +444,8 @@ void __init __start_xen_ppc(
     2.4  
     2.5  }
     2.6  
     2.7 -extern void arch_get_xen_caps(xen_capabilities_info_t info);
     2.8 -void arch_get_xen_caps(xen_capabilities_info_t info)
     2.9 +extern void arch_get_xen_caps(xen_capabilities_info_t *info);
    2.10 +void arch_get_xen_caps(xen_capabilities_info_t *info)
    2.11  {
    2.12  }
    2.13  
     3.1 --- a/xen/arch/x86/setup.c	Tue Jan 30 18:30:18 2007 +0000
     3.2 +++ b/xen/arch/x86/setup.c	Wed Jan 31 10:11:26 2007 +0000
     3.3 @@ -800,52 +800,52 @@ void __init __start_xen(multiboot_info_t
     3.4      startup_cpu_idle_loop();
     3.5  }
     3.6  
     3.7 -void arch_get_xen_caps(xen_capabilities_info_t info)
     3.8 +void arch_get_xen_caps(xen_capabilities_info_t *info)
     3.9  {
    3.10      int major = xen_major_version();
    3.11      int minor = xen_minor_version();
    3.12      char s[32];
    3.13  
    3.14 -    info[0] = '\0';
    3.15 +    (*info)[0] = '\0';
    3.16  
    3.17  #if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE)
    3.18  
    3.19      snprintf(s, sizeof(s), "xen-%d.%d-x86_32 ", major, minor);
    3.20 -    safe_strcat(info, s);
    3.21 +    safe_strcat(*info, s);
    3.22      if ( hvm_enabled )
    3.23      {
    3.24          snprintf(s, sizeof(s), "hvm-%d.%d-x86_32 ", major, minor);
    3.25 -        safe_strcat(info, s);
    3.26 +        safe_strcat(*info, s);
    3.27      }
    3.28  
    3.29  #elif defined(CONFIG_X86_32) && defined(CONFIG_X86_PAE)
    3.30  
    3.31      snprintf(s, sizeof(s), "xen-%d.%d-x86_32p ", major, minor);
    3.32 -    safe_strcat(info, s);
    3.33 +    safe_strcat(*info, s);
    3.34      if ( hvm_enabled )
    3.35      {
    3.36          snprintf(s, sizeof(s), "hvm-%d.%d-x86_32 ", major, minor);
    3.37 -        safe_strcat(info, s);
    3.38 +        safe_strcat(*info, s);
    3.39          snprintf(s, sizeof(s), "hvm-%d.%d-x86_32p ", major, minor);
    3.40 -        safe_strcat(info, s);
    3.41 +        safe_strcat(*info, s);
    3.42      }
    3.43  
    3.44  #elif defined(CONFIG_X86_64)
    3.45  
    3.46      snprintf(s, sizeof(s), "xen-%d.%d-x86_64 ", major, minor);
    3.47 -    safe_strcat(info, s);
    3.48 +    safe_strcat(*info, s);
    3.49  #ifdef CONFIG_COMPAT
    3.50      snprintf(s, sizeof(s), "xen-%d.%d-x86_32p ", major, minor);
    3.51 -    safe_strcat(info, s);
    3.52 +    safe_strcat(*info, s);
    3.53  #endif
    3.54      if ( hvm_enabled )
    3.55      {
    3.56          snprintf(s, sizeof(s), "hvm-%d.%d-x86_32 ", major, minor);
    3.57 -        safe_strcat(info, s);
    3.58 +        safe_strcat(*info, s);
    3.59          snprintf(s, sizeof(s), "hvm-%d.%d-x86_32p ", major, minor);
    3.60 -        safe_strcat(info, s);
    3.61 +        safe_strcat(*info, s);
    3.62          snprintf(s, sizeof(s), "hvm-%d.%d-x86_64 ", major, minor);
    3.63 -        safe_strcat(info, s);
    3.64 +        safe_strcat(*info, s);
    3.65      }
    3.66  
    3.67  #endif
     4.1 --- a/xen/common/kernel.c	Tue Jan 30 18:30:18 2007 +0000
     4.2 +++ b/xen/common/kernel.c	Wed Jan 31 10:11:26 2007 +0000
     4.3 @@ -162,10 +162,10 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDL
     4.4      case XENVER_capabilities:
     4.5      {
     4.6          xen_capabilities_info_t info;
     4.7 -        extern void arch_get_xen_caps(xen_capabilities_info_t info);
     4.8 +        extern void arch_get_xen_caps(xen_capabilities_info_t *info);
     4.9  
    4.10          memset(info, 0, sizeof(info));
    4.11 -        arch_get_xen_caps(info);
    4.12 +        arch_get_xen_caps(&info);
    4.13  
    4.14          if ( copy_to_guest(arg, (char *)info, sizeof(info)) )
    4.15              return -EFAULT;