Skip to content

Commit

Permalink
[S390] fix dfp elf hwcap/facility bit detection
Browse files Browse the repository at this point in the history
The old dfp detection wanted to check bit 43 (dfp high performance), but due
to a wrong calculation always used to check bit 42. Additionally the
"userspace expectation" is, that the dfp capability bit is set is if facility
bit 42 (decimal floating point facility available) and bit 44 (perform floating
point operation facility avail).
The patch fixes the bit calculation and extends the check to work like:
  elf hw cap dfp bit = facility bits 42 (dfp) & 44 (pfpo) available

Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Christian Ehrhardt authored and Martin Schwidefsky committed Mar 26, 2009
1 parent d0d3cdf commit 2ac3307
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/s390/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,13 +713,15 @@ static void __init setup_hwcaps(void)
* How many facility words are stored depends on the number of
* doublewords passed to the instruction. The additional facilites
* are:
* Bit 43: decimal floating point facility is installed
* Bit 42: decimal floating point facility is installed
* Bit 44: perform floating point operation facility is installed
* translated to:
* HWCAP_S390_DFP bit 6.
*/
if ((elf_hwcap & (1UL << 2)) &&
__stfle(&facility_list_extended, 1) > 0) {
if (facility_list_extended & (1ULL << (64 - 43)))
if ((facility_list_extended & (1ULL << (63 - 42)))
&& (facility_list_extended & (1ULL << (63 - 44))))
elf_hwcap |= 1UL << 6;
}

Expand Down

0 comments on commit 2ac3307

Please sign in to comment.