Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2155817ybk; Mon, 11 May 2020 13:21:01 -0700 (PDT) X-Google-Smtp-Source: APiQypKUNJUB3xQKqbxlJGLCxYVsc6QRxBTd8JOW8n5XX0we+Sm5MIGQZC0avm1iUax8KhrAzL/Y X-Received: by 2002:a17:906:ce4b:: with SMTP id se11mr15651675ejb.178.1589228461670; Mon, 11 May 2020 13:21:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589228461; cv=none; d=google.com; s=arc-20160816; b=hcnGrguNvieHRCA7vwVkFNuXmmef6fGtjxvhgULoDpsUCJ3FzNES4ztPtw6nfeL6IJ 9XaSxdnvbnOtiT9l03/pdk2JG8/b2z9DS39te3TXsMzZ0+wPUmnskcdpBt1eg/d+tt3x 2SWlpXoACVNy+h4zlGBKlzkwtNSbjJmh1The+33LQDCPK8k7XTDZ0JgoBlkufHfFpvh/ 1x/BPq9SDx701YPRQ2smuctT7HU90QqkC9A9mbP2IBfIZsRPqpa1yGZLnDPKSf0VCBw/ AZnV1qvlOTB7IdmJEEcZvrjZSnqRWP2S7eZE/ki3o154g0QuyI9YE+prHVKh+xjdI9Xj DbCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=RaKCKeEWoOtodhTrqkkg6DSzOPDR7Bchx62Tp5LVkS0=; b=UCohwyGKxYQ5sPsl1AbSj4x6JtQf93yFIRmuGuYgP2KO2wy10SmBOv9AEurEfz0w1s t58546dOH77h6uXkB7oPdNNt/dHFTIpLRKcKw00IQyq2VWBQ91eeTjd/3WKOBYefGvxi 8IsKOwxK26RpyKsbhEQ0tvCwO3GtfZRcFjfc8aLbGU0YRn+nPTl4YniLvhuYnGvmun4O XsTtiEN5r3VY+WOq7Ayz54wsQOPrPCWOn9PKaCoDaRCfUmIStHLq/IZneXQqaQCrasz9 vpkSQjQI1HADK5b2bDnkridEkAx1mEp6fHGDiYsmAgzF7GF5oyRENcD2Bz/VXf9yy1YK Ok/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l16si6653316edv.378.2020.05.11.13.20.38; Mon, 11 May 2020 13:21:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731320AbgEKURD (ORCPT + 99 others); Mon, 11 May 2020 16:17:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727873AbgEKURD (ORCPT ); Mon, 11 May 2020 16:17:03 -0400 Received: from antares.kleine-koenig.org (antares.kleine-koenig.org [IPv6:2a01:4f8:c0c:3a97::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB29AC061A0C for ; Mon, 11 May 2020 13:17:02 -0700 (PDT) Received: by antares.kleine-koenig.org (Postfix, from userid 1000) id 56683981F75; Mon, 11 May 2020 22:17:01 +0200 (CEST) Date: Mon, 11 May 2020 22:16:56 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Lu Baolu , Joerg Roedel Cc: linux-kernel@vger.kernel.org, rafael.j.wysocki@intel.com, tglx@linutronix.de, x86@kernel.org Subject: Re: Failure to shutdown/reboot with intel_iommu=on Message-ID: <20200511201656.GA2725@taurus.defre.kleine-koenig.org> References: <20200506144558.GA4019@taurus.defre.kleine-koenig.org> <20200508150734.GP8135@suse.de> <11a3945a-f743-ac32-135c-1de026da66c9@kleine-koenig.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="huq684BweRXVnRxX" Content-Disposition: inline In-Reply-To: <11a3945a-f743-ac32-135c-1de026da66c9@kleine-koenig.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --huq684BweRXVnRxX Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello again, On Mon, May 11, 2020 at 09:59:31PM +0200, Uwe Kleine-K=F6nig wrote: > On 5/9/20 3:58 AM, Lu Baolu wrote: > > Hi Uwe, > >=20 > > Have you tried commenting out intel_disable_iommus() in > > intel_iommu_shutdowan()? > >=20 > > diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c > > index 0182cff2c7ac..532e62600f95 100644 > > --- a/drivers/iommu/intel-iommu.c > > +++ b/drivers/iommu/intel-iommu.c > > @@ -4928,8 +4928,10 @@ void intel_iommu_shutdown(void) > > =A0=A0=A0=A0=A0=A0=A0 for_each_iommu(iommu, drhd) > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 iommu_disable_protect_mem= _regions(iommu); > >=20 > > +#if 0 > > =A0=A0=A0=A0=A0=A0=A0 /* Make sure the IOMMUs are switched off */ > > =A0=A0=A0=A0=A0=A0=A0 intel_disable_iommus(); > > +#endif > >=20 > > =A0=A0=A0=A0=A0=A0=A0 up_write(&dmar_global_lock); > > =A0} >=20 > I just tested that and it didn't help. The machine still hangs with the > same symptoms as reported before. I patched the file a bit differently: diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index ef0a5246700e..b76acae6a6ac 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -4922,16 +4922,24 @@ void intel_iommu_shutdown(void) if (no_iommu || dmar_disabled) return; =20 + pr_warn("%s:%d\n", __func__, __LINE__); down_write(&dmar_global_lock); =20 + pr_warn("%s:%d\n", __func__, __LINE__); /* Disable PMRs explicitly here. */ - for_each_iommu(iommu, drhd) + for_each_iommu(iommu, drhd) { + pr_warn("%s:%d\n", __func__, __LINE__); iommu_disable_protect_mem_regions(iommu); + pr_warn("%s:%d\n", __func__, __LINE__); + } =20 + pr_warn("%s:%d\n", __func__, __LINE__); /* Make sure the IOMMUs are switched off */ intel_disable_iommus(); =20 + pr_warn("%s:%d\n", __func__, __LINE__); up_write(&dmar_global_lock); + pr_warn("%s:%d\n", __func__, __LINE__); } =20 static inline struct intel_iommu *dev_to_intel_iommu(struct device *dev) and the output shows that the for_each_iommu loop runs twice and the last pr_warn is reached, too. So the hang doesn't occur in intel_iommu_shutdown() but later. I don't know enough about x86 and iommus to judge what that means or even if this was a useful test. Best regards Uwe --huq684BweRXVnRxX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAl65srQACgkQwfwUeK3K 7AnJTgf+O5xIGA9I6hKnJ72zZZW7bZS07Yrt30PfSkzYcCNOeYU9gjF2/Dis/JX1 P/VPEE3+yENFD8fW8ZP1/Y2ml7eeCO1/zCdeLjuE/AVj282V+8fHgwjLfJUd/QR3 rypvOfsmBuJFyv+WuXqQloTYB6oSiSRn5xKtyfshRQH/B0IAqjC9kGWma7dkqDve NakrmX5fkgZ4flsv+4zdVLFD9tYeLRq2AM/j+B9okgZyM521V5NniwubdMn53tfm XVNjYn0sgUsq5lgQyOQaT7UW6MIuOOCFYFh5gWUL+KObY6YaleLBVtI6GLyL55A4 X8MBHcWYlv3iaen4++grZsZOci6PRQ== =6lsu -----END PGP SIGNATURE----- --huq684BweRXVnRxX--