From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A0686C3DA4A for ; Fri, 16 Aug 2024 13:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WLdyyDxuoCEu/ofqE3qKzxzdPAofyeH2iLCwX0g+TKk=; b=LETvbdpuKeoKzs1kpnSaebOWAY p4aX2fBLIUoNvp8OFpHce7qSXUzPbJcepoCrCFiQUIMaIEeOKl946sP1DcM8oqebM+LbX59FUq/co x2y6O7GMNHUizTzDr8zJaF6NDs/Xd2C4sJhnXXYqSZOt4tg+10pGO4CIGwYfcD9az/QgOdMVdO8n0 IC6MaWwjaUzA665o4SCyPEqm31GpvBv5LaHOWigLMMIsYdR302A9XJjVHe4ULknXJ4nh9lGshXALf Mq6qS4lE4K75zH3M4G1UrXvf0oshYgFs0gnri8nrLsn+KHDpAJUUAGHQvtOkEWu0aIdqTgkUNrmtg m25pLxjw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sex4o-0000000D3Ro-095X; Fri, 16 Aug 2024 13:33:10 +0000 Received: from mail-qv1-xf2f.google.com ([2607:f8b0:4864:20::f2f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sex49-0000000D3KD-0UX8 for linux-arm-kernel@lists.infradead.org; Fri, 16 Aug 2024 13:32:30 +0000 Received: by mail-qv1-xf2f.google.com with SMTP id 6a1803df08f44-6bd6f2c9d52so10099836d6.3 for ; Fri, 16 Aug 2024 06:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1723815147; x=1724419947; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=WLdyyDxuoCEu/ofqE3qKzxzdPAofyeH2iLCwX0g+TKk=; b=N9nhdxN9wzVdELXw2SKMfJ6Kp3Ztq/+3NQRGmMdvdc9g06siIwT1bw4P/n2x09KvZC BbFaUjJgulMvlzhyTXYjkHBj8IEdpjVIjC5RtowinPP1fSJ3jZm8BT2Eh71wdJ+S7MDX xyyfoY5CKnZB9AusULkPLfEFRJdpsrayu85ab6c2PiuLtoTccNUwPVoaqsE1J6Oe2Dhz oXq23OVweNTxyJtmEsZX10jQnwMNF+A+vjYKRw3q0M3oOQoRKHCwO1DuCf/r4WtcHpIT PILpvrVPwvyBhQFvKSQ+di4yX+U87jR5LbrReMYGGFTzArflApRg0EqOJygba0z9zGrG pD0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723815147; x=1724419947; h=in-reply-to:content-transfer-encoding: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=WLdyyDxuoCEu/ofqE3qKzxzdPAofyeH2iLCwX0g+TKk=; b=wBf4Ds0KfAyLsD8wHFFKPTjAY6qQgP2ahhqZtyeQ/1foHzafJepz8r0t/bUdmGEo08 eH5/IjFP6fDYFLiwboT0bv3B2D1kch9YKqBd0HydjNclugLl74i2/Cy5RbOcQTQQ6Gof 3anzsGeXOwrer5L74rBvc1ApRKQ8zsK5iZ6IMYilkaI/DJtMfZmsTTD1Hg/gorYfjK4Y 5OMOEh5RuDJkx1leUcbDpcpnZCmYx2QdHYEzmeXwBdZofej5iAWCCuzJVoQ3gdzNvrFk Sfntee6gvwxvjrgMFR+gTiyxCUnOF6mNfUfG+fsLL2VkZR/Dx9MszDRCFh2PeOZnC0BR v0Nw== X-Forwarded-Encrypted: i=1; AJvYcCX/eBnxybiw9udG+MjrvxVVKBQ2onp+Hdqj9YAgWmt91gpgGRV3Uhu1TXcFQ91FgbRWFtfYv1bG7AmFwUPPfIIvMZ4MyA1nJxmHjWxGYzHQ0Kvqk0Q= X-Gm-Message-State: AOJu0Yx+ABTqPuRzbqe9smvN2sHVgqTYjsizIGdKp0KZ+9lQHe+mUpkb 8GRT4JBZY5cndHeGzRYhYFwK8YLFMdrG3A4wzal9T23GKdRWD+5fnqfXgnLJlDU= X-Google-Smtp-Source: AGHT+IFSYD7XIUdE2zz0q7OwzKKppto9XaQU9IEejkC+twRGET75J3c2JhhzjEgdxqdQt2xI7LB8Qg== X-Received: by 2002:a05:6214:3f8a:b0:6bf:7aa3:92dd with SMTP id 6a1803df08f44-6bf7cd80e7cmr35004036d6.9.1723815146697; Fri, 16 Aug 2024 06:32:26 -0700 (PDT) Received: from ziepe.ca ([128.77.69.90]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6bf6ff0a5a6sm17351556d6.138.2024.08.16.06.32.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2024 06:32:25 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1sex3H-009kK9-3S; Fri, 16 Aug 2024 10:31:35 -0300 Date: Fri, 16 Aug 2024 10:31:35 -0300 From: Jason Gunthorpe To: Mostafa Saleh Cc: linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, will@kernel.org, robin.murphy@arm.com, joro@8bytes.org, jean-philippe@linaro.org, nicolinc@nvidia.com, mshavit@google.com Subject: Re: [PATCH v3] iommu/arm-smmu-v3: Match Stall behaviour for S2 Message-ID: <20240816133135.GP3468552@ziepe.ca> References: <20240816125901.3773388-1-smostafa@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240816125901.3773388-1-smostafa@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240816_063229_334194_E8A49A81 X-CRM114-Status: GOOD ( 19.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Aug 16, 2024 at 12:59:01PM +0000, Mostafa Saleh wrote: > According to the spec (ARM IHI 0070 F.b), in > "5.5 Fault configuration (A, R, S bits)": > A STE with stage 2 translation enabled and STE.S2S == 0 is > considered ILLEGAL if SMMU_IDR0.STALL_MODEL == 0b10. > > Also described in the pseudocode “SteIllegal()” > if STE.Config == '11x' then > [..] > if eff_idr0_stall_model == '10' && STE.S2S == '0' then > // stall_model forcing stall, but S2S == 0 > return TRUE; > > Which means, S2S must be set when stall model is > "ARM_SMMU_FEAT_STALL_FORCE", but at the moment the driver ignores that. > > Although, the driver can do the minimum and only set S2S for > “ARM_SMMU_FEAT_STALL_FORCE”, it is more consistent to match S1 > behaviour, which also sets it for “ARM_SMMU_FEAT_STALL” if the > master has requested stalls. > > Also, since S2 stalls are enabled now, report them to the IOMMU layer > and for VFIO devices it will fail anyway as VFIO doesn’t register an > iopf handler. > > Signed-off-by: Mostafa Saleh > > --- > v3: > - Set S2S for s2 and not s1 domain > - Ignore ats check > > v2: > - Fix index of the STE > - Fix conflict with ATS > - Squash the 2 patches and drop enable_nesting > --- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 5 +---- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 1 + > 2 files changed, 2 insertions(+), 4 deletions(-) Reviewed-by: Jason Gunthorpe Jason