Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp168608lqp; Thu, 4 Apr 2024 09:39:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVL9yeLphprzYwNDtTb7Xj1H+iUQDOXuwg8Z14kMOWUZkf/gNzdRzQIAQMCplfblw3c7ajBjpO/g5ypraNfR05dkjDN5UXgxpmGHGVSfg== X-Google-Smtp-Source: AGHT+IFfazYqXRUXF26NvHXsp4alvR6Z8rwPNvkzZFBPIfnUAG3vkEcGCRX+w6oQt0oQ9hwsr9C7 X-Received: by 2002:a05:6512:510:b0:516:cbfb:d479 with SMTP id o16-20020a056512051000b00516cbfbd479mr1535901lfb.27.1712248772255; Thu, 04 Apr 2024 09:39:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712248772; cv=pass; d=google.com; s=arc-20160816; b=KGgjoX0iNlD/OuuBl/bLRyOPxktVEm8q5M3ErBIlJCEYuBhhonEnODcGyCWRaJcbGo 8TADxEP1ke5p24MXhADspidimb2jYJDf5Cl/ECqykjUGgZ6fQy9fq3ImUIJfrXPqG5ZZ o218FilM57nfa88s4g2QxXBKQwWWH2JNoNCAP4flemBzsELjx/3DWV0gEzXr+yxkoG3+ KTDRcjbyLZmkoEWX/UZ9ruAhyGxRhzbkqfzIREvAc+JTBcfE0hfRP4CXLMN4tuf/rCoF kQfpOuWQG8PtmYakzZBuNW7/eMdJd9OqFkREYFbesBwKGvqlfwM4SJRTFr0uors+YuNF AfXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Q3q+pZ5P34ghakudMZLyDnJaIa/cVUQD0kuqVhWGHj8=; fh=t+LjNwjqFDXyApTP0a0u3Yye20bYk5Mfk6wncAYiAak=; b=mFb7BnxWjkpp6wZ6HgvtEv0S+3tJsgsqMmdgs2ktC8oAPkSncubkVs+l2aZVnYmlrk kIFjMmciMaxlFqhpYbcRjitg0z9S06mpjdKJ3n02KpJGzD9/rIctu/+7crwpOrubXIEN 7zexuCyy7awOjpcCd57zmH9kExusU+AUHOSfczJCpkKFK3CWVh+NNiXvWDE3IfdMn/dW 5Yvha/dngBzSMAN5fqD/S5NaWtVv0pGRtF88FAfKjEPYlef2v0dF3CldFeWjYbHQ9Oa4 3VVBh12nJQNpnoqSU6FY7C+iC3RjaKWwc+DMpcu7wj7SPDTMUIFRpac0gGgWfeX2ZBGV pdVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hOLd7dXM; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-131835-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id sh31-20020a1709076e9f00b00a4e2537c8a4si7788034ejc.329.2024.04.04.09.39.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 09:39:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131835-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hOLd7dXM; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-131835-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131835-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id ED0311F2127E for ; Thu, 4 Apr 2024 16:39:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C0712130A7C; Thu, 4 Apr 2024 16:37:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hOLd7dXM" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 671D3130E25 for ; Thu, 4 Apr 2024 16:37:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712248656; cv=none; b=MxFbqfBnEkVsPzfCuFwkxauFYhqgGw4WJ5nXKS7d/lYFRlzHGMYIYcDxyVhqPVpDsjmgyPhVUyzBFXasddgnzf8DQtaI80mH7KLb2xdX5l4v3Q1z8qUS8x8HCcTzMwokPr9GHYpZmLmJZYYhp9cEVM7DmZpGwSovMyGNDoG+zsE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712248656; c=relaxed/simple; bh=MRKvUOhgbx1JCPqRkZYfqZCtresFIov/9ISiCIQgDR4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mrsPUev0b5vBHuscjtfy/RXMbS5VHO+IjWN0IfI04onTWiRK5wfAPdotUFjQL9jzL74qFj6rUr0uTRHwyvIplilQ89rAJbYSm+n5z3FRM4O3akdyqPHYbzmpmSHI2IWhFUWyXrJs1krlqXOfJC7lkdlHf2hPdIPa78IvZl1KVrg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=hOLd7dXM; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712248654; 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=hOLd7dXMAJrsahgszPN4y+MZdG3OJiuTEYEfv0dy5vijSCZkTdkS2Ech7sTmuBp62tLOte xwCUGKVbiXjEhlRDph9VDaEaH5Ic3BdPyknjQXUrVPbyqPdrrqa/u8wobC9BL2p0JuIdpU GtJaT7Faly/Q1JY8n0FImaHndWkfJeM= 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 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); } -- 2.44.0