[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <30034c82-99fa-3592-c215-cb9c61f87456@intel.com>
Date: Tue, 7 Sep 2021 07:13:46 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Jarkko Sakkinen <jarkko@...nel.org>,
"Luck, Tony" <tony.luck@...el.com>,
Sean Christopherson <seanjc@...gle.com>
Cc: "Zhang, Cathy" <cathy.zhang@...el.com>,
"x86@...nel.org" <x86@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 5/6] x86/sgx: Hook sgx_memory_failure() into mainline
code
On 9/7/21 7:07 AM, Jarkko Sakkinen wrote:
>> If I just #include <asm/sgx.h> in those files I'll break the build for other
>> architectures.
> What does specifically break the build?
Remember, our x86 "<asm/sgx.h>" is:
arch/x86/include/asm/sgx.h
On powerpc, "<asm/sgx.h>" is:
arch/powerpc/include/asm/sgx.h
You'll get a file not found error looking for sgx.h.
That said... Tony, it's probably a bit more friendly if the mm.h code
you add:
> +#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
was a bit more generic. Maybe something like:
int arch_memory_failure(unsigned long pfn, int flags);
BTW, I don't see sgx_is_epc_page() in arch-generic code. Does it really
need to be in mm.h?
Powered by blists - more mailing lists