Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1302883

Re: [PATCH v7 3/3] x86, mce: Add __mcsafe_copy()

From Dan Williams <dan.j.williams@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v7 3/3] x86, mce: Add __mcsafe_copy()
Date 2016-01-06 17:40 +0100
Message-ID <qNZhT-3D5-1@gated-at.bofh.it> (permalink)
References <qNnvY-2lN-11@gated-at.bofh.it> <qNnvY-2lN-13@gated-at.bofh.it> <qNOcO-4GP-3@gated-at.bofh.it> <qNQoi-6kA-11@gated-at.bofh.it> <qNQxY-6nZ-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Jan 5, 2016 at 11:11 PM, Dan Williams <dan.j.williams@intel.com> wrote:
> On Tue, Jan 5, 2016 at 11:06 PM, Luck, Tony <tony.luck@intel.com> wrote:
>> You were heading towards:
>>
>> ld: undefined __mcsafe_copy
>
> True, we'd also need a dummy mcsafe_copy() definition to compile it
> out in the disabled case.
>
>> since that is also inside the #ifdef.
>>
>> Weren't you going to "select" this?
>>
>
> I do select it, but by randconfig I still need to handle the
> CONFIG_X86_MCE=n case.
>
>> I'm seriously wondering whether the ifdef still makes sense. Now I don't have an extra exception table and routines to sort/search/fixup, it doesn't seem as useful as it was a few iterations ago.
>
> Either way is ok with me.  That said, the extra definitions to allow
> it compile out when not enabled don't seem too onerous.

This works for me, because all we need is the definitions.  As long as
we don't attempt to link to mcsafe_copy() we get the benefit of
compiling this out when de-selected:


diff --git a/arch/x86/include/asm/string_64.h b/arch/x86/include/asm/string_64.h
index 16a8f0e56e4a..5b24039463a4 100644
--- a/arch/x86/include/asm/string_64.h
+++ b/arch/x86/include/asm/string_64.h
@@ -78,7 +78,6 @@ int strcmp(const char *cs, const char *ct);
#define memset(s, c, n) __memset(s, c, n)
#endif

-#ifdef CONFIG_MCE_KERNEL_RECOVERY
struct mcsafe_ret {
       u64 trapnr;
       u64 remain;
@@ -86,7 +85,6 @@ struct mcsafe_ret {

struct mcsafe_ret __mcsafe_copy(void *dst, const void __user *src, size_t cnt);
extern void __mcsafe_copy_end(void);
-#endif

#endif /* __KERNEL__ */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v7 3/3] x86, mce: Add __mcsafe_copy() Tony Luck <tony.luck@intel.com> - 2016-01-05 01:20 +0100
  Re: [PATCH v7 3/3] x86, mce: Add __mcsafe_copy() Dan Williams <dan.j.williams@intel.com> - 2016-01-06 05:50 +0100
    Re: [PATCH v7 3/3] x86, mce: Add __mcsafe_copy() "Luck, Tony" <tony.luck@intel.com> - 2016-01-06 08:10 +0100
      Re: [PATCH v7 3/3] x86, mce: Add __mcsafe_copy() Dan Williams <dan.j.williams@intel.com> - 2016-01-06 08:20 +0100
        Re: [PATCH v7 3/3] x86, mce: Add __mcsafe_copy() Dan Williams <dan.j.williams@intel.com> - 2016-01-06 17:40 +0100
          RE: [PATCH v7 3/3] x86, mce: Add __mcsafe_copy() "Luck, Tony" <tony.luck@intel.com> - 2016-01-06 18:00 +0100
            Re: [PATCH v7 3/3] x86, mce: Add __mcsafe_copy() Dan Williams <dan.j.williams@intel.com> - 2016-01-06 18:10 +0100

csiph-web