Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp547262pxf; Wed, 17 Mar 2021 10:13:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzM0of09236aHJKQ8hkwBni556HoTkGWqJJZ1whWLzZG6xI+bTojWdGvGOWj+6INcy/WM7 X-Received: by 2002:aa7:c346:: with SMTP id j6mr43379801edr.386.1616001190559; Wed, 17 Mar 2021 10:13:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616001190; cv=none; d=google.com; s=arc-20160816; b=SOqSYOSKGK1c8jQanywLKTFupESS0GUnCAhgu5k8NYG7H8gKFTb9RY0LbPhEg/N2dF QM2esXvx34fMHIkrzvV7eN0OQM2Gg9syoLdcB1qJIldO+YacXqoZqYjL5xHNqWPrVBP2 Vix5qW8Ot0wfPeAlbTwdM5jTnRwXWYN32LzrlIZ9QX7ZofxQhlPtfIA8B5djdizQkp68 FfGGhhfA4vMEpKcWXv8PGgM+nA4EPMDrB2tYKlXf5YbkpKqhuAyGWNkS0Oqyo0pEmjLm RabqJ8lyZFQS8iLR8UsD9t0YhS8BrkrUy6v+QafqcohsHfrBB7YDQvIpOMwYdn1Pf8dC mUFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=FzOBEypVqGVqchNzbSeQbEfoZ4l7GGVisQZY0BM/7Ew=; b=atzOyXbE9tWqJi+WNLTY4ev9PAbJT0EU1YiWk+NO8h/0pBc042vyTYoueji529YlyS OQlmWHnigm6MMNIYC4pugH0JNB3Qu2IUD2cwVkd7q+99WuAyB6mI+hoaXONTHG6q0ZHF q10Cdx/aRw6Rq8zEpHgbns3O9a1aihxu7NCFm44Fs1MsJJobn8VFd4+CSPz8+5M3suK0 Lj1UKAw1dC17R+eAXsZqu+Uhr5CuSx0xV4VY2jXr8Yuna5WIBa7SLdgFoOZ+zZULux/J h84cvhwiIDJ3OkIYBZ22oLNZiCD2mIkgPd/o3JJS5Gnp9Mnh3A5DgUTyvVfK6S6lhwzL BRyQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i33si17573801edd.421.2021.03.17.10.12.48; Wed, 17 Mar 2021 10:13:10 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231231AbhCQNdK (ORCPT + 99 others); Wed, 17 Mar 2021 09:33:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231184AbhCQNcm (ORCPT ); Wed, 17 Mar 2021 09:32:42 -0400 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82DA7C06174A; Wed, 17 Mar 2021 06:32:41 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id 5B8992DA; Wed, 17 Mar 2021 14:32:38 +0100 (CET) Date: Wed, 17 Mar 2021 14:32:35 +0100 From: Joerg Roedel To: David Woodhouse Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Huang Rui , Suravee Suthikulpanit , Alex Deucher , Xiaojian Du , Joerg Roedel , stable@vger.kernel.org Subject: Re: [PATCH 2/3] iommu/amd: Don't call early_amd_iommu_init() when AMD IOMMU is disabled Message-ID: References: <20210317091037.31374-1-joro@8bytes.org> <20210317091037.31374-3-joro@8bytes.org> <449d4a2d192d23eb504e43b13c35c326f2d0309a.camel@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <449d4a2d192d23eb504e43b13c35c326f2d0309a.camel@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 17, 2021 at 11:47:11AM +0000, David Woodhouse wrote: > If you've already moved the Stoney Ridge check out of the way, there's > no real reason why you can't just set init_state=IOMMU_CMDLINE_DISABLED > directly from parse_amd_iommu_options(), is there? Then you don't need > the condition here at all? True, there is even more room for optimization. The amd_iommu_disabled variable can go away entirely, including its checks in early_amd_iommu_init(). I will do a patch-set on-top of this for v5.13 which does more cleanups. Thanks, Joerg