From patchwork Fri Feb 14 22:26:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 11383385 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4F9721820 for ; Fri, 14 Feb 2020 22:27:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 39B0722314 for ; Fri, 14 Feb 2020 22:27:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728177AbgBNW1p (ORCPT ); Fri, 14 Feb 2020 17:27:45 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36916 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728178AbgBNW1p (ORCPT ); Fri, 14 Feb 2020 17:27:45 -0500 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01EMP2ts109904; Fri, 14 Feb 2020 17:27:44 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2y4j8dejt3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Feb 2020 17:27:43 -0500 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 01EMQmNm112984; Fri, 14 Feb 2020 17:27:43 -0500 Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com with ESMTP id 2y4j8dejst-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Feb 2020 17:27:43 -0500 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 01EMP9UT003849; Fri, 14 Feb 2020 22:27:42 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma04wdc.us.ibm.com with ESMTP id 2y5bc09xaa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Feb 2020 22:27:42 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 01EMRd8c57934334 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Feb 2020 22:27:39 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 35187136091; Fri, 14 Feb 2020 22:27:39 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 78E3B136094; Fri, 14 Feb 2020 22:27:38 +0000 (GMT) Received: from localhost.localdomain (unknown [9.114.17.106]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 14 Feb 2020 22:27:38 +0000 (GMT) From: Christian Borntraeger To: Christian Borntraeger , Janosch Frank Cc: KVM , Cornelia Huck , David Hildenbrand , Thomas Huth , Ulrich Weigand , Claudio Imbrenda , linux-s390 , Michael Mueller , Vasily Gorbik Subject: [PATCH v2 41/42] potential fixup for "s390/mm: provide memory management functions for protected KVM guests" Date: Fri, 14 Feb 2020 17:26:57 -0500 Message-Id: <20200214222658.12946-42-borntraeger@de.ibm.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200214222658.12946-1-borntraeger@de.ibm.com> References: <20200214222658.12946-1-borntraeger@de.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-14_08:2020-02-14,2020-02-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 mlxlogscore=867 clxscore=1015 impostorscore=0 mlxscore=0 adultscore=0 lowpriorityscore=0 malwarescore=0 bulkscore=0 spamscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002140165 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Claudio Imbrenda Needed when "example for future extension: mm:gup/writeback: add callbacks for inaccessible pages: source indication" is applied. Signed-off-by: Claudio Imbrenda Signed-off-by: Christian Borntraeger --- arch/s390/include/asm/page.h | 2 +- arch/s390/kernel/uv.c | 2 +- arch/s390/mm/fault.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h index 4ebcf891ff3c..a658487fe8e7 100644 --- a/arch/s390/include/asm/page.h +++ b/arch/s390/include/asm/page.h @@ -154,7 +154,7 @@ static inline int devmem_is_allowed(unsigned long pfn) #define HAVE_ARCH_ALLOC_PAGE #if IS_ENABLED(CONFIG_PGSTE) -int arch_make_page_accessible(struct page *page); +int arch_make_page_accessible(struct page *page, int where); #define HAVE_ARCH_MAKE_PAGE_ACCESSIBLE #endif diff --git a/arch/s390/kernel/uv.c b/arch/s390/kernel/uv.c index fb606b171f42..5ace77694ed3 100644 --- a/arch/s390/kernel/uv.c +++ b/arch/s390/kernel/uv.c @@ -287,7 +287,7 @@ EXPORT_SYMBOL_GPL(gmap_convert_to_secure); /** * To be called with the page locked or with an extra reference! */ -int arch_make_page_accessible(struct page *page) +int arch_make_page_accessible(struct page *page, int where) { int rc = 0; diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 7bd86ebc882f..1f31025bc2cf 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c @@ -842,7 +842,7 @@ void do_secure_storage_access(struct pt_regs *regs) up_read(&mm->mmap_sem); break; } - if (arch_make_page_accessible(page)) + if (arch_make_page_accessible(page, MAKE_ACCESSIBLE_GENERIC)) send_sig(SIGSEGV, current, 0); put_page(page); up_read(&mm->mmap_sem); @@ -851,7 +851,7 @@ void do_secure_storage_access(struct pt_regs *regs) page = phys_to_page(addr); if (unlikely(!try_get_page(page))) break; - rc = arch_make_page_accessible(page); + rc = arch_make_page_accessible(page, MAKE_ACCESSIBLE_GENERIC); put_page(page); if (rc) BUG();