From nobody Thu Dec 18 22:26:08 2025 Delivered-To: importer@patchew.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 ARC-Seal: i=1; a=rsa-sha256; t=1612289626; cv=none; d=zohomail.com; s=zohoarc; b=mBSE0juxoGKfjM+3hud2SRF5Pn6rVwa7oY+Z8L2yu0+zdmiO50uweGE3BTpk9CNSV2zNF/+RYtkpAtI6TzpZfM4eUBuRo6VFA1kFXjjBWyLCIHLI1Bo6J8URCY/I37ddAFTr+tQGKiXdmVxI8oLiTa9VHa3MvqOA7Ir2olwagYg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612289626; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HOai2hjmb+bjOdqLwZmme/jaMMIUJwVTY3N//HvBLNo=; b=KOcZCsfal4wn3FYMUt7Okpy4M65VFCMJhBjhQecEv30Fq87N/14BASz1FgS+5PH0aRgK/cFV4LJX7lJXUl8lppiymC3SBF/UWJme33cgmuIF+aDsbZ/1j2qpPFS/b7wdLJRGlpO0WPFwS+s4+VZOw8nDg1PQL7E2xWBhRXGaeC0= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1612289626662902.3208340271177; Tue, 2 Feb 2021 10:13:46 -0800 (PST) Received: from localhost ([::1]:50432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l70BN-0007XS-CK for importer@patchew.org; Tue, 02 Feb 2021 13:13:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6ztx-0005PJ-6p for qemu-devel@nongnu.org; Tue, 02 Feb 2021 12:55:45 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:34875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l6ztk-0002GU-PY for qemu-devel@nongnu.org; Tue, 02 Feb 2021 12:55:44 -0500 Received: by mail-wr1-x433.google.com with SMTP id l12so21439576wry.2 for ; Tue, 02 Feb 2021 09:55:29 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id q6sm4142283wmj.32.2021.02.02.09.55.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 09:55:23 -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=HOai2hjmb+bjOdqLwZmme/jaMMIUJwVTY3N//HvBLNo=; b=ACE9PI16XvuR4oj7cJdy7TmAft0AqDDOjm/s0IqpVTj+2DGGS3NMMHaFmI1qiIGYB9 Dtubvl/YPTxVO0rlmLtIc16Y26dLQYbpVBHPp69dEhbkqc7GQX/UTOQv62aLgt9xN6qp sIaObxF2Nu0SvhyKxzC1uiU8vwza1QpuCiEIwgrYLVRuWecDINrRbK6EcGH04qoSLjh1 dn/VQSDZHR4FdJkkN1ahUQCV/ypTXH5f8M6OFlip03PyidIRltXvU3qh8jQAeKdTpQbl R5cbAkedinpKLCdvM3RJ7gjmNuo8ao9K+Z776Cq8K9LcUgusIhJmZFSL4vZNPDZouEcF WNug== 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=HOai2hjmb+bjOdqLwZmme/jaMMIUJwVTY3N//HvBLNo=; b=s/IcKkJxKy0hZFu13jNWjX3FMmjc/yCjv9m4qHjL7oABs9koxILOf5mwBUuARIvWed wD83mbpiQzCy05iJiOPUxIa7yuG4hHFODT76vJB21rphnhR6tQNaVXd6xAZSAcyFMo6m hAh3kdAS+13GMTDDYzMpauM5VHCDQ2njEK3HSny+RkZynLgEyq7fElFkU1Cop9iin9fn jBpeMQNZcZO4Ist+6aBgKxDNidcH2Y+bhgKidyt4CCrtMgjHsJKe9x01R47+gkEvDAlB MXWmeVC6tTOiHrheXUudS4efj3blZ8Rcwa23RLt2XgsaSjAtdOW5pt1eaQ24cHWZGf9F klsA== X-Gm-Message-State: AOAM532g0lM1WdhuQwdkIB/u7nuNZPV+4m6L3DKUM5UpyLHQ4XOdpF6j 1tB+GhKtC4xru7njkUr6dQRKrNva0uV16Q== X-Google-Smtp-Source: ABdhPJwSdzObFCB01MZ/6cedfHFSHDVrJ4G4jkIBtvlAIvwYev3ynbx0EzCwcu4lTH+QJmIOn+/WJQ== X-Received: by 2002:adf:e7c1:: with SMTP id e1mr25031265wrn.23.1612288523828; Tue, 02 Feb 2021 09:55:23 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 04/21] hw/arm/smmuv3: Fix addr_mask for range-based invalidation Date: Tue, 2 Feb 2021 17:55:00 +0000 Message-Id: <20210202175517.28729-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210202175517.28729-1-peter.maydell@linaro.org> References: <20210202175517.28729-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 When handling guest range-based IOTLB invalidation, we should decode the TG field into the corresponding translation granule size so that we can pass the correct invalidation range to backend. Set @granule to (tg * 2 + 10) to properly emulate the architecture. Fixes: d52915616c05 ("hw/arm/smmuv3: Get prepared for range invalidation") Signed-off-by: Zenghui Yu Acked-by: Eric Auger Message-id: 20210130043220.1345-1-yuzenghui@huawei.com Signed-off-by: Peter Maydell --- hw/arm/smmuv3.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c index bbca0e9f209..98b99d4fe8e 100644 --- a/hw/arm/smmuv3.c +++ b/hw/arm/smmuv3.c @@ -801,7 +801,7 @@ static void smmuv3_notify_iova(IOMMUMemoryRegion *mr, { SMMUDevice *sdev =3D container_of(mr, SMMUDevice, iommu); IOMMUTLBEvent event; - uint8_t granule =3D tg; + uint8_t granule; =20 if (!tg) { SMMUEventInfo event =3D {.inval_ste_allowed =3D true}; @@ -821,6 +821,8 @@ static void smmuv3_notify_iova(IOMMUMemoryRegion *mr, return; } granule =3D tt->granule_sz; + } else { + granule =3D tg * 2 + 10; } =20 event.type =3D IOMMU_NOTIFIER_UNMAP; --=20 2.20.1