From: Peter Maydell <peter.maydell@linaro.org>
To: niuguoxiang <niuguoxiang@huawei.com>
Cc: P J P <ppandit@redhat.com>,
QEMU Developers <qemu-devel@nongnu.org>,
qemu-arm <qemu-arm@nongnu.org>,
Prasad J Pandit <pjp@fedoraproject.org>
Subject: Re: [Qemu-devel] 答复: [PATCH] intc: arm_gicv3: limit GICR ipriority index
Date: Tue, 5 Sep 2017 13:35:38 +0100 [thread overview]
Message-ID: <CAFEAcA8JxuM-ddQVTBfgnSDD2fD+kz_RNShdNDqMqVH=zOKBfw@mail.gmail.com> (raw)
In-Reply-To: <7FD21DDFE9A3784693E393AF276FE7D21F17E49E@DGGEMA501-MBX.china.huawei.com>
On 5 September 2017 at 13:30, niuguoxiang <niuguoxiang@huawei.com> wrote:
> I think only assert is not enough, because assert() depends on NDEBUG
> preprocessing
The code cannot be reached with a non-aligned value,
because we register these functions via the gic_ops[]
MemoryRegionops in hw/intc/arm_gicv3.c, and since we
do not specify .valid.unaligned=true there, the memory.c
code will throw out attempts at unaligned accesses.
The assert is just checking at runtime that this never
becomes false accidentally (and also for the benefit of
people reading the code).
Incidentally, QEMU can never be compiled with NDEBUG not
set -- we will #error in the compilation if it is not set.
(It's not good practice to depend on the assert() actually
doing anything though, and indeed in this case we don't.)
thanks
-- PMM
next prev parent reply other threads:[~2017-09-05 12:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-05 11:21 [Qemu-devel] [PATCH] intc: arm_gicv3: limit GICR ipriority index P J P
2017-09-05 11:58 ` Peter Maydell
2017-09-05 12:29 ` [Qemu-devel] [Qemu-arm] " Philippe Mathieu-Daudé
2017-09-05 12:30 ` [Qemu-devel] 答复: " niuguoxiang
2017-09-05 12:35 ` Peter Maydell [this message]
2017-09-05 19:42 ` Eric Blake
2017-09-06 6:45 ` P J P
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='CAFEAcA8JxuM-ddQVTBfgnSDD2fD+kz_RNShdNDqMqVH=zOKBfw@mail.gmail.com' \
--to=peter.maydell@linaro.org \
--cc=niuguoxiang@huawei.com \
--cc=pjp@fedoraproject.org \
--cc=ppandit@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@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).