From patchwork Mon Aug 12 20:52:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mostafa Saleh X-Patchwork-Id: 13761045 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 F0B3FC3DA7F for ; Mon, 12 Aug 2024 21:07:12 +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:Content-Transfer-Encoding: Content-Type:Cc:To:From:Subject:Message-ID:Mime-Version:Date:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=88bVHoRsxbRrvGL5pbopsa/PY4mJcz4Ns16/n4GjTEM=; b=34kAMnhU3QGD82aZJ3CgemLWvg 7XPVdWlvyhC5U5CEwJGM6gjAdo/Kvpbv8pe5sFWkxGCznJPHxHEu4OOQrz/JW4WG5zBkjlbhzgy+Q rzBmccZ/aeTuKAqMAWMyo/+l3vo6WdMc0xEQRpDisJrUbxs8VabdEHQlppJUEuab/66cmLSqtDBPK lUy/UdvHw/VoQ5wFUC89pvXHxoFPUa2T4lxDuabYBGPhuWp5VV9+S18wbqpmSsOuV8Iy5tF/s8qU3 b/PWIbCk3wzG+Vwez4hiXyAYuwewAvrUGCc+QKDwCSUmD1yTijlEUT5Wncr4GGarM6zkxBMaoT6wv vAoOr8yw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdcFr-00000001ZnD-0h37; Mon, 12 Aug 2024 21:07:03 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sdc2P-00000001WJc-3QuC for linux-arm-kernel@lists.infradead.org; Mon, 12 Aug 2024 20:53:11 +0000 Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-e0b3d35ccfbso6913549276.3 for ; Mon, 12 Aug 2024 13:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1723495988; x=1724100788; darn=lists.infradead.org; h=content-transfer-encoding:cc:to:from:subject:message-id :mime-version:date:from:to:cc:subject:date:message-id:reply-to; bh=88bVHoRsxbRrvGL5pbopsa/PY4mJcz4Ns16/n4GjTEM=; b=PaX1qrUyWJSWwpNtFW8FwHmWQpZ+4ueFelK1otK3LuIBGf2jRHzQGEX7gw5Mqi98o0 k3YI9KFTyIdmnYuwIdSB4HCDbf4ymIZyc6cIP17bI4EXb5+SgRItMSdmKAgw0/nRQMwK O3YJ1fcm5ANnIPp28b2mog/rt8O5wvs0aIDmnFqOVrqpvKwuJtjRk6U0oK5U/x90Wp5L RXHl5la2yk8QSZENZ3SJwj+qtfmztffgzcC7M3jTfrDflo/0N56o5SHuqgJGRUw2276E rBpkpxdh67ihQFHD24odv9AXs5ZQE38S3FyUBxUcbVi4pHDWJuQv1PNwwIY/gK4v005B utgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723495988; x=1724100788; h=content-transfer-encoding:cc:to:from:subject:message-id :mime-version:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=88bVHoRsxbRrvGL5pbopsa/PY4mJcz4Ns16/n4GjTEM=; b=eb5kLl+qOe52xK8Oyh1jr76EsYzErMKDMnW1k1oW2MO29QwHDkAmW2M0hXXmOHmNfV NbsM7FNGiDs2TNppSPLaZ9qV4U0y41MwPC8nwVyNvig5LWElHTaAbEC9LyIdcrz7XR37 ritcMha5SPvWK+kN2jHEqcrF25k2E+bfHCxW92r7lde6U8ptebHtKFwtu0bpt9UN4qYI ywmTVjlEVaHVqGMVNhGhl44znHuhfsmvfnvXDNVDbRcLix8953JyzLKsfqV5Ar9GnJyx tiZC1RxswZ7Z/3EOm0iYCKhogX67rsqtmTm5aoFLRKDgnSuLIci14eAetxBCZwaVZB4o 584w== X-Forwarded-Encrypted: i=1; AJvYcCUV2AuL+w5UbTd+L6d+Ef8rvTg8glkUg4nJ+YKSJatukEL8G1qmc9S4kcGPrxT/uA5Q6u9KNDnQ0U05OX/6VCM0@lists.infradead.org X-Gm-Message-State: AOJu0YyUZy0/wjIu5wPMxPFrWv/ECF0yekBH9joKqD9KX2c7qyAAQ3eL Z1idV59n3HkhHri36CqaKuzRCcg761dn/LfigRHy2ngnF7asCgdx5CPrDNbFF7UVKDduSjSJjfR MX26BSlxv2Q== X-Google-Smtp-Source: AGHT+IE+M3ZD7kW5OEAx0JM3HgxM7/yZxSBsb3zBQBn1c1T3spqqB7uD0VloVa5DqUJLt3JAncTwC2KgNLBnow== X-Received: from mostafa.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:333c]) (user=smostafa job=sendgmr) by 2002:a5b:483:0:b0:e0b:f69b:da0a with SMTP id 3f1490d57ef6-e113d2c151bmr2350276.12.1723495987868; Mon, 12 Aug 2024 13:53:07 -0700 (PDT) Date: Mon, 12 Aug 2024 20:52:53 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.46.0.76.ge559c4bf1a-goog Message-ID: <20240812205255.97781-1-smostafa@google.com> Subject: [PATCH 0/2] Fix handling of S2 stalls From: Mostafa Saleh To: 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 Cc: jgg@ziepe.ca, nicolinc@nvidia.com, mshavit@google.com, Mostafa Saleh X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240812_135309_888285_8B1CD1AA X-CRM114-Status: GOOD ( 10.55 ) 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 While debugging something else, I spent hours looking at hexdumps of STEs, CDs and commands while comparing them against the arch specs, where I noticed a minor violation in the driver regarding handling of S2S bit in the STE. This has been there for ages, so it’s highly unlikely that any HW (if it exists with such features) running Linux is affected. I don’t have access to HW with stalls so I just tested normal usage and (terminated) translation fault events. Mostafa Saleh (2): iommu/arm-smmu-v3: Match Stall behaviour for S2 iommu/arm-smmu-v3: Report stalled S2 events drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 23 ++++++++++++++++----- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 3 +++ 2 files changed, 21 insertions(+), 5 deletions(-)