aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/setup.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2012-11-02 07:56:43 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2012-11-23 05:14:30 -0500
commit6b70a92080be508e16b2f53efba39e5155eff809 (patch)
treea8bce16cd2f31284a392b29b4054230afce87168 /arch/s390/kernel/setup.c
parent1e466fcf3882e4c17c7df918185d0069cc334811 (diff)
s390/memory hotplug: use pfmf instruction to initialize storage keys
Move and rename init_storage_keys() to pageattr.c, so it can also be used from the sclp memory hotplug code in order to initialize storage keys. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/setup.c')
-rw-r--r--arch/s390/kernel/setup.c36
1 files changed, 1 insertions, 35 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index b1f2be9aaaad..cfdad57957fe 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -777,40 +777,6 @@ static void __init reserve_crashkernel(void)
777#endif 777#endif
778} 778}
779 779
780static void __init init_storage_keys(unsigned long start, unsigned long end)
781{
782 unsigned long boundary, function, size;
783
784 while (start < end) {
785 if (MACHINE_HAS_EDAT2) {
786 /* set storage keys for a 2GB frame */
787 function = 0x22000 | PAGE_DEFAULT_KEY;
788 size = 1UL << 31;
789 boundary = (start + size) & ~(size - 1);
790 if (boundary <= end) {
791 do {
792 start = pfmf(function, start);
793 } while (start < boundary);
794 continue;
795 }
796 }
797 if (MACHINE_HAS_EDAT1) {
798 /* set storage keys for a 1MB frame */
799 function = 0x21000 | PAGE_DEFAULT_KEY;
800 size = 1UL << 20;
801 boundary = (start + size) & ~(size - 1);
802 if (boundary <= end) {
803 do {
804 start = pfmf(function, start);
805 } while (start < boundary);
806 continue;
807 }
808 }
809 page_set_storage_key(start, PAGE_DEFAULT_KEY, 0);
810 start += PAGE_SIZE;
811 }
812}
813
814static void __init setup_memory(void) 780static void __init setup_memory(void)
815{ 781{
816 unsigned long bootmap_size; 782 unsigned long bootmap_size;
@@ -889,7 +855,7 @@ static void __init setup_memory(void)
889 memblock_add_node(PFN_PHYS(start_chunk), 855 memblock_add_node(PFN_PHYS(start_chunk),
890 PFN_PHYS(end_chunk - start_chunk), 0); 856 PFN_PHYS(end_chunk - start_chunk), 0);
891 pfn = max(start_chunk, start_pfn); 857 pfn = max(start_chunk, start_pfn);
892 init_storage_keys(PFN_PHYS(pfn), PFN_PHYS(end_chunk)); 858 storage_key_init_range(PFN_PHYS(pfn), PFN_PHYS(end_chunk));
893 } 859 }
894 860
895 psw_set_key(PAGE_DEFAULT_KEY); 861 psw_set_key(PAGE_DEFAULT_KEY);