Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp3002564pxb; Tue, 24 Aug 2021 12:39:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy76gF9jGx7RVqKXF5h/7ueM7DK7DkNHuSHIchsr+2KFj6oYNGGC5wM8K3B2AUhdbzrM6kb X-Received: by 2002:a92:6a05:: with SMTP id f5mr21061499ilc.140.1629833991612; Tue, 24 Aug 2021 12:39:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629833991; cv=none; d=google.com; s=arc-20160816; b=j7pwVUtt0TWM2BkMSbjgf1h+L2u2hnL/hXyDR9NYGj9SiK72H0ngJb+gL9ami+bMrh t9HBrSDdcR/gjZPPtT/dKuAmVKr5cVGoZ/cc1ln6TIGSm2b8cijZnoeoEgGwkX0j2vOv iXXGRAU3Wh6KAHibM6GmDBMdGRjll0Y28Ec4SDRuuEOWIUfYK6XD5uuBJY3A1ObfL91g BQABR4LNeJmaa2kCuRAilIg7xU0tYlyxVbFXqEsFv2L5BsADphAgOrlhORyzmA3kg+fL +vqK5Cap7jBlb3hpwXtDElR6baDWe4l6/TR4H3SA3lfnKvVb//zmLhW3C+yJFVGiSDAS hkRQ== 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:dkim-signature; bh=ri5TEBgTA2LGbGlEqzw1BWYXpn+hiv7uMMvSWE4yd40=; b=YNvtk+4i4yQMd0ixh9pkHH9aZ7alQvzuab/FfDUOJAWE+zLosdVG5YCtx5FgykHr0W cUyji1ItbKQouO5sDS9bsQp/CWUvcvH+Lco0SfGPGkah40YfNc0rIDXh19sd+reuwB04 RdsDWJNT1YpT/3PVd3M9dQTDfA+LF1LTG3yhKpK0yydgF/aVa95J7ZcFADmK1in3tfIZ PJ5oyLq6EbhUyqEzM5/Cmxh3sfqcNZDp77t3RGYNPYWY/D/U9O8urYgs8X/7/CrAM4+U eSolFtGXh2Be4z2VeKr8GbjlZnkkN4QRpalS6+iYiGIRiBck2gzEIDGGSaVgc52MP7AW kLdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=e2Y8kNG1; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m2si20165331ili.39.2021.08.24.12.39.38; Tue, 24 Aug 2021 12:39:51 -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; dkim=pass header.i=@alien8.de header.s=dkim header.b=e2Y8kNG1; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233964AbhHXTjc (ORCPT + 99 others); Tue, 24 Aug 2021 15:39:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229907AbhHXTjb (ORCPT ); Tue, 24 Aug 2021 15:39:31 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6BC8C061757 for ; Tue, 24 Aug 2021 12:38:46 -0700 (PDT) Received: from zn.tnic (p200300ec2f1144000e600dcb30086556.dip0.t-ipconnect.de [IPv6:2003:ec:2f11:4400:e60:dcb:3008:6556]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id EB7821EC04D1; Tue, 24 Aug 2021 21:38:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1629833921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=ri5TEBgTA2LGbGlEqzw1BWYXpn+hiv7uMMvSWE4yd40=; b=e2Y8kNG1MY8XIKPZ96YXtYnIM0QtlPtW/X5/6/ItyWxYH0bhEu1yqn0ye6o6wKVjwXia2v GkGfI+729kSvN9mgBSSXkvm4wC+I9nJLxenTZam0ohRMdiXMgW2GeB+vfcZ/PknXVN+yBH AnQNPDJVhMPpXnLONOxMZO7S6alcy2U= Date: Tue, 24 Aug 2021 21:39:17 +0200 From: Borislav Petkov To: "Kuppuswamy, Sathyanarayanan" Cc: Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Andy Lutomirski , Peter H Anvin , Dave Hansen , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 09/12] x86/tdx: Wire up KVM hypercalls Message-ID: References: <20210804181329.2899708-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210804181329.2899708-10-sathyanarayanan.kuppuswamy@linux.intel.com> <8ccbf970-fd4f-b1ea-ac85-98acfe296b00@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 24, 2021 at 12:11:00PM -0700, Kuppuswamy, Sathyanarayanan wrote: > If the TDX code is complied for another hypervior, we need some config to > disable above the above code. Isn't that what CONFIG_KVM_GUEST is for? Also, if they don't get used anywhere, the compiler will simply discard them. I still don't see the need for the ifdeffery. > Following is the error info. > > WARNING: modpost: EXPORT symbol "__tdx_hypercall" [vmlinux] version > generation failed, symbol will not be versioned. > > So to fix the above issue, added tdx.h in arch/x86/include/asm/asm-prototypes.h You need the C-style declaration of __tdx_hypercall, see 334bb7738764 ("x86/kbuild: enable modversions for symbols exported from asm") and you can do the include without the ifdeffery. And also state in the commit message why you're including it. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette