On 29.05.2017 21:24, Aurelien Jarno wrote:
> And at the same time make IPTE SMP aware.
> 
> Signed-off-by: Aurelien Jarno <aurel...@aurel32.net>
> ---
>  target/s390x/helper.h     |  2 +-
>  target/s390x/mem_helper.c | 19 ++++++++++++-------
>  target/s390x/translate.c  |  6 +++++-
>  3 files changed, 18 insertions(+), 9 deletions(-)
[...]
> @@ -1092,13 +1091,19 @@ void HELPER(ipte)(CPUS390XState *env, uint64_t pto, 
> uint64_t vaddr)
>  
>      /* XXX we exploit the fact that Linux passes the exact virtual
>         address here - it's not obliged to! */
> -    tlb_flush_page(cs, page);
> +    /* XXX: the LC bit should be considered as 0 if the local-TLB-clearing
> +       facility is not installed.  */

That should be easy, I think:

    if (!s390_has_feat(S390_FEAT_LOCAL_TLB_CLEARING)) {
        m4 = 0;
    }

> +    if (m4 & 1) {
> +        tlb_flush_page(cs, page);
> +    } else {
> +        tlb_flush_page_all_cpus_synced(cs, page);
> +    }
>  
>      /* XXX 31-bit hack */
> -    if (page & 0x80000000) {
> -        tlb_flush_page(cs, page & ~0x80000000);
> +    if (m4 & 1) {
> +        tlb_flush_page(cs, page ^ 0x80000000);
>      } else {
> -        tlb_flush_page(cs, page | 0x80000000);
> +        tlb_flush_page_all_cpus_synced(cs, page ^ 0x80000000);
>      }
>  }

 Thomas

Reply via email to