From patchwork Tue Apr 13 12:07:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 12200309 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44DA3C433B4 for ; Tue, 13 Apr 2021 12:10:02 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B12606023C for ; Tue, 13 Apr 2021 12:10:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B12606023C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:40454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWHrk-0001bq-Mh for qemu-devel@archiver.kernel.org; Tue, 13 Apr 2021 08:10:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWHpm-0000QI-GM for qemu-devel@nongnu.org; Tue, 13 Apr 2021 08:07:58 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:33673) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lWHpk-0004g3-Rg for qemu-devel@nongnu.org; Tue, 13 Apr 2021 08:07:58 -0400 Received: by mail-wr1-x429.google.com with SMTP id g9so164777wrx.0 for ; Tue, 13 Apr 2021 05:07:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=TZi3a++hHJ8/RuSozHubV+jvMjnNryNqhY5lxnqN274=; b=diNfmtb2u86kG67INmACsmbn7OFOJC69xmY8QPMhH2B2zxIB12MHBcnVd4PKEet9Fd N1Fh/SgaaxeFOCfFoKXXSqnaZlgDr4O3F6PJRV4u7hrW2C7eq67a0GW/l0s5z9sYFczj nmY5By4fE5r3kzZQJQW5h9hqcPRADK3f3ZeTLn0cInvyFB4+UGJizO+a7PTqYnpzCnQ+ QzPuKQJxN/A/a7JF1csJNCcwWHLhXVTVwyBcrUSgcmG8uvQ3j4dxe/43WoG1YR5/yz33 okLtzPaJlq/5zPbenYqmglUoA6wHqEKT8U5vNAMSNztiHhqphZWrhjpw9G+vWHbiGshI N4Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TZi3a++hHJ8/RuSozHubV+jvMjnNryNqhY5lxnqN274=; b=ZIkHpv+i7NlBi22LbeSSioysMm5s/Jk9+xH54kQItfuJdTLi5X/Tr1UxfxI2/c/FNy ca0+2z8CS0wLcuzEl0j8WbMwJDRhsNGDkKWkAe9QDgBTm1YfnaDCvuzHl0GarTIP2Ed+ vgQfEDUdJud+hMam1sLyFMPoKC0xsODvsLalUOiwXzfDJtrNFQHX3gkNsiMBqLIRJ/pB R8eL8+CnanCK/FcsQZx8OVA+XLvMyV6h+kfijMVHbBo5zFbZXgcOoT41mAPAgQEHMPbG bdaYoczWUXpw1lsP24sjfH1W9QkyBiGfOFNi0SIwGCWHMpDdwBdRcafX1cJaXPfWEhgv mcmg== X-Gm-Message-State: AOAM533wx2+3gRlDYP4bxUQ12q7y6LoAl03WViC5DOj7gC7G3MU3a8pp n2AulPaQ5phCOSCFzB8oQcLSdW5M6hP2FI4T X-Google-Smtp-Source: ABdhPJxnP72AQRhcM3ZSEga6DNvyckA3fkwZrzDfFADIJKMmwnhPDevhG0ibAElcHB1iJ1RA1RKjMA== X-Received: by 2002:a05:6000:10c7:: with SMTP id b7mr36628991wrx.143.1618315675480; Tue, 13 Apr 2021 05:07:55 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id o2sm2245275wmc.23.2021.04.13.05.07.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Apr 2021 05:07:55 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 1/3] hw/arm/mps2-tz: Fix MPC setting for AN524 SRAM block Date: Tue, 13 Apr 2021 13:07:50 +0100 Message-Id: <20210413120752.18699-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210413120752.18699-1-peter.maydell@linaro.org> References: <20210413120752.18699-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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 3fbe3d29f95..5ebd671bf83 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 patchwork Tue Apr 13 12:07:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 12200331 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59659C433ED for ; Tue, 13 Apr 2021 12:12:35 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 177FF600D4 for ; Tue, 13 Apr 2021 12:12:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 177FF600D4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWHuE-0003ge-B1 for qemu-devel@archiver.kernel.org; Tue, 13 Apr 2021 08:12:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWHpn-0000Rj-Rp for qemu-devel@nongnu.org; Tue, 13 Apr 2021 08:07:59 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:44830) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lWHpl-0004gl-CJ for qemu-devel@nongnu.org; Tue, 13 Apr 2021 08:07:59 -0400 Received: by mail-wr1-x432.google.com with SMTP id e7so7236272wrs.11 for ; Tue, 13 Apr 2021 05:07:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=0DwG24uBdQRtPZtJXorqQ6XjIZeWaJljD2bW9Ttkeq8=; b=vZs0D9xm1Ki1XVjYZxZsGmOz1yvlpwDp1QB1DMoIc0oqB7NXz5w9vG1rKhAupa11tD xAXRJwEnAoOcAtHtxKXMVXoYxdiX/vVKodnQWvmIBiqDSTj5HJYNoIO8hU7gZx7L5YYS jq+NclxglwvSWIHa1hJXAfyqYblY2c0Lwwj5g05M+ttEm8ATrytWH9MpnH3yZRQjstzl RoNVLwg9Lf69KiCqZmDf9H6ycM3mnW2IY49j2Hngh1GbGNIHkkhYELVj63fUoOm7ZYYd 6Gx76Txrz55R3IPYiw/MXdqBefYphmvnEq4z6jmo3Qazi0UrKz2ZtsgWKdQV0UVBoy1A YMuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0DwG24uBdQRtPZtJXorqQ6XjIZeWaJljD2bW9Ttkeq8=; b=JCIoxDHWcHgyZ1cCLMk/nCFJBwF4Vb9Cvrr7KShxSP0/57knNiTFo6uP2Eg8hskSko 6R+dlvHAXctpTHWOfh6htCZenNlPwke5TzSXwmE1KPFjaA6I0hIqTEtRqxKv7fzhnVaw gtau+oeJTYluIjmfI9WaNgFgzjFVAq9Psqg096PJumU1a+4oa5Yd6WYy9dydI3Z0v3NA 4/Ur3n5lS72LsJhqUhLPo5V0TYtwmv59h0hy6brm+j07ibbYdErsWdMRqVk6mhg50Raz ZIjfITvbU1mzPOb17Rqrncbp6nrEW61kv/jzsvtVN4snjsi8FtaJ3NhS9bvmGPPrjgEt NNMA== X-Gm-Message-State: AOAM530yYQGNm/WyWOLcHViKTEp7+dNGk9QakYTm8kgrYVf/FfKZr57y LX/iDZ1OJblezm8LsqIzU5dJFVFY41hdj7dC X-Google-Smtp-Source: ABdhPJxWLn5ZLNsgKovQmW8WaOyLW5iOUDcLzY8YKSqQbZPiKzZMb+nOyyI1YfuykV5q/KEcvjMlcA== X-Received: by 2002:a5d:4010:: with SMTP id n16mr37161032wrp.125.1618315676086; Tue, 13 Apr 2021 05:07:56 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id o2sm2245275wmc.23.2021.04.13.05.07.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Apr 2021 05:07:55 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 2/3] hw/arm/mps2-tz: Assert if more than one RAM is attached to an MPC Date: Tue, 13 Apr 2021 13:07:51 +0100 Message-Id: <20210413120752.18699-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210413120752.18699-1-peter.maydell@linaro.org> References: <20210413120752.18699-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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 5ebd671bf83..25016e464d9 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 patchwork Tue Apr 13 12:07:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 12200333 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D00A7C433B4 for ; Tue, 13 Apr 2021 12:14:04 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 812AA61026 for ; Tue, 13 Apr 2021 12:14:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 812AA61026 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:48114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWHvf-0004wc-PP for qemu-devel@archiver.kernel.org; Tue, 13 Apr 2021 08:14:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWHpo-0000SM-G6 for qemu-devel@nongnu.org; Tue, 13 Apr 2021 08:08:00 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:40508) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lWHpm-0004h8-04 for qemu-devel@nongnu.org; Tue, 13 Apr 2021 08:08:00 -0400 Received: by mail-wr1-x434.google.com with SMTP id 12so16216265wrz.7 for ; Tue, 13 Apr 2021 05:07:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=PqvH81v0CcRZh67EoO9qpkreERfLaZWxwreRW1VRrbY=; b=wg9gGamdMA1mBaIHKEW9lHH1UKb2UZ0m8snkL+2oxWkTBtu8eTAv5Xb6wzgigHT6OO 5swVEzbjy1u9LqE9lw2+//5wgAzb2SOYhASwlLl9WTVUKnQmCethTEZuOdJpbVUUUDAI ZeUQrNxi5105ht0qDTHrsldpuy/RJeMm93XToIZzcMXqUtDGTr344umTBTsnRgxgrqer crVhN7ii3Q6N+1enb5xdQxYndEcLvmXklFotswLiyA/+rmxrA4VI5qJcB6Y7UAtFR418 JjbIDkk1oyQmgeSw8qSv0vSZ1EDTzTJYH+3mcnLZ39lbADYSJUj0o3W+YoGgpAYzKiT+ /Wfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PqvH81v0CcRZh67EoO9qpkreERfLaZWxwreRW1VRrbY=; b=AseHdGAkONR4xxKzsXQ+UOFFVCfY3yPNb2ug3qURBi9rO09faSzTJCnAbiMpW6o129 K+55TvJ31DxVZOlxjbmqUgl3mj2SM/vzUc+lIxwTohE+AeYhXVxcZXinDnpedjhtx5we REKiJ8iO6U4ug2M3cBp/BmEXbovC2eCRc7ZiV5amSpAXoSk3pKAhwbaG7CyHFqa5+d6D aMkBF2dZNDm788ay2UtbZBsGopMWp3PkL6TVItY0Gfe3qn7R65Az9SYNuWps3Dqji6T3 d6Z6rPHjaqm9bPWOOLe9rmbdeISx/vD+kkOecPK4P2bw4SOMvlowxTJx8rpA8E/bNmgo Tk8w== X-Gm-Message-State: AOAM531tZk4ShjizSU3/uliO8gzkwxZ5G5JKUGuOJoXVG+iaI+jvocGf 3zlPYIydPHZRhB0B0KmZSjdUc0MkAmnrKZyS X-Google-Smtp-Source: ABdhPJxY6yeZaad9tkVPKzMu6nLdJLsFwn15ezgMW/U6EPB/pC37yVT7My/bU4+Cw8MC1GnyR7rqFQ== X-Received: by 2002:adf:fcca:: with SMTP id f10mr27892510wrs.148.1618315676738; Tue, 13 Apr 2021 05:07:56 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id o2sm2245275wmc.23.2021.04.13.05.07.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Apr 2021 05:07:56 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 3/3] sphinx: qapidoc: Wrap "If" section body in a paragraph node Date: Tue, 13 Apr 2021 13:07:52 +0100 Message-Id: <20210413120752.18699-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210413120752.18699-1-peter.maydell@linaro.org> References: <20210413120752.18699-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: John Snow 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 b7b86b5dffb..b7a2d39c105 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