diff mbox series

[3/7] pc-bios: s390x: Remove unneeded dasd-ipl.c reset psw mask changes

Message ID 20200715094045.381984-4-frankja@linux.ibm.com
State New
Headers show
Series pc-bios: s390x: Cleanup part 2 | expand

Commit Message

Janosch Frank July 15, 2020, 9:40 a.m. UTC
jump_to_low_kernel() and the functions that it calls will already or
64 bit addressing into the reset psw mask when executing
jump_to_IPL_2() after the diag308 subcode 1.

The kernel proper is then branched to rather than doing a full PSW
change.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
---
 pc-bios/s390-ccw/dasd-ipl.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Thomas Huth July 20, 2020, 11:45 a.m. UTC | #1
On 15/07/2020 11.40, Janosch Frank wrote:
> jump_to_low_kernel() and the functions that it calls will already or
> 64 bit addressing into the reset psw mask when executing
> jump_to_IPL_2() after the diag308 subcode 1.

But there is also a check in jump_to_low_kernel that could be affected
by your change:

    if (*((uint64_t *)0) & RESET_PSW_MASK) {
        jump_to_IPL_code((*((uint64_t *)0)) & PSW_MASK_SHORT_ADDR);
    }

... but I assume that there should not be any kernels out there in the
wild which do not have these bits set, so I think your modifications
here should be ok.

Acked-by: Thomas Huth <thuth@redhat.com>


> The kernel proper is then branched to rather than doing a full PSW
> change.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> ---
>  pc-bios/s390-ccw/dasd-ipl.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/pc-bios/s390-ccw/dasd-ipl.c b/pc-bios/s390-ccw/dasd-ipl.c
> index 0fc879bb8e..e8f2846740 100644
> --- a/pc-bios/s390-ccw/dasd-ipl.c
> +++ b/pc-bios/s390-ccw/dasd-ipl.c
> @@ -206,7 +206,6 @@ static void run_ipl2(SubChannelId schid, uint16_t cutype, uint32_t addr)
>   */
>  void dasd_ipl(SubChannelId schid, uint16_t cutype)
>  {
> -    PSWLegacy *pswl = (PSWLegacy *) 0x00;
>      uint32_t ipl2_addr;
>  
>      /* Construct Read IPL CCW and run it to read IPL1 from boot disk */
> @@ -229,7 +228,5 @@ void dasd_ipl(SubChannelId schid, uint16_t cutype)
>      run_ipl2(schid, cutype, ipl2_addr);
>  
>      /* Transfer control to the guest operating system */
> -    pswl->mask |= PSW_MASK_EAMODE;   /* Force z-mode */
> -    pswl->addr |= PSW_MASK_BAMODE;   /* ...          */
>      jump_to_low_kernel();
>  }
Janosch Frank July 20, 2020, 12:16 p.m. UTC | #2
On 7/20/20 1:45 PM, Thomas Huth wrote:
> On 15/07/2020 11.40, Janosch Frank wrote:
>> jump_to_low_kernel() and the functions that it calls will already or
>> 64 bit addressing into the reset psw mask when executing
>> jump_to_IPL_2() after the diag308 subcode 1.
> 
> But there is also a check in jump_to_low_kernel that could be affected
> by your change:
> 
>     if (*((uint64_t *)0) & RESET_PSW_MASK) {
>         jump_to_IPL_code((*((uint64_t *)0)) & PSW_MASK_SHORT_ADDR);
>     }
> 
> ... but I assume that there should not be any kernels out there in the
> wild which do not have these bits set, so I think your modifications
> here should be ok.

The mask needs to have the short bit indication set so it needs to be !=
0 anyway, no?

> 
> Acked-by: Thomas Huth <thuth@redhat.com>
> 
> 
>> The kernel proper is then branched to rather than doing a full PSW
>> change.
>>
>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>> ---
>>  pc-bios/s390-ccw/dasd-ipl.c | 3 ---
>>  1 file changed, 3 deletions(-)
>>
>> diff --git a/pc-bios/s390-ccw/dasd-ipl.c b/pc-bios/s390-ccw/dasd-ipl.c
>> index 0fc879bb8e..e8f2846740 100644
>> --- a/pc-bios/s390-ccw/dasd-ipl.c
>> +++ b/pc-bios/s390-ccw/dasd-ipl.c
>> @@ -206,7 +206,6 @@ static void run_ipl2(SubChannelId schid, uint16_t cutype, uint32_t addr)
>>   */
>>  void dasd_ipl(SubChannelId schid, uint16_t cutype)
>>  {
>> -    PSWLegacy *pswl = (PSWLegacy *) 0x00;
>>      uint32_t ipl2_addr;
>>  
>>      /* Construct Read IPL CCW and run it to read IPL1 from boot disk */
>> @@ -229,7 +228,5 @@ void dasd_ipl(SubChannelId schid, uint16_t cutype)
>>      run_ipl2(schid, cutype, ipl2_addr);
>>  
>>      /* Transfer control to the guest operating system */
>> -    pswl->mask |= PSW_MASK_EAMODE;   /* Force z-mode */
>> -    pswl->addr |= PSW_MASK_BAMODE;   /* ...          */
>>      jump_to_low_kernel();
>>  }
>
Thomas Huth July 21, 2020, 7:10 a.m. UTC | #3
On 20/07/2020 14.16, Janosch Frank wrote:
> On 7/20/20 1:45 PM, Thomas Huth wrote:
>> On 15/07/2020 11.40, Janosch Frank wrote:
>>> jump_to_low_kernel() and the functions that it calls will already or
>>> 64 bit addressing into the reset psw mask when executing
>>> jump_to_IPL_2() after the diag308 subcode 1.
>>
>> But there is also a check in jump_to_low_kernel that could be affected
>> by your change:
>>
>>     if (*((uint64_t *)0) & RESET_PSW_MASK) {
>>         jump_to_IPL_code((*((uint64_t *)0)) & PSW_MASK_SHORT_ADDR);
>>     }
>>
>> ... but I assume that there should not be any kernels out there in the
>> wild which do not have these bits set, so I think your modifications
>> here should be ok.
> 
> The mask needs to have the short bit indication set so it needs to be !=
> 0 anyway, no?

That's true. If there were still broken images out there, they should
have stopped working since commit 104130cb7c106378da anyway.

 Thomas
diff mbox series

Patch

diff --git a/pc-bios/s390-ccw/dasd-ipl.c b/pc-bios/s390-ccw/dasd-ipl.c
index 0fc879bb8e..e8f2846740 100644
--- a/pc-bios/s390-ccw/dasd-ipl.c
+++ b/pc-bios/s390-ccw/dasd-ipl.c
@@ -206,7 +206,6 @@  static void run_ipl2(SubChannelId schid, uint16_t cutype, uint32_t addr)
  */
 void dasd_ipl(SubChannelId schid, uint16_t cutype)
 {
-    PSWLegacy *pswl = (PSWLegacy *) 0x00;
     uint32_t ipl2_addr;
 
     /* Construct Read IPL CCW and run it to read IPL1 from boot disk */
@@ -229,7 +228,5 @@  void dasd_ipl(SubChannelId schid, uint16_t cutype)
     run_ipl2(schid, cutype, ipl2_addr);
 
     /* Transfer control to the guest operating system */
-    pswl->mask |= PSW_MASK_EAMODE;   /* Force z-mode */
-    pswl->addr |= PSW_MASK_BAMODE;   /* ...          */
     jump_to_low_kernel();
 }