Message ID | 20220530092706.11637-3-borntraeger@linux.ibm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | s390/gmap/pgtable improve handling of keyed KVM guests | expand |
On Mon, 30 May 2022 11:27:06 +0200 Christian Borntraeger <borntraeger@linux.ibm.com> wrote: > 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> > --- > arch/s390/mm/pgtable.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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(); > }
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(); }
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> --- arch/s390/mm/pgtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)