From: Shannon Zhao <zhaoshenglong@huawei.com>
To: Peter Maydell <peter.maydell@linaro.org>, <qemu-arm@nongnu.org>,
<qemu-devel@nongnu.org>
Cc: patches@linaro.org, Shlomo Pongratz <shlomo.pongratz@huawei.com>,
Shlomo Pongratz <shlomopongratz@gmail.com>,
Pavel Fedin <p.fedin@samsung.com>,
Shannon Zhao <shannon.zhao@linaro.org>,
Christoffer Dall <christoffer.dall@linaro.org>
Subject: Re: [Qemu-devel] [PATCH v2 11/22] hw/intc/arm_gicv3: Implement GICv3 distributor registers
Date: Mon, 13 Jun 2016 14:27:05 +0800 [thread overview]
Message-ID: <575E5239.6030408@huawei.com> (raw)
In-Reply-To: <1464274540-19693-12-git-send-email-peter.maydell@linaro.org>
On 2016/5/26 22:55, Peter Maydell wrote:
> +static uint8_t gicd_read_ipriorityr(GICv3State *s, MemTxAttrs attrs, int irq)
> +{
> + /* Read the value of GICD_IPRIORITYR<n> for the specified interrupt,
> + * honouring security state (these are RAZ/WI for Group 0 or Secure
> + * Group 1 interrupts).
> + */
> + uint32_t prio;
> +
> + if (irq < GIC_INTERNAL || irq >= s->num_irq) {
> + return 0;
> + }
> +
> + prio = s->gicd_ipriority[irq];
> +
> + if (!attrs.secure && !(s->gicd_ctlr & GICD_CTLR_DS)) {
> + if (!gicv3_gicd_group_test(s, irq)) {
> + /* Fields for Group 0 or Secure Group 1 interrupts are RAZ/WI */
Here this check assure this interrupt belongs to Group 0 and NS access
is not permitted, so it should return 0. But it doesn't say anything
about Secure Group 1.
> + return 0;
> + }
> + /* NS view of the interrupt priority */
> + prio = (prio << 1) & 0xff;
> + }
So maybe here it should check if attrs.secure is true and the Group is
1, then return 0.
> + return prio;
> +}
> +
> +static void gicd_write_ipriorityr(GICv3State *s, MemTxAttrs attrs, int irq,
> + uint8_t value)
> +{
> + /* Write the value of GICD_IPRIORITYR<n> for the specified interrupt,
> + * honouring security state (these are RAZ/WI for Group 0 or Secure
> + * Group 1 interrupts).
> + */
> + if (irq < GIC_INTERNAL || irq >= s->num_irq) {
> + return;
> + }
> +
> + if (!attrs.secure && !(s->gicd_ctlr & GICD_CTLR_DS)) {
> + if (!gicv3_gicd_group_test(s, irq)) {
> + /* Fields for Group 0 or Secure Group 1 interrupts are RAZ/WI */
Same here.
> + return;
> + }
> + /* NS view of the interrupt priority */
> + value = 0x80 | (value >> 1);
> + }
> + s->gicd_ipriority[irq] = value;
> +}
--
Shannon
WARNING: multiple messages have this Message-ID (diff)
From: Shannon Zhao <zhaoshenglong@huawei.com>
To: Peter Maydell <peter.maydell@linaro.org>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: patches@linaro.org, Shlomo Pongratz <shlomo.pongratz@huawei.com>,
Shlomo Pongratz <shlomopongratz@gmail.com>,
Pavel Fedin <p.fedin@samsung.com>,
Shannon Zhao <shannon.zhao@linaro.org>,
Christoffer Dall <christoffer.dall@linaro.org>
Subject: Re: [Qemu-devel] [PATCH v2 11/22] hw/intc/arm_gicv3: Implement GICv3 distributor registers
Date: Mon, 13 Jun 2016 14:27:05 +0800 [thread overview]
Message-ID: <575E5239.6030408@huawei.com> (raw)
In-Reply-To: <1464274540-19693-12-git-send-email-peter.maydell@linaro.org>
On 2016/5/26 22:55, Peter Maydell wrote:
> +static uint8_t gicd_read_ipriorityr(GICv3State *s, MemTxAttrs attrs, int irq)
> +{
> + /* Read the value of GICD_IPRIORITYR<n> for the specified interrupt,
> + * honouring security state (these are RAZ/WI for Group 0 or Secure
> + * Group 1 interrupts).
> + */
> + uint32_t prio;
> +
> + if (irq < GIC_INTERNAL || irq >= s->num_irq) {
> + return 0;
> + }
> +
> + prio = s->gicd_ipriority[irq];
> +
> + if (!attrs.secure && !(s->gicd_ctlr & GICD_CTLR_DS)) {
> + if (!gicv3_gicd_group_test(s, irq)) {
> + /* Fields for Group 0 or Secure Group 1 interrupts are RAZ/WI */
Here this check assure this interrupt belongs to Group 0 and NS access
is not permitted, so it should return 0. But it doesn't say anything
about Secure Group 1.
> + return 0;
> + }
> + /* NS view of the interrupt priority */
> + prio = (prio << 1) & 0xff;
> + }
So maybe here it should check if attrs.secure is true and the Group is
1, then return 0.
> + return prio;
> +}
> +
> +static void gicd_write_ipriorityr(GICv3State *s, MemTxAttrs attrs, int irq,
> + uint8_t value)
> +{
> + /* Write the value of GICD_IPRIORITYR<n> for the specified interrupt,
> + * honouring security state (these are RAZ/WI for Group 0 or Secure
> + * Group 1 interrupts).
> + */
> + if (irq < GIC_INTERNAL || irq >= s->num_irq) {
> + return;
> + }
> +
> + if (!attrs.secure && !(s->gicd_ctlr & GICD_CTLR_DS)) {
> + if (!gicv3_gicd_group_test(s, irq)) {
> + /* Fields for Group 0 or Secure Group 1 interrupts are RAZ/WI */
Same here.
> + return;
> + }
> + /* NS view of the interrupt priority */
> + value = 0x80 | (value >> 1);
> + }
> + s->gicd_ipriority[irq] = value;
> +}
--
Shannon
next prev parent reply other threads:[~2016-06-13 6:30 UTC|newest]
Thread overview: 98+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-26 14:55 [Qemu-arm] [PATCH v2 00/22] GICv3 emulation Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] " Peter Maydell
2016-05-26 14:55 ` [Qemu-arm] [PATCH v2 01/22] migration: Define VMSTATE_UINT64_2DARRAY Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] " Peter Maydell
2016-06-07 3:32 ` Shannon Zhao
2016-06-07 3:32 ` Shannon Zhao
2016-05-26 14:55 ` [Qemu-arm] [PATCH v2 02/22] bitops.h: Implement half-shuffle and half-unshuffle ops Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] " Peter Maydell
2016-06-07 6:35 ` Shannon Zhao
2016-06-07 6:35 ` Shannon Zhao
2016-05-26 14:55 ` [Qemu-arm] [PATCH v2 03/22] target-arm: Define new arm_is_el3_or_mon() function Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] " Peter Maydell
2016-06-07 6:32 ` Shannon Zhao
2016-06-07 6:32 ` Shannon Zhao
2016-05-26 14:55 ` [Qemu-arm] [PATCH v2 04/22] target-arm: Provide hook to tell GICv3 about changes of security state Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] " Peter Maydell
2016-06-14 1:49 ` [Qemu-arm] " Shannon Zhao
2016-06-14 1:49 ` Shannon Zhao
2016-05-26 14:55 ` [Qemu-arm] [PATCH v2 05/22] target-arm: Add mp-affinity property for ARM CPU class Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] " Peter Maydell
2016-06-07 7:55 ` Shannon Zhao
2016-06-07 7:55 ` Shannon Zhao
2016-05-26 14:55 ` [Qemu-arm] [PATCH v2 06/22] hw/intc/arm_gicv3: Add state information Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] " Peter Maydell
2016-06-07 7:51 ` Shannon Zhao
2016-06-07 7:51 ` Shannon Zhao
2016-05-26 14:55 ` [Qemu-arm] [PATCH v2 07/22] hw/intc/arm_gicv3: Move irq lines into GICv3CPUState structure Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] " Peter Maydell
2016-06-07 8:33 ` Shannon Zhao
2016-06-07 8:33 ` Shannon Zhao
2016-05-26 14:55 ` [Qemu-arm] [PATCH v2 08/22] hw/intc/arm_gicv3: Add vmstate descriptors Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] " Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] [PATCH v2 09/22] hw/intc/arm_gicv3: ARM GICv3 device framework Peter Maydell
2016-06-07 9:01 ` [Qemu-arm] " Shannon Zhao
2016-06-07 9:01 ` Shannon Zhao
2016-05-26 14:55 ` [Qemu-arm] [PATCH v2 10/22] hw/intc/arm_gicv3: Implement functions to identify next pending irq Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] " Peter Maydell
2016-06-08 1:57 ` [Qemu-arm] " Shannon Zhao
2016-06-08 1:57 ` Shannon Zhao
2016-06-09 15:24 ` [Qemu-arm] " Peter Maydell
2016-06-09 15:24 ` Peter Maydell
2016-05-26 14:55 ` [Qemu-arm] [PATCH v2 11/22] hw/intc/arm_gicv3: Implement GICv3 distributor registers Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] " Peter Maydell
2016-06-13 6:27 ` Shannon Zhao [this message]
2016-06-13 6:27 ` Shannon Zhao
2016-06-13 9:04 ` [Qemu-arm] " Peter Maydell
2016-06-13 9:04 ` Peter Maydell
2016-06-13 9:35 ` Shannon Zhao
2016-06-13 9:35 ` Shannon Zhao
2016-05-26 14:55 ` [Qemu-arm] [PATCH v2 12/22] hw/intc/arm_gicv3: Implement GICv3 redistributor registers Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] " Peter Maydell
2016-06-14 3:09 ` [Qemu-arm] " Shannon Zhao
2016-06-14 3:09 ` Shannon Zhao
2016-06-14 12:25 ` Peter Maydell
2016-06-14 12:25 ` Peter Maydell
2016-06-14 12:28 ` [Qemu-arm] " Peter Maydell
2016-06-14 12:28 ` Peter Maydell
2016-05-26 14:55 ` [Qemu-arm] [PATCH v2 13/22] hw/intc/arm_gicv3: Wire up distributor and redistributor MMIO regions Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] " Peter Maydell
2016-06-13 7:19 ` [Qemu-arm] " Shannon Zhao
2016-06-13 7:19 ` Shannon Zhao
2016-05-26 14:55 ` [Qemu-arm] [PATCH v2 14/22] hw/intc/arm_gicv3: Implement gicv3_set_irq() Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] " Peter Maydell
2016-06-13 7:49 ` [Qemu-arm] " Shannon Zhao
2016-06-13 7:49 ` Shannon Zhao
2016-06-13 9:07 ` [Qemu-arm] " Peter Maydell
2016-06-13 9:07 ` Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] [PATCH v2 15/22] hw/intc/arm_gicv3: Implement GICv3 CPU interface registers Peter Maydell
2016-05-26 14:55 ` [Qemu-arm] [PATCH v2 16/22] hw/intc/arm_gicv3: Implement gicv3_cpuif_update() Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] " Peter Maydell
2016-06-13 7:56 ` [Qemu-arm] " Shannon Zhao
2016-06-13 7:56 ` Shannon Zhao
2016-06-13 9:10 ` Peter Maydell
2016-06-13 9:10 ` Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] [PATCH v2 17/22] hw/intc/arm_gicv3: Implement CPU i/f SGI generation registers Peter Maydell
2016-06-14 6:24 ` [Qemu-arm] " Shannon Zhao
2016-06-14 6:24 ` Shannon Zhao
2016-05-26 14:55 ` [Qemu-arm] [PATCH v2 18/22] hw/intc/arm_gicv3: Add IRQ handling CPU interface registers Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] " Peter Maydell
2016-05-26 14:55 ` [Qemu-arm] [PATCH v2 19/22] target-arm/machine.c: Allow user to request GICv3 emulation Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] " Peter Maydell
2016-06-13 11:38 ` [Qemu-arm] " Shannon Zhao
2016-06-13 11:38 ` Shannon Zhao
2016-05-26 14:55 ` [Qemu-arm] [PATCH v2 20/22] target-arm/monitor.c: Advertise emulated GICv3 in capabilities Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] " Peter Maydell
2016-06-13 11:40 ` Shannon Zhao
2016-06-13 11:40 ` Shannon Zhao
2016-05-26 14:55 ` [Qemu-devel] [PATCH v2 21/22] NOT-FOR-UPSTREAM: kernel: Add definitions for GICv3 attributes Peter Maydell
2016-06-13 11:51 ` Shannon Zhao
2016-06-13 11:51 ` Shannon Zhao
2016-06-13 12:02 ` [Qemu-arm] " Peter Maydell
2016-06-13 12:02 ` Peter Maydell
2016-05-26 14:55 ` [Qemu-arm] [PATCH v2 22/22] RFC: hw/intc/arm_gicv3_kvm: Implement get/put functions Peter Maydell
2016-05-26 14:55 ` [Qemu-devel] " Peter Maydell
2016-05-30 11:15 ` [Qemu-arm] [Qemu-devel] [PATCH v2 00/22] GICv3 emulation Andrew Jones
2016-05-30 11:15 ` Andrew Jones
2016-06-06 14:42 ` [Qemu-arm] " Peter Maydell
2016-06-06 14:42 ` [Qemu-devel] " 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=575E5239.6030408@huawei.com \
--to=zhaoshenglong@huawei.com \
--cc=christoffer.dall@linaro.org \
--cc=p.fedin@samsung.com \
--cc=patches@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=shannon.zhao@linaro.org \
--cc=shlomo.pongratz@huawei.com \
--cc=shlomopongratz@gmail.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 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.