From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6C9CC433EF for ; Tue, 7 Sep 2021 14:07:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9AD76103B for ; Tue, 7 Sep 2021 14:07:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232386AbhIGOI1 (ORCPT ); Tue, 7 Sep 2021 10:08:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:52700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229650AbhIGOIX (ORCPT ); Tue, 7 Sep 2021 10:08:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EAAAF6103B; Tue, 7 Sep 2021 14:07:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631023637; bh=+6pq5RkAoSIUZfooNDRh1HsK7vTGdlktLrMWVjASe44=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=QjGn5Z9WvN50IBXQt4+0/uMA1Nsheh/VG4nYFnb+d298Hzj4pdS4YllRxdiOoDQCM j4cvrq+M5qrWFEnOgz8SqW7Io+tku7z5ZuLMnTITy3/ZgYBAg2TAkyyNqiOIx9OUhI pls72UWzM93Fx9OOJie5iJpqfZO2oz7Op1Olpee9+Q4RSsiss15iNqn8bZo4xI/nFt VSRlvMUBIkOHhzag/Lv+2+1HMgGPcNQNhY84AYTdvfhCJ4Z6j5nsbqGBbc4rAaaJG+ VwYHGp+9QvK/g0OaSnL58fD9Dshc2FBE1hdk5/fUHdwKHKHl/cihpR8sbK9jrEvrwp k3UVuo8G0nqFA== Message-ID: <848905ffa20cf234446b16682cbbcf1e56853950.camel@kernel.org> Subject: Re: [PATCH v4 5/6] x86/sgx: Hook sgx_memory_failure() into mainline code From: Jarkko Sakkinen To: "Luck, Tony" , Sean Christopherson , "Hansen, Dave" Cc: "Zhang, Cathy" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" Date: Tue, 07 Sep 2021 17:07:14 +0300 In-Reply-To: <25db682402d14c34af9ba525cffe85c5@intel.com> References: <20210728204653.1509010-1-tony.luck@intel.com> <20210827195543.1667168-1-tony.luck@intel.com> <20210827195543.1667168-6-tony.luck@intel.com> <49fccddbbf92279f575409851a9c682495146ad8.camel@kernel.org> <681d530d72de842c8bf43733c11f3c3f2ebf8c6e.camel@kernel.org> <25db682402d14c34af9ba525cffe85c5@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2021-09-06 at 18:51 +0000, Luck, Tony wrote: > On Fri, 2021-09-03 at 09:12 +0300, Jarkko Sakkinen wrote: > > On Fri, 2021-08-27 at 12:55 -0700, Tony Luck wrote: > > > +#ifdef CONFIG_X86_SGX > > > +int sgx_memory_failure(unsigned long pfn, int flags); > > > +bool sgx_is_epc_page(u64 paddr); > > > +#else > > > +static inline int sgx_memory_failure(unsigned long pfn, int flags) > > > +{ > > > + return -ENXIO; > > > +} > > > + > > > +static inline bool sgx_is_epc_page(u64 paddr) > > > +{ > > > + return false; > > > +} > > > +#endif > >=20 > > These decl's should be in arch/x86/include/asm/sgx.h, and as part of > > patch that contains the implementations. >=20 > But I need to use these functions in arch independent code. Specifically= in > mm/memory-failure.c and drivers/acpi/apei/einj.c >=20 > If I just #include in those files I'll break the build for ot= her > architectures. What does specifically break the build? /Jarkko