All of lore.kernel.org
 help / color / mirror / Atom feed
From: Janosch Frank <frankja@linux.ibm.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>, qemu-devel@nongnu.org
Cc: thuth@redhat.com, cohuck@redhat.com, david@redhat.com
Subject: Re: [PATCH] pc-bios: s390x: Add a comment to the io and external new PSW setup
Date: Wed, 22 Jul 2020 10:05:53 +0200	[thread overview]
Message-ID: <cd2c8bb2-413f-b6b9-ae16-e79e838b503d@linux.ibm.com> (raw)
In-Reply-To: <2e6134fb-3e34-4d3a-1bf8-1665ceffef38@de.ibm.com>


[-- Attachment #1.1: Type: text/plain, Size: 2901 bytes --]

On 7/22/20 9:39 AM, Christian Borntraeger wrote:
> 
> 
> On 22.07.20 09:24, Janosch Frank wrote:
>> On 7/22/20 8:43 AM, Christian Borntraeger wrote:
>>>
>>>
>>> On 15.07.20 16:08, Janosch Frank wrote:
>>>> Normally they don't need to be set up before waiting for an interrupt
>>>> but are set up on boot. The BIOS however might overwrite the lowcore
>>>> (and hence the PSWs) when loading a blob into memory and therefore
>>>> needs to set up those PSWs more often.
>>>
>>> Now when I read the new comment this actually inidicates a bug. 
>>> When do we restore the original content? If the loaded program
>>> does have interrupt handlers in the original image and relies on that
>>> then we are broken, no?
>>
>> I haven't seen references to a save/restore functionality for those
>> PSWs. And I also think it's not that easy to do because we have multiple
>> ways of loading data and if we want to print when loading we might end
>> up overwriting and then saving the written value for a later restore.
>>
>> I need to have a closer look at how virtio works, but wouldn't we have a
>> chicken - egg problem with IO interrupts for IO that writes the prefix?
>>
>> The BIOS often has "interesting" solutions to problems.
>> If you have a quick fix, be my guest and send it. If not I'd put it on
>> my todo list or let Stefan make it a proper dev item.
> 
> Maybe a global fixup table in BIOS memory that restores all the memory that
> we messed with when we hand over control? Can you at least change the comment
> here to add a fixme?

Sure

> 
>>
>>>
>>>>
>>>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>>>> ---
>>>>  pc-bios/s390-ccw/start.S | 10 ++++++++--
>>>>  1 file changed, 8 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/pc-bios/s390-ccw/start.S b/pc-bios/s390-ccw/start.S
>>>> index 01c4c21b26..b0fcb918cc 100644
>>>> --- a/pc-bios/s390-ccw/start.S
>>>> +++ b/pc-bios/s390-ccw/start.S
>>>> @@ -64,7 +64,10 @@ consume_sclp_int:
>>>>          stctg   %c0,%c0,0(%r15)
>>>>          oi      6(%r15),0x2
>>>>          lctlg   %c0,%c0,0(%r15)
>>>> -        /* prepare external call handler */
>>>> +        /*
>>>> +         * Prepare external new PSW as it might have been overwritten
>>>> +         * by a loaded blob
>>>> +         */
>>>>          larl %r1, external_new_code
>>>>          stg %r1, 0x1b8
>>>>          larl %r1, external_new_mask
>>>> @@ -84,7 +87,10 @@ consume_io_int:
>>>>          stctg %c6,%c6,0(%r15)
>>>>          oi    4(%r15), 0xff
>>>>          lctlg %c6,%c6,0(%r15)
>>>> -        /* prepare i/o call handler */
>>>> +        /*
>>>> +         * Prepare i/o new PSW as it might have been overwritten
>>>> +         * by a loaded blob
>>>> +         */
>>>>          larl  %r1, io_new_code
>>>>          stg   %r1, 0x1f8
>>>>          larl  %r1, io_new_mask
>>>>
>>
>>



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-07-22  8:10 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15  9:40 [PATCH 0/7] pc-bios: s390x: Cleanup part 2 Janosch Frank
2020-07-15  9:40 ` [PATCH 1/7] pc-bios: s390x: Fix bootmap.c zipl component entry data handling Janosch Frank
2020-07-17 15:05   ` Thomas Huth
2020-07-22  6:50   ` Christian Borntraeger
2020-07-22  7:30     ` Janosch Frank
2020-07-22  7:33       ` Christian Borntraeger
2020-07-22  8:06         ` Janosch Frank
2020-07-15  9:40 ` [PATCH 2/7] pc-bios: s390x: Cleanup jump to ipl code Janosch Frank
2020-07-17 15:13   ` Thomas Huth
2020-07-21 13:07     ` Janosch Frank
2020-07-21 13:54     ` Christian Borntraeger
2020-07-15  9:40 ` [PATCH 3/7] pc-bios: s390x: Remove unneeded dasd-ipl.c reset psw mask changes Janosch Frank
2020-07-20 11:45   ` Thomas Huth
2020-07-20 12:16     ` Janosch Frank
2020-07-21  7:10       ` Thomas Huth
2020-07-15  9:40 ` [PATCH 4/7] pc-bios: s390x: Rework data initialization Janosch Frank
2020-07-20 11:56   ` Thomas Huth
2020-07-20 12:10     ` Janosch Frank
2020-07-15  9:40 ` [PATCH 5/7] pc-bios: s390x: Replace lowcore offsets with pointers in dasd-ipl.c Janosch Frank
2020-07-21  7:00   ` Thomas Huth
2020-07-15  9:40 ` [PATCH 6/7] pc-bios: s390x: Use PSW constants in start.S Janosch Frank
2020-07-21  7:05   ` Thomas Huth
2020-07-22  6:47     ` Christian Borntraeger
2020-07-15  9:40 ` [PATCH 7/7] pc-bios: s390x: Setup io and ext new psws only once Janosch Frank
2020-07-15 13:13   ` Janosch Frank
2020-07-15 13:16     ` Christian Borntraeger
2020-07-15 14:08       ` [PATCH] pc-bios: s390x: Add a comment to the io and external new PSW setup Janosch Frank
2020-07-21  7:03         ` Thomas Huth
2020-07-22  6:43         ` Christian Borntraeger
2020-07-22  7:24           ` Janosch Frank
2020-07-22  7:39             ` Christian Borntraeger
2020-07-22  8:05               ` Janosch Frank [this message]
2020-08-27  9:20                 ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cd2c8bb2-413f-b6b9-ae16-e79e838b503d@linux.ibm.com \
    --to=frankja@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.