[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#425393: linux-2.6: [s390] kernel panic while loading initramfs (hercules emulator)



On Tuesday 22 May 2007 14:11, Michael Holzheu wrote:
> Could you please check, if the following patch fixes your problem?

Yes, with this patch applied to 2.6.22-rc2 hercules boots correctly.

Thanks a lot for the quick response.

> Index: hypfs_diag.c
> ===================================================================
> RCS file: /home/cvs/linux-2.5/arch/s390/hypfs/hypfs_diag.c,v
> retrieving revision 1.10
> diff -a -u -r1.10 hypfs_diag.c
> --- hypfs_diag.c  8 Dec 2006 16:31:51 -0000     1.10
> +++ hypfs_diag.c  21 May 2007 15:37:21 -0000
> @@ -481,9 +481,17 @@
>
>  /* Diagnose 224 functions */
>
> -static void diag224(void *ptr)
> +static int diag224(void *ptr)
>  {
> -     asm volatile("diag %0,%1,0x224" : :"d" (0), "d"(ptr) : "memory");
> +     int rc = -ENOTSUPP;
> +
> +     asm volatile(
> +           "     diag  %1,%2,0x224\n"
> +           "0:   lhi   %0,0x0\n"
> +           "1:\n"
> +           EX_TABLE(0b,1b)
> +           : "+d" (rc) :"d" (0), "d" (ptr) : "memory");
> +     return rc;
>  }
>
>  static int diag224_get_name_table(void)
> @@ -492,7 +500,10 @@
>       diag224_cpu_names = kmalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);
>       if (!diag224_cpu_names)
>             return -ENOMEM;
> -     diag224(diag224_cpu_names);
> +     if (diag224(diag224_cpu_names)) {
> +           kfree(diag224_cpu_names);
> +           return -ENOTSUPP;
> +     }
>       EBCASC(diag224_cpu_names + 16, (*diag224_cpu_names + 1) * 16);
>       return 0;
>  }



Reply to: