Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp719719imi; Fri, 22 Jul 2022 08:02:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v30lG+GK9huEAiqJtao4boL2IC+XI3uVeMs/niAPx+8P/5GHBiXxuaAbGgt0yXmjkKYozL X-Received: by 2002:a05:6402:190e:b0:43a:e914:8c11 with SMTP id e14-20020a056402190e00b0043ae9148c11mr252203edz.281.1658502134147; Fri, 22 Jul 2022 08:02:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658502134; cv=none; d=google.com; s=arc-20160816; b=hsywsK5kA91udRiucOyNu0WbKA5CeIM1JQ4uZWuB7Wwnqt53fUnU+mMeInnspadzZi DyFw72MOE263AtnNZBV9wPkTKjwxMeIs+09eUZalo5X2dhBbkRwT4auGxgdx/zpY8FKT Ztt/BWMOWzZpy8fRvQD+KSVJrO8qsB8Uogo/zxBjSVRLkLRMfZznd4PaKG2al03U1NUl Jel47LvGooigm30XOwfDqR8saPQWgz3FA8hPJN1Q5v6VoP63Urosh9qNb53NEOEcwNsa SP6VvXriNdR/N5h4X7LFrSnn22WD4EmtXr4RpxlcGc/LhlRmXYrqrB55vM6o+U9+dZ3R 282A== 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=260w/7kAP8oziys5O26p3zF2vCL7N4w7HYmip9LfFDw=; b=ewVkqaJ7V4Qvw5/kRcqLp9+VUzjHL7dN7iIsfPmPrabOiVR3qh6x6cTA1DrbJwk7JL MKlydK7GQU/72N1YDuGUcjMi8FjGea/ihOvF58WhgQd9sYCMA580fBQpyUWAddko7gW7 aaG7/WdTGgCweN0Gp1BG90odHktsjd9A/BaHbE+d5SZwhnXhnhBRb1gLtfVRClaQ52HD O+6JYumm+PyR8dISuTHyPmDiq9DCXtt78nLU/3oVoisVCG08q2M4UgQRxvQrsFiq+i6f uBI3l0RaChFamAvlsdaUQ/D8muUFcryhdrJBxWDb79UgUATzftFIgXWqbJqjPerFkjrX XYVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr42-20020a1709073faa00b0072a950b5535si6526585ejc.556.2022.07.22.08.01.47; Fri, 22 Jul 2022 08:02:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233193AbiGVOhT (ORCPT + 99 others); Fri, 22 Jul 2022 10:37:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiGVOhR (ORCPT ); Fri, 22 Jul 2022 10:37:17 -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 9108A7FE5F for ; Fri, 22 Jul 2022 07:37:16 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id 2FF685D1; Fri, 22 Jul 2022 16:37:15 +0200 (CEST) Date: Fri, 22 Jul 2022 16:37:13 +0200 From: Joerg Roedel To: Jerry Snitselaar Cc: Suravee Suthikulpanit , Will Deacon , iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iommu/amd: Disable guest vapic logging during early kdump init Message-ID: References: <20220721003439.403435-1-jsnitsel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220721003439.403435-1-jsnitsel@redhat.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 20, 2022 at 05:34:39PM -0700, Jerry Snitselaar wrote: > diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c > index 1d08f87e734b..2b00d7f28df7 100644 > --- a/drivers/iommu/amd/init.c > +++ b/drivers/iommu/amd/init.c > @@ -815,6 +815,11 @@ static void free_ga_log(struct amd_iommu *iommu) > #endif > } > > +static void iommu_ga_log_disable(struct amd_iommu *iommu) > +{ > + iommu_feature_disable(iommu, CONTROL_GALOG_EN); > +} > + > static int iommu_ga_log_enable(struct amd_iommu *iommu) > { > #ifdef CONFIG_IRQ_REMAP > @@ -2504,6 +2509,7 @@ static void early_enable_iommus(void) > for_each_iommu(iommu) { > iommu_disable_command_buffer(iommu); > iommu_disable_event_buffer(iommu); > + iommu_ga_log_disable(iommu); > iommu_enable_command_buffer(iommu); > iommu_enable_event_buffer(iommu); > iommu_enable_ga(iommu); Looks about right, but I also let Suravee comment on this. Disabling the GA-Log under a device still using it should hopefully not put it into some undefined state.