From nobody Fri Dec 19 04:32:16 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1580401444812174.7655491505559; Thu, 30 Jan 2020 08:24:04 -0800 (PST) Received: from localhost ([::1]:35374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixCbq-0001r1-Fh for importer@patchew.org; Thu, 30 Jan 2020 11:24:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43289) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixCU8-0005nJ-0h for qemu-devel@nongnu.org; Thu, 30 Jan 2020 11:16:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ixCU6-00038A-CF for qemu-devel@nongnu.org; Thu, 30 Jan 2020 11:16:03 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:36101) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ixCU6-00037D-5Q for qemu-devel@nongnu.org; Thu, 30 Jan 2020 11:16:02 -0500 Received: by mail-wr1-x443.google.com with SMTP id z3so4816357wru.3 for ; Thu, 30 Jan 2020 08:16:02 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id a22sm6994442wmd.20.2020.01.30.08.16.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jan 2020 08:16:00 -0800 (PST) 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=FudFrPLs/FW28wgW4YGWYEJ4ys1uBPtYGVZ/qV1IY/0=; b=F+unshtH700rv40WL/rt6Kk1EVMPrfMuA2LZV+2W3UYilLAG7Oc4xZkOXSB1HmvxQz QEXu6gqBaSZ4cp0Z5l2tPHrE2Tkhtv/qqzpowWZTeWdpbrcROtz9KM/WBdaqBW09nB+K Xg8fHXWKpWxqLJXZtUcmPE+IJfIm8voLaguOGvTxe49jP2EMmcqpERCzrIWw9YyG6JMU crXD5qmBC/URL4kO7UPQu/ZnGB/PoScPjQuc8//Vf2JiorKJb977AOrDJFp5pwkR5VZ3 A3Vvn6Qv1CLY6a3/XBir/RRFp/3PNYcafWHDpQNnI6UNEoOVfvOeTtxWl5DV3hbxQxrz 4VkQ== 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=FudFrPLs/FW28wgW4YGWYEJ4ys1uBPtYGVZ/qV1IY/0=; b=YgX/esXk8zx42FvF6DrWhin/kkWy1HBHtpPW70sjFDVAEkvSJCBXWbm9Y9OepzYrwm BHZKW1XDAfAm+RS/FiWEUETiQwrNYKm2GjPY6PcwYRAuAfSnHAydAS5YYvis7dU+FF4w J5UWYi+OkOnuOM3WUg5v8F5QnrjBMz7FA2nQ2OoW5xh0sA2T+eajaWyuuVxefqUa5/D+ W/+vyBmd9zhb0jo5bb3lyhe4lvAWF9EkAvvVBoMqk4sU24Fgu6iJkJ314LmdcnQmJH53 /SmQi2RZsjP0p077rAxIe2FIh0JPHUK9j6rkteknihv+YDgxvwJFk+EnZkmOHYZpm5Sy 3zAw== X-Gm-Message-State: APjAAAWEpy0oalTT7Y4T5G1+fXKsBsQ6FqSAriT+zVxBpDnfPmDdZBzw Fgz632uN1V+PUXFgiPy14V7z88k5g2RFlA== X-Google-Smtp-Source: APXvYqyILcGWB3J8Izj0T7GaH0f4bzA9t1BC7YsWMz1Eeabpk/ttdMjuhkuq0csvcrmZBQT8Aa0f/Q== X-Received: by 2002:adf:f484:: with SMTP id l4mr6759498wro.207.1580400960970; Thu, 30 Jan 2020 08:16:00 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 20/26] hw/intc/arm_gicv3_kvm: Stop wrongly programming GICR_PENDBASER.PTZ bit Date: Thu, 30 Jan 2020 16:15:27 +0000 Message-Id: <20200130161533.8180-21-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200130161533.8180-1-peter.maydell@linaro.org> References: <20200130161533.8180-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" From: Zenghui Yu If LPIs are disabled, KVM will just ignore the GICR_PENDBASER.PTZ bit when restoring GICR_CTLR. Setting PTZ here makes littlt sense in "reduce GIC initialization time". And what's worse, PTZ is generally programmed by guest to indicate to the Redistributor whether the LPI Pending table is zero when enabling LPIs. If migration is triggered when the PTZ has just been cleared by guest (and before enabling LPIs), we will see PTZ=3D=3D1 on the destination side, which is not as expected. Let's just drop this hackish userspace behavior. Also take this chance to refine the comment a bit. Fixes: 367b9f527bec ("hw/intc/arm_gicv3_kvm: Implement get/put functions") Signed-off-by: Zenghui Yu Message-id: 20200119133051.642-1-yuzenghui@huawei.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_kvm.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c index 9c7f4ab8711..49304ca589d 100644 --- a/hw/intc/arm_gicv3_kvm.c +++ b/hw/intc/arm_gicv3_kvm.c @@ -336,7 +336,10 @@ static void kvm_arm_gicv3_put(GICv3State *s) kvm_gicd_access(s, GICD_CTLR, ®, true); =20 if (redist_typer & GICR_TYPER_PLPIS) { - /* Set base addresses before LPIs are enabled by GICR_CTLR write */ + /* + * Restore base addresses before LPIs are potentially enabled by + * GICR_CTLR write + */ for (ncpu =3D 0; ncpu < s->num_cpu; ncpu++) { GICv3CPUState *c =3D &s->cpu[ncpu]; =20 @@ -347,12 +350,6 @@ static void kvm_arm_gicv3_put(GICv3State *s) kvm_gicr_access(s, GICR_PROPBASER + 4, ncpu, ®h, true); =20 reg64 =3D c->gicr_pendbaser; - if (!(c->gicr_ctlr & GICR_CTLR_ENABLE_LPIS)) { - /* Setting PTZ is advised if LPIs are disabled, to reduce - * GIC initialization time. - */ - reg64 |=3D GICR_PENDBASER_PTZ; - } regl =3D (uint32_t)reg64; kvm_gicr_access(s, GICR_PENDBASER, ncpu, ®l, true); regh =3D (uint32_t)(reg64 >> 32); --=20 2.20.1