Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1869858rdb; Sun, 11 Feb 2024 00:36:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGyjeLEflAVYGbvBE1HCjJYdYA83qdpZka0RnZWmYnRqrxQev/hVRmBi/JlQ68usBuyjTp X-Received: by 2002:a17:903:18e:b0:1da:1b60:21e0 with SMTP id z14-20020a170903018e00b001da1b6021e0mr3382223plg.15.1707640613353; Sun, 11 Feb 2024 00:36:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707640613; cv=pass; d=google.com; s=arc-20160816; b=k20JxpPcGGCkwmdtUDJXxxFEmguquHCTOKXp7mKoLzLH2VgtovRSakLSfUyryFKlmz qW1R7uHy82yFrJ2BL8nrgOKzsFgdjBNbQUja1NoWIOsz0Al9vHnnz7eRu6kuszEPI9aB LwNYMzUD1poow5tSbcV26IQUSquwB/pzy6+8U08I1KltbnbwyQerjRE4dmgDOendpXLF aBS/MBTQ7+vQhRo9eDiktQ7MPrOccykBOdyIR9CGXVfQYgtP/DZKsI7RzHL7oVgeXHZQ 1lrpbx0jRlPHpg/eATWAFQQnv51OZwRqAIFJGmNSUmBuGvu1H0k08cH0XZXv6GJWIIs/ /osA== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=WgK2rhF0MEavRxG1nB7KIKdfUxp0z+0YRkDvo4+DSAo=; fh=hovPUthD6DTcZRQ3Rin7/34XDBwPo8l4mnYqCJVKdlM=; b=xJ7Y+e+Yk57zHlppsxDfsfzA3ySyToeeAs9H2w2M4YQvanmuAQgaqncGeM7OJy51HG Tvl5x2Uu1uDcsaIr1avtyEMESInqtoZfewGfuRw16T368+XLe8f6L4TzAaws9BZOltnN +PVerQ89fqiBzkn7Y69NNmG/fepgT0UsSE+4fbkYVRfTqW0gvllW2HeKNOAW8kSyOZ1C 4QLV/hIVRIsMQaQPSPJxkiJ5EvNoS5HEGfBBGMLzYaaXWsnrU48vHYMDMkK3WhaJwCJo CPFcha/RCOiOH00oFdhTysEVSI2OmOl9NVS7LHa8UUJEbZETrh9PVCi1JEO0iYA4+BFy 3snw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=DuFPPgP5; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-60659-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60659-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCU1Tcg+YmVSP/3bjLY221Jro0S0klBEYagBP/g1t+6bfLMkiWHbFYxcaXT/SPEeEqh2dFMh8DOz1dSSubwcMx+d3kNFkTeWcaXBiE1jaQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 18-20020a170902ee5200b001d941c96b6dsi4424307plo.647.2024.02.11.00.36.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 00:36:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60659-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=DuFPPgP5; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-60659-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60659-linux.lists.archive=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 0885E283CB7 for ; Sun, 11 Feb 2024 08:36:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7735758ADD; Sun, 11 Feb 2024 08:36:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="DuFPPgP5" Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D5DAD3F9FA for ; Sun, 11 Feb 2024 08:36:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707640606; cv=none; b=iNRx4XmRlSyuyQ0c0L4LW5LZBCyRGsoly6839BG/NNIes+hqIrgIlfNTXs2410fmMRdI41N773klpx54a1o4C0WP9T4UdaQtZmG6YahEyVEtYMRfx+wotqVRLCnBhgDcv7OIwaQ7HxkoWH9Q+mGiHsla6fdYcEMEm4kMpi8FzwU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707640606; c=relaxed/simple; bh=PaQEOmqiRvmk/nVIn8ZoXgDVArBIW2evYornBF1T+Y8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=LHiI07iVzrrAaVi9W4goWpzcMrkKsGM4Nny2pkK9gJ7PJe4cQ6OmU9PKue8Qd2YYM2XnzpHIbETF9P2SRYj4KkinIcIH8msj11MMJLb0mAtHYl3yjWbT6+043HJFLHkQHE1uKgkAXo5Sbz6eBowh0cdWvNUY0Nhf4Lla4TIE8tk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=DuFPPgP5; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-410a2adf878so6486725e9.1 for ; Sun, 11 Feb 2024 00:36:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1707640602; x=1708245402; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=WgK2rhF0MEavRxG1nB7KIKdfUxp0z+0YRkDvo4+DSAo=; b=DuFPPgP5Kk4upRPMzGWMov0cEaLppQNj0QBd/h7WYvoZg9Dlh2HfjBlExYoWlcEpMg N0d22dFXMzR6ZMf5zd8rhzlc0olzEwuU0bWt5NsHjjZtPh+/24nd6KVGqHddtAs4Zd+L KJ+xgY8DoqVleKUHBsG/rfYJWIVTC1ArAW/+0JBRsm6TGk30GM4iyWVNb9MosG+PbwUg hbpmgMe9ar8lWboMm15OvaFBG8cqwsUHpVbUao8c+PXOFAKHCwS9cno2twz0W0bkxFdv URlXKvLm0Re4o7kdVw2765tbpRLBjSarYho2XxU/4tVSNXXTcWKzHFWmAciimmO/Hc3p GP9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707640602; x=1708245402; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WgK2rhF0MEavRxG1nB7KIKdfUxp0z+0YRkDvo4+DSAo=; b=XahfnGoLqQqvYBeea83N0UAt2aGYSukUXJ2ww3UYOpAmlbzLNn5rjRFCcMokJrBfK7 hUmYTMr0iMIAwfUm13niu0TK3vBxzXi1hCtbp8FkkSBbO+zZGXBc6ThnDphImbMhjW4M c5kCy+ShKRCpRS4CSUj+mhUIIxmQmezlAgn8b589PHIruVUewVU2vsa3RDy9AVgEyN3G PyJ3zZGv0jzRrz/+LBJtEGykIIhUJTTVQYDZo19M8t+d1jFp1tGDEeXlcCz9MS4wJttL ssiNaBuWLmrjeynNHPoVzpOqwxflDVKyZ7Maym31YqSZ1etDo2ShCKUjTts4MFx5q3lQ LdtA== X-Gm-Message-State: AOJu0YzhBNTdpjuPibUDezhCL8y1OWqBjZbFrTY98uyCa3j6NQbdQp40 UBiog0uL+mqPjQ13G0Jf+4oN/TLzYjk3UjU870B2KYKadXpA/PBSho1ZQq2TZZU= X-Received: by 2002:a05:600c:1d11:b0:410:6a37:89c with SMTP id l17-20020a05600c1d1100b004106a37089cmr3067197wms.13.1707640601917; Sun, 11 Feb 2024 00:36:41 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWb/SQxYauRZY0HBr6Cqy/kvT5IVBu6SCA1i6zk+vNJoZLBmYvB4pbObUujZlCM/ql0Y8VwwIYxryM5ZBR7bhEG/2TbbpCyJ9TUucLRrsfFlysHXgALNR3L09EG46mqr1Hqq2EIyi6tO51SSzkEd6cnkKLIAzv6fcByNBkA136GJADRJhNhfCPkgQXNmRIwmx8ER1tK2YCmc0QVziEAqVh9jt0S6Ek3Cf4V56h78LPvyQ== Received: from alex-rivos.ba.rivosinc.com (amontpellier-656-1-456-62.w92-145.abo.wanadoo.fr. [92.145.124.62]) by smtp.gmail.com with ESMTPSA id w6-20020a05600c474600b0040efc268713sm5321708wmo.26.2024.02.11.00.36.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 00:36:41 -0800 (PST) From: Alexandre Ghiti To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: kernel test robot Subject: [PATCH -fixes] riscv: Fix build error if !CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION Date: Sun, 11 Feb 2024 09:36:40 +0100 Message-Id: <20240211083640.756583-1-alexghiti@rivosinc.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The new riscv specific arch_hugetlb_migration_supported() must be guarded with a #ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION to avoid the following build error: In file included from include/linux/hugetlb.h:851, from kernel/fork.c:52: >> arch/riscv/include/asm/hugetlb.h:15:42: error: static declaration of 'arch_hugetlb_migration_supported' follows non-static declaration 15 | #define arch_hugetlb_migration_supported arch_hugetlb_migration_supported | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/hugetlb.h:916:20: note: in expansion of macro 'arch_hugetlb_migration_supported' 916 | static inline bool arch_hugetlb_migration_supported(struct hstate *h) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/riscv/include/asm/hugetlb.h:14:6: note: previous declaration of 'arch_hugetlb_migration_supported' with type 'bool(struct hstate *)' {aka '_Bool(struct hstate *)'} 14 | bool arch_hugetlb_migration_supported(struct hstate *h); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202402110258.CV51JlEI-lkp@intel.com/ Fixes: ce68c035457b ("riscv: Fix arch_hugetlb_migration_supported() for NAPOT") Signed-off-by: Alexandre Ghiti --- arch/riscv/include/asm/hugetlb.h | 2 ++ arch/riscv/mm/hugetlbpage.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/arch/riscv/include/asm/hugetlb.h b/arch/riscv/include/asm/hugetlb.h index 20f9c3ba2341..22deb7a2a6ec 100644 --- a/arch/riscv/include/asm/hugetlb.h +++ b/arch/riscv/include/asm/hugetlb.h @@ -11,8 +11,10 @@ static inline void arch_clear_hugepage_flags(struct page *page) } #define arch_clear_hugepage_flags arch_clear_hugepage_flags +#ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION bool arch_hugetlb_migration_supported(struct hstate *h); #define arch_hugetlb_migration_supported arch_hugetlb_migration_supported +#endif #ifdef CONFIG_RISCV_ISA_SVNAPOT #define __HAVE_ARCH_HUGE_PTE_CLEAR diff --git a/arch/riscv/mm/hugetlbpage.c b/arch/riscv/mm/hugetlbpage.c index 29c7606414d2..5ef2a6891158 100644 --- a/arch/riscv/mm/hugetlbpage.c +++ b/arch/riscv/mm/hugetlbpage.c @@ -426,10 +426,12 @@ bool __init arch_hugetlb_valid_size(unsigned long size) return __hugetlb_valid_size(size); } +#ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION bool arch_hugetlb_migration_supported(struct hstate *h) { return __hugetlb_valid_size(huge_page_size(h)); } +#endif #ifdef CONFIG_CONTIG_ALLOC static __init int gigantic_pages_init(void) -- 2.39.2