From patchwork Thu Feb 16 17:11:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 654065 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp86400wrc; Thu, 16 Feb 2023 09:15:21 -0800 (PST) X-Google-Smtp-Source: AK7set9OBeMEf3F/MjBjlsGVQOkv2oSb3bvzIpsG9h65vf8n0WVejwsWQaj9OVj7y20gXKRedF/A X-Received: by 2002:ac8:5983:0:b0:3b9:b43e:5733 with SMTP id e3-20020ac85983000000b003b9b43e5733mr10527815qte.61.1676567720882; Thu, 16 Feb 2023 09:15:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676567720; cv=none; d=google.com; s=arc-20160816; b=qC8hx1ALF+l1ocUkKOQgLY1KEo9mlu1Tq0FtVNCEQntreJAtE9tDtVeqhzO46zhpjf c8DrdV2wU9YEQXi8l8KhhJx5Y8f6uCnwRqflq9PF3zUiEmgIwrI32rBJ14yH0PVeRGVN GxxV0J14cCriLbpYHixwNcqoMN3+7wI26arSi1id8zG/q+ZzT+w+hxJ1AYGO9LpCqjVy vgK4P2PStJdhsk12QQpEDMumReAG86922Sdl0MSRNf96CgbtfYkH/Z3zzogP9mlQCCic LWaVi84GiusIsq/kg5X1Y4VUqBE+jdZbz6UAtu/CnYwLTKMuDrxXzoyaGi75LiyrJcoz 7tMg== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=zD+gZe3NwGNlSfMSq90UNcL0FHuG48xEwAB0qrl/tCo=; b=b4wVLcQ0qNoaret/I5N8iKM0l8m/O4ZswFfdxJUr5OxgTLkc2H4vaKVqkqN/Ryngly t3V8ufN5oWkyJzFOK8/mvD6eRq9n9CxnJBr+r7END5W7PqpmZOxO7XxaQuH86doLpf8L qUcgJaL7EoXAK5Mi+djl0w5gg0ukttkkTOl4gGG/eFmjARWvtQ5Cv/IvEJ/0OYcs6P3/ tMIMR3xc1iHAwsGkk63L7bwXeCNU3wfPAWgDh7VCUeCVi7UXC34o3gph4FVH+UvywKSR Ztm7HpUB/eMlfQY//b8d4LzDSJd/f9v5cJS6zA/l1HOwcMro6R79JTpslJhMmF2Y25mv iylg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cLsqx9Dn; 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=pass (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 s8-20020ac85cc8000000b003b86db0752fsi1898284qta.369.2023.02.16.09.15.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Feb 2023 09:15:20 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b=cLsqx9Dn; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pShnO-0008ST-71; Thu, 16 Feb 2023 12:11:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pShnL-0008JG-QX for qemu-devel@nongnu.org; Thu, 16 Feb 2023 12:11:43 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pShnK-0007oV-3N for qemu-devel@nongnu.org; Thu, 16 Feb 2023 12:11:43 -0500 Received: by mail-wr1-x429.google.com with SMTP id bu23so2524831wrb.8 for ; Thu, 16 Feb 2023 09:11:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=zD+gZe3NwGNlSfMSq90UNcL0FHuG48xEwAB0qrl/tCo=; b=cLsqx9DnS1kGAR7sg6OZeZz6lU/Ez1p14F+dH/RUieysPYmlqkv0JzVYqQCniZ4saZ G+iAEwLcfxxime0TOJXP5rrMFcSpb/WBjWXy4jajYRGcU7p7/wVlWX9F1DgV2s6FhJzt a4otSoHMDYXinUXACDgy1l98NySiQFaWx1D4nf3p0k+ZzdB2TOucUQfwrt+m5Xe9vO1C fZQVQwb/TApYOGxyCkNoCW5hQFvNKKHeRheTztfc/XQTgqCb/hfJmNM4jzurk5nJ/WKM d/ohQQyu2pP5M354VBl7tSuS5sQO1XxA9//eXFTv4tcqlaQk7ASbH59lcxMdrL84a3vv V6AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zD+gZe3NwGNlSfMSq90UNcL0FHuG48xEwAB0qrl/tCo=; b=wfv/Pg8t/8noVlwAFaeG+FkcJLtGNXh6Grq47J/8taaTbLzWeX7Z95xDL/wTueshd0 C3ldnMyRyxfV0XRzBsWXcy8rCX7K83hXgme1t6PT34QT8KOsYCDTmzpdPtllrwAOxdt/ 0QiKn2jCZ6B7DWmUcXi3P1Oe5Jw4G2hDMgKioFRNSi3HvchrgaLGa1p0L6GZVf6W0kwp d3pkcSuBdT2H5HWA4bxuX4C0cJnSqd5fqPJhVpwwJtBt6zTIEiyhEdqE9/OHTAj+d/Jc jYaeyiVMfnh7XkumJ4vNbJLs4PHWAPTgKvI4Ev/Iv1a1DfDKmmSXHZWQLaLw9kpIvRrk K92g== X-Gm-Message-State: AO0yUKUbYPzUNKr6OEr2WnzgLyisNrCHibQdL7Fqyco13v+3FCGCID2S KJxrxDz4tJ8yoHVKWRJyR9qprcmrgAR/zriy X-Received: by 2002:a5d:5082:0:b0:2c5:4d68:5511 with SMTP id a2-20020a5d5082000000b002c54d685511mr5904976wrt.48.1676567501343; Thu, 16 Feb 2023 09:11:41 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id f12-20020a5d4dcc000000b002c556a4f1casm2049107wru.42.2023.02.16.09.11.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 09:11:40 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 19/30] hw/arm/smmu-common: Support 64-bit addresses Date: Thu, 16 Feb 2023 17:11:12 +0000 Message-Id: <20230216171123.2518285-20-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216171123.2518285-1-peter.maydell@linaro.org> References: <20230216171123.2518285-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x429.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.29 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-bounces+patch=linaro.org@nongnu.org From: Jean-Philippe Brucker Addresses targeting the second translation table (TTB1) in the SMMU have all upper bits set. Ensure the IOMMU region covers all 64 bits. Reviewed-by: Richard Henderson Signed-off-by: Jean-Philippe Brucker Reviewed-by: Eric Auger Message-id: 20230214171921.1917916-2-jean-philippe@linaro.org Signed-off-by: Peter Maydell --- include/hw/arm/smmu-common.h | 2 -- hw/arm/smmu-common.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/include/hw/arm/smmu-common.h b/include/hw/arm/smmu-common.h index c5683af07d6..9fcff26357f 100644 --- a/include/hw/arm/smmu-common.h +++ b/include/hw/arm/smmu-common.h @@ -27,8 +27,6 @@ #define SMMU_PCI_DEVFN_MAX 256 #define SMMU_PCI_DEVFN(sid) (sid & 0xFF) -#define SMMU_MAX_VA_BITS 48 - /* * Page table walk error types */ diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c index 733c9647784..2b8c67b9a1d 100644 --- a/hw/arm/smmu-common.c +++ b/hw/arm/smmu-common.c @@ -439,7 +439,7 @@ static AddressSpace *smmu_find_add_as(PCIBus *bus, void *opaque, int devfn) memory_region_init_iommu(&sdev->iommu, sizeof(sdev->iommu), s->mrtypename, - OBJECT(s), name, 1ULL << SMMU_MAX_VA_BITS); + OBJECT(s), name, UINT64_MAX); address_space_init(&sdev->as, MEMORY_REGION(&sdev->iommu), name); trace_smmu_add_mr(name);