From patchwork Wed Nov 28 14:34:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 10702769 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1D03C109C for ; Wed, 28 Nov 2018 14:35:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B49542B942 for ; Wed, 28 Nov 2018 14:35:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A51112C119; Wed, 28 Nov 2018 14:35:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CA822BE76 for ; Wed, 28 Nov 2018 14:35:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2A8546B4D6E; Wed, 28 Nov 2018 09:35:00 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 230976B4D6F; Wed, 28 Nov 2018 09:35:00 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0AB496B4D70; Wed, 28 Nov 2018 09:35:00 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by kanga.kvack.org (Postfix) with ESMTP id 9EE976B4D6E for ; Wed, 28 Nov 2018 09:34:59 -0500 (EST) Received: by mail-ed1-f69.google.com with SMTP id x15so12623779edd.2 for ; Wed, 28 Nov 2018 06:34:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:mime-version:content-transfer-encoding:message-id; bh=FUi5Kkf5kAmHiOozy7f+ZRCKkGbgD8ziYVGDr8j8rNI=; b=o8GjLVtMk9xB0AJB2/hXm8bXuw8X15Wn1sBNvSWrH954gCWJsmCbuHBm9kD6Ef/bTD ga+RVb1H2Wi3uoIGb1WuPaZYN9izlG2+dcHJdOBW7ZRYgnABVprd6ndYI0tojgAwgm3S /+3MEps+DDkC+2cFu7wojrlqoMLBMFH6E2v5njUe2xx0PxlOgBgy3bfxf/K9qDLXQUCF NyV+93/G5eDkC7f6F64gqBp4cTjfSNIoMSUwdJRa35UUkpITZsN2ahWRoM5IaH811fY4 DQ9yDG9W+J6X/Bzx74tDCGrB6h6OrOcFazacy/m0w580KSKNR+YeKX/RAyANNrvH0hLr jUsA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: AGRZ1gIwLTcfoVzdNS48CLYFu8ojVXlGTocD6dWS48gRQMEq+kxmfBet oaw8dcwasEdAIMoxU/2v///au527W+kxqwfgficVjohMihAhsZTHA7oZoKflnVebQSerMyA1voy odNlp2NkppNlpofDkG1bkf4aesYW3x43AEYnQKV68GspnOrPKd65STaldWrUoW76oVw== X-Received: by 2002:a17:906:48c5:: with SMTP id d5-v6mr26885214ejt.85.1543415699050; Wed, 28 Nov 2018 06:34:59 -0800 (PST) X-Google-Smtp-Source: AJdET5e8BYNRg1hDo885cFPoCBml65iiKus/lZNtFA+PCzP2GtHdGSObuNtvDhXzfBLLoaYMCz/T X-Received: by 2002:a17:906:48c5:: with SMTP id d5-v6mr26885153ejt.85.1543415697859; Wed, 28 Nov 2018 06:34:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543415697; cv=none; d=google.com; s=arc-20160816; b=mDtaU3NB1hng5+A/3vvvPS4nsM5jS7otqkJRXsobFSpcZhvf1nxXKXHx6r8PVo7h0f D3Q954YmVibn/ar1dqfKFAMdPVg1p/YqppRUg+3PuAe6Ny9Aj+gyLlZZ+86zFTxrjScC hJRSSgMZw+PKqMuBk1PkjQR99QKooEVCv2LwglLmyo8KfmujPrVSPrvI7D0gQM1YmFvy 7iEvN8cOgQvl43lOmfpys9NDQSdGyrlu8otJQhLL98vVYGf30vJyJmrZlOfE4M8nKmcm 7i7P76nSZtk0r8Kq6JiMbpffFk9ZVO2D3N4GOSJS1PxHcn0gNzMJ1UiXc32LkZklYwjk PGjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:content-transfer-encoding:mime-version:date:subject:cc :to:from; bh=FUi5Kkf5kAmHiOozy7f+ZRCKkGbgD8ziYVGDr8j8rNI=; b=yNtF4tJeznkODL3kC0xmCJIz745xzu6wRTJm6WlaKTXikuVZiVh5O+kdcFDGlm3I8z L0D6dUF5l6pXLoDlqiIl3U29HKvFtK9XYM2LDUmgqp4kOr2d9UOX2oWelUIRsWQz7JOs mp1lhC6rA2uhNoPoCg41LzFejlPujmHaFdHD3MrTSxZU1UfaKaPe3Gx+Rufb9mVW1Lq4 KDm10HFVcLnXeqJ37+x7N4cmg32Ocktg6cLzNtrOr7VG3H2X2JTRRxQ/HoAQYzt87AAP WfcVcMOjNJTE3c5NaBA/7czKf+FbpCQbyABZkfZeTM3h8w9uKAvqEJCuWsZwan/raQEV kaLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com. [148.163.158.5]) by mx.google.com with ESMTPS id z49si3929236edz.233.2018.11.28.06.34.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Nov 2018 06:34:57 -0800 (PST) Received-SPF: pass (google.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) client-ip=148.163.158.5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wASEYFOi082781 for ; Wed, 28 Nov 2018 09:34:56 -0500 Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) by mx0b-001b2d01.pphosted.com with ESMTP id 2p1vrn8eju-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 28 Nov 2018 09:34:55 -0500 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 28 Nov 2018 14:34:55 -0000 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 28 Nov 2018 14:34:52 -0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wASEYpMh16973910 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 28 Nov 2018 14:34:51 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8CE656E059; Wed, 28 Nov 2018 14:34:51 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9C6736E052; Wed, 28 Nov 2018 14:34:48 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.85.87.253]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 28 Nov 2018 14:34:48 +0000 (GMT) From: "Aneesh Kumar K.V" To: akpm@linux-foundation.org, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, "Aneesh Kumar K.V" Subject: [PATCH V2 0/5] NestMMU pte upgrade workaround for mprotect Date: Wed, 28 Nov 2018 20:04:33 +0530 X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18112814-0020-0000-0000-00000E918F63 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010137; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000270; SDB=6.01124008; UDB=6.00583546; IPR=6.00904137; MB=3.00024366; MTD=3.00000008; XFM=3.00000015; UTC=2018-11-28 14:34:54 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18112814-0021-0000-0000-000063DE30C9 Message-Id: <20181128143438.29458-1-aneesh.kumar@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-11-28_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=427 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811280129 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP We can upgrade pte access (R -> RW transition) via mprotect. We need to make sure we follow the recommended pte update sequence as outlined in commit: bd5050e38aec ("powerpc/mm/radix: Change pte relax sequence to handle nest MMU hang") for such updates. This patch series do that. Changes from V1: * Restrict ths only for R->RW upgrade. We don't need to do this for Autonuma * Restrict this only for radix translation mode. Aneesh Kumar K.V (5): mm: Update ptep_modify_prot_start/commit to take vm_area_struct as arg mm: update ptep_modify_prot_commit to take old pte value as arg arch/powerpc/mm: Nest MMU workaround for mprotect RW upgrade. mm/hugetlb: Add prot_modify_start/commit sequence for hugetlb update arch/powerpc/mm/hugetlb: NestMMU workaround for hugetlb mprotect RW upgrade arch/powerpc/include/asm/book3s/64/hugetlb.h | 12 ++++++++ arch/powerpc/include/asm/book3s/64/pgtable.h | 18 ++++++++++++ arch/powerpc/include/asm/book3s/64/radix.h | 4 +++ arch/powerpc/mm/hugetlbpage-radix.c | 17 ++++++++++++ arch/powerpc/mm/hugetlbpage.c | 29 ++++++++++++++++++++ arch/powerpc/mm/pgtable-book3s64.c | 27 ++++++++++++++++++ arch/powerpc/mm/pgtable-radix.c | 18 ++++++++++++ arch/s390/include/asm/pgtable.h | 5 ++-- arch/s390/mm/pgtable.c | 8 ++++-- arch/x86/include/asm/paravirt.h | 9 ++++-- fs/proc/task_mmu.c | 8 ++++-- include/asm-generic/pgtable.h | 10 +++---- include/linux/hugetlb.h | 18 ++++++++++++ mm/hugetlb.c | 8 ++++-- mm/memory.c | 8 +++--- mm/mprotect.c | 6 ++-- 16 files changed, 179 insertions(+), 26 deletions(-)