From patchwork Wed Dec 13 15:07:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Kozlov X-Patchwork-Id: 1875693 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=o+m9qqHq; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=pfptdkimsnps header.b=vGu3Yx/y; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=mail header.b=bUaHVxQo; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SqzPQ1Vpdz20H6 for ; Thu, 14 Dec 2023 02:07:54 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=e5MVuJLyqSD+PZQJK1gnIQSub5XnxPzViSvIzSMlNmo=; b=o+m9qqHqBa+Hut sIh5UN9rFGilbiCX/fANS2thCqnYgOBrWlB0hOiZeF5oQHI0YhLtElNVNw2XjHPVr/dSujdCvankg oDzKN/jHWs0fbKaCXEYqpckK1C69h/YOzHEf7zAkbQweeYE0ozKTTG6B9hvGIqHX89o4Ow40RPwX+ 35Sy4107r9ywkRKn5viKZC2v7SKP5t5yeBDK9nBY68b5AMueD5FiRSfdt+ixgb7N5KQvxmMMGU8Ah c4Cdt8Gp+vfyx+rqziBkeGcox5+VQjf2sdtLzz07n+jTl9legsk32K5vfatYrkOgQ9sw39JjapeAn HKE22JkthRBJ6CAt9AHw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rDQpx-00FAFs-2j; Wed, 13 Dec 2023 15:07:49 +0000 Received: from mx0a-00230701.pphosted.com ([148.163.156.19]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rDQpv-00FAFV-2k for linux-snps-arc@lists.infradead.org; Wed, 13 Dec 2023 15:07:49 +0000 Received: from pps.filterd (m0098571.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BDETVOQ002775; Wed, 13 Dec 2023 07:07:33 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=pfptdkimsnps; bh=Tr7IYPITuxAPWl4EK zGwdZNRtItdCX54g+L6fr6UUJQ=; b=vGu3Yx/yzm/mY6SOHOT/o42XwXl1I5Uo+ hfS52RQiNOfK+Vxyp0znaDAm2WjaZyGU16y639I5rDIFhr6JQEFKPlZarFNjJIn5 nRY451Wh6pXjiuzG4kMinH4qpznkPC4ow99keg3xIfeCL5uveVcyHYexW8pryjKn ootwCGgWXRRxrSj9PtJ7pMYbcB8gcDx6FxVwjefNMBKfCrLhsNQHijUCdoBhZ72H VhrwWyOak+hzPk758l96tQMVcJQWgVOA6aVy36050UarQR+lOS+By/ArfQfK5I/B NJaIXAAPf7TALcOAtWm7BPxJ00WoQxRvej2X3dzvTKKO9iairVz6A== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 3uxnyx0dqm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Dec 2023 07:07:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1702480052; bh=7RvO1yPLoi3+j1sn4inWAZ+9901WN8LfuW7qtiFW94E=; h=From:To:Cc:Subject:Date:From; b=bUaHVxQodscb9VOuNT/T1ioZ3/filOfVm154k30A8sKlqgvITySxh2hfIL/e+xATf aGEKBcew/jelR4p8pt6Oeag8PSZF+G1Bg7679cAgcvaF8oZldCS7y7Lzczmu+7BO8/ 2kL1ApMIJhW8ToeGdLcr+xzOdfwN/dmKKKlpoLH6H/9pDk+RN1+Q1XrSk4MVB8VGs3 g0ZvM9P7hkUePVWue+OZ1PkCQkaM9TAovtzCIwJVhPsLbw2/XV+UvUlBLkkndSoolG Gt/HqDu5fAzlyG53nVD7SrprFmByZBjDY+pfMfnYUq5kgqpoj1BhyqBqNqTFjI619R lQnvWaNOxW5bQ== Received: from mailhost.synopsys.com (sv1-mailhost2.synopsys.com [10.205.2.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) client-signature RSA-PSS (2048 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 6357A4048E; Wed, 13 Dec 2023 15:07:31 +0000 (UTC) Received: from SNPS-o0WHuHJU73.internal.synopsys.com (snps-o0whuhju73.internal.synopsys.com [10.116.105.128]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPSA id 79F02A0073; Wed, 13 Dec 2023 15:07:29 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Pavel Kozlov To: linux-snps-arc@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Vineet Gupta , Pavel Kozlov Subject: [PATCH] ARC: add hugetlb definitions Date: Wed, 13 Dec 2023 19:07:10 +0400 Message-Id: <20231213150710.13574-1-kozlov@synopsys.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-GUID: 8TCG7J6bXDDtw1NvaVsrMf5Zc-vH120n X-Proofpoint-ORIG-GUID: 8TCG7J6bXDDtw1NvaVsrMf5Zc-vH120n X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 impostorscore=0 phishscore=0 spamscore=0 mlxlogscore=539 mlxscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 malwarescore=0 suspectscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312130107 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231213_070747_924427_5E40E3D6 X-CRM114-Status: UNSURE ( 9.44 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Pavel Kozlov Add hugetlb definitions if THP enabled. ARC doesn't support HugeTLB FS but it supports THP. Some kernel code such as pagemap uses hugetlb definitions with THP. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 RCVD_IN_MSPIKE_H5 RBL: Excellent reputation (+5) [148.163.156.19 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Pavel Kozlov Add hugetlb definitions if THP enabled. ARC doesn't support HugeTLB FS but it supports THP. Some kernel code such as pagemap uses hugetlb definitions with THP. This patch fixes ARC build issue (HPAGE_SIZE undeclared error) with TRANSPARENT_HUGEPAGE enabled. Signed-off-by: Pavel Kozlov --- arch/arc/include/asm/hugepage.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arc/include/asm/hugepage.h b/arch/arc/include/asm/hugepage.h index ef8d4166370c..8a2441670a8f 100644 --- a/arch/arc/include/asm/hugepage.h +++ b/arch/arc/include/asm/hugepage.h @@ -10,6 +10,13 @@ #include #include +/* + * Hugetlb definitions. + */ +#define HPAGE_SHIFT PMD_SHIFT +#define HPAGE_SIZE (_AC(1, UL) << HPAGE_SHIFT) +#define HPAGE_MASK (~(HPAGE_SIZE - 1)) + static inline pte_t pmd_pte(pmd_t pmd) { return __pte(pmd_val(pmd));