Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp53084pxb; Tue, 12 Apr 2022 16:34:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxO0S+0IWzV6WS3B10FWl4P7VaeaE18HTMbRMlQBj651OgpBNtaSjRZeBtPPC8vcpCgdIIf X-Received: by 2002:a17:90b:224a:b0:1cb:8bad:ec3e with SMTP id hk10-20020a17090b224a00b001cb8badec3emr7699876pjb.30.1649806481418; Tue, 12 Apr 2022 16:34:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649806481; cv=none; d=google.com; s=arc-20160816; b=KUstVUG9u4T5L6Bai7TBEQYrKcci+l4VAHcHi0Yy0sSkihWqIZqhEbUDPA+MX6nNo4 AMPQqR7vE5EtAtWtwPSzu1h2ulFYHRiiubn/UPf7Nd5IIbRTVCnctbxMzaGukwaXbW7S k8Yw4FfD4PDIeZ9483Ie/8NDTVo//oda7ijahRDZOC7gjs3CmGJ0/207fRSg9/lB8/Md Ae+vtroGHH+3jsfePeGWna91U5VD+VV2vUFWR+Lm6XODNKDDrocKDEU7J0DoaO78HP6U iiOF1Stb3Do008mNobNmklRxRUjLY4IQY3Y4xknw2z1XhT21wGZVIoHxjkrdozk8AsS6 dpNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=gg55rwA+CxyctkxU7vTp6Fb+9ZuAHWlfx3CjvLejbkc=; b=AhZmjUQLSZgcPnvrQPVKl372ZA3V3X1fJ/GIBd/E4J/501gWxfCxDJUaEQVXlOX0l+ 0Q2TJ+gFHNIikYn3QWy14iyAIsnbDtm4dFbL/NYJKekt+kb4HgdRGuiZ4PZCE8FeS5eE r+6oxG73f1RiR8fPcD/9Qn5WOrnN2FANIVR0YoAwBysqYPZDT18wxau9YZ1uhT5wZYaN V3PjpDdvrKXtfzrBfSSe4P8mXuOrgzgdqIZiU1Dw89YTG/VfCYn9w0uMuQw3JLXPZtiI BVyBjWQEgaDJXLF1FATX6Mok98tA6fUpgEXWhlp6lRJZD8eErvYZ80pOMGjnBjZOlahm /F5A== 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x12-20020a170902b40c00b00156b0dd99b6si12477886plr.221.2022.04.12.16.34.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 16:34:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3210F1B2C76; Tue, 12 Apr 2022 14:25:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1391286AbiDLJ3C (ORCPT + 99 others); Tue, 12 Apr 2022 05:29:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383021AbiDLIfS (ORCPT ); Tue, 12 Apr 2022 04:35:18 -0400 Received: from mx1.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A2445D1A1 for ; Tue, 12 Apr 2022 01:01:26 -0700 (PDT) Received: from [192.168.0.2] (ip5f5aef95.dynamic.kabel-deutschland.de [95.90.239.149]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 30DB661EA1923; Tue, 12 Apr 2022 10:01:22 +0200 (CEST) Message-ID: <88760cd1-d1ed-8952-d061-15e238b2ec57@molgen.mpg.de> Date: Tue, 12 Apr 2022 10:01:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH] drm/amd/amdgpu: Not request init data for MS_HYPERV with vega10 Content-Language: en-US To: Alex Deucher , Yongqiang Sun Cc: Jingwen Chen , "Luo, Zhigang" , amd-gfx@lists.freedesktop.org, monk.liu@amd.com, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, LKML References: <20220411135939.906700-1-yongqiang.sun@amd.com> From: Paul Menzel In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 [Cc: +x86 folks] Dear Alex, dear x86 folks, x86 folks, can you think of alternatives to access `X86_HYPER_MS_HYPERV` from `arch/x86/include/asm/hypervisor.h` without any preprocessor ifdef-ery? Am 11.04.22 um 18:28 schrieb Alex Deucher: > On Mon, Apr 11, 2022 at 11:28 AM Paul Menzel wrote: […] >> Am 11.04.22 um 15:59 schrieb Yongqiang Sun: >>> MS_HYPERV with vega10 doesn't have the interface to process >>> request init data msg. >> >> Should some Hyper-V folks be added to the reviewers list too? >> >>> Check hypervisor type to not send the request for MS_HYPERV. >> >> Please add a blank line between paragraphs. >> >>> Signed-off-by: Yongqiang Sun >>> --- >>> drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 12 ++++++++++-- >>> 1 file changed, 10 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c >>> index 933c41f77c92..56b130ec44a9 100644 >>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c >>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c >>> @@ -23,6 +23,10 @@ >>> >>> #include >>> >>> +#ifdef CONFIG_X86 >>> +#include >>> +#endif >>> + >>> #include >>> >>> #include "amdgpu.h" >>> @@ -721,8 +725,12 @@ void amdgpu_detect_virtualization(struct amdgpu_device *adev) >>> break; >>> case CHIP_VEGA10: >>> soc15_set_virt_ops(adev); >>> - /* send a dummy GPU_INIT_DATA request to host on vega10 */ >>> - amdgpu_virt_request_init_data(adev); >>> +#ifdef CONFIG_X86 >>> + /* not send GPU_INIT_DATA with MS_HYPERV*/ >>> + if (hypervisor_is_type(X86_HYPER_MS_HYPERV) == false) >>> +#endif >> >> Why guard everything with CONFIG_X86? (If it’s needed, it should be done >> in C code.) > > X86_HYPER_MS_HYPERV only available on x86. Sorry, I missed the X86 dependency when quickly looking at the Hyper-V stub IOMMU driver `drivers/iommu/hyperv-iommu.c`, but missed that `HYPERV_IOMMU` has `depends on HYPERV && X86`. Kind regards, Paul >>> + /* send a dummy GPU_INIT_DATA request to host on vega10 */ >>> + amdgpu_virt_request_init_data(adev); >>> break; >>> case CHIP_VEGA20: >>> case CHIP_ARCTURUS: >> >> >> Kind regards, >> >> Paul