qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 03/29] target/s390x: implement local-TLB-clea


From: Thomas Huth
Subject: Re: [Qemu-devel] [PATCH v2 03/29] target/s390x: implement local-TLB-clearing in IPTE
Date: Tue, 30 May 2017 11:01:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0

On 29.05.2017 21:24, Aurelien Jarno wrote:
> And at the same time make IPTE SMP aware.
> 
> Signed-off-by: Aurelien Jarno <address@hidden>
> ---
>  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

[Prev in Thread] Current Thread [Next in Thread]