From: ynorov@caviumnetworks.com (Yury Norov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 2/4] asm-generic: Provide a fncpy() implementation
Date: Mon, 19 Jun 2017 04:11:05 +0300 [thread overview]
Message-ID: <20170619011105.gjkisjrrtzlmgk6s@yury-thinkpad> (raw)
In-Reply-To: <20170618235108.peaxdi367jpkt542@yury-thinkpad>
> > +/*
> > + * Minimum alignment requirement for the source and destination addresses
> > + * for function copying.
> > + */
> > +#define FNCPY_ALIGN 8
>
> >From now this is not arm-only, and it's possible that some architectures
> might want to redefine it in their arch/xxx/include/asm/fncpy.h files.
> So it will be easier for them if you'll wrap FNCPY_ALIGN here with #ifdef
> guards.
>
> By the way, compiler already has an information on the proper alignment.
> Maybe it's better to use it as the default value here instead of the
> hardcoded value?
>
> #ifndef FNCPY_ALIGN
> #define FNCPY_ALIGN ({void foo(); __alignof__(&foo);})
> #endif
Ah sorry, at first it should be like this:
#define FNCPY_ALIGN ({void foo(); __alignof__(foo);})
And at second, the correct version returns 1 always.
Even if I pass falign-functions=4096 to gcc, and I see that functions
are aligned accordingly in elf file, the macro returns 1 anyway. So if
it doesn't work, the hardcoded '8' is the only option.
Yury
next prev parent reply other threads:[~2017-06-19 1:11 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-17 0:07 [PATCH v3 0/4] Generalize fncpy availability Florian Fainelli
2017-06-17 0:07 ` [PATCH v3 1/4] ARM: fncpy: Rename include guards Florian Fainelli
2017-06-17 0:07 ` [PATCH v3 2/4] asm-generic: Provide a fncpy() implementation Florian Fainelli
2017-06-18 23:51 ` Yury Norov
2017-06-19 1:11 ` Yury Norov [this message]
2017-06-19 15:18 ` Yury Norov
2017-06-19 17:27 ` Florian Fainelli
2017-06-19 17:43 ` Russell King - ARM Linux
2017-06-20 14:27 ` Yury Norov
2017-06-19 20:58 ` Florian Fainelli
2017-06-20 14:24 ` Yury Norov
2017-06-17 0:07 ` [PATCH v3 3/4] arm64: Provide a fncpy implementation Florian Fainelli
2017-06-17 0:07 ` [PATCH v3 4/4] misc: sram: Allow ARM64 to select SRAM_EXEC Florian Fainelli
2017-06-28 14:55 ` Mark Rutland
2017-06-19 12:24 ` [PATCH v3 0/4] Generalize fncpy availability Mark Rutland
2017-06-19 13:53 ` Tony Lindgren
2017-06-19 17:32 ` Florian Fainelli
2017-06-20 9:10 ` Lorenzo Pieralisi
2017-06-20 16:20 ` Florian Fainelli
2017-06-20 16:46 ` Lorenzo Pieralisi
2017-06-20 16:54 ` Sudeep Holla
2017-06-20 17:03 ` Florian Fainelli
2017-06-19 13:34 ` David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170619011105.gjkisjrrtzlmgk6s@yury-thinkpad \
--to=ynorov@caviumnetworks.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox