Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp665847rwn; Thu, 15 Sep 2022 04:55:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR4wvopdcAaz7oDLK4Nq+GT7CjpPShX6YOMeQAh/WUX+1LMHuXUfi+FzEUbxSkt4J5k/sOcR X-Received: by 2002:a63:e513:0:b0:42b:d733:602d with SMTP id r19-20020a63e513000000b0042bd733602dmr34357440pgh.549.1663242909060; Thu, 15 Sep 2022 04:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663242909; cv=none; d=google.com; s=arc-20160816; b=XxCueFDfxYjdIPaYQCUx1jSK2xSSQXrv8jPrSYU5PITwWo44VufiUUdo5kAmpjARUx 8vNi5p8GBT9ucUqXOkQe7vbk7JnZtDn6F/vPJSri4xwD89sa0naCLZZcjlerdhpelApZ vkk7DdMxnvCdFW3o59bgFCaNMyiXQYel0XqXFHDGnrZVq8VkKZuaJlY2GsG/DKBSKyBu yOCISz4IffHdliTZFjmVL9LF7veipkZbmKxH1PMuPfTvRFJsjxMw744i2bcJqoBCR8ty UpddkqssuyJHRFUiUWKZ9BKvNSOi7B2lkA5xcU1CZ0yWnb4bvss5slhwRj/VMc/+S82w tUyw== 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=xuEI8as/jYwiLJ6SoTm5McmMqEG68InuXlpF+p13Abs=; b=IAlvIEi8xWrGIknk+CFAPWum9pe6k2xOB5K9zFPKNr+NCR6/qn/t+dzGYnbitfAjq7 jkLHbjgyRiNMyTagYWNi0szosy7/qvYXt8BqC8Fx7Y7oNff8S7BlDMAhXk3Z2vKOs2ct bt9e9ChZ/UHlr3/HqnrrmZq4tlbtba4fYWa4+eHMcjt/OY547oS8lC2H/GpMsGpO+sXq g27F1ERlakROJT2BgMnZO3ONUAd/xDRlwcwQCll0cfwv+jBMufZPl/FeSdVMvBfwftrI sRcIgz9mHg4JlDHUvccKqYVLjaee7gbeQCGUzVKg0y/qf/rhPpW1zHDxfwxf7l425V6v 1XxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=boJ7wi+9; 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 y12-20020a655b4c000000b0042b9d02fa23si4250751pgr.307.2022.09.15.04.54.57; Thu, 15 Sep 2022 04:55:09 -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=boJ7wi+9; 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 S229780AbiIOLJA (ORCPT + 99 others); Thu, 15 Sep 2022 07:09:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbiIOLI5 (ORCPT ); Thu, 15 Sep 2022 07:08:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB83D9A953; Thu, 15 Sep 2022 04:08:56 -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 ams.source.kernel.org (Postfix) with ESMTPS id 374A0B81FB1; Thu, 15 Sep 2022 11:08:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7413BC433C1; Thu, 15 Sep 2022 11:08:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663240134; bh=X2hjnjeX49SebaaaihSZE19uspJmmj2lwVirIDzCF7U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=boJ7wi+9tDgG0wTR1Qga6ltlyFe0JxieAebGeG3fD/VJAJEQC22qH+AyaZwlVQ+Ls jKaAYOJO2r8e7nmsnFrKkkFeEbHWT0j/bPIWLhhgnPZZ9jr+OOc5+XqgQfmcE7kj8i yn3QOmPtbgta0EkCGoup4tnfwSGTyyxZ1rKgrEuU= Date: Thu, 15 Sep 2022 13:09:19 +0200 From: Greg Kroah-Hartman To: Kuppuswamy Sathyanarayanan Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Shuah Khan , "H . Peter Anvin" , "Kirill A . Shutemov" , Tony Luck , Andi Kleen , Kai Huang , Wander Lairson Costa , Isaku Yamahata , marcelo.cerri@canonical.com, tim.gardner@canonical.com, khalid.elmously@canonical.com, philip.cox@canonical.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH v13 1/3] x86/tdx: Add TDX Guest attestation interface driver Message-ID: References: <20220909192708.1113126-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20220909192708.1113126-2-sathyanarayanan.kuppuswamy@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220909192708.1113126-2-sathyanarayanan.kuppuswamy@linux.intel.com> X-Spam-Status: No, score=-7.1 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 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 Fri, Sep 09, 2022 at 12:27:06PM -0700, Kuppuswamy Sathyanarayanan wrote: > +static int __init tdx_guest_init(void) > +{ > + int ret; > + > + if (!cpu_feature_enabled(X86_FEATURE_TDX_GUEST)) > + return -EIO; > + > + ret = misc_register(&tdx_misc_dev); > + if (ret) { > + pr_err("misc device registration failed\n"); > + return ret; > + } > + > + return 0; > +} > +device_initcall(tdx_guest_init) As mentioned elsewhere, make this a normal module_init() format and only load the module if the hardware is present. Don't just always be built/loaded, that's not ok. thanks, greg k-h