Received: by 2002:a17:906:da85:b0:8b1:202f:4753 with SMTP id xh5csp1437270ejb; Tue, 14 Feb 2023 08:47:33 -0800 (PST) X-Google-Smtp-Source: AK7set+w84jYs6mO7fC+ujspzqtgrFeWASRd5wHL+aRJDSU8RXdKUg7IBr0A38lXG3ofq2uhkBpg X-Received: by 2002:ad4:5bce:0:b0:56e:b1d2:9c2a with SMTP id t14-20020ad45bce000000b0056eb1d29c2amr6340408qvt.28.1676393252830; Tue, 14 Feb 2023 08:47:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676393252; cv=none; d=google.com; s=arc-20160816; b=tIcEPG8X3AqlLdTj1Dz3xMmw6eUbgDD5Z8S7P5Qx2q0WXT0oVRRN2fxMxLvqGdBkYS b4i4YW6Dlx5wKOShNiyaTGMClMs+6+Wc/JsmFwsfa3ayFbVNe5XPbxCJmWdCg5pG29Ht TAlyiOY9mLoW6GONpn9lUQRTvZ8VpkLwguQ5CaJzuhI6PET9itRH/LqBEnS6NVmlnGYO 9rkQnCUZXQGTuuXtdtsUOYSH+VTv8IDzP/p8T37VxT+7zwto0nO8jK4LXpB72jbS6nWx dF+bIUMDRtlYzfsIfJXmv0mmFAV+U7UgeDQRCMRy4EZO/g15wEGz6hK4/uV9DzuUGA0N N1bA== 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:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=yPQ3A/aqIa3E8/dq3NNnJxVzrOysQLv4cmbI87Qg/7M=; b=W3DUb6Ad96V3EUSGaN4OEaklOoWRAfHRRRVW2wW6D1KMpQWDui+YMWTrTnURAZ1kO/ XbDtLSSgMruv/VkxcGW2GxJpek3am1tdclPZ8oyYulxa6EIQuY5JJb46xnQUT9qNZbc7 Cpbr6L4/BUe73+HKrHQ/+1+vRfMqAD3m1yZaTskgk3KqERtlNclBMxFZspoZ4hXXh8HO TfbqK6RtAG90b6WNIWlXJwW+zl/nhtl6sseOMMakCRP5QFLmtOpb2J2KGAUsBatoBeK5 JnDVx83LfMi8BtGp+ZbtH3b1+buOaWS8/A2+4uRqwxcVx/mL5zQVNoaSHLXr4FIoMejj z+3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cySMrgEk; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=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 l11-20020a0cac0b000000b005354c56eec3si12361622qvb.409.2023.02.14.08.47.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Feb 2023 08:47:32 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=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=cySMrgEk; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=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 1pRySb-0004bF-2x; Tue, 14 Feb 2023 11:47:17 -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 1pRySY-0004aM-Rw for qemu-arm@nongnu.org; Tue, 14 Feb 2023 11:47:14 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRySX-0000ol-2A for qemu-arm@nongnu.org; Tue, 14 Feb 2023 11:47:14 -0500 Received: by mail-wr1-x436.google.com with SMTP id m10so7406065wrn.4 for ; Tue, 14 Feb 2023 08:47:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=yPQ3A/aqIa3E8/dq3NNnJxVzrOysQLv4cmbI87Qg/7M=; b=cySMrgEk4vg/vb81EgKw9J8i5hmBSP7nSKT+h3jl3ibuOIgl4YCt+em1Y1FKqU8N7K a7j/2vfJWcjqe2iOVuXDW1EbbBVt00/v+Ut09CN8hLUlwZ/br6G4GzokKFRXNQTDzQsF 31FLxcsZxgd0RBCASRkxj4MfMhhaLEg3OnQn3j9q/7UdBvYrtfhsckNDIpMm8yInIPYe b+fpf3HTqXR/tr93/um5eQ8l9XkHMDiw1JQdJ+6MEpCKp2+ZLOaYVOSTsB2UZVHD/Wms GcobD24zIFiqyxuqZYjFhKthsyZV3AoJ1mOVt0IJEGJNvMJujnm0uLVry3mQqfLlykzl /CVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=yPQ3A/aqIa3E8/dq3NNnJxVzrOysQLv4cmbI87Qg/7M=; b=l3UXWEMBY3w8ISimaWnyrsGh/h8Di89ORvEUwmXGvzeMGKBamYGb/ZM2jB6XhkAQQu FhbL5nIgyNalu28xEtFfdBm4ImAda853qLUTj6t/xM5kf6dbZyznM1SvUSSMJAz30WPp G3IkWuJlrd2SCvt/KylU5qmqvpMXbWizW4xGaEB9b3CTBtF2EFFZnSWvFF6nYkGv3RBJ Vq+6jZpKKengOLsHScG0fBAexdNK449S25nfuTzGQj/Y1PsfzPm7M73wzTqaZF0FmhwQ oiRu/jaMnS9tgWLOf3IUOxoyJcxVTNsfm7oXxgysloVKxr2jBry/AvFFS+gygNoW7yHn gG4A== X-Gm-Message-State: AO0yUKX09OoTmD48WYARt2i2eyMfqJLTqDIC1x4BWKGM+ak3ZnNNYLxe SzdF9FULJuHZXB/4ors8hKLqPg== X-Received: by 2002:a5d:4490:0:b0:2c5:598a:dd0c with SMTP id j16-20020a5d4490000000b002c5598add0cmr2796969wrq.0.1676393231173; Tue, 14 Feb 2023 08:47:11 -0800 (PST) Received: from myrica (054592b0.skybroadband.com. [5.69.146.176]) by smtp.gmail.com with ESMTPSA id k16-20020adfe8d0000000b002c54536c662sm12025958wrn.34.2023.02.14.08.47.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 08:47:10 -0800 (PST) Date: Tue, 14 Feb 2023 16:46:59 +0000 From: Jean-Philippe Brucker To: Eric Auger Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, qemu-arm@nongnu.org, ola.hugosson@arm.com Subject: Re: [PATCH 2/2] hw/arm/smmu-common: Fix TTB1 handling Message-ID: References: <20230210163731.970130-1-jean-philippe@linaro.org> <20230210163731.970130-3-jean-philippe@linaro.org> <1964d20f-e18b-5875-914b-16f2f3acee37@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1964d20f-e18b-5875-914b-16f2f3acee37@redhat.com> Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=jean-philippe@linaro.org; helo=mail-wr1-x436.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-arm@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-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: Y3HGtfsF4Ej7 On Mon, Feb 13, 2023 at 05:30:03PM +0100, Eric Auger wrote: > Hi Jean, > > On 2/10/23 17:37, Jean-Philippe Brucker wrote: > > Addresses targeting the second translation table (TTB1) in the SMMU have > > all upper bits set (except for the top byte when TBI is enabled). Fix > > the TTB1 check. > > > > Reported-by: Ola Hugosson > > Signed-off-by: Jean-Philippe Brucker > > --- > > hw/arm/smmu-common.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c > > index 2b8c67b9a1..0a5a60ca1e 100644 > > --- a/hw/arm/smmu-common.c > > +++ b/hw/arm/smmu-common.c > > @@ -249,7 +249,7 @@ SMMUTransTableInfo *select_tt(SMMUTransCfg *cfg, dma_addr_t iova) > > /* there is a ttbr0 region and we are in it (high bits all zero) */ > > return &cfg->tt[0]; > > } else if (cfg->tt[1].tsz && > > - !extract64(iova, 64 - cfg->tt[1].tsz, cfg->tt[1].tsz - tbi_byte)) { > > + sextract64(iova, 64 - cfg->tt[1].tsz, cfg->tt[1].tsz - tbi_byte) == -1) { > > /* there is a ttbr1 region and we are in it (high bits all one) */ > > return &cfg->tt[1]; > > } else if (!cfg->tt[0].tsz) { > > Reviewed-by: Eric Auger > > While reading the spec again, I noticed we do not support VAX. Is it > something that we would need to support? I guess it would be needed to support sharing page tables with the CPU, if the CPU supports and the OS uses FEAT_LVA. But in order to share the stage-1, Linux would need more complex features as well (ATS+PRI/Stall, PASID). For a private DMA address space, I think 48 bits of VA is already plenty. Thanks, Jean