From patchwork Mon Jun 17 14:33:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 167066 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp3001367ilk; Mon, 17 Jun 2019 08:26:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyAfcM718NDWFLir8o4gBGcmhRin6u/TVaRB5bgpiIyeASmIq5WWwB7SzBeAWdwuAL9ohQ/ X-Received: by 2002:a50:90c6:: with SMTP id d6mr97789867eda.19.1560785164186; Mon, 17 Jun 2019 08:26:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560785164; cv=none; d=google.com; s=arc-20160816; b=xFmJ7pksQmQw4QwR6MAZ59FiXQfPaoWK3Q5xt+guHrOKy+QYIwgExvrekODXPY3pxX AqpXcgE3RccIVpk6UJb0o1kTU1WVi8vmVwKADEQJrB+lXpp8CE0QO4RRybfESQ5Z+ya2 oov4C7Ndg2q0YvK3TAcf2t1vuKU27g19sdrUh0imUht5g9xWMYZuPjQBAEOylMw1j1WR ADj7RQSFkDH3WjLMRz5RdgWvf/gM7jrf+BRpWAeyEaAsPq7aqapp1wyJXpWKBDk0/bkr /377VZT2BxNQwIGkpTNJTLjaT1/7323tMfFBetIPyaKQcvLIUCzs9pKCvDrJUrAKsaCd kcvA== 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=ayi0GkBgLKY3AdrRPsXWIx7VD1COuTHMv3O+HeMPbB0=; b=kYD3vZrxIlbKqQ5QpH28XtGS7GQSqNotvn1VYni2u5l65V6laoHzoZIPDceCVVVAbN 1snTsGCXTN3hFR4T0bebZY/XAjxP/s3pyZ7ZHtVdOvvw/sF9/YvMZBpx3N8nVVjdDhRI 7TKokbRf3MnAk1YmbWes0ygUwLb9FY4RExb9ZAMnLCoqBlqWC8r1RJBV++ZhBNgYyNKb nzxCHLXJmUJYVtErVxgne1Gnk7m/foEQ3sJRxr2c6YPNaOSQdIH7fbQtyhCOHVch2DlX 5lBNTpLSsYZOXKJB26PyvM3PjBVKF6FvbGkJv8XDyBy0hw0zUG10xTCFZjLxQRNhbwTC 1INw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WfhuD0Pz; 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 b4si8736584edc.223.2019.06.17.08.26.03 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Jun 2019 08:26:04 -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=WfhuD0Pz; 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 ([::1]:48454 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hctWF-0004Lj-5n for patch@linaro.org; Mon, 17 Jun 2019 11:26:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46675) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcsiK-0003Zw-Fl for qemu-devel@nongnu.org; Mon, 17 Jun 2019 10:34:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcsiI-000851-Sj for qemu-devel@nongnu.org; Mon, 17 Jun 2019 10:34:28 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:46168) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hcsiI-00084S-Jz for qemu-devel@nongnu.org; Mon, 17 Jun 2019 10:34:26 -0400 Received: by mail-wr1-x441.google.com with SMTP id n4so10192048wrw.13 for ; Mon, 17 Jun 2019 07:34:26 -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=ayi0GkBgLKY3AdrRPsXWIx7VD1COuTHMv3O+HeMPbB0=; b=WfhuD0PzKdy+iiteBQFDe2da6G+5lxjDaa9BE4Mz8P6fZBfIum8Px3CFAS83lyP8u/ msLLlrVIqJkqN+gbHtcszpBGuwx/0qzYMS9phVHJA4UKZs9Zw7rZCUSNDfYXppYLo0TM TwGA2PkMVJ8ugMibl9JMjwjVke9xjrj/VutHeRDZ5KHwK3O4OKO5JxqyA7YrmmiE6lGI xukuH19e2vb1dZ1YqdRJ9w9citZaniyh0yvVQHimJnibiWdUPMjBKphAELkuBPLSRYFO eQ7NZ6iOeQKamw7EhT+KjLLfGRynjMq4J5+6blS8c72P+Ce51pl3WacNE3h9B6PSsKCM xCJQ== 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=ayi0GkBgLKY3AdrRPsXWIx7VD1COuTHMv3O+HeMPbB0=; b=NWrQmth9IfZhCo6snDtMA3/G+58N/7n2ateuBz5qMufbLOjTKqujxm81VHtDd29M8g 1H0nEqOw9LsOUmZ4IYqAQOVwV7q9gpXSYU7f7Eag5YLCxwSgowHnJvgCYm9B93RBz15b 0NBI4nlTvI5/sJJZZ4prS6UMjXH7a3nr4m20d4mgwch0+jgGtzc1LJpcWlrLWVXtIsSf W1XGx/5fnQU6Jz2N73l+QGwVMTnxS15jo6H+sA2X+48y3t6WlnLnzOTzFbWwtWYlOofs 0/iQw8V+TWr/+/SxrSnbcDj0nm2ECTuxPvXQvv5ZBZQJEMdh4K+z2Xh0Z41uQNPX+DS/ S37g== X-Gm-Message-State: APjAAAWyVVNMHf36wWrIe7uRO+mJGRr7JaE7WpGewj+gH8fZiUIFuHcx zdu3VvuG5MKKWa3pn3CstFqlVWR3OgFs7w== X-Received: by 2002:a5d:4ac1:: with SMTP id y1mr1996411wrs.183.1560782065136; Mon, 17 Jun 2019 07:34:25 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id a67sm13819985wmh.40.2019.06.17.07.34.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jun 2019 07:34:24 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 17 Jun 2019 15:33:58 +0100 Message-Id: <20190617143412.5734-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190617143412.5734-1-peter.maydell@linaro.org> References: <20190617143412.5734-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::441 Subject: [Qemu-devel] [PULL 10/24] 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.23 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 Message-id: 20190524124248.28394-3-peter.maydell@linaro.org --- 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 e6fe4905fd3..b65f56f9035 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; }