Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1535756pxb; Wed, 4 Nov 2020 11:33:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJymtrwb+Bv40qbnMZWhuqhLsHq8vkRfLqLVRKjn6TgStXyf8rIPpd0Gjy4qxv/GS6aQk6u9 X-Received: by 2002:a05:6402:a51:: with SMTP id bt17mr26388382edb.328.1604518381548; Wed, 04 Nov 2020 11:33:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604518381; cv=none; d=google.com; s=arc-20160816; b=Y1DVXw5YUZ3bYT1yay/TvLN53+0p6BQqIFDcijK5/UQxkeSc0C9vaaWSgSa45rYnzE kJ23WGY7DjSCh1xwidJrvwjSN35AhUb+DtXS9CWWAKnBDNiwkvKFmsrfOjKa1z+oM1zk NThq9uHXD6VKiEzYx6+tafvW/Jvf6aQqyuSV2989ZWVmlRCvxDcFfxuP8WJsdeMQy65h 30ZoBvLx/sert0y6Ww5z1XnRvqz5y0l8N0viA3qbA826RLsi035P7WWorjVP3luegzrt nm4Tr7+P74eTK+G6+W7vp6Cdagx83hDCmTLLp8jxnmdEiCvD6GZT4/G6pMcjAUUfND6m /csA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Wbd2lXcBc55lTsjOyjrcsm3MlnE9aWCiGuQl4hACdDk=; b=xFZxCi0I9hUfhqVLWAvL9rTPtSl9g4hPS8jcYE5J4rpFEacbALyUv0qGOB4mEPTn2m pIJEj83MTK1s9C0SlGRAtH8iLC90VnMqJlTvP8476yHo8nRkHExKhq8uY2VfZCLZSiHu ZpczC89u8aQAPShP2NdMHNCjSsO3aVksPR+8adAt5Zg4fYDJu3AsIe9mU++R+bHmqUNl INb0j5GCoul3WTBm/V/B8djmb3yRfEuWHfjkiG6qx10jUBHeVrwac0VF9IfmNyRsIu6M CVtyf9c+WBAbWxMaDsFR9BoKDor8JlJppOx8N73CP0C5m5UQiyIj8cWlQGH9mAaoVpFL ppYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="KsRiZ5o/"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p13si1860113ejx.702.2020.11.04.11.32.38; Wed, 04 Nov 2020 11:33:01 -0800 (PST) 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=@kernel.org header.s=default header.b="KsRiZ5o/"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730524AbgKDTEy (ORCPT + 99 others); Wed, 4 Nov 2020 14:04:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:37556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727098AbgKDTEy (ORCPT ); Wed, 4 Nov 2020 14:04:54 -0500 Received: from kernel.org (83-245-197-237.elisa-laajakaista.fi [83.245.197.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E1F71206D9; Wed, 4 Nov 2020 19:04:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604516692; bh=fyUM4moJMRF9g5/7ofZBd/q6w2cVQ6ALWSxN7yCG0yI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KsRiZ5o/+GRPMFkvMxbe8KgqmtDlnz3kagsNjQ5/fA89FCjg0AoTX8p6KuHXcEQRd 3M3J0wMjgzNPnREWUZa6x9n4VPaVopCcy4Sx66wYUGhkGjMLXqH804isPMNcQEAJTX 1yrc4waLOpV7//9Xpy4PElK1JpZLmFKPTNIO6WDQ= Date: Wed, 4 Nov 2020 21:04:43 +0200 From: Jarkko Sakkinen To: Borislav Petkov Cc: Jarkko Sakkinen , x86@kernel.org, linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org, Sean Christopherson , Jethro Beekman , Darren Kenny , Serge Ayoun , akpm@linux-foundation.org, andriy.shevchenko@linux.intel.com, asapek@google.com, cedric.xing@intel.com, chenalexchen@google.com, conradparker@google.com, cyhanish@google.com, dave.hansen@intel.com, haitao.huang@intel.com, kai.huang@intel.com, kai.svahn@intel.com, kmoy@google.com, ludloff@google.com, luto@kernel.org, nhorman@redhat.com, npmccallum@redhat.com, puiterwijk@redhat.com, rientjes@google.com, tglx@linutronix.de, yaozhangx@google.com, mikko.ylinen@intel.com Subject: Re: [PATCH v40 03/24] x86/sgx: Initialize metadata for Enclave Page Cache (EPC) sections Message-ID: <20201104190443.GA318315@kernel.org> References: <20201104145430.300542-1-jarkko.sakkinen@linux.intel.com> <20201104145430.300542-4-jarkko.sakkinen@linux.intel.com> <20201104182129.GD23298@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201104182129.GD23298@zn.tnic> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 04, 2020 at 07:21:29PM +0100, Borislav Petkov wrote: > On Wed, Nov 04, 2020 at 04:54:09PM +0200, Jarkko Sakkinen wrote: > > +static void __init sgx_init(void) > > +{ > > + int i; > > + > > + if (!boot_cpu_has(X86_FEATURE_SGX)) > > Guys, you need to build-test *every* *single* patch - otherwise we break > bisectability and that is a no-no: I've done it quite a few times (every time I've rebased my tree). I did today too before sending but forgot to redo git format-patch again (was the very last thing). In my tree the order is: e987eb0c95dd (HEAD -> master, origin/master, origin/HEAD) x86/sgx: Update MAINTAINERS 90dc0ee37f44 docs: x86/sgx: Document SGX kernel architecture 1c2e9bdab128 x86/sgx: Add ptrace() support for the SGX driver 05ce4345fb5f x86/sgx: Add a page reclaimer 94c1f778fa09 selftests/x86: Add a selftest for SGX 741b631d197b x86/vdso: Implement a vDSO for Intel SGX enclave call 5744b02641ff x86/traps: Attempt to fixup exceptions in vDSO before signaling e957c7e79dd0 x86/fault: Add helper function to sanitize error code 96cc520b2bc9 x86/vdso: Add support for exception fixup in vDSO functions 4aff9d81b2fe x86/sgx: Add SGX_IOC_ENCLAVE_PROVISION ea9bc917c469 x86/sgx: Add SGX_IOC_ENCLAVE_INIT 6e61e843291d x86/sgx: Add SGX_IOC_ENCLAVE_ADD_PAGES 4235ce22235e x86/sgx: Add SGX_IOC_ENCLAVE_CREATE 681299401c91 x86/sgx: Add SGX misc driver interface fbd69fd9acf4 mm: Add 'mprotect' hook to struct vm_operations_struct 93b27a8908aa x86/sgx: Add SGX page allocator functions 5984a2ca130c x86/cpu/intel: Add nosgx kernel parameter e131efe5ba06 x86/cpu/intel: Detect SGX support b0bacb54d36c x86/mm: x86/sgx: Signal SIGSEGV with PF_SGX 0c64b4c07298 x86/sgx: Initialize metadata for Enclave Page Cache (EPC) sections 358d17098c4c x86/cpufeatures: x86/msr: Add Intel SGX Launch Control hardware bits 8f7ab60e5458 x86/cpufeatures: x86/msr: Add Intel SGX hardware bits 0fb18ca935cf x86/sgx: Add wrappers for ENCLS functions 3dbc95582baf x86/sgx: Add SGX architectural data structures I always do this before I send the patch set (or rebase my tree): for x in {23..0} do git checkout master~$x git clean -f -d -x make tinyconfig && cat >> .config <> success.txt done The order is the only difference between the patch set and my tree (i.e. diff's do not conflict between the orderings). > arch/x86/kernel/cpu/sgx/main.c: In function ‘sgx_init’: > arch/x86/kernel/cpu/sgx/main.c:172:20: error: ‘X86_FEATURE_SGX’ undeclared (first use in this function); did you mean ‘X86_FEATURE_SMX’? > 172 | if (!boot_cpu_has(X86_FEATURE_SGX)) > | ^~~~~~~~~~~~~~~ > ./arch/x86/include/asm/cpufeature.h:118:24: note: in definition of macro ‘cpu_has’ > 118 | (__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \ > | ^~~ > arch/x86/kernel/cpu/sgx/main.c:172:7: note: in expansion of macro ‘boot_cpu_has’ > 172 | if (!boot_cpu_has(X86_FEATURE_SGX)) > | ^~~~~~~~~~~~ > arch/x86/kernel/cpu/sgx/main.c:172:20: note: each undeclared identifier is reported only once for each function it appears in > 172 | if (!boot_cpu_has(X86_FEATURE_SGX)) > | ^~~~~~~~~~~~~~~ > ./arch/x86/include/asm/cpufeature.h:118:24: note: in definition of macro ‘cpu_has’ > 118 | (__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \ > | ^~~ > arch/x86/kernel/cpu/sgx/main.c:172:7: note: in expansion of macro ‘boot_cpu_has’ > 172 | if (!boot_cpu_has(X86_FEATURE_SGX)) > | ^~~~~~~~~~~~ > make[4]: *** [scripts/Makefile.build:283: arch/x86/kernel/cpu/sgx/main.o] Error 1 > make[3]: *** [scripts/Makefile.build:500: arch/x86/kernel/cpu/sgx] Error 2 > make[2]: *** [scripts/Makefile.build:500: arch/x86/kernel/cpu] Error 2 > make[2]: *** Waiting for unfinished jobs.... > make[1]: *** [scripts/Makefile.build:500: arch/x86/kernel] Error 2 > make[1]: *** Waiting for unfinished jobs.... > make: *** [Makefile:1799: arch/x86] Error 2 > make: *** Waiting for unfinished jobs.... > > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette /Jarkko