From patchwork Mon May 20 16:28:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 164655 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp503075ili; Mon, 20 May 2019 09:37:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzoPSllfBO57sKUP3p3hPLy1KEnsxnerbj3ZSfQ6HItKilkXBrJDk+Yjca7dGeRv6NJlNB1 X-Received: by 2002:a17:906:1483:: with SMTP id x3mr29183016ejc.90.1558370234036; Mon, 20 May 2019 09:37:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558370234; cv=none; d=google.com; s=arc-20160816; b=1G9wDmg3AwNZU7ZCa5efuE27FDT4PguKVBm/hxFE+e0hKnr8aVsxoK4PB/MhmiBeJI fN7RgSzmAbNHKDZz/3FyVYKV7rOg9UQ3Gd/x0C0UWb7Z9N6Cn7sb3UzxvYcl6bLFmbqN zeAbphVc05RywVL3DqaRak2iXSIHFbWf58B3cC/fAooN4/EBwIND15wUJB2lRjcgHaZm ojQP5sOQe9LEvf84lBCcj8WRXIxsHhI/I/f/PNDi3kCdIZc/JlFX+lSlHCPxzstWWQvw YQs9eB8G8zX80BJ+LhJUe5Es4ReKmQh7ZbRODGpAJqVnGYqLJXJxsC5maHLxFFXS95hf ZdxA== 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=PkWoGkmjDkhsD31RM3UCQj/839ATuI528gwh2A5xGB8=; b=xKL4QhvbRCegMjmpkDNWpz24ouVwZCSnHF11/EQr0obhNvGPGVh/Bb6Z8Y/it/Bh+L +JAyIedzUz5oqdIdCBT4s9YOJ0fzdoQ/ow753YgGER9MonAwusQtsdNfdWPhLoIeZXWD 0EvTGocU4Zyzl1obSX0bU2oI+YGMRV3aK27atRXGfhCn70OPkFALGGKAOr3Q5+Q417w0 uWwKYS8uFSksedgzqOI3hlxekosZlabJ+6SFs+b8g5D5nr8cTpUJDK1ZsXyvR7fcK5/J E7gXvEZ0FIf4ySeiTDIBLA0zBYdt6JZhHo8zhvx+KZENWFpQKfwCmoieYM7k2PW62RL3 LSfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Jwmi22dV; 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 t10si2418507eju.219.2019.05.20.09.37.13 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 May 2019 09:37:14 -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=Jwmi22dV; 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]:38356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSlHk-00015R-Tg for patch@linaro.org; Mon, 20 May 2019 12:37:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42775) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSl9H-000387-Ap for qemu-devel@nongnu.org; Mon, 20 May 2019 12:28:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSl9E-0001Hz-NK for qemu-devel@nongnu.org; Mon, 20 May 2019 12:28:27 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:37148) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hSl9B-0001FI-JJ for qemu-devel@nongnu.org; Mon, 20 May 2019 12:28:23 -0400 Received: by mail-wr1-x443.google.com with SMTP id e15so15346985wrs.4 for ; Mon, 20 May 2019 09:28:18 -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=PkWoGkmjDkhsD31RM3UCQj/839ATuI528gwh2A5xGB8=; b=Jwmi22dVbDnOydNY0B5odrgKV11CmiOu58HW75RFMOF+ajMvP6M8TNN9G0wVXg1w4g DPknhgM5CQc/ZvzQ2kefCY+bRy8vbb0F1sD4ZlbFWwost/aaHmEE+YJvbgm+RuDWxTa3 Hn7SexgatDSuWC3WRjuu+f8Pk+/Gt7rSwQbCpVjh5kqgpLHmGFRvsinQszxZAuFgODMm rC2geh8z3gCmt/zg6PBCUhI9iLyNThh/rTKFhCnQaKvtkd8lm4dwZc7hGLTfWeUXOfKC x1s6JXp/Zho6Pay/ztjRqgVwfVPzxQa1oIzJB9OMYZxA2eQ/6p9Pze4kA46UvvQGeDpO A2pg== 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=PkWoGkmjDkhsD31RM3UCQj/839ATuI528gwh2A5xGB8=; b=hiNxr9eUbp0ZFNV96OEE0fVt7wuyfxFU3wd2/ttDqUpvETEUlyijvZqPMBpundUrYM gUdqWk/xe6T1z4lqeZp1lxqPXAL8x2grX7p5jofpudO1kcS6G4zyQopeR8KQgQ2+kdfP 6yYCpgwh3roXZDQbQ3ezjrIhuMUdeB34Dz1A7vXIEBRGdI14/5khjQEqMQh/5ezLVb9i 81+n4ziF6tlu7ALUv20fRAzewGHb8gS/vg/VN/xMJmml0nsG58rZHFVOaPM9zyxwLZaM xt8E4mD8UooUDCxFkkBR7ySCuH6Bptm5gmNQQwqAaklrtceyHpmvz/p5R5XFRtIOWd5j 9ypg== X-Gm-Message-State: APjAAAUAiSAT2P5jNuDfXUcWAmwAFUmloni5xBg9fVhHRU0B/MyPOVWn oY2TlSV9KnknkBfhX+VO6DRey6CjmOQ= X-Received: by 2002:a5d:4907:: with SMTP id x7mr33644400wrq.199.1558369697410; Mon, 20 May 2019 09:28:17 -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.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 09:28:16 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Mon, 20 May 2019 17:28:09 +0100 Message-Id: <20190520162809.2677-5-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::443 Subject: [Qemu-devel] [PATCH 4/4] 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 --- hw/intc/arm_gicv3_cpuif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé 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; }