From patchwork Mon May 20 16:28:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 164659 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp508197ili; Mon, 20 May 2019 09:42:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEp9CI6cJuN8AkrNRmxFdfeekCpzJW3pmWUQlKQLUyBlA+Aanfd/L8zoBWHB6EA9Quujw8 X-Received: by 2002:a17:906:3459:: with SMTP id d25mr47381793ejb.7.1558370551287; Mon, 20 May 2019 09:42:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558370551; cv=none; d=google.com; s=arc-20160816; b=yxjRgj+/n9zsbQaVYF0l9shkVImSWeYB8dhgQBb8LPyaGSljzhJ4lWPM/EheJHc+JT J03uPB8QCrWp4TKGcYfQg4/b1wF8yY1riS0WZEREkR//qY+IoNwWiIFHw7Qs33Mi10hC H3BELRFaNzmI7HmYRwfh/nXlFKNBYexo9UHWvdiZHKfKRF16oXEpOX+2Bha8VdpYZufF MqbrSeOyIpojvJK7UBe0xiMuHayZt6kuHu+t/U8h7VcmkGMSR5x969Qm+IUq8+DtIPL2 c5EsT7xXEdeKDK8ltDTvwgsiPh+ED5AqKRGrhTFQiX9X3xtUzDQ3nVN+tLT9t0E0YyPK euTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=TQvN/mWAlK741QKpEKQhjF7DDPH0rKnlVOvBsAJinxg=; b=xqRf9cHD6/P9Ww4PpPGghr6CsVscUZjlD/0N4gh32avVMKfP+4mhlzlOFS+AtLLgpy v76pOXgdJmKkd8LTc8KiSTxfM2HgZutzGwKq+eUdS1QglsZWNuQCS+IwPrv6x2OT+vwC euqjcOx1yEc8yCCXc11DM3pZsjmj+mRWoxUtYixOk+t9KdlJPka/3doswshAh0KmaDWF 7xcEAwymGYzEPX5zxDShEVsAvELKXXUuNkQY5LUoniTrfEqciule9X0rRjHA/Monechs y78wQcudwk2aBDogTWQtsLq3gO4p1aIkVDcvoCaJo23tP8/Av39hcrGtu6kFJ5lewL1U aJBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eE858BT9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a21si529306ejv.119.2019.05.20.09.42.31 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 May 2019 09:42:31 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eE858BT9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:38436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSlMs-0005v4-8O for patch@linaro.org; Mon, 20 May 2019 12:42:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSl9B-00031Y-KO for qemu-devel@nongnu.org; Mon, 20 May 2019 12:28:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSl98-0001Fr-2K for qemu-devel@nongnu.org; Mon, 20 May 2019 12:28:19 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:51087) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hSl95-0001Em-TV for qemu-devel@nongnu.org; Mon, 20 May 2019 12:28:17 -0400 Received: by mail-wm1-x341.google.com with SMTP id f204so15202wme.0 for ; Mon, 20 May 2019 09:28:15 -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=TQvN/mWAlK741QKpEKQhjF7DDPH0rKnlVOvBsAJinxg=; b=eE858BT9oM4qVPLyFxNriaIXSVdrnnIC54UhLvK6faBWTZWEzMUoFiT/poR81eWyS1 2qpzy4F0kw0P5T8vl+FniHqUywhjV10HmSXj9XdOJUKPWzOjCVbrcDUQmcBAjPvDNA1D 5SkSTki1k3qBeIxZORGAF5d9j6zOnjdjXyPx4KEzvkBDu+Q5UfnjqYz+Dyk2MjMDP7vw tBCEZKgyvS9yEML1uWVG7ANz9kbAYl2dLKepWkwqVrBtAPL5aqI3pwDfIkZEf9Wktr0a bvgna8UcEnrj4vzicr7S5pIEuwsqdLcbDCQCwMt7o0XbHRQBR13+KAE92GowwTFK2EpD N8QA== 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=TQvN/mWAlK741QKpEKQhjF7DDPH0rKnlVOvBsAJinxg=; b=tL2IDb72irExIhKWHVuvdJ1L0eznKIw/j/dzv2HRWeW+NWuKZlcusEQo10TGtbXSJD Y2qKuPvwFb5CGSC5ZfmqKBWgVwrCdSZWIZH+eMZyyz45Ya/PEB4omhpj8ibmojyKPxcA yYj1CgqDoYZe91BGYYnDwOcLiNNe8e/hWBYRX735k2XwR/49TNeKt5DJ49C1fvmGELjb A/J7bdAMhqy8zsCoC0fIsXIPjj6gks7sdtmeVtHXRB1CFbTAOtfyZaxjusDOdosfOLXq f2mQAxDSE2Y6NUB8mNxcKtDOYptV4t5PzuazrAGXksZH6pOUfP3H6BKpQDlXHbT0a6EE cIVA== X-Gm-Message-State: APjAAAWA6AO4gJ7KVNsjpCFofrEYbyEqWrOovQ6IHHKTLKb4L+LaYkK5 JfyPIbyp4dTi9yGU29HmAzTis1ix61c= X-Received: by 2002:a7b:c549:: with SMTP id j9mr4712wmk.114.1558369694777; Mon, 20 May 2019 09:28:14 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id x2sm5830394wrs.39.2019.05.20.09.28.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 09:28:14 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Mon, 20 May 2019 17:28:07 +0100 Message-Id: <20190520162809.2677-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190520162809.2677-1-peter.maydell@linaro.org> References: <20190520162809.2677-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 Subject: [Qemu-devel] [PATCH 2/4] hw/intc/arm_gicv3: GICD_TYPER.SecurityExtn is RAZ if GICD_CTLR.DS == 1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The GICv3 specification says that the GICD_TYPER.SecurityExtn bit is RAZ if GICD_CTLR.DS is 1. We were incorrectly making it RAZ if the security extension is unsupported. "Security extension unsupported" always implies GICD_CTLR.DS == 1, but the guest can also set DS on a GIC which does support the security extension. Fix the condition to correctly check the GICD_CTLR.DS bit. Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_dist.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/hw/intc/arm_gicv3_dist.c b/hw/intc/arm_gicv3_dist.c index 335386ff3ac..d6ae576110d 100644 --- a/hw/intc/arm_gicv3_dist.c +++ b/hw/intc/arm_gicv3_dist.c @@ -378,8 +378,14 @@ static MemTxResult gicd_readl(GICv3State *s, hwaddr offset, * ITLinesNumber == (num external irqs / 32) - 1 */ int itlinesnumber = ((s->num_irq - GIC_INTERNAL) / 32) - 1; + /* + * SecurityExtn must be RAZ if GICD_CTLR.DS == 1, and + * "security extensions not supported" always implies DS == 1, + * so we only need to check the DS bit. + */ + bool sec_extn = !(s->gicd_ctlr & GICD_CTLR_DS); - *data = (1 << 25) | (1 << 24) | (s->security_extn << 10) | + *data = (1 << 25) | (1 << 24) | (sec_extn << 10) | (0xf << 19) | itlinesnumber; return MEMTX_OK; }