From: Stefan Weil <sw@weilnetz.de>
To: Waldemar Brodkorb <wbx@openadk.org>, qemu-devel@nongnu.org
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Subject: Re: [Qemu-devel] [PATCH] qemu-m68k: add support for interrupt masking/unmasking
Date: Sun, 22 Mar 2015 10:49:30 +0100 [thread overview]
Message-ID: <550E902A.3080202@weilnetz.de> (raw)
In-Reply-To: <20150322090902.GA8451@waldemar-brodkorb.de>
Technically this implementation looks reasonable. I added some remarks
below.
Am 22.03.2015 um 10:09 schrieb Waldemar Brodkorb:
> Fixes following problem, when trying to boot linux:
> qemu: hardware error: mcf_intc_write: Bad write offset 28
>
> CPU #0:
> D0 = 000000ff A0 = 402ea5dc F0 = 0000000000000000 ( 0)
> D1 = 00000004 A1 = 402ea5e0 F1 = 0000000000000000 ( 0)
> D2 = 00000040 A2 = 40040752 F2 = 0000000000000000 ( 0)
> D3 = 00000000 A3 = 40040a98 F3 = 0000000000000000 ( 0)
> D4 = 00000000 A4 = 400407b4 F4 = 0000000000000000 ( 0)
> D5 = 00000000 A5 = 00000000 F5 = 0000000000000000 ( 0)
> D6 = 00000000 A6 = 40195ff8 F6 = 0000000000000000 ( 0)
> D7 = 00000000 A7 = 40195fd0 F7 = 0000000000000000 ( 0)
> PC = 401b2058 SR = 2704 --Z-- FPRESULT = 0
> Aborted
>
> System started via:
> qemu-system-m68k -nographic -nographic -M mcf5208evb -cpu m5208 -kernel kernel
>
> Patch originally posted here:
> http://lists.busybox.net/pipermail/buildroot/2012-April/052585.html
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Tested-by: Waldemar Brodkorb <wbx@openadk.org>
> Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> ---
> hw/m68k/mcf_intc.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/hw/m68k/mcf_intc.c b/hw/m68k/mcf_intc.c
> index 621423c..1d161b1 100644
> --- a/hw/m68k/mcf_intc.c
> +++ b/hw/m68k/mcf_intc.c
> @@ -65,6 +65,10 @@ static uint64_t mcf_intc_read(void *opaque, hwaddr addr,
> return (uint32_t)(s->ifr >> 32);
> case 0x14:
> return (uint32_t)s->ifr;
> + /* Reading from SIMR and CIMR return 0 */
Maybe this comment is not needed if the following code is changed (see
below).
> + case 0x1c:
Add /* SIMR */ comment behind case statement like it was done for SWIACK.
Then either add a /* fall through */ comment or a return 0 (to satisfy
static
code analyzers).
> + case 0x1d:
Dto. for CIMR.
> + return 0;
> case 0xe0: /* SWIACK. */
> return s->active_vector;
> case 0xe1: case 0xe2: case 0xe3: case 0xe4:
> @@ -102,6 +106,20 @@ static void mcf_intc_write(void *opaque, hwaddr addr,
> case 0x0c:
> s->imr = (s->imr & 0xffffffff00000000ull) | (uint32_t)val;
> break;
> + /* SIMR allows to easily mask interrupts */
> + case 0x1c:
> + if (val & 0x40)
> + s->imr = ~0ull;
UINT64_MAX
> + else
> + s->imr |= (1 << (val & 0x3f));
The QEMU coding style requires {}.
> + break;
> + /* CIMR allows to easily unmask interrupts */
> + case 0x1d:
> + if (val & 0x40)
> + s->imr = 0ull;
> + else
> + s->imr &= ~(1 << (val & 0x3f));
Dto.
> + break;
> default:
> hw_error("mcf_intc_write: Bad write offset %d\n", offset);
> break;
next prev parent reply other threads:[~2015-03-22 9:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-22 9:09 [Qemu-devel] [PATCH] qemu-m68k: add support for interrupt masking/unmasking Waldemar Brodkorb
2015-03-22 9:49 ` Stefan Weil [this message]
2015-03-22 11:43 ` Peter Maydell
2015-03-22 11:40 ` Peter Maydell
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=550E902A.3080202@weilnetz.de \
--to=sw@weilnetz.de \
--cc=qemu-devel@nongnu.org \
--cc=thomas.petazzoni@free-electrons.com \
--cc=wbx@openadk.org \
/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 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.