summaryrefslogtreecommitdiffstats
path: root/arch/s390/mm
diff options
context:
space:
mode:
authorClaudio Imbrenda <imbrenda@linux.ibm.com>2021-09-20 15:24:54 +0200
committerChristian Borntraeger <borntraeger@de.ibm.com>2021-10-27 07:55:53 +0200
commit380d97bd02fca7b9b41aec2d1c767874d602bc78 (patch)
tree8e9f822ec608744ebcb9f4e5ddb293936e59393a /arch/s390/mm
parentKVM: s390: Fix handle_sske page fault handling (diff)
downloadlinux-380d97bd02fca7b9b41aec2d1c767874d602bc78.tar.xz
linux-380d97bd02fca7b9b41aec2d1c767874d602bc78.zip
KVM: s390: pv: properly handle page flags for protected guests
Introduce variants of the convert and destroy page functions that also clear the PG_arch_1 bit used to mark them as secure pages. The PG_arch_1 flag is always allowed to overindicate; using the new functions introduced here allows to reduce the extent of overindication and thus improve performance. These new functions can only be called on pages for which a reference is already being held. Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> Link: https://lore.kernel.org/r/20210920132502.36111-7-imbrenda@linux.ibm.com Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r--arch/s390/mm/gmap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c
index d63c0ccc5ccd..dfee0ebb2fac 100644
--- a/arch/s390/mm/gmap.c
+++ b/arch/s390/mm/gmap.c
@@ -2684,8 +2684,10 @@ static int __s390_reset_acc(pte_t *ptep, unsigned long addr,
{
pte_t pte = READ_ONCE(*ptep);
+ /* There is a reference through the mapping */
if (pte_present(pte))
- WARN_ON_ONCE(uv_destroy_page(pte_val(pte) & PAGE_MASK));
+ WARN_ON_ONCE(uv_destroy_owned_page(pte_val(pte) & PAGE_MASK));
+
return 0;
}