From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF611C433FE for ; Wed, 27 Apr 2022 14:47:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238536AbiD0OvB (ORCPT ); Wed, 27 Apr 2022 10:51:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238648AbiD0OvA (ORCPT ); Wed, 27 Apr 2022 10:51:00 -0400 Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 896C33C4AD; Wed, 27 Apr 2022 07:47:48 -0700 (PDT) Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-e2442907a1so2156895fac.8; Wed, 27 Apr 2022 07:47:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=47QrNpfa52VRAC22Iw7llWY6NibddnutqiXI8UWF5ZM=; b=BdJa1sqLVKb1yE4G6mdcb+IrXimsh9k5VFXCHYO+xamM3nHZHMPfWXsOGISyvqSyNo nj/hprdtte/D+dyo5UFYWHWD0JqP/tyYtAypuVFKL/355jiVI8mIAOZOnM+zEgOpPyjJ zVlYcc1Vkdo7mdLZU45vCRQ3kA7/qECRXtUtRMM2KyWBpqLpegiBA4FlZlUlLOF4OzTy 5C7zE+/I6B+H0BWA4ES7h6gBKoldpZlVCdzNrvv7Ye8vpasDV3FApa6mu3BCPMvClwAb k9ozUssb2Rlv9vN2YbP6OZ+2AVnpwmmh15Vhq9VnkzqVtlV6i3R8EEh6tycLjcSEhi13 nZjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=47QrNpfa52VRAC22Iw7llWY6NibddnutqiXI8UWF5ZM=; b=5LKs2YXc9kZtBNwNUnkI4fAS137p80G4/k6LmTr0hexbQSaG2obmWQDhwb1GS83qUj Z8mBZ+yiIS2IjqTosDIoJNbwFg8Gm+pjI/MG10JDDOphkwKHAMCcPRR5efyOt8tgV/7m Pz0WqSHyH0t1lYVpfJGDvVP2mzMa75FinA+TOeYnKxN03ypRUBmatrP/YV5nCb92by8l fUCsVyQKdAQnQ6crGN6ZJSPH7jPFr/cX098IB/xbO3F/3frnBg3WzhP7sozD3d6kQFMO xEykk96x4QQVmU1pxi+ToDASlPWi0soD0KreOfJ11YwX2qNn5I8tZNXVRJwaq2HShzLs YYoQ== X-Gm-Message-State: AOAM531DRGUEtON+1RebNnqEWC9+/+aJJ0ZBJOihqil1CmUFhablIuAw iAuaxHQ287Q3AkpY2PpETcLRY17Ju/uvnNq9k/w= X-Google-Smtp-Source: ABdhPJydWVQo9tj6Nu9xcJ7dQNUmdfr2cmUvOyyF9AuD6pmYXXsyxO9TpTngDTsG+9sTvqz8Na6H+DpwNnJxqzKT5+8= X-Received: by 2002:a05:6870:311d:b0:de:9b6c:362b with SMTP id v29-20020a056870311d00b000de9b6c362bmr15164301oaa.200.1651070867943; Wed, 27 Apr 2022 07:47:47 -0700 (PDT) MIME-Version: 1.0 References: <20220426235718.1634359-1-marmarek@invisiblethingslab.com> In-Reply-To: <20220426235718.1634359-1-marmarek@invisiblethingslab.com> From: Alex Deucher Date: Wed, 27 Apr 2022 10:47:36 -0400 Message-ID: Subject: Re: [PATCH] drm/amdgpu: do not use passthrough mode in Xen dom0 To: =?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= Cc: LKML , Lijo Lazar , "open list:DRM DRIVERS" , Guchun Chen , David Airlie , Bokun Zhang , Jingwen Chen , "Pan, Xinhui" , "for 3.8" , Victor Skvortsov , =?UTF-8?Q?Michel_D=C3=A4nzer?= , "open list:RADEON and AMDGPU DRM DRIVERS" , Bernard Zhao , Alex Deucher , Candice Li , =?UTF-8?Q?Christian_K=C3=B6nig?= , Hawking Zhang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Applied. Thanks! Alex On Wed, Apr 27, 2022 at 3:12 AM Marek Marczykowski-G=C3=B3recki wrote: > > 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 i= dle: status=3D3 > > 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 passthroug= h") > Signed-off-by: Marek Marczykowski-G=C3=B3recki > Cc: stable@vger.kernel.org > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/a= md/amdgpu/amdgpu_virt.c > index a025f080aa6a..5e3756643da3 100644 > --- 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" > @@ -710,7 +711,8 @@ void amdgpu_detect_virtualization(struct amdgpu_devic= e *adev) > adev->virt.caps |=3D AMDGPU_SRIOV_CAPS_ENABLE_IOV; > > if (!reg) { > - if (is_virtual_machine()) /* passthrough mode exclu= s sriov mod */ > + /* passthrough mode exclus sriov mod */ > + if (is_virtual_machine() && !xen_initial_domain()) > adev->virt.caps |=3D AMDGPU_PASSTHROUGH_MODE; > } > > -- > 2.35.1 >