From patchwork Thu May 23 14:23:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 165024 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2275208ili; Thu, 23 May 2019 07:34:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxhJBVgkI+k7DxnYBVrUiqYWpsKKvSIv7QSQ6gpCvsmdIurDoPJefHx/WtDBov3LJZCp3C X-Received: by 2002:a17:906:774e:: with SMTP id o14mr51495018ejn.175.1558622078374; Thu, 23 May 2019 07:34:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558622078; cv=none; d=google.com; s=arc-20160816; b=QZOXWUBwvmN5YrHu3leozHnTDzRYD9G6zYRMbDBXfLKxwWC4gHOeqnyh+810FeZ/GC O3kl9G7FDvZkiQYeBeWXVL9oA66VZpVj5Str4QIw3SAElyJHRhkk1J71JARNwsS9kdT2 NxAGLGZLcxr9Jkf0rmqPP6U+kN1CgFevBrE7GToIOkL8mYv3nDb/SKRNPKTV6ZMoHNNS qZleWAh64QzI8FORmWQnzrjphao6woxJCYeMwyXV/C6PPIOFhK75vWu/93gz58Tqb4+O XLfezr2Z2m1SylsqdYQe1cvoWyvqs1UrFAOyxColflAMLRRIePKJWlRjlFQtlbCOawRg XWeA== 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=0a+RF8S0YvjE+0k16KJTj/Qgw1ZTceu2oeIc7kE90J8=; b=ED6zdGiL9ygr1BLaIBoOaM3fIgfak1ftzGmlVi15AEPydZXFbl1h5Y/GDi5gi8BXc1 UHIDj0BUFG0ZCKC12AGPsUpFrSWfN6qm2eYDuhXiqLUK4LHiNLmhwscIYHXG6cvJKoiU 8JkkQ1Cj0MDalnsdwQLBBQxcQuWkZ7LR/d69pZGRmihtuD/TanbaXhl7mz41nJH/BZTQ u/JuthN4Wg0QUzib/6IvsA5Tupdue95IHKxqy6XuUqB3rV1yR1rpVkG1blpbHYcrD8Ha MiXk4GRT08qduGTTrp6zdOcHe/Q6VXXRpga4jWDKA+xK4UM3tcqYL4RbT8M3H8PERv6r YjyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=s36ruKot; 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 z11si14015913ejo.132.2019.05.23.07.34.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 07:34:38 -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=s36ruKot; 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]:37663 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTonl-0003s2-BC for patch@linaro.org; Thu, 23 May 2019 10:34:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTodu-0002tz-1E for qemu-devel@nongnu.org; Thu, 23 May 2019 10:24:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTodt-000766-08 for qemu-devel@nongnu.org; Thu, 23 May 2019 10:24:25 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:33478) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTodr-0006uh-0H for qemu-devel@nongnu.org; Thu, 23 May 2019 10:24:24 -0400 Received: by mail-wm1-x344.google.com with SMTP id c66so7251224wme.0 for ; Thu, 23 May 2019 07:24:09 -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=0a+RF8S0YvjE+0k16KJTj/Qgw1ZTceu2oeIc7kE90J8=; b=s36ruKotbViYmwprbIqvwx6JUZmsVUHq6HOWeloAGXrzSXJwOLmoMELRfOO3Z/3L4i Hy4BmS1mVzyAF6UdVTB9jVPGlYBai4XYD/YWteNamg7E71jb3mJTfU4+z//REdvFUgxm COLg+jS/3Rx3Dz6QRC52uYW/nPwxKW7ui+wdTjWu7k/j5V5DAvKXY7Acx+q4/TCFywJn dX3mn0jfm6RWbL916JHpOlSxATv+lWc/S5qY7ZhxKTbk8Uqg+98Mp9foX0xQcBguKttq 5gC2br08PihZXYGr0tO4zIiBAJKvtwZyWTwy4jxJGxJ57qbjZmVlQo4pvvudaaIetxns rFbQ== 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=0a+RF8S0YvjE+0k16KJTj/Qgw1ZTceu2oeIc7kE90J8=; b=sWK21TLZxX46bT/xi2q5ezEyi3QvEqnc2RdKBUgjkC3aqUtWi3QCJYIVGjx/Usf+og qCzWf14N3Cd72LPkSC3LtLk6DqEjJrl+skf4VE3hybTEW1/SgjQ3OyAo35S0+b9osfTE oJyvUjqPJ8w8XGyHhrSg0N+6xwuh4dIhW2/EiHyJGpj4efJLn0jEVZCn35W/Zkkhs7Ll 5AZp6aD4Qt3jzxaOP/RZehB2RVdmmPCCH9ClQy8JhkpXdp//a2nuaOcidhKmH3qXq5Gn 6jbzTxeeS8mE+gWB2SuP1r/K8OpMMEL1VVt6/9oReGqQJChb0j8EPuS/AMEvZYgbTt+d iMEg== X-Gm-Message-State: APjAAAVLLRCgZVH5zQMcA+Qqff4wDnwjLsk8d9WptKgBVSqt46Bil3r8 NnVmfC1odhZR9K3WuQtGZYeK1gY4EI5w+g== X-Received: by 2002:a1c:a804:: with SMTP id r4mr11960271wme.21.1558621448518; Thu, 23 May 2019 07:24:08 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id z5sm9700617wmi.34.2019.05.23.07.24.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 May 2019 07:24:08 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 15:23:53 +0100 Message-Id: <20190523142357.5175-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190523142357.5175-1-peter.maydell@linaro.org> References: <20190523142357.5175-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::344 Subject: [Qemu-devel] [PULL 08/12] hw/intc/arm_gicv3: Fix writes to ICC_CTLR_EL3 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 ICC_CTLR_EL3 register includes some bits which are aliases of bits in the ICC_CTLR_EL1(S) and (NS) registers. QEMU chooses to keep those bits in the cs->icc_ctlr_el1[] struct fields. Unfortunately a missing '~' in the code to update the bits in those fields meant that writing to ICC_CTLR_EL3 would corrupt the ICC_CLTR_EL1 register values. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Message-id: 20190520162809.2677-5-peter.maydell@linaro.org --- hw/intc/arm_gicv3_cpuif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c index 000bdbd6247..3b212d91c8f 100644 --- a/hw/intc/arm_gicv3_cpuif.c +++ b/hw/intc/arm_gicv3_cpuif.c @@ -1856,7 +1856,7 @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, trace_gicv3_icc_ctlr_el3_write(gicv3_redist_affid(cs), value); /* *_EL1NS and *_EL1S bits are aliases into the ICC_CTLR_EL1 bits. */ - cs->icc_ctlr_el1[GICV3_NS] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); + cs->icc_ctlr_el1[GICV3_NS] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); if (value & ICC_CTLR_EL3_EOIMODE_EL1NS) { cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_EOIMODE; } @@ -1864,7 +1864,7 @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_CBPR; } - cs->icc_ctlr_el1[GICV3_S] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); + cs->icc_ctlr_el1[GICV3_S] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); if (value & ICC_CTLR_EL3_EOIMODE_EL1S) { cs->icc_ctlr_el1[GICV3_S] |= ICC_CTLR_EL1_EOIMODE; }