mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ryan Arnold <rsa@us.ibm.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "libc-alpha@sourceware.org" <libc-alpha@sourceware.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: [RFC] Expand available hwcap bits with AT_HWCAP2 in auxv
Date: Fri, 16 Nov 2012 16:53:54 -0600	[thread overview]
Message-ID: <1353106434.10806.14067.camel@localhost.localdomain> (raw)

Hi,

We're out of bits in the AT_HWCAP entry for PowerPC. Per the following
discussion on libc-alpha, I'd like to propose the expansion of the auxv
to make additional space available for further system feature flags.  

http://www.sourceware.org/ml/libc-alpha/2012-10/msg00438.html

There are a few ways to do this (as pointed out by Ben Herrenschmidt).
glibc would prefer to parse an AT_HWCAP2 entry from the auxv and compose
those bits into the high 32-bits of the existing glibc uint64_t hwcap
field.

Currently, the high 32-bits of this field are only available in 64-bit
userspace, and only for platforms where the kernel designates the auxv
hwcap as unsigned long int (example: s390). Platforms like PowerPC, arm,
and x86 maintain parity between 64-bit and 32-bit userspace and thus
only allow 32-bits for capabilities.

I propose that the kernel shift capabilities designated in the high
32-bits into an AT_HWCAP2 auxv entry. In userspace, glibc will compose
that into the available high 32-bits of glibc's hwcap field making the
rest of it available to all platforms.

The beauty of this approach is that if either the Kernel or glibc lack
the AT_HWCAP2 improvement the high 32-bits of glibc's hwcap field will
remain empty, i.e., feature not available.

With this in mind, I need to reserve an identifier in
include/linux/auxvec.h for AT_HWCAP2.  I was thinking:

#define AT_HWCAP  26

GLIBC will have parity with this identifier in elf/elf.h.

I think Ben H. had planned to work on the kernel side of this and I have
a GLIBC patch in process.

Comments?

Ryan S. Arnold
IBM Linux Technology Center
glibc PowerPC maintainer


                 reply	other threads:[~2012-11-16 22:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1353106434.10806.14067.camel@localhost.localdomain \
    --to=rsa@us.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®