diff mbox series

[v1,for-2.12,13/15] s390x/tcg: use program_interrupt_ra() in STSI

Message ID 20171128203326.6062-14-david@redhat.com
State New
Headers show
Series s390x/tcg: cleanup and fix program interrupts | expand

Commit Message

David Hildenbrand Nov. 28, 2017, 8:33 p.m. UTC
STSI needs some more love, but let's do one step at a time.
We can now drop potential_page_fault().

Signed-off-by: David Hildenbrand <david@redhat.com>
---
 target/s390x/misc_helper.c | 2 +-
 target/s390x/translate.c   | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

Comments

Cornelia Huck Nov. 29, 2017, 3:53 p.m. UTC | #1
On Tue, 28 Nov 2017 21:33:23 +0100
David Hildenbrand <david@redhat.com> wrote:

> STSI needs some more love, but let's do one step at a time.

Out of curiousity: What else do you want to do?

> We can now drop potential_page_fault().
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  target/s390x/misc_helper.c | 2 +-
>  target/s390x/translate.c   | 1 -
>  2 files changed, 1 insertion(+), 2 deletions(-)
David Hildenbrand Nov. 29, 2017, 3:56 p.m. UTC | #2
On 29.11.2017 16:53, Cornelia Huck wrote:
> On Tue, 28 Nov 2017 21:33:23 +0100
> David Hildenbrand <david@redhat.com> wrote:
> 
>> STSI needs some more love, but let's do one step at a time.
> 
> Out of curiousity: What else do you want to do?
> 

Will post the patch as soon as this series has been picked up.

Here is a preview:

commit a1a86f4db56e307d22918117515184fde540c14b
Author: David Hildenbrand <david@redhat.com>
Date:   Wed Nov 22 18:18:52 2017 +0100

    s390x/tcg: fix size + content of STSI blocks
    
    All blocks are 4k in size, which is only true for one of them right now.
    Also some reserved fields were wrong, fix it and convert all reserved
    fields to speficy u8.
    
    This also fixes the LPAR part output in /proc/sysinfo under LPAR.
    
    Signed-off-by: David Hildenbrand <david@redhat.com>


commit 41192e74109532d4c106c7b1a6bcf7f989b2f4fd
Author: David Hildenbrand <david@redhat.com>
Date:   Wed Nov 22 18:21:14 2017 +0100

    s390x/tcg: STSI overhaul
    
    Current STSI implementation is a mess, so let's rewrite it.
    
    Problems fixed by this patch:
    1) The order of exceptions/when recognized is wrong.
    2) We have to store to virtual address space, not absolute.
    3) Alignment check of the block is missing.
    3) The SMP information is not indicated.
    
    While at it:
    a) Make the code look nicer
        - get rid of nesting levels
        - use struct initialization instead of initializing to zero
        - rename a misspelled field and rename function code defines
        - use a union and have only one write statement
        - use cpu_to_beX()
    b) Indicate the VM name/extended name + UUID just like KVM does
    c) Indicate that all LPAR CPUs we fake are dedicated
    d) Add a comment why we fake being a KVM guest
    e) Give our guest as default the name "TCGguest"
    f) Fake the same CPU information we have in our Guest for all layers
    
    While at it, get rid of "potential_page_fault()" by forwarding the
    retaddr properly.
    
    The result is best verified by looking at "/proc/sysinfo" in the guest
    when specifying on the qemu command line
        -uuid "74738ff5-5367-5958-9aee-98fffdcd1876" \
        -name "extra long guest name"
    
    Signed-off-by: David Hildenbrand <david@redhat.com>
Richard Henderson Nov. 29, 2017, 6:14 p.m. UTC | #3
On 11/28/2017 08:33 PM, David Hildenbrand wrote:
> STSI needs some more love, but let's do one step at a time.
> We can now drop potential_page_fault().
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  target/s390x/misc_helper.c | 2 +-
>  target/s390x/translate.c   | 1 -
>  2 files changed, 1 insertion(+), 2 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
diff mbox series

Patch

diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c
index 6ae8e8a220..aa0430dcac 100644
--- a/target/s390x/misc_helper.c
+++ b/target/s390x/misc_helper.c
@@ -184,7 +184,7 @@  uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0,
     if ((r0 & STSI_LEVEL_MASK) <= STSI_LEVEL_3 &&
         ((r0 & STSI_R0_RESERVED_MASK) || (r1 & STSI_R1_RESERVED_MASK))) {
         /* valid function code, invalid reserved bits */
-        program_interrupt(env, PGM_SPECIFICATION, 4);
+        program_interrupt_ra(env, PGM_SPECIFICATION, 4, GETPC());
     }
 
     sel1 = r0 & STSI_R0_SEL1_MASK;
diff --git a/target/s390x/translate.c b/target/s390x/translate.c
index f26fa64a78..1ce1390699 100644
--- a/target/s390x/translate.c
+++ b/target/s390x/translate.c
@@ -3988,7 +3988,6 @@  static ExitStatus op_stpt(DisasContext *s, DisasOps *o)
 static ExitStatus op_stsi(DisasContext *s, DisasOps *o)
 {
     check_privileged(s);
-    potential_page_fault(s);
     gen_helper_stsi(cc_op, cpu_env, o->in2, regs[0], regs[1]);
     set_cc_static(s);
     return NO_EXIT;