Subject: Re: [PATCH] arch/powerpc: advertise ISA2.07, HTM, DSCR, EBB and ISEL bits in HWCAP2

From: Benjamin Herrenschmidt <[email-masked]>
Date: Tue, 07 May 2013 07:37:08 +1000

On Mon, 2013-05-06 at 09:38 -0500, Ryan Arnold wrote:
> My understanding was that these bits being 'on' is an indication of
> what features the hardware supports (or what the kernel emulates) and
> a not an indication of whether that facility is currently enabled or
> not.  If the hardware supports a particular feature but it is not
> enabled I'd expect that user-space usage of that feature would cause
> the kernel to trap on a facility availability exception (which is how
> Altivec/VMX is implemented, being defaulted to turned off).

Right but the discussion is about whether we should expose the bits
when the kernel doesn't have the ability to handle the feature :-)

IE. We need to remove the HTM feature if the kernel is compiled without
transactional memory support.

Similarily, Nish, you may need to check that we remove those bits if
pHyp has the partition in a mode that doesn't support them (P7
compatibility for example) for migration purposes.

Cheers,
Ben.

> Otherwise there's no way I could know whether an ISA [optional]
> feature is actually available on a particular machine.
> 
> And yes, the bits can't change.  My usage of hwcap.h has to coincide
> with the kernel's asm/cputable.h