qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: anthony.perard@citrix.com
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Xen Devel <xen-devel@lists.xensource.com>,
	QEMU-devel <qemu-devel@nongnu.org>,
	Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH V13 05/17] pc_memory_init: Move memory calculation to the caller.
Date: Mon, 18 Apr 2011 14:12:35 +0200	[thread overview]
Message-ID: <4DAC2AB3.4060502@siemens.com> (raw)
In-Reply-To: <1303126637-31877-6-git-send-email-anthony.perard@citrix.com>

On 2011-04-18 13:37, anthony.perard@citrix.com wrote:
> From: Anthony PERARD <anthony.perard@citrix.com>
> 
> This patch moves above_4g_mem_size and below_4g_mem_size calculation in
> the caller of pc_memory_init (pc_init1). And the prototype of
> pc_memory_init is changed because there is no need anymore to have
> variable pointer.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
>  hw/pc.c      |   14 ++------------
>  hw/pc.h      |    4 ++--
>  hw/pc_piix.c |   11 +++++++++--
>  3 files changed, 13 insertions(+), 16 deletions(-)
> 
> diff --git a/hw/pc.c b/hw/pc.c
> index 6939c04..18b96cc 100644
> --- a/hw/pc.c
> +++ b/hw/pc.c
> @@ -961,25 +961,15 @@ void pc_memory_init(ram_addr_t ram_size,
>                      const char *kernel_filename,
>                      const char *kernel_cmdline,
>                      const char *initrd_filename,
> -                    ram_addr_t *below_4g_mem_size_p,
> -                    ram_addr_t *above_4g_mem_size_p)
> +                    ram_addr_t below_4g_mem_size,
> +                    ram_addr_t above_4g_mem_size)
>  {
>      char *filename;
>      int ret, linux_boot, i;
>      ram_addr_t ram_addr, bios_offset, option_rom_offset;
> -    ram_addr_t below_4g_mem_size, above_4g_mem_size = 0;
>      int bios_size, isa_bios_size;
>      void *fw_cfg;
>  
> -    if (ram_size >= 0xe0000000 ) {
> -        above_4g_mem_size = ram_size - 0xe0000000;
> -        below_4g_mem_size = 0xe0000000;
> -    } else {
> -        below_4g_mem_size = ram_size;
> -    }
> -    *above_4g_mem_size_p = above_4g_mem_size;
> -    *below_4g_mem_size_p = below_4g_mem_size;
> -

This obsoletes the ram_size parameter. Please drop it.

>      linux_boot = (kernel_filename != NULL);
>  
>      /* allocate RAM */
> diff --git a/hw/pc.h b/hw/pc.h
> index feb8a7a..35bb890 100644
> --- a/hw/pc.h
> +++ b/hw/pc.h
> @@ -133,8 +133,8 @@ void pc_memory_init(ram_addr_t ram_size,
>                      const char *kernel_filename,
>                      const char *kernel_cmdline,
>                      const char *initrd_filename,
> -                    ram_addr_t *below_4g_mem_size_p,
> -                    ram_addr_t *above_4g_mem_size_p);
> +                    ram_addr_t below_4g_mem_size,
> +                    ram_addr_t above_4g_mem_size);
>  qemu_irq *pc_allocate_cpu_irq(void);
>  void pc_vga_init(PCIBus *pci_bus);
>  void pc_basic_device_init(qemu_irq *isa_irq,
> diff --git a/hw/pc_piix.c b/hw/pc_piix.c
> index a85214b..e487c38 100644
> --- a/hw/pc_piix.c
> +++ b/hw/pc_piix.c
> @@ -72,7 +72,7 @@ static void pc_init1(ram_addr_t ram_size,
>                       int kvmclock_enabled)
>  {
>      int i;
> -    ram_addr_t below_4g_mem_size, above_4g_mem_size;
> +    ram_addr_t below_4g_mem_size, above_4g_mem_size = 0;
>      PCIBus *pci_bus;
>      PCII440FXState *i440fx_state;
>      int piix3_devfn = -1;
> @@ -92,9 +92,16 @@ static void pc_init1(ram_addr_t ram_size,
>          kvmclock_create();
>      }
>  
> +    if (ram_size >= 0xe0000000 ) {
> +        above_4g_mem_size = ram_size - 0xe0000000;
> +        below_4g_mem_size = 0xe0000000;
> +    } else {
> +        below_4g_mem_size = ram_size;

Let's initialize above_4g_mem_size here.

> +    }
> +
>      /* allocate ram and load rom/bios */
>      pc_memory_init(ram_size, kernel_filename, kernel_cmdline, initrd_filename,
> -                   &below_4g_mem_size, &above_4g_mem_size);
> +                   below_4g_mem_size, above_4g_mem_size);
>  
>      cpu_irq = pc_allocate_cpu_irq();
>      i8259 = i8259_init(cpu_irq[0]);

Looks good otherwise.

Thanks,
Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

  reply	other threads:[~2011-04-18 12:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-18 11:37 [Qemu-devel] [PATCH V13 00/17] Xen device model support anthony.perard
2011-04-18 11:37 ` [Qemu-devel] [PATCH V13 01/17] xen: Replace some tab-indents with spaces (clean-up) anthony.perard
2011-04-18 11:37 ` [Qemu-devel] [PATCH V13 02/17] xen: Make Xen build once anthony.perard
2011-04-18 11:37 ` [Qemu-devel] [PATCH V13 03/17] xen: Support new libxc calls from xen unstable anthony.perard
2011-04-18 11:37 ` [Qemu-devel] [PATCH V13 04/17] xen: Add initialisation of Xen anthony.perard
2011-04-18 11:37 ` [Qemu-devel] [PATCH V13 05/17] pc_memory_init: Move memory calculation to the caller anthony.perard
2011-04-18 12:12   ` Jan Kiszka [this message]
2011-04-18 11:37 ` [Qemu-devel] [PATCH V13 06/17] xen: Add xenfv machine anthony.perard
2011-04-18 11:37 ` [Qemu-devel] [PATCH V13 07/17] piix_pci: Introduces Xen specific call for irq anthony.perard
2011-04-18 11:37 ` [Qemu-devel] [PATCH V13 08/17] xen: Introduce Xen Interrupt Controller anthony.perard
2011-04-18 11:37 ` [Qemu-devel] [PATCH V13 09/17] xen: Introduce the Xen mapcache anthony.perard
2011-04-18 11:37 ` [Qemu-devel] [PATCH V13 10/17] xen: Adds a cap to the number of map cache entries anthony.perard
2011-04-18 11:37 ` [Qemu-devel] [PATCH V13 11/17] Introduce qemu_put_ram_ptr anthony.perard
2011-04-18 11:37 ` [Qemu-devel] [PATCH V13 12/17] configure: Always use 64bits target physical addresses with xen enabled anthony.perard
2011-04-18 11:37 ` [Qemu-devel] [PATCH V13 13/17] pci: Use of qemu_put_ram_ptr in pci_add_option_rom anthony.perard
2011-04-18 11:37 ` [Qemu-devel] [PATCH V13 14/17] vl.c: Introduce getter for shutdown_requested and reset_requested anthony.perard
2011-04-18 11:37 ` [Qemu-devel] [PATCH V13 15/17] xen: Initialize event channels and io rings anthony.perard
2011-04-18 11:37 ` [Qemu-devel] [PATCH V13 16/17] xen: Set running state in xenstore anthony.perard
2011-04-18 11:37 ` [Qemu-devel] [PATCH V13 17/17] xen: Add Xen hypercall for sleep state in the cmos_s3 callback anthony.perard

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=4DAC2AB3.4060502@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=agraf@suse.de \
    --cc=anthony.perard@citrix.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.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).