From: Alistair Francis <alistair23@gmail.com>
To: Jim Shu <jim.shu@sifive.com>
Cc: qemu-devel@nongnu.org, qemu-riscv@nongnu.org,
Alistair Francis <Alistair.Francis@wdc.com>,
Bin Meng <bin.meng@windriver.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
chigot@adacore.com, Emmanuel Blot <emmanuel.blot@sifive.com>
Subject: Re: [PATCH v3 1/2] hw/intc: sifive_plic: fix hard-coded max priority level
Date: Tue, 11 Oct 2022 15:47:31 +1000 [thread overview]
Message-ID: <CAKmqyKMTv-KXrPmDiKuthiRuhd1PB55GRsxYRWuHvT5_+ZaOrw@mail.gmail.com> (raw)
In-Reply-To: <20221003041440.2320-2-jim.shu@sifive.com>
On Mon, Oct 3, 2022 at 2:16 PM Jim Shu <jim.shu@sifive.com> wrote:
>
> The maximum priority level is hard-coded when writing to interrupt
> priority register. However, when writing to priority threshold register,
> the maximum priority level is from num_priorities Property which is
> configured by platform.
>
> Also change interrupt priority register to use num_priorities Property
> in maximum priority level.
>
> Signed-off-by: Emmanuel Blot <emmanuel.blot@sifive.com>
> Signed-off-by: Jim Shu <jim.shu@sifive.com>
> Reviewed-by: Frank Chang <frank.chang@sifive.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> hw/intc/sifive_plic.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/hw/intc/sifive_plic.c b/hw/intc/sifive_plic.c
> index af4ae3630e..f864efa761 100644
> --- a/hw/intc/sifive_plic.c
> +++ b/hw/intc/sifive_plic.c
> @@ -180,8 +180,10 @@ static void sifive_plic_write(void *opaque, hwaddr addr, uint64_t value,
> if (addr_between(addr, plic->priority_base, plic->num_sources << 2)) {
> uint32_t irq = ((addr - plic->priority_base) >> 2) + 1;
>
> - plic->source_priority[irq] = value & 7;
> - sifive_plic_update(plic);
> + if (value <= plic->num_priorities) {
> + plic->source_priority[irq] = value;
> + sifive_plic_update(plic);
> + }
> } else if (addr_between(addr, plic->pending_base,
> plic->num_sources >> 3)) {
> qemu_log_mask(LOG_GUEST_ERROR,
> --
> 2.17.1
>
>
next prev parent reply other threads:[~2022-10-11 6:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-03 4:14 [PATCH v3 0/2] Enhance maximum priority support of PLIC Jim Shu
2022-10-03 4:14 ` [PATCH v3 1/2] hw/intc: sifive_plic: fix hard-coded max priority level Jim Shu
2022-10-11 5:47 ` Alistair Francis [this message]
2022-10-03 4:14 ` [PATCH v3 2/2] hw/intc: sifive_plic: change interrupt priority register to WARL field Jim Shu
2022-10-03 7:07 ` Clément Chigot
2022-10-11 5:50 ` Alistair Francis
2022-10-11 5:16 ` [PATCH v3 0/2] Enhance maximum priority support of PLIC Jim Shu
2022-10-11 22:47 ` Alistair Francis
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=CAKmqyKMTv-KXrPmDiKuthiRuhd1PB55GRsxYRWuHvT5_+ZaOrw@mail.gmail.com \
--to=alistair23@gmail.com \
--cc=Alistair.Francis@wdc.com \
--cc=bin.meng@windriver.com \
--cc=chigot@adacore.com \
--cc=emmanuel.blot@sifive.com \
--cc=jim.shu@sifive.com \
--cc=palmer@dabbelt.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.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 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).