s390/setup: fix virtual vs physical address confusion
authorGerald Schaefer <gerald.schaefer@linux.ibm.com>
Wed, 14 Feb 2024 15:17:08 +0000 (16:17 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Fri, 16 Feb 2024 13:30:12 +0000 (14:30 +0100)
Fix virtual vs physical address confusion. This does not fix a bug
since virtual and physical address spaces are currently the same.

/proc/iomem should report the physical address ranges, so use __pa_symbol()
for resource registration, similar to other architectures.

Signed-off-by: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/kernel/setup.c

index d1f3b56e7afc2b9b6326451ae446c73a9c1ce1c7..24ed33f044ec39720b11f83a5a925303d8c983a2 100644 (file)
@@ -504,12 +504,12 @@ static void __init setup_resources(void)
        int j;
        u64 i;
 
-       code_resource.start = (unsigned long) _text;
-       code_resource.end = (unsigned long) _etext - 1;
-       data_resource.start = (unsigned long) _etext;
-       data_resource.end = (unsigned long) _edata - 1;
-       bss_resource.start = (unsigned long) __bss_start;
-       bss_resource.end = (unsigned long) __bss_stop - 1;
+       code_resource.start = __pa_symbol(_text);
+       code_resource.end = __pa_symbol(_etext) - 1;
+       data_resource.start = __pa_symbol(_etext);
+       data_resource.end = __pa_symbol(_edata) - 1;
+       bss_resource.start = __pa_symbol(__bss_start);
+       bss_resource.end = __pa_symbol(__bss_stop) - 1;
 
        for_each_mem_range(i, &start, &end) {
                res = memblock_alloc(sizeof(*res), 8);