All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/mips: align initrd to 64KB to avoid kernel error
@ 2013-06-27  7:35 Leon Alrae
  2013-06-27  8:12 ` Peter Maydell
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Leon Alrae @ 2013-06-27  7:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: yongbok.kim, cristian.cuna, james.hogan, leon.alrae, aurelien

From: James Hogan <james.hogan@imgtec.com>

The Linux kernel can be configured to use 64KB pages, but it also
requires initrd to be page aligned. Therefore, to be safe, align the
initrd to 64KB using a new INITRD_PAGE_MASK rather than
TARGET_PAGE_MASK.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
---
 hw/mips/mips_fulong2e.c |    2 +-
 hw/mips/mips_malta.c    |    2 +-
 hw/mips/mips_mipssim.c  |    2 +-
 hw/mips/mips_r4k.c      |    2 +-
 include/hw/mips/mips.h  |    3 +++
 5 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index 1aac93a..c03a4f2 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -126,7 +126,7 @@ static int64_t load_kernel (CPUMIPSState *env)
     if (loaderparams.initrd_filename) {
         initrd_size = get_image_size (loaderparams.initrd_filename);
         if (initrd_size > 0) {
-            initrd_offset = (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK;
+            initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK;
             if (initrd_offset + initrd_size > ram_size) {
                 fprintf(stderr,
                         "qemu: memory too small for initial ram disk '%s'\n",
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index 5033d51..526a122 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -699,7 +699,7 @@ static int64_t load_kernel (void)
     if (loaderparams.initrd_filename) {
         initrd_size = get_image_size (loaderparams.initrd_filename);
         if (initrd_size > 0) {
-            initrd_offset = (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK;
+            initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK;
             if (initrd_offset + initrd_size > ram_size) {
                 fprintf(stderr,
                         "qemu: memory too small for initial ram disk '%s'\n",
diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c
index d1681ec..3f54e64 100644
--- a/hw/mips/mips_mipssim.c
+++ b/hw/mips/mips_mipssim.c
@@ -83,7 +83,7 @@ static int64_t load_kernel(void)
     if (loaderparams.initrd_filename) {
         initrd_size = get_image_size (loaderparams.initrd_filename);
         if (initrd_size > 0) {
-            initrd_offset = (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK;
+            initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK;
             if (initrd_offset + initrd_size > loaderparams.ram_size) {
                 fprintf(stderr,
                         "qemu: memory too small for initial ram disk '%s'\n",
diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
index 4646ab6..fb7eb14 100644
--- a/hw/mips/mips_r4k.c
+++ b/hw/mips/mips_r4k.c
@@ -102,7 +102,7 @@ static int64_t load_kernel(void)
     if (loaderparams.initrd_filename) {
         initrd_size = get_image_size (loaderparams.initrd_filename);
         if (initrd_size > 0) {
-            initrd_offset = (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK;
+            initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK;
             if (initrd_offset + initrd_size > ram_size) {
                 fprintf(stderr,
                         "qemu: memory too small for initial ram disk '%s'\n",
diff --git a/include/hw/mips/mips.h b/include/hw/mips/mips.h
index 291e85f..2a7a9c9 100644
--- a/include/hw/mips/mips.h
+++ b/include/hw/mips/mips.h
@@ -2,6 +2,9 @@
 #define HW_MIPS_H
 /* Definitions for mips board emulation.  */
 
+/* Kernels can be configured with 64KB pages */
+#define INITRD_PAGE_MASK (~((1 << 16) - 1))
+
 #include "exec/memory.h"
 
 /* gt64xxx.c */
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/mips: align initrd to 64KB to avoid kernel error
  2013-06-27  7:35 [Qemu-devel] [PATCH] hw/mips: align initrd to 64KB to avoid kernel error Leon Alrae
@ 2013-06-27  8:12 ` Peter Maydell
  2013-06-27  9:40   ` James Hogan
  2013-07-10 15:01 ` Leon Alrae
  2013-07-28 22:28 ` Aurelien Jarno
  2 siblings, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2013-06-27  8:12 UTC (permalink / raw)
  To: Leon Alrae; +Cc: yongbok.kim, cristian.cuna, james.hogan, qemu-devel, aurelien

On 27 June 2013 08:35, Leon Alrae <leon.alrae@imgtec.com> wrote:
> From: James Hogan <james.hogan@imgtec.com>
>
> The Linux kernel can be configured to use 64KB pages, but it also
> requires initrd to be page aligned. Therefore, to be safe, align the
> initrd to 64KB using a new INITRD_PAGE_MASK rather than
> TARGET_PAGE_MASK.

This is kind of similar to the ARM bug fixed in 98ed805c3.
I wonder if we ought to have a per-CPU #define for "largest
possible page alignment for this architecture" as well as
"smallest possible" (the latter being TARGET_PAGE_MASK).

This patch is a reasonable enough way to fix things though,
so I'm not objecting to it.

Aside: given the repetitive nature of the context hunks
observable in this patch, it looks like it ought to be
possible to abstract out some of the initrd/kernel load
code from all those boards...

thanks
-- PMM

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/mips: align initrd to 64KB to avoid kernel error
  2013-06-27  8:12 ` Peter Maydell
@ 2013-06-27  9:40   ` James Hogan
  0 siblings, 0 replies; 6+ messages in thread
From: James Hogan @ 2013-06-27  9:40 UTC (permalink / raw)
  To: Peter Maydell
  Cc: yongbok.kim, cristian.cuna, Leon Alrae, qemu-devel, aurelien

On 27/06/13 09:12, Peter Maydell wrote:
> On 27 June 2013 08:35, Leon Alrae <leon.alrae@imgtec.com> wrote:
>> From: James Hogan <james.hogan@imgtec.com>
>>
>> The Linux kernel can be configured to use 64KB pages, but it also
>> requires initrd to be page aligned. Therefore, to be safe, align the
>> initrd to 64KB using a new INITRD_PAGE_MASK rather than
>> TARGET_PAGE_MASK.
> 
> This is kind of similar to the ARM bug fixed in 98ed805c3.
> I wonder if we ought to have a per-CPU #define for "largest
> possible page alignment for this architecture" as well as
> "smallest possible" (the latter being TARGET_PAGE_MASK).

Yes, very similar. Although "largest possible" is probably quite Linux
specific so I'm not sure where it should really go (some arches support
pages up to 4MB and beyond, but obviously they're never used as basic
pages by Linux).

LINUX_MAXPAGE_MASK?

> This patch is a reasonable enough way to fix things though,
> so I'm not objecting to it.
> 
> Aside: given the repetitive nature of the context hunks
> observable in this patch, it looks like it ought to be
> possible to abstract out some of the initrd/kernel load
> code from all those boards...

That thought did occur to me too :)

Cheers
James

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/mips: align initrd to 64KB to avoid kernel error
  2013-06-27  7:35 [Qemu-devel] [PATCH] hw/mips: align initrd to 64KB to avoid kernel error Leon Alrae
  2013-06-27  8:12 ` Peter Maydell
@ 2013-07-10 15:01 ` Leon Alrae
  2013-07-24 16:24   ` Leon Alrae
  2013-07-28 22:28 ` Aurelien Jarno
  2 siblings, 1 reply; 6+ messages in thread
From: Leon Alrae @ 2013-07-10 15:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: yongbok.kim, cristian.cuna, james.hogan, Leon Alrae, aurelien

ping

http://patchwork.ozlabs.org/patch/255005/

On 27/06/13 08:35, Leon Alrae wrote:
> From: James Hogan <james.hogan@imgtec.com>
> 
> The Linux kernel can be configured to use 64KB pages, but it also
> requires initrd to be page aligned. Therefore, to be safe, align the
> initrd to 64KB using a new INITRD_PAGE_MASK rather than
> TARGET_PAGE_MASK.
> 
> Signed-off-by: James Hogan <james.hogan@imgtec.com>
> Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
> ---
>  hw/mips/mips_fulong2e.c |    2 +-
>  hw/mips/mips_malta.c    |    2 +-
>  hw/mips/mips_mipssim.c  |    2 +-
>  hw/mips/mips_r4k.c      |    2 +-
>  include/hw/mips/mips.h  |    3 +++
>  5 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
> index 1aac93a..c03a4f2 100644
> --- a/hw/mips/mips_fulong2e.c
> +++ b/hw/mips/mips_fulong2e.c
> @@ -126,7 +126,7 @@ static int64_t load_kernel (CPUMIPSState *env)
>      if (loaderparams.initrd_filename) {
>          initrd_size = get_image_size (loaderparams.initrd_filename);
>          if (initrd_size > 0) {
> -            initrd_offset = (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK;
> +            initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK;
>              if (initrd_offset + initrd_size > ram_size) {
>                  fprintf(stderr,
>                          "qemu: memory too small for initial ram disk '%s'\n",
> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
> index 5033d51..526a122 100644
> --- a/hw/mips/mips_malta.c
> +++ b/hw/mips/mips_malta.c
> @@ -699,7 +699,7 @@ static int64_t load_kernel (void)
>      if (loaderparams.initrd_filename) {
>          initrd_size = get_image_size (loaderparams.initrd_filename);
>          if (initrd_size > 0) {
> -            initrd_offset = (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK;
> +            initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK;
>              if (initrd_offset + initrd_size > ram_size) {
>                  fprintf(stderr,
>                          "qemu: memory too small for initial ram disk '%s'\n",
> diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c
> index d1681ec..3f54e64 100644
> --- a/hw/mips/mips_mipssim.c
> +++ b/hw/mips/mips_mipssim.c
> @@ -83,7 +83,7 @@ static int64_t load_kernel(void)
>      if (loaderparams.initrd_filename) {
>          initrd_size = get_image_size (loaderparams.initrd_filename);
>          if (initrd_size > 0) {
> -            initrd_offset = (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK;
> +            initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK;
>              if (initrd_offset + initrd_size > loaderparams.ram_size) {
>                  fprintf(stderr,
>                          "qemu: memory too small for initial ram disk '%s'\n",
> diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
> index 4646ab6..fb7eb14 100644
> --- a/hw/mips/mips_r4k.c
> +++ b/hw/mips/mips_r4k.c
> @@ -102,7 +102,7 @@ static int64_t load_kernel(void)
>      if (loaderparams.initrd_filename) {
>          initrd_size = get_image_size (loaderparams.initrd_filename);
>          if (initrd_size > 0) {
> -            initrd_offset = (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK;
> +            initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK;
>              if (initrd_offset + initrd_size > ram_size) {
>                  fprintf(stderr,
>                          "qemu: memory too small for initial ram disk '%s'\n",
> diff --git a/include/hw/mips/mips.h b/include/hw/mips/mips.h
> index 291e85f..2a7a9c9 100644
> --- a/include/hw/mips/mips.h
> +++ b/include/hw/mips/mips.h
> @@ -2,6 +2,9 @@
>  #define HW_MIPS_H
>  /* Definitions for mips board emulation.  */
>  
> +/* Kernels can be configured with 64KB pages */
> +#define INITRD_PAGE_MASK (~((1 << 16) - 1))
> +
>  #include "exec/memory.h"
>  
>  /* gt64xxx.c */

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/mips: align initrd to 64KB to avoid kernel error
  2013-07-10 15:01 ` Leon Alrae
@ 2013-07-24 16:24   ` Leon Alrae
  0 siblings, 0 replies; 6+ messages in thread
From: Leon Alrae @ 2013-07-24 16:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: yongbok.kim, cristian.cuna, james.hogan, Leon Alrae, aurelien

ping

On 10/07/13 16:01, Leon Alrae wrote:
> ping
> 
> http://patchwork.ozlabs.org/patch/255005/
> 
> On 27/06/13 08:35, Leon Alrae wrote:
>> From: James Hogan <james.hogan@imgtec.com>
>>
>> The Linux kernel can be configured to use 64KB pages, but it also
>> requires initrd to be page aligned. Therefore, to be safe, align the
>> initrd to 64KB using a new INITRD_PAGE_MASK rather than
>> TARGET_PAGE_MASK.
>>
>> Signed-off-by: James Hogan <james.hogan@imgtec.com>
>> Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
>> ---
>>  hw/mips/mips_fulong2e.c |    2 +-
>>  hw/mips/mips_malta.c    |    2 +-
>>  hw/mips/mips_mipssim.c  |    2 +-
>>  hw/mips/mips_r4k.c      |    2 +-
>>  include/hw/mips/mips.h  |    3 +++
>>  5 files changed, 7 insertions(+), 4 deletions(-)
>>
>> diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
>> index 1aac93a..c03a4f2 100644
>> --- a/hw/mips/mips_fulong2e.c
>> +++ b/hw/mips/mips_fulong2e.c
>> @@ -126,7 +126,7 @@ static int64_t load_kernel (CPUMIPSState *env)
>>      if (loaderparams.initrd_filename) {
>>          initrd_size = get_image_size (loaderparams.initrd_filename);
>>          if (initrd_size > 0) {
>> -            initrd_offset = (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK;
>> +            initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK;
>>              if (initrd_offset + initrd_size > ram_size) {
>>                  fprintf(stderr,
>>                          "qemu: memory too small for initial ram disk '%s'\n",
>> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
>> index 5033d51..526a122 100644
>> --- a/hw/mips/mips_malta.c
>> +++ b/hw/mips/mips_malta.c
>> @@ -699,7 +699,7 @@ static int64_t load_kernel (void)
>>      if (loaderparams.initrd_filename) {
>>          initrd_size = get_image_size (loaderparams.initrd_filename);
>>          if (initrd_size > 0) {
>> -            initrd_offset = (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK;
>> +            initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK;
>>              if (initrd_offset + initrd_size > ram_size) {
>>                  fprintf(stderr,
>>                          "qemu: memory too small for initial ram disk '%s'\n",
>> diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c
>> index d1681ec..3f54e64 100644
>> --- a/hw/mips/mips_mipssim.c
>> +++ b/hw/mips/mips_mipssim.c
>> @@ -83,7 +83,7 @@ static int64_t load_kernel(void)
>>      if (loaderparams.initrd_filename) {
>>          initrd_size = get_image_size (loaderparams.initrd_filename);
>>          if (initrd_size > 0) {
>> -            initrd_offset = (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK;
>> +            initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK;
>>              if (initrd_offset + initrd_size > loaderparams.ram_size) {
>>                  fprintf(stderr,
>>                          "qemu: memory too small for initial ram disk '%s'\n",
>> diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
>> index 4646ab6..fb7eb14 100644
>> --- a/hw/mips/mips_r4k.c
>> +++ b/hw/mips/mips_r4k.c
>> @@ -102,7 +102,7 @@ static int64_t load_kernel(void)
>>      if (loaderparams.initrd_filename) {
>>          initrd_size = get_image_size (loaderparams.initrd_filename);
>>          if (initrd_size > 0) {
>> -            initrd_offset = (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK;
>> +            initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK;
>>              if (initrd_offset + initrd_size > ram_size) {
>>                  fprintf(stderr,
>>                          "qemu: memory too small for initial ram disk '%s'\n",
>> diff --git a/include/hw/mips/mips.h b/include/hw/mips/mips.h
>> index 291e85f..2a7a9c9 100644
>> --- a/include/hw/mips/mips.h
>> +++ b/include/hw/mips/mips.h
>> @@ -2,6 +2,9 @@
>>  #define HW_MIPS_H
>>  /* Definitions for mips board emulation.  */
>>  
>> +/* Kernels can be configured with 64KB pages */
>> +#define INITRD_PAGE_MASK (~((1 << 16) - 1))
>> +
>>  #include "exec/memory.h"
>>  
>>  /* gt64xxx.c */
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/mips: align initrd to 64KB to avoid kernel error
  2013-06-27  7:35 [Qemu-devel] [PATCH] hw/mips: align initrd to 64KB to avoid kernel error Leon Alrae
  2013-06-27  8:12 ` Peter Maydell
  2013-07-10 15:01 ` Leon Alrae
@ 2013-07-28 22:28 ` Aurelien Jarno
  2 siblings, 0 replies; 6+ messages in thread
From: Aurelien Jarno @ 2013-07-28 22:28 UTC (permalink / raw)
  To: Leon Alrae; +Cc: yongbok.kim, cristian.cuna, james.hogan, qemu-devel

On Thu, Jun 27, 2013 at 08:35:27AM +0100, Leon Alrae wrote:
> From: James Hogan <james.hogan@imgtec.com>
> 
> The Linux kernel can be configured to use 64KB pages, but it also
> requires initrd to be page aligned. Therefore, to be safe, align the
> initrd to 64KB using a new INITRD_PAGE_MASK rather than
> TARGET_PAGE_MASK.
> 
> Signed-off-by: James Hogan <james.hogan@imgtec.com>
> Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
> ---
>  hw/mips/mips_fulong2e.c |    2 +-
>  hw/mips/mips_malta.c    |    2 +-
>  hw/mips/mips_mipssim.c  |    2 +-
>  hw/mips/mips_r4k.c      |    2 +-
>  include/hw/mips/mips.h  |    3 +++
>  5 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
> index 1aac93a..c03a4f2 100644
> --- a/hw/mips/mips_fulong2e.c
> +++ b/hw/mips/mips_fulong2e.c
> @@ -126,7 +126,7 @@ static int64_t load_kernel (CPUMIPSState *env)
>      if (loaderparams.initrd_filename) {
>          initrd_size = get_image_size (loaderparams.initrd_filename);
>          if (initrd_size > 0) {
> -            initrd_offset = (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK;
> +            initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK;
>              if (initrd_offset + initrd_size > ram_size) {
>                  fprintf(stderr,
>                          "qemu: memory too small for initial ram disk '%s'\n",
> diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
> index 5033d51..526a122 100644
> --- a/hw/mips/mips_malta.c
> +++ b/hw/mips/mips_malta.c
> @@ -699,7 +699,7 @@ static int64_t load_kernel (void)
>      if (loaderparams.initrd_filename) {
>          initrd_size = get_image_size (loaderparams.initrd_filename);
>          if (initrd_size > 0) {
> -            initrd_offset = (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK;
> +            initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK;
>              if (initrd_offset + initrd_size > ram_size) {
>                  fprintf(stderr,
>                          "qemu: memory too small for initial ram disk '%s'\n",
> diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c
> index d1681ec..3f54e64 100644
> --- a/hw/mips/mips_mipssim.c
> +++ b/hw/mips/mips_mipssim.c
> @@ -83,7 +83,7 @@ static int64_t load_kernel(void)
>      if (loaderparams.initrd_filename) {
>          initrd_size = get_image_size (loaderparams.initrd_filename);
>          if (initrd_size > 0) {
> -            initrd_offset = (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK;
> +            initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK;
>              if (initrd_offset + initrd_size > loaderparams.ram_size) {
>                  fprintf(stderr,
>                          "qemu: memory too small for initial ram disk '%s'\n",
> diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
> index 4646ab6..fb7eb14 100644
> --- a/hw/mips/mips_r4k.c
> +++ b/hw/mips/mips_r4k.c
> @@ -102,7 +102,7 @@ static int64_t load_kernel(void)
>      if (loaderparams.initrd_filename) {
>          initrd_size = get_image_size (loaderparams.initrd_filename);
>          if (initrd_size > 0) {
> -            initrd_offset = (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK;
> +            initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK;
>              if (initrd_offset + initrd_size > ram_size) {
>                  fprintf(stderr,
>                          "qemu: memory too small for initial ram disk '%s'\n",
> diff --git a/include/hw/mips/mips.h b/include/hw/mips/mips.h
> index 291e85f..2a7a9c9 100644
> --- a/include/hw/mips/mips.h
> +++ b/include/hw/mips/mips.h
> @@ -2,6 +2,9 @@
>  #define HW_MIPS_H
>  /* Definitions for mips board emulation.  */
>  
> +/* Kernels can be configured with 64KB pages */
> +#define INITRD_PAGE_MASK (~((1 << 16) - 1))
> +
>  #include "exec/memory.h"
>  
>  /* gt64xxx.c */

Thanks, applied.

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-07-28 22:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-27  7:35 [Qemu-devel] [PATCH] hw/mips: align initrd to 64KB to avoid kernel error Leon Alrae
2013-06-27  8:12 ` Peter Maydell
2013-06-27  9:40   ` James Hogan
2013-07-10 15:01 ` Leon Alrae
2013-07-24 16:24   ` Leon Alrae
2013-07-28 22:28 ` Aurelien Jarno

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.