From: Scott Wood <scottwood@freescale.com>
To: Bharat Bhushan <r65777@freescale.com>
Cc: agraf@suse.de, stuart.yoder@freescale.com, qemu-devel@nongnu.org,
Bharat Bhushan <bharat.bhushan@freescale.com>,
qemu-ppc@nongnu.org, david@gibson.dropbear.id.au
Subject: Re: [Qemu-devel] [PATCH v2] ppc: initialize GPRs as per epapr
Date: Mon, 29 Apr 2013 12:50:35 -0500 [thread overview]
Message-ID: <1367257835.32182.2@snotra> (raw)
In-Reply-To: <1367246456-22382-1-git-send-email-Bharat.Bhushan@freescale.com> (from r65777@freescale.com on Mon Apr 29 09:40:56 2013)
On 04/29/2013 09:40:56 AM, Bharat Bhushan wrote:
> ePAPR defines the initial values of cpu registers.
> This patch initialize the GPRs as per ePAPR specification.
>
> This resolves the issue of guest reboot/reset (guest hang on reboot).
>
> Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
> ---
> v1-->v2
> - Dynemic seting of initial map size in gpr[7]
> - For this the tlb size calculation is moved into a function.
>
> hw/ppc/e500.c | 29 ++++++++++++++++++++++++++---
> 1 files changed, 26 insertions(+), 3 deletions(-)
>
> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
> index c1bdb6b..decd86c 100644
> --- a/hw/ppc/e500.c
> +++ b/hw/ppc/e500.c
> @@ -37,6 +37,7 @@
> #include "qemu/host-utils.h"
> #include "hw/pci-host/ppce500.h"
>
> +#define EPAPR_MAGIC (0x45504150)
> #define BINARY_DEVICE_TREE_FILE "mpc8544ds.dtb"
> #define UIMAGE_LOAD_BASE 0
> #define DTC_LOAD_PAD 0x1800000
> @@ -393,11 +394,10 @@ static inline hwaddr
> booke206_page_size_to_tlb(uint64_t size)
> return 63 - clz64(size >> 10);
> }
>
> -static void mmubooke_create_initial_mapping(CPUPPCState *env)
> +static int booke206_initial_map_tsize(CPUPPCState *env)
> {
> struct boot_info *bi = env->load_info;
> - ppcmas_tlb_t *tlb = booke206_get_tlbm(env, 1, 0, 0);
> - hwaddr size, dt_end;
> + hwaddr dt_end;
> int ps;
>
> /* Our initial TLB entry needs to cover everything from 0 to
> @@ -408,6 +408,23 @@ static void
> mmubooke_create_initial_mapping(CPUPPCState *env)
> /* e500v2 can only do even TLB size bits */
> ps++;
> }
> + return ps;
> +}
> +static uint64_t mmubooke_initial_mapsize(CPUPPCState *env)
Please leave a blank line after each of those } lines.
You change the function name to look like it's simply returning
information, but it still creates the TLB entry as far as I can see.
Then you go calling it multiple times (why?). This may not be harmful,
but it is ugly.
> +{
> + int tsize;
> +
> + tsize = booke206_initial_map_tsize(env);
> + return (1ULL << 10 << tsize);
> +}
What value does this wrapper have? The caller needs both the "tsize"
and the size in bytes, and you only call this wrapper once, so let the
caller do the conversion instead.
-Scott
next prev parent reply other threads:[~2013-04-29 17:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-29 14:40 [Qemu-devel] [PATCH v2] ppc: initialize GPRs as per epapr Bharat Bhushan
2013-04-29 17:50 ` Scott Wood [this message]
2013-04-29 19:10 ` Bhushan Bharat-R65777
2013-04-29 19:16 ` Scott Wood
2013-04-30 10:03 ` Alexander Graf
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=1367257835.32182.2@snotra \
--to=scottwood@freescale.com \
--cc=agraf@suse.de \
--cc=bharat.bhushan@freescale.com \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=r65777@freescale.com \
--cc=stuart.yoder@freescale.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).