Message ID | 20230319001535.23210-13-rick.p.edgecombe@intel.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99424C7619A for <linux-mm@archiver.kernel.org>; Sun, 19 Mar 2023 00:16:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 554BB28000A; Sat, 18 Mar 2023 20:16:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4B91E280001; Sat, 18 Mar 2023 20:16:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E2E528000A; Sat, 18 Mar 2023 20:16:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 0AF41280001 for <linux-mm@kvack.org>; Sat, 18 Mar 2023 20:16:18 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id E1171C0CF8 for <linux-mm@kvack.org>; Sun, 19 Mar 2023 00:16:17 +0000 (UTC) X-FDA: 80583730794.02.AA848F0 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by imf16.hostedemail.com (Postfix) with ESMTP id B24C2180014 for <linux-mm@kvack.org>; Sun, 19 Mar 2023 00:16:15 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=j9EcXTtc; spf=pass (imf16.hostedemail.com: domain of rick.p.edgecombe@intel.com designates 192.55.52.115 as permitted sender) smtp.mailfrom=rick.p.edgecombe@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679184976; a=rsa-sha256; cv=none; b=vi/32Wgx2444G9lbWB0R49QE8tieFUynMlAlD9pGYKeBWJRx07bkG/DFeuv/MtMA5x94BK WyvRvLFojOjN+A2J4uXh00EhN9LKrF1auUp6ObDvqgBseVan0IeRFYtKIPyOOPl3f/1AM7 mlZH6x9T4lxM08966AwrjkWaSoKU4uA= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=j9EcXTtc; spf=pass (imf16.hostedemail.com: domain of rick.p.edgecombe@intel.com designates 192.55.52.115 as permitted sender) smtp.mailfrom=rick.p.edgecombe@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679184976; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=33oWnhrr3jWrLjHxAwTEeqeEC+bn441diBSfuvAd5ZQ=; b=i+9BHIVqdPkjSYlNFHs7TSYqXEAycResaqkFFn+aDMbSOJ88I/Ct9oHxx/9oJ+OOiSfIIE 7GybakQ4Qab4+5itRxsbNT0eHwO64vqj8mgzMyE6SBE4ThI34HDShmuUwVp072aUvLeY5z pyDsTCMqCQe6lyWme2NqFD/wEzseNZI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679184975; x=1710720975; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=izjgG3aKsLsDvcFVl85obe6QvAjx4LnRxYiOny/YjPI=; b=j9EcXTtcXRuB47kINGnCdrkCJpOjtDD8iQ91XYLlqR4vODNTqSM4z4eE sgBkozvVQhTEvAxAXpyaecv10MFcPLsQbHBv8WE6kmfZW8zas2IiLnNIj cnfa2yqzG9arXXQloY88JD24a1jJwa8KGsl2dZejADIbuTp29Tg+GskAd Pdju9HdsVxdehZqbeC8cgaIGeIEXxpA7uOvHk6bmaGZ4llKVa4xv0f6lp kmfismpDNsbZFwUnUbI/vHLbAn48rPukzGyRxQt6qyZo/qdbkvZE5wE1c z7nIkI07u1H9i8AQbb30SGl+PvCMXJevvxTYzTqCOU2rnFmC2l8DEHheB Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10653"; a="338490992" X-IronPort-AV: E=Sophos;i="5.98,272,1673942400"; d="scan'208";a="338490992" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2023 17:16:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10653"; a="749672826" X-IronPort-AV: E=Sophos;i="5.98,272,1673942400"; d="scan'208";a="749672826" Received: from bmahatwo-mobl1.gar.corp.intel.com (HELO rpedgeco-desk.amr.corp.intel.com) ([10.135.34.5]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2023 17:16:13 -0700 From: Rick Edgecombe <rick.p.edgecombe@intel.com> To: x86@kernel.org, "H . Peter Anvin" <hpa@zytor.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>, Andy Lutomirski <luto@kernel.org>, Balbir Singh <bsingharora@gmail.com>, Borislav Petkov <bp@alien8.de>, Cyrill Gorcunov <gorcunov@gmail.com>, Dave Hansen <dave.hansen@linux.intel.com>, Eugene Syromiatnikov <esyr@redhat.com>, Florian Weimer <fweimer@redhat.com>, "H . J . Lu" <hjl.tools@gmail.com>, Jann Horn <jannh@google.com>, Jonathan Corbet <corbet@lwn.net>, Kees Cook <keescook@chromium.org>, Mike Kravetz <mike.kravetz@oracle.com>, Nadav Amit <nadav.amit@gmail.com>, Oleg Nesterov <oleg@redhat.com>, Pavel Machek <pavel@ucw.cz>, Peter Zijlstra <peterz@infradead.org>, Randy Dunlap <rdunlap@infradead.org>, Weijiang Yang <weijiang.yang@intel.com>, "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>, John Allen <john.allen@amd.com>, kcc@google.com, eranian@google.com, rppt@kernel.org, jamorris@linux.microsoft.com, dethoma@microsoft.com, akpm@linux-foundation.org, Andrew.Cooper3@citrix.com, christina.schimpe@intel.com, david@redhat.com, debug@rivosinc.com, szabolcs.nagy@arm.com Cc: rick.p.edgecombe@intel.com Subject: [PATCH v8 12/40] s390/mm: Introduce pmd_mkwrite_kernel() Date: Sat, 18 Mar 2023 17:15:07 -0700 Message-Id: <20230319001535.23210-13-rick.p.edgecombe@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230319001535.23210-1-rick.p.edgecombe@intel.com> References: <20230319001535.23210-1-rick.p.edgecombe@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Queue-Id: B24C2180014 X-Rspamd-Server: rspam01 X-Stat-Signature: jcbeogp41jztu5ao46fg3kdjf6a87w3o X-HE-Tag: 1679184975-400138 X-HE-Meta: U2FsdGVkX19X+1Bur5c5F0vfXobTldf/NiBLolJZSsAm5SfDtWYddfEJwZtEVA14MrCwcZTHlHLXCKMzax/oC1eb0HHWVwhykkKpu43k11hrOZXWgdCFT6JlvIpV7nNzPCu9ssBnADubIcNnYzxAkOX8GnURcZxYS0/xXX9WxyXPTw3wRzu2OZBsHBHqTK8fN7OEeviliZyLKHSJkMWABpS98EDme75qavNhtQP2H7FXqzCP5v5xLu+0dsbc1FUoD+qi9bW83zlXHnUqaF52xa23a4eLcm44ZBisiTxfMR0ThdmciYPH2hG6cP1UW+7IYpVU2xH64zjqdOxaodczpbJeunPMpPwp+gyidG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iYV9evb4Bwqm+udLAWoRktTmgUGD0CqeMd6XFvTo41FlBPDi/zC0dtUbBqD2WTg== 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: <linux-mm.kvack.org> |
Series |
Shadow stacks for userspace
|
expand
|
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index d4943f2d3f00..deeb918cae1d 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h @@ -1491,7 +1491,7 @@ static inline pmd_t pmd_wrprotect(pmd_t pmd) return set_pmd_bit(pmd, __pgprot(_SEGMENT_ENTRY_PROTECT)); } -static inline pmd_t pmd_mkwrite(pmd_t pmd) +static inline pmd_t pmd_mkwrite_kernel(pmd_t pmd) { pmd = set_pmd_bit(pmd, __pgprot(_SEGMENT_ENTRY_WRITE)); if (pmd_val(pmd) & _SEGMENT_ENTRY_DIRTY) @@ -1499,6 +1499,11 @@ static inline pmd_t pmd_mkwrite(pmd_t pmd) return pmd; } +static inline pmd_t pmd_mkwrite(pmd_t pmd) +{ + return pmd_mkwrite_kernel(pmd); +} + static inline pmd_t pmd_mkclean(pmd_t pmd) { pmd = clear_pmd_bit(pmd, __pgprot(_SEGMENT_ENTRY_DIRTY)); diff --git a/arch/s390/mm/pageattr.c b/arch/s390/mm/pageattr.c index 4ee5fe5caa23..7b6967dfacd0 100644 --- a/arch/s390/mm/pageattr.c +++ b/arch/s390/mm/pageattr.c @@ -146,7 +146,7 @@ static void modify_pmd_page(pmd_t *pmdp, unsigned long addr, if (flags & SET_MEMORY_RO) new = pmd_wrprotect(new); else if (flags & SET_MEMORY_RW) - new = pmd_mkwrite(pmd_mkdirty(new)); + new = pmd_mkwrite_kernel(pmd_mkdirty(new)); if (flags & SET_MEMORY_NX) new = set_pmd_bit(new, __pgprot(_SEGMENT_ENTRY_NOEXEC)); else if (flags & SET_MEMORY_X)