From patchwork Sun Jul 14 14:32:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Sakkinen X-Patchwork-Id: 11043211 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1FABD13B1 for ; Sun, 14 Jul 2019 14:32:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E31D274A3 for ; Sun, 14 Jul 2019 14:32:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01D4E27D16; Sun, 14 Jul 2019 14:32:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9796A274A3 for ; Sun, 14 Jul 2019 14:32:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728368AbfGNOcU (ORCPT ); Sun, 14 Jul 2019 10:32:20 -0400 Received: from mga14.intel.com ([192.55.52.115]:55007 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728146AbfGNOcU (ORCPT ); Sun, 14 Jul 2019 10:32:20 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jul 2019 07:32:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,490,1557212400"; d="scan'208";a="194260874" Received: from hgenzken-mobl.ger.corp.intel.com (HELO localhost) ([10.249.35.131]) by fmsmga002.fm.intel.com with ESMTP; 14 Jul 2019 07:32:18 -0700 From: Jarkko Sakkinen To: linux-sgx@vger.kernel.org Cc: sean.j.christopherson@intel.com, Jarkko Sakkinen Subject: [PATCH] x86/sgx: Return 0 when !CONFIG_INTEL_SGX_DRIVER Date: Sun, 14 Jul 2019 17:32:12 +0300 Message-Id: <20190714143212.971-1-jarkko.sakkinen@linux.intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-sgx-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sgx@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When the config option is not enabled the initialization is always succesful. Signed-off-by: Jarkko Sakkinen --- This was the reason why I got the -ENODEV error with my BuildRoot image. The config option was not enabled but took some time realize as I was kind of getting an error code from the driver initialization. Finally when I used ftrace with 'sgx*' I knew what was going on. arch/x86/kernel/cpu/sgx/driver/driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/sgx/driver/driver.h b/arch/x86/kernel/cpu/sgx/driver/driver.h index da60839b133a..aafa64a4f481 100644 --- a/arch/x86/kernel/cpu/sgx/driver/driver.h +++ b/arch/x86/kernel/cpu/sgx/driver/driver.h @@ -37,7 +37,7 @@ int sgx_drv_init(void); #else static inline int sgx_drv_init(void) { - return -ENODEV; + return 0; } #endif