From patchwork Thu Apr 4 16:36:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13618061 Return-Path: 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 139A1CD1284 for ; Thu, 4 Apr 2024 16:37:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9BADA6B00A4; Thu, 4 Apr 2024 12:37:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 96B656B00A5; Thu, 4 Apr 2024 12:37:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 80CAC6B00A6; Thu, 4 Apr 2024 12:37:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 5EF4A6B00A4 for ; Thu, 4 Apr 2024 12:37:38 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 2F636A145E for ; Thu, 4 Apr 2024 16:37:38 +0000 (UTC) X-FDA: 81972405396.01.A75DA80 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf15.hostedemail.com (Postfix) with ESMTP id 55BE0A000D for ; Thu, 4 Apr 2024 16:37:36 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=XjOIYAFp; spf=pass (imf15.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712248656; 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:dkim-signature; bh=Q3q+pZ5P34ghakudMZLyDnJaIa/cVUQD0kuqVhWGHj8=; b=f7iJKOPkrCTX5015C4RraEE12zMeApvKstNaY5vp87eqGESERNlDGAYoKyQygm+IafzjFy /1pRSBrMN4Rme+z7mJREf8xdRgpiynmdHvHnQOj9VevAMyMaZglct22eO40H2f7vd4nysz JweO6YQxD0WYC0KaESkAvxY+MvB7Iio= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712248656; a=rsa-sha256; cv=none; b=WBu+4GoluwAzkBQ9s956WH8M6YYIVC85Xfi8jmErVZch7ZPAwyq6dbViWB7zJE8i5yVcEV +Mb8rfcrRF1YwL77JtaoCeZ9PfwGLdqaWIFo8YekiSDuFrcY2ihUtA7DRS5xKTW/0LjfyZ XhV9sC0wEbwDhEbukUQeBvkO6zjlfrU= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=XjOIYAFp; spf=pass (imf15.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712248655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q3q+pZ5P34ghakudMZLyDnJaIa/cVUQD0kuqVhWGHj8=; b=XjOIYAFpxvj2lctppkjJdZ4GRCD7Q2wJrFxsh+c8SfrnuY67WJe8eNJbW+QJSfFOPx5TA+ OxD/TeT/qbjuYAKgM4nYSpwQL9BQTm8ZRf/Nu7x26/f77EZcYwpCodlgkl6BXkU//cmC// 5FWoh8muvxcEN76rEmD5wIra7C8EGkI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-383-iKIcEnTlP7OdF8dgEB13LQ-1; Thu, 04 Apr 2024 12:37:30 -0400 X-MC-Unique: iKIcEnTlP7OdF8dgEB13LQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9AC5E88D016; Thu, 4 Apr 2024 16:37:29 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.192.101]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0804E3C24; Thu, 4 Apr 2024 16:37:25 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org, David Hildenbrand , Matthew Wilcox , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Janosch Frank , Claudio Imbrenda , Gerald Schaefer , Thomas Huth Subject: [PATCH v1 5/5] s390/hugetlb: convert PG_arch_1 code to work on folio->flags Date: Thu, 4 Apr 2024 18:36:42 +0200 Message-ID: <20240404163642.1125529-6-david@redhat.com> In-Reply-To: <20240404163642.1125529-1-david@redhat.com> References: <20240404163642.1125529-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Stat-Signature: shxbg7yupsgqeef7dacaaq9y7r1d8z9f X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 55BE0A000D X-Rspam-User: X-HE-Tag: 1712248656-147759 X-HE-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oRx4/F/qJFAY0C181iCdM35QWbe3S4TMYSomud3e8q0kqtMl5A7PpMVABKaDiRUJKrpBzLL8NLYiKDbto73vsey921cNJuKmBTr6oTJTEqkNJ+RrW92vK2bihmvwg6tW5lDP7IiSaoKq0dohndBbhbIJL/V8Kc 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: List-Subscribe: List-Unsubscribe: Let's make it clearer that we are always working on folio flags and never page flags of tail pages. Signed-off-by: David Hildenbrand --- arch/s390/mm/gmap.c | 4 ++-- arch/s390/mm/hugetlbpage.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c index 9233b0acac89..ca31f2143bc0 100644 --- a/arch/s390/mm/gmap.c +++ b/arch/s390/mm/gmap.c @@ -2731,7 +2731,7 @@ static int __s390_enable_skey_hugetlb(pte_t *pte, unsigned long addr, { pmd_t *pmd = (pmd_t *)pte; unsigned long start, end; - struct page *page = pmd_page(*pmd); + struct folio *folio = pmd_folio(*pmd); /* * The write check makes sure we do not set a key on shared @@ -2746,7 +2746,7 @@ static int __s390_enable_skey_hugetlb(pte_t *pte, unsigned long addr, start = pmd_val(*pmd) & HPAGE_MASK; end = start + HPAGE_SIZE - 1; __storage_key_init_range(start, end); - set_bit(PG_arch_1, &page->flags); + set_bit(PG_arch_1, &folio->flags); cond_resched(); return 0; } diff --git a/arch/s390/mm/hugetlbpage.c b/arch/s390/mm/hugetlbpage.c index e1e63dc1b23d..21ed6ac5f1c5 100644 --- a/arch/s390/mm/hugetlbpage.c +++ b/arch/s390/mm/hugetlbpage.c @@ -121,7 +121,7 @@ static inline pte_t __rste_to_pte(unsigned long rste) static void clear_huge_pte_skeys(struct mm_struct *mm, unsigned long rste) { - struct page *page; + struct folio *folio; unsigned long size, paddr; if (!mm_uses_skeys(mm) || @@ -129,16 +129,16 @@ static void clear_huge_pte_skeys(struct mm_struct *mm, unsigned long rste) return; if ((rste & _REGION_ENTRY_TYPE_MASK) == _REGION_ENTRY_TYPE_R3) { - page = pud_page(__pud(rste)); + folio = page_folio(pud_page(__pud(rste))); size = PUD_SIZE; paddr = rste & PUD_MASK; } else { - page = pmd_page(__pmd(rste)); + folio = pmd_folio(__pmd(rste)); size = PMD_SIZE; paddr = rste & PMD_MASK; } - if (!test_and_set_bit(PG_arch_1, &page->flags)) + if (!test_and_set_bit(PG_arch_1, &folio->flags)) __storage_key_init_range(paddr, paddr + size - 1); }