linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* please consider for stable: "s390/mm: use non-quiescing sske for KVM switch to keyed guest"
@ 2022-06-23 15:15 Christian Borntraeger
  2022-06-23 15:44 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Borntraeger @ 2022-06-23 15:15 UTC (permalink / raw)
  To: borntraeger, stable; +Cc: linux-s390

stable team, please consider
commit 3ae11dbcfac906a8c3a480e98660a823130dc16a
It will noticeable reduce system overhead when this happens on multiple CPUs.

----snip----
commit 3ae11dbcfac906a8c3a480e98660a823130dc16a
    s390/mm: use non-quiescing sske for KVM switch to keyed guest
    
    The switch to a keyed guest does not require a classic sske as the other
    guest CPUs are not accessing the key before the switch is complete.
    By using the NQ SSKE things are faster especially with multiple guests.

    
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Suggested-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Link: https://lore.kernel.org/r/20220530092706.11637-3-borntraeger@linux.ibm.com
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index 697df02362af..4909dcd762e8 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -748,7 +748,7 @@ void ptep_zap_key(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
 	pgste_val(pgste) |= PGSTE_GR_BIT | PGSTE_GC_BIT;
 	ptev = pte_val(*ptep);
 	if (!(ptev & _PAGE_INVALID) && (ptev & _PAGE_WRITE))
-		page_set_storage_key(ptev & PAGE_MASK, PAGE_DEFAULT_KEY, 1);
+		page_set_storage_key(ptev & PAGE_MASK, PAGE_DEFAULT_KEY, 0);
 	pgste_set_unlock(ptep, pgste);
 	preempt_enable();
 }

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: please consider for stable: "s390/mm: use non-quiescing sske for KVM switch to keyed guest"
  2022-06-23 15:15 please consider for stable: "s390/mm: use non-quiescing sske for KVM switch to keyed guest" Christian Borntraeger
@ 2022-06-23 15:44 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2022-06-23 15:44 UTC (permalink / raw)
  To: Christian Borntraeger; +Cc: stable, linux-s390

On Thu, Jun 23, 2022 at 05:15:20PM +0200, Christian Borntraeger wrote:
> stable team, please consider
> commit 3ae11dbcfac906a8c3a480e98660a823130dc16a
> It will noticeable reduce system overhead when this happens on multiple CPUs.
> 
> ----snip----
> commit 3ae11dbcfac906a8c3a480e98660a823130dc16a
>     s390/mm: use non-quiescing sske for KVM switch to keyed guest
>     
>     The switch to a keyed guest does not require a classic sske as the other
>     guest CPUs are not accessing the key before the switch is complete.
>     By using the NQ SSKE things are faster especially with multiple guests.
> 
>     
> Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
> Suggested-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> Link: https://lore.kernel.org/r/20220530092706.11637-3-borntraeger@linux.ibm.com
> Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
> 
> diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
> index 697df02362af..4909dcd762e8 100644
> --- a/arch/s390/mm/pgtable.c
> +++ b/arch/s390/mm/pgtable.c
> @@ -748,7 +748,7 @@ void ptep_zap_key(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
>  	pgste_val(pgste) |= PGSTE_GR_BIT | PGSTE_GC_BIT;
>  	ptev = pte_val(*ptep);
>  	if (!(ptev & _PAGE_INVALID) && (ptev & _PAGE_WRITE))
> -		page_set_storage_key(ptev & PAGE_MASK, PAGE_DEFAULT_KEY, 1);
> +		page_set_storage_key(ptev & PAGE_MASK, PAGE_DEFAULT_KEY, 0);
>  	pgste_set_unlock(ptep, pgste);
>  	preempt_enable();
>  }

Now queued up to all stable branches (as you didn't mention
otherwise...)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-23 15:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-23 15:15 please consider for stable: "s390/mm: use non-quiescing sske for KVM switch to keyed guest" Christian Borntraeger
2022-06-23 15:44 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).