qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Cc: kvm-ppc@vger.kernel.org, Liu Yu <yu.liu@freescale.com>,
	hollisb@us.ibm.com, aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH 1/5] kvm/powerpc: Enable MPIC for E500 platform.
Date: Tue, 17 Feb 2009 16:55:51 +0200	[thread overview]
Message-ID: <f43fc5580902170655w4dadb1aem31bf8d5d6742d50e@mail.gmail.com> (raw)
In-Reply-To: <1234864778-19099-2-git-send-email-yu.liu@freescale.com>

On 2/17/09, Liu Yu <yu.liu@freescale.com> wrote:
> MPIC and OpenPIC have very similar design.
>  So a lot of code can be reused.
>
>  Modification mainly include:
>  1. keep struct openpic_t to the maximum size of both MPIC and OpenPIC.
>  2. endianess swap.
>    MPIC has the same endianess as target, so no need to swap for MPIC.

I don't think this is correct, the host can still be different endian
from target.

>  3. using different init functions and function pointers for reset and irq raise.

You didn't register the reset handler with qemu_register_reset.

>  Haven't test OpenPIC.
>
>  Signed-off-by: Liu Yu <yu.liu@freescale.com>

>  +static void mpic_src_write (void *opaque, uint32_t addr, uint32_t val)

>  +    if (addr < 0x180) {
>  +        idx = MPIC_EXT_IRQ;
>  +    } else if (addr >= 0x200 && addr < 0xa00) {
>  +        idx = MPIC_INT_IRQ;
>  +        addr -= 0x200;
>  +    } else if (addr >= 0x1600 && addr < 0x1700) {
>  +        idx = MPIC_MSG_IRQ;
>  +        addr -= 0x1600;
>  +    } else if (addr >= 0x1C00 && addr < 0x1D00) {
>  +        idx = MPIC_MSI_IRQ;
>  +        addr -= 0x1C00;
>  +    } else {
>  +        return;

It would be faster and simpler to register different handlers for
these memory areas, same goes for mpic_src_read, mpic_writel and
mpic_readl.

>  +    register_savevm("mpic", 0, 1, openpic_save, openpic_load,  mpp);

When the save format changes, the version number should be bumped.

  parent reply	other threads:[~2009-02-17 14:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-17  9:59 [Qemu-devel] powerpc/kvm: Add MPC8544DS board support Liu Yu
2009-02-17  9:59 ` [Qemu-devel] [PATCH 1/5] kvm/powerpc: Enable MPIC for E500 platform Liu Yu
2009-02-17  9:59   ` [Qemu-devel] [PATCH 2/5] kvm/powerpc: Add freescale pci controller's support Liu Yu
2009-02-17  9:59     ` [Qemu-devel] [PATCH 3/5] kvm/powerpc: Add irq support for E500 core Liu Yu
2009-02-17  9:59       ` [Qemu-devel] [PATCH 4/5] kvm/powerpc: Add MPC8544DS board support Liu Yu
2009-02-17  9:59         ` [Qemu-devel] [PATCH 5/5] kvm/powerpc: flat device tree files for MPC8544DS Liu Yu
2009-02-17 15:28         ` [Qemu-devel] [PATCH 4/5] kvm/powerpc: Add MPC8544DS board support Blue Swirl
2009-02-18  7:01           ` Liu Yu-B13201
2009-02-17 15:09     ` [Qemu-devel] [PATCH 2/5] kvm/powerpc: Add freescale pci controller's support Blue Swirl
2009-02-17 16:08       ` M. Warner Losh
2009-02-17 16:23         ` M. Warner Losh
2009-02-17 17:41           ` Jamie Lokier
2009-02-18  6:04       ` Liu Yu-B13201
2009-02-17 14:55   ` Blue Swirl [this message]
2009-02-18  7:17     ` [Qemu-devel] [PATCH 1/5] kvm/powerpc: Enable MPIC for E500 platform Liu Yu-B13201
2009-02-19 22:41     ` Aurelien Jarno
2009-02-20 17:20       ` Blue Swirl
2009-02-19 23:09   ` Paulev
  -- strict thread matches above, loose matches on Subject: below --
2009-02-26 10:35 [Qemu-devel] [PATCH v4 0/5] powerpc/kvm: Add MPC8544DS board support Liu Yu
2009-02-26 10:35 ` [Qemu-devel] [PATCH 1/5] kvm/powerpc: Enable MPIC for E500 platform Liu Yu

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=f43fc5580902170655w4dadb1aem31bf8d5d6742d50e@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=aurelien@aurel32.net \
    --cc=hollisb@us.ibm.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    --cc=yu.liu@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).