Message ID | 20240704043132.28501-8-osalvador@suse.de (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 50084C30653 for <linux-mm@archiver.kernel.org>; Thu, 4 Jul 2024 04:32:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1A32F6B009A; Thu, 4 Jul 2024 00:32:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 12AEF6B009B; Thu, 4 Jul 2024 00:32:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EC0056B009C; Thu, 4 Jul 2024 00:32:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id C454A6B009A for <linux-mm@kvack.org>; Thu, 4 Jul 2024 00:32:01 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 6FA94C0ACF for <linux-mm@kvack.org>; Thu, 4 Jul 2024 04:32:01 +0000 (UTC) X-FDA: 82300797642.25.C8C13AD Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf17.hostedemail.com (Postfix) with ESMTP id 709FE40011 for <linux-mm@kvack.org>; Thu, 4 Jul 2024 04:31:59 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720067495; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YieWm4jzRwGnc/AoSi0Kzmy4dIO/mgBRJsIk5x6bE30=; b=LjoCuj/zTlgGc0DgofVHDT94UiymvCrYiFMdbmT2GarYK2sabtpcosoX9yE81GaD4vvRAZ wWeIyPcfrP6l6YDyJNgGXNmiOXm7VySNMFryXqgsem+Yac5AsoUcqPOEHhRiJrfKLnXury j6fxUsltJKDc3QpB+bo+pmhBlvxvqmY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720067495; a=rsa-sha256; cv=none; b=r+3Zft3thp1iXXJBjweBsR2mGDyQWcUoCk8D5OrDkVty4WqHXPVcgSdZT4aB2cHhtanPic EU/H4eDueo915Vzeij5JJvOtigpsi1EY4h870SBsNEFuy50rXpwIFfZUaGzNcoYs/iun+g aoEqPf68oGyjN1Ntuy9RCDUsl9Jb/qI= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 3F26421C12; Thu, 4 Jul 2024 04:31:58 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 270FD13889; Thu, 4 Jul 2024 04:31:57 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 0IRfBb0lhmbnDAAAD6G6ig (envelope-from <osalvador@suse.de>); Thu, 04 Jul 2024 04:31:57 +0000 From: Oscar Salvador <osalvador@suse.de> To: Andrew Morton <akpm@linux-foundation.org> Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Peter Xu <peterx@redhat.com>, Muchun Song <muchun.song@linux.dev>, David Hildenbrand <david@redhat.com>, SeongJae Park <sj@kernel.org>, Miaohe Lin <linmiaohe@huawei.com>, Michal Hocko <mhocko@suse.com>, Matthew Wilcox <willy@infradead.org>, Christophe Leroy <christophe.leroy@csgroup.eu>, Oscar Salvador <osalvador@suse.de> Subject: [PATCH 07/45] arch/s390: Enable __s390_enable_skey_pmd to handle hugetlb vmas Date: Thu, 4 Jul 2024 06:30:54 +0200 Message-ID: <20240704043132.28501-8-osalvador@suse.de> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240704043132.28501-1-osalvador@suse.de> References: <20240704043132.28501-1-osalvador@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 709FE40011 X-Stat-Signature: 9kkb5t7tco696gogww6ggqrywdfmp535 X-HE-Tag: 1720067519-726938 X-HE-Meta: U2FsdGVkX19/O/ukdlEPi3rIku9wEqyebtVlMu4EYIklKglNBBnc///gZP76XfzmKmMWHWx+gXhjbTa8jRNdk6JjtPkEd+2djPkU8gAdtrryLh+OucOi/H9BV+5Pgr1iyCG6tWyHvRerTnBo9rLsbP+c1hWYscWnxsCqqgco5ZixVtncpZvmM+M2YfFphxWsvHz7Oy61ud/MERc7TMbK5YL7ubg45uf1vmwDsO5jE3A+t2mYrB/M8ubsa7O3eTwmBRUq5VyI7wcSqkbNTLMrnzC0DHvtLr1N7K5BM16MJRhWCZPoTF9yDfg423E355kLEGZT5CmTrY3DMCjBkll50V+XkfcmjhwAqkphJfVL0aE7fA0tsRNuLiSrNyCdc7DjYtEbtD/3ehDvxIXB8HHMDRmyVLT4JHp7d9y2HkkwU8DZ82QwT0Yi4MT1TcrVcvyHGdKTLpzfAZ/t8Y9bEpDeuJCHnlxFEa0lrv/Qp6uv2LQvF2pJkOYA0Zk6FwpFKjpa6wRqOLhtfqQF5JumdBjvDWTtnEg3vzFCQqkvkBxYBkUmUExShmJveVPAsVNpc3ZkPRmozxtRhmXxUjWeDCbAlTUIi/pMXgEyae9MmqGR0zNhaIQQqfxJB7vQr72NccBRDDwNHQcnGgXSGFoCBUbWX5sueBwqphJKJYLz4UcS9qw6t83RSNpx7nqNCVYyWwkYKjtHhkjfzMQZjerg8uG9aJBynfDUZr8n657tF3GMAtg8X/dm6gjDJtdpp/S/cFcRF6JaaEAXZRyZMqxoYi4SWei+8pR1DUaDk/eEMw8yMEKeeQsYp8vohWDeWlLVk4cP50qNgAo8ImkG+adjYiiMDot2l70OUp0OcWgMwnTD8mNphqg5YwZwnEnpjzYi6X24z/x0OhONCUJRDY5OXWo2vGHSHBdbxqYwMdIXWipjzKMQe3i1nbJGo8nWjn8bHSgxjgWlIYkKMVRIpBaZw5K zW3SEXsm xbzXN7jZ2oZE4/FiBWsFfOjp8dpsGxvACgeZp5ORq89/K2Py0dDY8NI2ydGeVZNGk5KLMocArcG+hR/ieyLu6A0dwBFxRPJXUgHp0W4Y/ASa4PPU8Yf+7PPWfcoFB4NqOdN+Bqu9aJZLJ6HIN6uDMRwdqThZ8z6cxbTg/fjw9laQBK6Y= 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> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
hugetlb pagewalk unification
|
expand
|
diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c index 474a25ca5c48..e1d098dc7f07 100644 --- a/arch/s390/mm/gmap.c +++ b/arch/s390/mm/gmap.c @@ -2723,6 +2723,20 @@ static int __s390_enable_skey_pte(pte_t *pte, unsigned long addr, static int __s390_enable_skey_pmd(pmd_t *pmd, unsigned long addr, unsigned long next, struct mm_walk *walk) { + if (pmd_leaf(*pmd) && is_vm_hugetlb_page(vma)) + unsigned long start, end; + struct page *page = pmd_page(*pmd); + + if (pmd_val(*pmd) & _SEGMENT_ENTRY_INVALID || + !(pmd_val(*pmd) & _SEGMENT_ENTRY_WRITE)) + return 0; + + start = pmd_val(*pmd) & HPAGE_MASK; + end = start + HPAGE_SIZE; + __storage_key_init_range(start, end); + set_bit(PG_arch_1, &page->flags); + } + cond_resched(); return 0; }
__s390_enable_skey_pmd does nothing for THP, but will handle pmd-leafs hugetlb vmas from now onwards, so teach it how to handle those. Signed-off-by: Oscar Salvador <osalvador@suse.de> --- arch/s390/mm/gmap.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)