From db2fc83aa45a391fa0eb9caa2728f5aa9225d4cc Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Fri, 9 Apr 2021 16:05:26 +0100 Subject: [PATCH 1/3] hw/arm/mps2-tz: Fix MPC setting for AN524 SRAM block MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The AN524 has three MPCs: one for the BRAM, one for the QSPI flash, and one for the DDR. We incorrectly set the .mpc field in the RAMInfo struct for the SRAM block to 1, giving it the same MPC we are using for the QSPI. The effect of this was that the QSPI didn't get mapped into the system address space at all, via an MPC or otherwise, and guest programs which tried to read from the QSPI would get a bus error. Correct the SRAM RAMInfo to indicate that it does not have an associated MPC. Fixes: 25ff112a8cc ("hw/arm/mps2-tz: Add new mps3-an524 board") Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-id: 20210409150527.15053-2-peter.maydell@linaro.org --- hw/arm/mps2-tz.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c index 3fbe3d29f953..5ebd671bf837 100644 --- a/hw/arm/mps2-tz.c +++ b/hw/arm/mps2-tz.c @@ -238,7 +238,7 @@ static const RAMInfo an524_raminfo[] = { { .name = "sram", .base = 0x20000000, .size = 32 * 4 * KiB, - .mpc = 1, + .mpc = -1, .mrindex = 1, }, { /* We don't model QSPI flash yet; for now expose it as simple ROM */ From 91c0a79891b080efea276caf6bd3ff10809c4e4c Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Fri, 9 Apr 2021 16:05:27 +0100 Subject: [PATCH 2/3] hw/arm/mps2-tz: Assert if more than one RAM is attached to an MPC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each board in mps2-tz.c specifies a RAMInfo[] array providing information about each RAM in the board. The .mpc field of the RAMInfo struct specifies which MPC, if any, the RAM is attached to. We already assert if the array doesn't have any entry for an MPC, but we don't diagnose the error of using the same MPC number twice (which is quite easy to do by accident if copy-and-pasting structure entries). Enhance find_raminfo_for_mpc() so that it detects multiple entries for the MPC as well as missing entries. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-id: 20210409150527.15053-3-peter.maydell@linaro.org --- hw/arm/mps2-tz.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c index 5ebd671bf837..25016e464d97 100644 --- a/hw/arm/mps2-tz.c +++ b/hw/arm/mps2-tz.c @@ -306,14 +306,18 @@ static const RAMInfo *find_raminfo_for_mpc(MPS2TZMachineState *mms, int mpc) { MPS2TZMachineClass *mmc = MPS2TZ_MACHINE_GET_CLASS(mms); const RAMInfo *p; + const RAMInfo *found = NULL; for (p = mmc->raminfo; p->name; p++) { if (p->mpc == mpc && !(p->flags & IS_ALIAS)) { - return p; + /* There should only be one entry in the array for this MPC */ + g_assert(!found); + found = p; } } /* if raminfo array doesn't have an entry for each MPC this is a bug */ - g_assert_not_reached(); + assert(found); + return found; } static MemoryRegion *mr_for_raminfo(MPS2TZMachineState *mms, From 2d18b4ca023ca1a3aee18064251d6e6e1084f3eb Mon Sep 17 00:00:00 2001 From: John Snow Date: Tue, 6 Apr 2021 10:19:09 -0400 Subject: [PATCH 3/3] sphinx: qapidoc: Wrap "If" section body in a paragraph node These sections need to be wrapped in a block-level element, such as Paragraph in order for them to be rendered into Texinfo correctly. Before (e.g.):
If defined(CONFIG_REPLICATION)
became: .SS If \fBdefined(CONFIG_REPLICATION)\fP.SS \fBBlockdevOptionsReplication\fP (Object) ... After:
If defined(CONFIG_REPLICATION)
becomes: .SS If .sp \fBdefined(CONFIG_REPLICATION)\fP .SS \fBBlockdevOptionsReplication\fP (Object) ... Reported-by: Markus Armbruster Tested-by: Markus Armbruster Signed-off-by: John Snow Reviewed-by: Peter Maydell Message-id: 20210406141909.1992225-2-jsnow@redhat.com Signed-off-by: Peter Maydell --- docs/sphinx/qapidoc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py index b7b86b5dffbb..b7a2d39c105c 100644 --- a/docs/sphinx/qapidoc.py +++ b/docs/sphinx/qapidoc.py @@ -278,7 +278,9 @@ def _nodes_for_if_section(self, ifcond): nodelist = [] if ifcond: snode = self._make_section('If') - snode += self._nodes_for_ifcond(ifcond, with_if=False) + snode += nodes.paragraph( + '', '', *self._nodes_for_ifcond(ifcond, with_if=False) + ) nodelist.append(snode) return nodelist