qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Leon Alrae <leon.alrae@imgtec.com>
To: qemu-devel@nongnu.org
Cc: yongbok.kim@imgtec.com, cristian.cuna@imgtec.com,
	james.hogan@imgtec.com, Leon Alrae <leon.alrae@imgtec.com>,
	aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH] hw/mips: align initrd to 64KB to avoid kernel error
Date: Wed, 24 Jul 2013 17:24:36 +0100	[thread overview]
Message-ID: <51EFFFC4.2040405@imgtec.com> (raw)
In-Reply-To: <51DD7760.3050707@imgtec.com>

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 */
> 

  reply	other threads:[~2013-07-24 16:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2013-07-28 22:28 ` Aurelien Jarno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51EFFFC4.2040405@imgtec.com \
    --to=leon.alrae@imgtec.com \
    --cc=aurelien@aurel32.net \
    --cc=cristian.cuna@imgtec.com \
    --cc=james.hogan@imgtec.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yongbok.kim@imgtec.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).