From nobody Tue Oct 7 20:20:13 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 header.i=@amazon.de; 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=quarantine dis=none) header.from=amazon.de ARC-Seal: i=1; a=rsa-sha256; t=1576076367; cv=none; d=zohomail.com; s=zohoarc; b=VEN4tLJpraMFkYJnkc3Kt16zyJH3CUL62E+1BkKHgpJfs34INPSyZgMYkGqL1oqZ/eGf44ags1/ul+DnNw2XralyD3OpD8x+vuEt7koo3q3+8IxRKpx7YWDtEMKHe8AOUXTjVQhybvn8hhDEdYKfvwLKfz/x4iYtd0keNWXC7dA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576076367; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=syWV6RethZ9zkiIkM27Et4g5OSvaauBfpbT1hVu+9aY=; b=NtheeX7FXC9O2Babg0TJun1tFQb6wvdbYm6KXxCNghmthzw1HGa/o5jtxl4d6DM1FbGkJh9XkW1wjoX22TVJRYqJy35cT2wHc3QTAAYNjrzYjM1W9tplube4g596iQndeOcEaI0npC/yUPW5xtjAbg/MQF0HpKyTTRUnR52F79Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@amazon.de; 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=quarantine 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 157607636701622.828853583942987; Wed, 11 Dec 2019 06:59:27 -0800 (PST) Received: from localhost ([::1]:43750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1if3SX-0006ON-Q8 for importer@patchew.org; Wed, 11 Dec 2019 09:59:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49991) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1if3Rb-0005VT-JF for qemu-devel@nongnu.org; Wed, 11 Dec 2019 09:58:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1if3Ra-0001be-IB for qemu-devel@nongnu.org; Wed, 11 Dec 2019 09:58:27 -0500 Received: from smtp-fw-6001.amazon.com ([52.95.48.154]:60967) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1if3RY-0001YO-8Y; Wed, 11 Dec 2019 09:58:24 -0500 Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2b-5bdc5131.us-west-2.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP; 11 Dec 2019 14:58:23 +0000 Received: from sveith-desktop.aka.corp.amazon.com (pdx2-ws-svc-lb17-vlan2.amazon.com [10.247.140.66]) by email-inbound-relay-2b-5bdc5131.us-west-2.amazon.com (Postfix) with ESMTPS id AC093A1C74; Wed, 11 Dec 2019 14:58:21 +0000 (UTC) Received: from sveith-desktop.aka.corp.amazon.com (localhost [127.0.0.1]) by sveith-desktop.aka.corp.amazon.com (8.15.2/8.15.2/Debian-3) with ESMTP id xBBEwITa019099; Wed, 11 Dec 2019 15:58:18 +0100 Received: (from sveith@localhost) by sveith-desktop.aka.corp.amazon.com (8.15.2/8.15.2/Submit) id xBBEwIVR019077; Wed, 11 Dec 2019 15:58:18 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1576076304; x=1607612304; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=syWV6RethZ9zkiIkM27Et4g5OSvaauBfpbT1hVu+9aY=; b=Ud4yWMct5kmOFiH3Ispu0ZWbHdQG1c1y0CMUt0VhOEv6j4646r/6AGGd rhdIFPZXO+xFBlO7LFjg3BRbpSD3TemKKNPVjTWLSn6UrVw68FUqQOf69 brMwslAkXa8jnCf+WLAUovHM4CEZe97lzSUpkymdPY2em2hFLA6waIRmv U=; IronPort-SDR: 5U4PCsk5faTlsL3Cto8jsoKGs1PL+7+mTrFEHbg7o+uX5q2rZ64rYnPXCTiHqUCp9Udm/yoNQu fzb7kbt/0GiA== X-IronPort-AV: E=Sophos;i="5.69,301,1571702400"; d="scan'208";a="8624211" From: Simon Veith To: qemu-devel@nongnu.org, qemu-arm@nongnu.org Cc: Simon Veith , Eric Auger Subject: [PATCH v2 1/6] hw/arm/smmuv3: Apply address mask to linear strtab base address Date: Wed, 11 Dec 2019 15:57:35 +0100 Message-Id: <1576076260-18659-2-git-send-email-sveith@amazon.de> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1576076260-18659-1-git-send-email-sveith@amazon.de> References: <1576076260-18659-1-git-send-email-sveith@amazon.de> Precedence: Bulk X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 52.95.48.154 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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 @amazon.de) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" In the SMMU_STRTAB_BASE register, the stream table base address only occupies bits [51:6]. Other bits, such as RA (bit [62]), must be masked out to obtain the base address. The branch for 2-level stream tables correctly applies this mask by way of SMMU_BASE_ADDR_MASK, but the one for linear stream tables does not. Apply the missing mask in that case as well so that the correct stream base address is used by guests which configure a linear stream table. Linux guests are unaffected by this change because they choose a 2-level stream table layout for the QEMU SMMUv3, based on the size of its stream ID space. ref. ARM IHI 0070C, section 6.3.23. Signed-off-by: Simon Veith Cc: Eric Auger Cc: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Acked-by: Eric Auger --- hw/arm/smmuv3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c index e2fbb83..eef9a18 100644 --- a/hw/arm/smmuv3.c +++ b/hw/arm/smmuv3.c @@ -429,7 +429,7 @@ static int smmu_find_ste(SMMUv3State *s, uint32_t sid, = STE *ste, } addr =3D l2ptr + l2_ste_offset * sizeof(*ste); } else { - addr =3D s->strtab_base + sid * sizeof(*ste); + addr =3D (s->strtab_base & SMMU_BASE_ADDR_MASK) + sid * sizeof(*st= e); } =20 if (smmu_get_ste(s, addr, ste, event)) { --=20 2.7.4