Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6265927iob; Tue, 10 May 2022 14:22:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyi4BHf49VgyGS5Tl2JhRfpGct46vD8pzd5fKRU867ki1T/fBRwUjQbOoWIL3qX7d27BRjC X-Received: by 2002:a17:907:6ea4:b0:6f9:b218:8cd with SMTP id sh36-20020a1709076ea400b006f9b21808cdmr13106505ejc.376.1652217777956; Tue, 10 May 2022 14:22:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652217777; cv=none; d=google.com; s=arc-20160816; b=FUd4+I/n1xO8G9rszL+LkP0uK0FNC9D41rsKviMQbV0oLcSrrsxBs9206VB6YAoRMz dEmd+eoWPGY1lX0nwKTLRkHDBaaF+iohcssSXS7x/6YyBZ04Ho7IqrwlN+EMV+MrhG5a io6DzAQmh0xU1budW23Hh2d+VP93Fwuk1ScvXiGBARX9E0+JEZmqRc/XCERLa5e0zdtK AjiPEWpaVQQ8hn3SMtdon7MI3SvK+lpmTNTHSIagiYPlBrJNe6NwXJkJezwA/g8m8HoN EM8b+HJ7ilx2MxQ97ROYNEKFPIbbIQ4wspCWkdlNDa93EoUbV45WkI5USjqmSo31FXHZ qucQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zmjNeZ/uib4bbc8zO5qfT7cM/tpMMaCnS+8N8ZsjUfI=; b=sDt1dKN5dSsYJKHkHfhGdD5K41Lp2wNX/7TdegNuNAZMMwWwJ1CSvp8QVus6fkiq2a bhEbDk0HXxZjB5OMF8Z6+B5Gs4juHDXmr3Ecbqx7a552ItdC1heCws4D6aDPMQdeQ81W t2Io+z7RYBcGBMsymDyvpaG1erRIcd84qOqLXDShKXTN+78JYMpRK9fhJzuV3SNq0CtB QzD+OiW0tc2BFnB38qO1R4NbkefHbU7VI2iPuV7s5W2A2yLKt8FOXtgoaDTDZKwfrf70 qsmsNuhAINvmlQFKWMMoeLT09q9bp+SItj9B2ByYVYcbJaiyAGquw5juj2Baw4M/UxL4 rupQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="EdM/dvvF"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa37-20020a1709076d2500b006e88cb94b9bsi380144ejc.360.2022.05.10.14.22.33; Tue, 10 May 2022 14:22:57 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="EdM/dvvF"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245673AbiEJOPm (ORCPT + 99 others); Tue, 10 May 2022 10:15:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245611AbiEJNsB (ORCPT ); Tue, 10 May 2022 09:48:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4F032A2F51; Tue, 10 May 2022 06:36:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1F1B161929; Tue, 10 May 2022 13:35:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26948C385C2; Tue, 10 May 2022 13:35:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1652189756; bh=AS54HcrEZsHjiqai2G11EoC2ALkaQiTyOe3F86mglWc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EdM/dvvFKtjkIC89HaySSy1kdCPbTWnNhGdqMGNBRU7kVr469yWA4iuWINBaNVwKi YogKd9uF+T7NQStQaodoSm9/LCMwPjYpwuUH344rNCwzmz4lNI4tyHOHzWGraMHFfp t7bijzPugxqjk1c5Iz82VuxdoU/g5jPvztlgslT0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Alex Deucher Subject: [PATCH 5.17 019/140] drm/amdgpu: do not use passthrough mode in Xen dom0 Date: Tue, 10 May 2022 15:06:49 +0200 Message-Id: <20220510130742.159711326@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220510130741.600270947@linuxfoundation.org> References: <20220510130741.600270947@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 From: Marek Marczykowski-Górecki commit 19965d8259fdabc6806da92adda49684f5bcbec5 upstream. While technically Xen dom0 is a virtual machine too, it does have access to most of the hardware so it doesn't need to be considered a "passthrough". Commit b818a5d37454 ("drm/amdgpu/gmc: use PCI BARs for APUs in passthrough") changed how FB is accessed based on passthrough mode. This breaks amdgpu in Xen dom0 with message like this: [drm:dc_dmub_srv_wait_idle [amdgpu]] *ERROR* Error waiting for DMUB idle: status=3 While the reason for this failure is unclear, the passthrough mode is not really necessary in Xen dom0 anyway. So, to unbreak booting affected kernels, disable passthrough mode in this case. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1985 Fixes: b818a5d37454 ("drm/amdgpu/gmc: use PCI BARs for APUs in passthrough") Signed-off-by: Marek Marczykowski-Górecki Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c @@ -24,6 +24,7 @@ #include #include +#include #include "amdgpu.h" #include "amdgpu_ras.h" @@ -708,7 +709,8 @@ void amdgpu_detect_virtualization(struct adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV; if (!reg) { - if (is_virtual_machine()) /* passthrough mode exclus sriov mod */ + /* passthrough mode exclus sriov mod */ + if (is_virtual_machine() && !xen_initial_domain()) adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE; }