Received: by 2002:ab2:7853:0:b0:1fa:5c73:8e2d with SMTP id m19csp50512lqp; Thu, 30 May 2024 11:38:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVbj1ePLnjxRdiz34/sNu/2MQ/i0SU6uqk4WhIOBW7mMDOvPZWG51f3p711pLmpavLtPXbhoEXqc+rWjs/7VYwDS78cAnDdrMLE6Pqp5A== X-Google-Smtp-Source: AGHT+IFXFfoMSAbKdSdcQX9VbEMyCjWUR4vjcs43dAUBtpkRkzZH3Sspw7VK24iS8kMA92xmFbRz X-Received: by 2002:a17:902:cec4:b0:1f3:46e:1901 with SMTP id d9443c01a7336-1f6193f4331mr33558545ad.10.1717094302432; Thu, 30 May 2024 11:38:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717094302; cv=pass; d=google.com; s=arc-20160816; b=ZbdckRAxzCp3pBjtcY3400tjqkr47QVL+BoMJKTsfZz59a1VlM753Nu+ZgnOG/MkeN cNOVUFl/KJoVr5ludO1QegiR4l6pgOuadhKsdIb9ZzZ5w38EMyclnsUHLxgiYuerFLrW 1B8kCH1CnkkVE/E4qZvHvfi+ZAr1bcPispZqqlk+F+jmRTTw2hM77ZX0ToZlU1I4mNxL 9t/oYu+H7Jtfug0lJcbDeMOgYGMHvoghneCtFW7U98VRcbkP18P5P5eXmcee/T/eOyLR BS6IitGax4SF47K39ijmXpQ3++zXJnpmJHBbH3i2dQ041F+wlWZ4x612L9f9rICamxK2 8W3w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=0U6HffCCQbVDpU0ZFcMNAlCec0e3gES0NCQepInaYBA=; fh=F0MT1zDJs27fXlrNIRAqoG+msG8GmeIYcBbTbbFc4NY=; b=Xi29ck3RPrl1N9qIjYAKJJUF4N6o6TYMXYnWkhgXzwBT8ZsyBA7FIRQmwuhaJLRFhR VOMZzDjdNUIUOzOYVUyBt9V2Qanno9/BLU8bC1sdAbasiNfTpNtMgngkrVZszY2VRNIk ySEa8cE/4B+3h4xJvPITn1Dt1t1/xm85BWfkFEaZzoQX3mMtG0sqbb1IJQ9G5B5mZS2A m43VvRZmIzifklenpRms2vhkqhvRz9Tnz+7ASJLZxuts8oBzFNXivuDp78+NZE62wPag WrcMCW7WMMYZ08eJHlW+zsycGuMEM6PEhQFe9GeN/BCmlHHVx5GgOsQmTC9DHTIoD02k ilDQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=ZPfXmtEg; arc=pass (i=1 spf=pass spfdomain=hpe.com dkim=pass dkdomain=hpe.com dmarc=pass fromdomain=hpe.com); spf=pass (google.com: domain of linux-kernel+bounces-195794-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195794-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f632402facsi1359205ad.491.2024.05.30.11.38.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 11:38:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195794-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=ZPfXmtEg; arc=pass (i=1 spf=pass spfdomain=hpe.com dkim=pass dkdomain=hpe.com dmarc=pass fromdomain=hpe.com); spf=pass (google.com: domain of linux-kernel+bounces-195794-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195794-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hpe.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 8CE1EB22809 for ; Thu, 30 May 2024 18:36:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4987C50241; Thu, 30 May 2024 18:36:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=hpe.com header.i=@hpe.com header.b="ZPfXmtEg" Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6D7E4CE05 for ; Thu, 30 May 2024 18:36:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.143.35 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717094196; cv=none; b=B1mjZ76w3kGy70iKySsT3ReLV91BXLB0mYrO+h16lUNZOD4HGfPxIx5S81NDEQw8hyBAkMv13z3sU9ojszF9yd2gIeFP6DrwS3ralfOV2zaBT1n9DHu8VB6Tpgf2VutKnZqUF/jsItSg+BosDzP0Sn6NfSY/HGn4OtN7WcEv7ng= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717094196; c=relaxed/simple; bh=RNwHdQcUYiTeG5hUBrDS1pUm7v2IHd2A3lb5RBu12MI=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=YglTbaIFhgcH2+xRS6FRTnFgVM1LtR7YGs5RS0CKe60VFUqc3LvpYItKApilySx2aha6KyhcolgiNkebA/wmd6S8vIxZOnyUJliUa1syNcHLDZQ3Pd3focLOPtjDn6Udojgwn4gzYV3JWOyP5XCw9BfkaI+U7NvvgdGr0H6kyhg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hpe.com; spf=pass smtp.mailfrom=hpe.com; dkim=pass (2048-bit key) header.d=hpe.com header.i=@hpe.com header.b=ZPfXmtEg; arc=none smtp.client-ip=148.163.143.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hpe.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hpe.com Received: from pps.filterd (m0134425.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44UFZPBn032085; Thu, 30 May 2024 18:36:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=cc:content-type:date:from:message-id:mime-version:subject:to; s=pps0720; bh=0U6HffCCQbVDpU0ZFcMNAlCec0e3gES0NCQepInaYBA=; b=ZPfXmtEgj5htOfBURnO9ItNEjA+88dJ9+Ncc3l9T/Y/KmKxQWALTiLdRgyfAKGnl3NyI ZbyA8hcPR448WITmIkvVF8Y6fUsXMWwDgtXBE93KntoEsnl06wrDJubFmiKVYWfGUSlI fEiGsbAZFF191nEopjWAVnT+/ZHAa8K53KvEIBXB/FCNCRpiCG0JIaCx6Bbee1CvlFTk HnfGr6kS27fdhD7xZbBMRFk034ksDMoSywezA7vvyXilYL0niqzzLc7OY0rUd4Nwns92 zAvE0pp2+PYchU97SBM+BM+Cnrnxo2jTpDy8Z8Een3ZIY6nAwkiZFSB/a8Jjkgtiiak5 8g== Received: from p1lg14878.it.hpe.com ([16.230.97.204]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3yechy0h2v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 30 May 2024 18:36:09 +0000 Received: from p1lg14886.dc01.its.hpecorp.net (unknown [10.119.18.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14878.it.hpe.com (Postfix) with ESMTPS id 16F6B130D4; Thu, 30 May 2024 18:36:08 +0000 (UTC) Received: from hpe.com (unknown [16.231.227.39]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by p1lg14886.dc01.its.hpecorp.net (Postfix) with ESMTPS id 5ED8A810082; Thu, 30 May 2024 18:36:05 +0000 (UTC) Date: Thu, 30 May 2024 13:36:03 -0500 From: Dimitri Sivanich To: Yi Zhang , "Tian, Kevin" , Vasant Hegde , Baolu Lu , Joerg Roedel , Suravee Suthikulpanit , Will Deacon , Robin Murphy , David Wang <00107082@163.com>, Shinichiro Kawasaki , Dimitri Sivanich , iommu@lists.linux.dev Cc: linux-kernel@vger.kernel.org, Steve Wahl , Russ Anderson Subject: [PATCH] iommu/amd: Fix panic accessing amd_iommu_enable_faulting Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Proofpoint-GUID: Zr1ZavLdYkTSvbOlZ5FyqI86n65-N2MK X-Proofpoint-ORIG-GUID: Zr1ZavLdYkTSvbOlZ5FyqI86n65-N2MK X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-30_13,2024-05-30_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 lowpriorityscore=0 phishscore=0 clxscore=1015 priorityscore=1501 mlxscore=0 malwarescore=0 adultscore=0 suspectscore=0 spamscore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405300137 This fixes a bug introduced by commit d74169ceb0d2 ("iommu/vt-d: Allocate DMAR fault interrupts locally"). The panic happens when amd_iommu_enable_faulting is called from CPUHP_AP_ONLINE_DYN context. Fixes: d74169ceb0d2 ("iommu/vt-d: Allocate DMAR fault interrupts locally") Signed-off-by: Dimitri Sivanich Tested-by: Yi Zhang --- drivers/iommu/amd/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c index a18e74878f68..b02b959d12af 100644 --- a/drivers/iommu/amd/init.c +++ b/drivers/iommu/amd/init.c @@ -3353,7 +3353,7 @@ int amd_iommu_reenable(int mode) return 0; } -int __init amd_iommu_enable_faulting(unsigned int cpu) +int amd_iommu_enable_faulting(unsigned int cpu) { /* We enable MSI later when PCI is initialized */ return 0; -- 2.35.3