diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2010-10-25 10:10:51 -0400 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2010-10-25 10:10:21 -0400 |
commit | 14375bc4eb8dd0fb0e765390650564c35bb31068 (patch) | |
tree | 27200620658245c582ee9497fc969a082b304cab /arch/s390/kernel/setup.c | |
parent | eca577ef5989d25dedc6b0fae3c4622ceaee8005 (diff) |
[S390] cleanup facility list handling
Store the facility list once at system startup with stfl/stfle and
reuse the result for all facility tests.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/setup.c')
-rw-r--r-- | arch/s390/kernel/setup.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 9071e984dcf1..e3ceb911dc75 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -409,6 +409,9 @@ setup_lowcore(void) | |||
409 | lc->current_task = (unsigned long) init_thread_union.thread_info.task; | 409 | lc->current_task = (unsigned long) init_thread_union.thread_info.task; |
410 | lc->thread_info = (unsigned long) &init_thread_union; | 410 | lc->thread_info = (unsigned long) &init_thread_union; |
411 | lc->machine_flags = S390_lowcore.machine_flags; | 411 | lc->machine_flags = S390_lowcore.machine_flags; |
412 | lc->stfl_fac_list = S390_lowcore.stfl_fac_list; | ||
413 | memcpy(lc->stfle_fac_list, S390_lowcore.stfle_fac_list, | ||
414 | MAX_FACILITY_BIT/8); | ||
412 | #ifndef CONFIG_64BIT | 415 | #ifndef CONFIG_64BIT |
413 | if (MACHINE_HAS_IEEE) { | 416 | if (MACHINE_HAS_IEEE) { |
414 | lc->extended_save_area_addr = (__u32) | 417 | lc->extended_save_area_addr = (__u32) |
@@ -675,12 +678,9 @@ setup_memory(void) | |||
675 | static void __init setup_hwcaps(void) | 678 | static void __init setup_hwcaps(void) |
676 | { | 679 | { |
677 | static const int stfl_bits[6] = { 0, 2, 7, 17, 19, 21 }; | 680 | static const int stfl_bits[6] = { 0, 2, 7, 17, 19, 21 }; |
678 | unsigned long long facility_list_extended; | ||
679 | unsigned int facility_list; | ||
680 | struct cpuid cpu_id; | 681 | struct cpuid cpu_id; |
681 | int i; | 682 | int i; |
682 | 683 | ||
683 | facility_list = stfl(); | ||
684 | /* | 684 | /* |
685 | * The store facility list bits numbers as found in the principles | 685 | * The store facility list bits numbers as found in the principles |
686 | * of operation are numbered with bit 1UL<<31 as number 0 to | 686 | * of operation are numbered with bit 1UL<<31 as number 0 to |
@@ -700,11 +700,10 @@ static void __init setup_hwcaps(void) | |||
700 | * HWCAP_S390_ETF3EH bit 8 (22 && 30). | 700 | * HWCAP_S390_ETF3EH bit 8 (22 && 30). |
701 | */ | 701 | */ |
702 | for (i = 0; i < 6; i++) | 702 | for (i = 0; i < 6; i++) |
703 | if (facility_list & (1UL << (31 - stfl_bits[i]))) | 703 | if (test_facility(stfl_bits[i])) |
704 | elf_hwcap |= 1UL << i; | 704 | elf_hwcap |= 1UL << i; |
705 | 705 | ||
706 | if ((facility_list & (1UL << (31 - 22))) | 706 | if (test_facility(22) && test_facility(30)) |
707 | && (facility_list & (1UL << (31 - 30)))) | ||
708 | elf_hwcap |= HWCAP_S390_ETF3EH; | 707 | elf_hwcap |= HWCAP_S390_ETF3EH; |
709 | 708 | ||
710 | /* | 709 | /* |
@@ -720,12 +719,8 @@ static void __init setup_hwcaps(void) | |||
720 | * translated to: | 719 | * translated to: |
721 | * HWCAP_S390_DFP bit 6 (42 && 44). | 720 | * HWCAP_S390_DFP bit 6 (42 && 44). |
722 | */ | 721 | */ |
723 | if ((elf_hwcap & (1UL << 2)) && | 722 | if ((elf_hwcap & (1UL << 2)) && test_facility(42) && test_facility(44)) |
724 | __stfle(&facility_list_extended, 1) > 0) { | 723 | elf_hwcap |= HWCAP_S390_DFP; |
725 | if ((facility_list_extended & (1ULL << (63 - 42))) | ||
726 | && (facility_list_extended & (1ULL << (63 - 44)))) | ||
727 | elf_hwcap |= HWCAP_S390_DFP; | ||
728 | } | ||
729 | 724 | ||
730 | /* | 725 | /* |
731 | * Huge page support HWCAP_S390_HPAGE is bit 7. | 726 | * Huge page support HWCAP_S390_HPAGE is bit 7. |