All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: "Luis R. Rodriguez" <mcgrof@kernel.org>,
	tglx@linutronix.de, mingo@redhat.com, bp@alien8.de
Cc: benh@kernel.crashing.org, ming.lei@canonical.com,
	masami.hiramatsu.pt@hitachi.com, linux-arch@vger.kernel.org,
	xen-devel@lists.xensource.com, linux@arm.linux.org.uk,
	x86@kernel.org, anil.s.keshavamurthy@intel.com, arnd@arndb.de,
	rusty@rustcorp.com.au, jbaron@akamai.com,
	boris.ostrovsky@oracle.com, andriy.shevchenko@linux.intel.com,
	mcb30@ipxe.org, jgross@suse.com, ananth@in.ibm.com,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	luto@amacapital.net, david.vrabel@citrix.com,
	dwmw2@infradead.org, davem@davemloft.net
Subject: Re: [RFC v2 2/7] tables.h: add linker table support
Date: Fri, 19 Feb 2016 12:25:55 -0800	[thread overview]
Message-ID: <56C77A53.6060708@zytor.com> (raw)
In-Reply-To: <1455889559-9428-3-git-send-email-mcgrof@kernel.org>

On 02/19/2016 05:45 AM, Luis R. Rodriguez wrote:
> +
> +/**
> + * DOC: Regular linker linker table constructors
> + *
> + * Regular constructors are expected to be used for valid linker table entries.
> + * Valid uses of weak entries other than the beginning and is currently
> + * untested but should in theory work.
> + */
> +
> +/**
> + * LINKTABLE_TEXT - Declares a linker table entry for execution
> + *
> + * @name: linker table name
> + * @level: order level
> + *
> + * Declares a linker table to be used for execution.
> + */
> +#define LINKTABLE_TEXT(name, level)					\
> +	      __typeof__(name[0])					\
> +	      __attribute__((used,					\
> +			     __aligned__(LINKTABLE_ALIGNMENT(name)),	\
> +			     section(SECTION_TBL(SECTION_TEXT, name, level))))

I'm really confused by this.  Text should obviously be readonly, but I'm
not at all clear how this works here.

The issue with linktables for text is kind of confusing if nothing else;
Russel is right about that.  It doesn't prevent us from doing something
similar, but perhaps it ought to have a different name.

For one thing, priority level is meaningless for text, since it is not a
table that can be indexed into.

	-hpa

WARNING: multiple messages have this Message-ID (diff)
From: "H. Peter Anvin" <hpa@zytor.com>
To: "Luis R. Rodriguez" <mcgrof@kernel.org>,
	tglx@linutronix.de, mingo@redhat.com, bp@alien8.de
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	luto@amacapital.net, boris.ostrovsky@oracle.com,
	rusty@rustcorp.com.au, david.vrabel@citrix.com,
	konrad.wilk@oracle.com, mcb30@ipxe.org, jgross@suse.com,
	ming.lei@canonical.com, gregkh@linuxfoundation.org,
	arnd@arndb.de, linux-arch@vger.kernel.org,
	linux@arm.linux.org.uk, benh@kernel.crashing.org,
	jbaron@akamai.com, ananth@in.ibm.com,
	anil.s.keshavamurthy@intel.com, davem@davemloft.net,
	masami.hiramatsu.pt@hitachi.com,
	andriy.shevchenko@linux.intel.com, dwmw2@infradead.org,
	xen-devel@lists.xensource.com
Subject: Re: [RFC v2 2/7] tables.h: add linker table support
Date: Fri, 19 Feb 2016 12:25:55 -0800	[thread overview]
Message-ID: <56C77A53.6060708@zytor.com> (raw)
Message-ID: <20160219202555.izqLmZTpvcK0j__Fkv-_8WrH_r9z7bpsvBb9wL9M4JY@z> (raw)
In-Reply-To: <1455889559-9428-3-git-send-email-mcgrof@kernel.org>

On 02/19/2016 05:45 AM, Luis R. Rodriguez wrote:
> +
> +/**
> + * DOC: Regular linker linker table constructors
> + *
> + * Regular constructors are expected to be used for valid linker table entries.
> + * Valid uses of weak entries other than the beginning and is currently
> + * untested but should in theory work.
> + */
> +
> +/**
> + * LINKTABLE_TEXT - Declares a linker table entry for execution
> + *
> + * @name: linker table name
> + * @level: order level
> + *
> + * Declares a linker table to be used for execution.
> + */
> +#define LINKTABLE_TEXT(name, level)					\
> +	      __typeof__(name[0])					\
> +	      __attribute__((used,					\
> +			     __aligned__(LINKTABLE_ALIGNMENT(name)),	\
> +			     section(SECTION_TBL(SECTION_TEXT, name, level))))

I'm really confused by this.  Text should obviously be readonly, but I'm
not at all clear how this works here.

The issue with linktables for text is kind of confusing if nothing else;
Russel is right about that.  It doesn't prevent us from doing something
similar, but perhaps it ought to have a different name.

For one thing, priority level is meaningless for text, since it is not a
table that can be indexed into.

	-hpa


  reply	other threads:[~2016-02-19 20:25 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-19 13:45 [RFC v2 0/7] linux: add linker tables Luis R. Rodriguez
2016-02-19 13:45 ` [RFC v2 1/7] sections.h: add sections header to collect all section info Luis R. Rodriguez
2016-02-19 13:45   ` Luis R. Rodriguez
2016-02-19 16:23   ` Greg KH
2016-02-19 20:06     ` Luis R. Rodriguez
2016-02-19 21:25       ` Greg KH
2016-02-19 21:59         ` Luis R. Rodriguez
2016-02-19 13:45 ` [RFC v2 2/7] tables.h: add linker table support Luis R. Rodriguez
2016-02-19 13:45   ` Luis R. Rodriguez
2016-02-19 20:25   ` H. Peter Anvin [this message]
2016-02-19 20:25     ` H. Peter Anvin
2016-02-19 21:48     ` Luis R. Rodriguez
2016-02-23 23:08       ` Luis R. Rodriguez
2016-02-23 23:08         ` Luis R. Rodriguez
2016-02-23 23:22         ` H. Peter Anvin
2016-02-23 23:22           ` H. Peter Anvin
2016-02-23 23:36           ` Luis R. Rodriguez
2016-02-23 23:36             ` Luis R. Rodriguez
2016-02-24  0:06             ` H. Peter Anvin
2016-02-24  0:06               ` H. Peter Anvin
2016-02-24  0:54               ` Luis R. Rodriguez
2016-02-24  0:54                 ` Luis R. Rodriguez
2016-02-19 20:33   ` H. Peter Anvin
2016-02-19 21:12     ` Luis R. Rodriguez
2016-02-19 13:45 ` [RFC v2 3/7] firmware: port built-in section to linker table Luis R. Rodriguez
2016-02-29 10:12   ` David Woodhouse
2016-02-29 18:56     ` Luis R. Rodriguez
2016-05-02 18:34       ` Kees Cook
2016-05-02 18:34         ` Kees Cook
2016-05-02 18:41         ` Greg KH
2016-05-02 18:41           ` Greg KH
2016-05-03 17:08           ` Luis R. Rodriguez
2016-05-03 17:08             ` Luis R. Rodriguez
2016-05-03 17:07         ` Luis R. Rodriguez
2016-05-03 17:07           ` Luis R. Rodriguez
2016-05-03 17:10           ` Luis R. Rodriguez
2016-05-03 17:10             ` Luis R. Rodriguez
2016-05-03 17:11             ` Luis R. Rodriguez
2016-05-03 17:11               ` Luis R. Rodriguez
2016-05-03 17:21             ` Kees Cook
2016-05-03 17:21               ` Kees Cook
2016-05-03 18:12             ` Greg KH
2016-05-03 18:12               ` Greg KH
2016-03-01 16:10     ` James Bottomley
2016-03-01 17:54       ` Luis R. Rodriguez
2016-04-29 19:24         ` Luis R. Rodriguez
2016-04-29 19:24           ` Luis R. Rodriguez
2016-02-19 13:45 ` [RFC v2 4/7] asm/sections: add a generic push_section_tbl() Luis R. Rodriguez
2016-02-19 13:45   ` Luis R. Rodriguez
2016-02-19 20:26   ` H. Peter Anvin
2016-02-19 21:06     ` Luis R. Rodriguez
2016-02-22  2:55       ` H. Peter Anvin
2016-02-26 14:56         ` Heiko Carstens
2016-05-20 19:53           ` Luis R. Rodriguez
2016-02-19 13:45 ` [RFC v2 5/7] jump_label: port __jump_table to linker tables Luis R. Rodriguez
2016-02-19 13:45   ` Luis R. Rodriguez
2016-02-19 13:45 ` [RFC v2 6/7] dynamic_debug: port to use " Luis R. Rodriguez
2016-02-19 13:45   ` Luis R. Rodriguez
2016-02-19 13:45 ` [RFC v2 7/7] kprobes: port to linker table Luis R. Rodriguez
2016-02-19 14:15   ` Russell King - ARM Linux
2016-02-19 14:55     ` Luis R. Rodriguez
2016-02-22  1:34   ` 平松雅巳 / HIRAMATU,MASAMI
2016-02-22  1:34     ` 平松雅巳 / HIRAMATU,MASAMI
2016-02-23  0:52     ` [Xen-devel] " Luis R. Rodriguez
2016-02-23  0:52       ` Luis R. Rodriguez
2016-07-21 23:53       ` Luis R. Rodriguez
2016-07-21 23:53         ` Luis R. Rodriguez
2016-02-19 20:16 ` [RFC v2 0/7] linux: add linker tables H. Peter Anvin
2016-02-19 21:19   ` Luis R. Rodriguez

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=56C77A53.6060708@zytor.com \
    --to=hpa@zytor.com \
    --cc=ananth@in.ibm.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=davem@davemloft.net \
    --cc=david.vrabel@citrix.com \
    --cc=dwmw2@infradead.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jbaron@akamai.com \
    --cc=jgross@suse.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=luto@amacapital.net \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mcb30@ipxe.org \
    --cc=mcgrof@kernel.org \
    --cc=ming.lei@canonical.com \
    --cc=mingo@redhat.com \
    --cc=rusty@rustcorp.com.au \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xensource.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.