From patchwork Tue Jul 4 07:43:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 115594 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp1044632vqx; Tue, 4 Jul 2023 00:50:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlE8C+HDle3e7nujWKoHQdvt/2ObmL3nCM8cVLjXS72XzZssGnKX9FlScoZojdwrXm1lS4EU X-Received: by 2002:a17:902:74c7:b0:1b8:78e:7c1 with SMTP id f7-20020a17090274c700b001b8078e07c1mr9817700plt.51.1688457036171; Tue, 04 Jul 2023 00:50:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688457036; cv=none; d=google.com; s=arc-20160816; b=ePq72pNg+hcTl+uQirG5aZ2MYlIePvWUEpGMw8NVwhN9snL3my/kBSMX1IdXPVcwiI yaoAIt3v7y2iLMCZ520QYkkRnYbP2Pq7OXD/+vVr9iuMRayO0rko/N9ngmQra/ZP7w54 0fZOzMhN4OPfmSjeGNH/4bG29M15hOrvH+vnf4H4ox3Qxo9uB04hMTIMJe/hKrwsAky1 bBXzYmwpxYMP0jtgw4p7D1h2qDUPcE5RSCXxg/0GpLPgbptP7Urh2iCSPFDmpLVmIQMz O6PIWfnPWdiBSi+tcrxFqx3PeLhd1WnXdbrPdSB+jxCYPtFi3LT/+u+0ULkzSRkG2fcy +HSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=NaN7FLuvwVnpnxsPOCNUh4V539jNJliF9+H8DZcJ4YM=; fh=RbTE1J6EfaEzAWTbKDeuhlHuAC6wrdW3lG4e15iXlSw=; b=j8MtCTkFgJj3LyYWVwdgjvMRPCLLFSO2m55M1j4nnYG7X/lQUCwXAs+njxbB5DmcwC 6tiGTwYx8JzBtKYE9MjHoYWlrojCNARP7rqJlL6w2V2pWDYvzH+4yIg3YIVmZXOgH5zT r2V0lyGvM9hXfxrx7ZtuEuV8rZBWWZZo8fGnbwFohq6yGkXp1fOVS1fnAuwzXF3Keb7/ ZiFU2WZ9KaLjPNoREQRc/8Df4u74fUsRo0xqcOoIFTSCXNVPxFuUUVHQ8vkIUrwG6izf +h2wncwEd7qV24oWTJ655UZ1zcsEfot0ClDC6aC6S/HuFhs9UjAgCnkpe8OgWhRuqjm3 WAfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=UW+p9aqo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n10-20020a1709026a8a00b001b11168bdddsi16427119plk.520.2023.07.04.00.50.23; Tue, 04 Jul 2023 00:50:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=UW+p9aqo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231482AbjGDHoH (ORCPT + 99 others); Tue, 4 Jul 2023 03:44:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231131AbjGDHoD (ORCPT ); Tue, 4 Jul 2023 03:44:03 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44814BB for ; Tue, 4 Jul 2023 00:44:02 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-3fbc63c2e84so50713965e9.3 for ; Tue, 04 Jul 2023 00:44:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1688456640; x=1691048640; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=NaN7FLuvwVnpnxsPOCNUh4V539jNJliF9+H8DZcJ4YM=; b=UW+p9aqobog562ULP3FjwFIYW3w4oDw/L8bG6v3uAVk7Cgjoh9ylTtxrzwp0ioAakV SSd2Lq69ada7NGqCwOziqGEuQ4msC0QC0h2Pp30r3LgXqI7pwM4PUvdmQvjH5A6Rha6f BihFqeSFAM2bpNbzqU9jtLX2jxaC+LBSiajG5EiQbKg3KWCIzhEZJBmBSBMCITwZFUHF nIFOW0h+8qoFJOm7OA/JkmvHCJKlWgKzrAcXicREr52rqEpQKiHB35ySdtOOPlawua7+ ZYotALMumf7cWbBsp2Szn29OyUpN0xzrm5rHtZjStkTUvz6zv3gSbQpgIAsDWx0qSbTC tj4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688456640; x=1691048640; 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=NaN7FLuvwVnpnxsPOCNUh4V539jNJliF9+H8DZcJ4YM=; b=Ua6WCyafUOc9QLD+AHeqlMfXwDiie5lDmWh2nZ+fb/gX7w8VnZjOYXHF8aHB8M7l0K S7XzA+GKslI5lmKs5Qs61fgwKPPKZ8PJqSXA2DbS1qtwE6mlYY2kZIYbinjaBG6hlMXl 7LzTx7VEOqgV6Eh3WaqZvItB3DOXrL++Es8AG1NnGWdCf1AHEmq4VJwjWDYg2TcONh1k fZhdjah9ZGF+JiUw4VbL0ZzFY0Kg0ArV4+BDxgoUuRL2z2UIHFkqobLvWzeNR/9Ti6o7 oW2TDro/x5sgngWht20tDMWUhsJHihsQONtB7uUoe5uSY6Y1l9xSDupRzCpMatbYIwxG 9F+w== X-Gm-Message-State: AC+VfDz7YR48Jk9cy7pohjTncQReuhjb1ZujBWCiRYsKBYOVRLIku7Yq kfiG+SST1Y5FqycctmQ7XgBNvw== X-Received: by 2002:a7b:cc82:0:b0:3fb:b008:2002 with SMTP id p2-20020a7bcc82000000b003fbb0082002mr10415933wma.0.1688456640324; Tue, 04 Jul 2023 00:44:00 -0700 (PDT) Received: from alex-rivos.ba.rivosinc.com ([93.23.105.195]) by smtp.gmail.com with ESMTPSA id y5-20020a05600c364500b003fbc9d178a8sm10790933wmq.4.2023.07.04.00.43.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jul 2023 00:43:59 -0700 (PDT) From: Alexandre Ghiti To: Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , kasan-dev@googlegroups.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: kernel test robot Subject: [PATCH 1/2] riscv: Mark KASAN tmp* page tables variables as static Date: Tue, 4 Jul 2023 09:43:56 +0200 Message-Id: <20230704074357.233982-1-alexghiti@rivosinc.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770475524963915047?= X-GMAIL-MSGID: =?utf-8?q?1770475524963915047?= tmp_pg_dir, tmp_p4d and tmp_pud are only used in kasan_init.c so they should be declared as static. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202306282202.bODptiGE-lkp@intel.com/ Fixes: 96f9d4daf745 ("riscv: Rework kasan population functions") Signed-off-by: Alexandre Ghiti --- arch/riscv/mm/kasan_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/riscv/mm/kasan_init.c b/arch/riscv/mm/kasan_init.c index 8fc0efcf905c..b88914741f3d 100644 --- a/arch/riscv/mm/kasan_init.c +++ b/arch/riscv/mm/kasan_init.c @@ -23,9 +23,9 @@ */ extern pgd_t early_pg_dir[PTRS_PER_PGD]; -pgd_t tmp_pg_dir[PTRS_PER_PGD] __page_aligned_bss; -p4d_t tmp_p4d[PTRS_PER_P4D] __page_aligned_bss; -pud_t tmp_pud[PTRS_PER_PUD] __page_aligned_bss; +static pgd_t tmp_pg_dir[PTRS_PER_PGD] __page_aligned_bss; +static p4d_t tmp_p4d[PTRS_PER_P4D] __page_aligned_bss; +static pud_t tmp_pud[PTRS_PER_PUD] __page_aligned_bss; static void __init kasan_populate_pte(pmd_t *pmd, unsigned long vaddr, unsigned long end) { From patchwork Tue Jul 4 07:43:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 115595 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp1045283vqx; Tue, 4 Jul 2023 00:52:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlED14Nn3+RefnNSPqhNe+MNpzL2a2kE6Q67SiNe0dbjblbgIxoJjWeqpWtvDXwFDyXoXJRn X-Received: by 2002:a17:90a:f0c9:b0:256:857f:823d with SMTP id fa9-20020a17090af0c900b00256857f823dmr8937114pjb.48.1688457134543; Tue, 04 Jul 2023 00:52:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688457134; cv=none; d=google.com; s=arc-20160816; b=zBwqcijyzmz/SQPAhGCMfMRCmIVKTs3z/1zmRFNwRAdVR0IJjcDkgwGsQ3s2LMtwJz qLETdrrYdA9hZ7+RiQP4n838l7IZDXWb0WOsOy4Wr5xckbxiOCbyAL7gCgp2WG7jq+2z Mbq7t8YI6HUkaKgvxQq6Wr0CFk7GQ26Z//gOx+aiCX2Hnx/Iv8Tj5BVdW3/A4JUyQcmc pasQHlrZx8TZj4+oSunugYRvdX7dzauRjo8rjdcCSBNxF7QYi0OrAabVCgaIfLT4BjaR 7RcfFr9pdmFF1XWbLnJTi/Ww733z3cFWjTWK6i89x2VCodPDVulDDPOZD1RLyNGe22fS hyqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=da1Ya2LZv3Pi8isMeSjt68UFYCIa9e30GSmEnk1v2WU=; fh=oUuWHtRXdl2pLIjz01E8JGLZlmXaVN4XvWpM/JVdRmE=; b=uFaThNOfhKY4QjDVk9/pjcgc6RSwUbC2qqpQwBWKA88gCcZz1IP7Jza5uS7OY38pBj MrsKYXRAPfPto30mZ0aDkJ1li3mxcy+1NASFYIaZjkI3x6GREwRTShwrpvJy//7vrxRi HMM+Rf2NBy/hV8NLgbptD5KQlpWYZpJXLzxLSwSc3p7DpJ7n9KScktGKM/D/5K0ggcf9 X+QUpMv+YtWjALVP4Rl4AcWNre5xXPHCbRP+vKSNevwD4WtVXnuOgNPP0wNX62YyrFCV DvMs+P+D8timsrpnldkfjWyrlJUhRxq3HKNiUHqcsdeFfr88EQA87xE96/3AO5QxZRJG O0Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=YBFkVrQU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b6-20020a17090a9bc600b00262ec69bd80si17146523pjw.72.2023.07.04.00.52.00; Tue, 04 Jul 2023 00:52:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=YBFkVrQU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231535AbjGDHqF (ORCPT + 99 others); Tue, 4 Jul 2023 03:46:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230402AbjGDHpo (ORCPT ); Tue, 4 Jul 2023 03:45:44 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A703E170D for ; Tue, 4 Jul 2023 00:45:17 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-4fb9ae4cef6so8283731e87.3 for ; Tue, 04 Jul 2023 00:45:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1688456702; x=1691048702; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=da1Ya2LZv3Pi8isMeSjt68UFYCIa9e30GSmEnk1v2WU=; b=YBFkVrQUVuVXwwqDBTbaJzy2/t3gm5gTRh4YaK09x3g6uBEJPRDKE8NS/9McR10pkx P5AOrhmEQMhod+anbEHbGZuuS+GpFejHfrmbGZ41RL1pU+LGRMXu7nUNqFqNWewQd4sO kf6i9i039rdr8OPy05gX4wq3SCdopIoOXFYGZAUtqBPRk1EBV1J+MLJeFuncm1jilmjc utZRmxMCCJlnOUm5KNtQYNVWgPztKtInGKQo8hp1wH/eg97MVKRBmFL4q3dXk7UgVviq v4RixJpiBg7Jw1cubz5N39ErtAt7ZxQltLf0KWtnzrTXgo4PhZw9d8kS17eXR4rb7a7Y tiqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688456702; x=1691048702; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=da1Ya2LZv3Pi8isMeSjt68UFYCIa9e30GSmEnk1v2WU=; b=ckMxJfmGq0CU4RImDRyUBKowm0BxdjeEEXnHuGKKzyGOqZu1Sk05XN7L4Y03fG0JxL RXnDK/nRp3O8C15U7yFCoLyEvDROyOudghjQxcpCPSzA9lrXU3PH5MasQ8AzNTNkAABK aZz1R6W1y02huJGuPmvQXMySwjd4qmBHYZoLlUCfWu5G3wNSlWEJSWs3Bc3tH2InXmk4 wqXglZJqt3z3xd1lQctFjGkFZBNfj32tv4f2N99p8mtGJz7jD0SCrnbri8TD55KmZnq7 Fo2Pzq9Lr8BGLRsQ770kqmRFXtQmrYAvjmRqJ7fOeRdebSGtqJFcciSlCytOqGozB+yZ RQIg== X-Gm-Message-State: ABy/qLb2Kn2GwkshVsXUPmjz6SmwfEJay6yj4u5tRllgPNDBGZ300xVc G8x0x5UqWlLVJGifhbj0/cuLLg== X-Received: by 2002:ac2:4f0e:0:b0:4fb:8bea:f5f6 with SMTP id k14-20020ac24f0e000000b004fb8beaf5f6mr9893002lfr.34.1688456702503; Tue, 04 Jul 2023 00:45:02 -0700 (PDT) Received: from alex-rivos.ba.rivosinc.com ([93.23.105.195]) by smtp.gmail.com with ESMTPSA id a20-20020a05600c225400b003fbb06af219sm17455668wmm.32.2023.07.04.00.45.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jul 2023 00:45:02 -0700 (PDT) From: Alexandre Ghiti To: Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , =?utf-8?b?QmrDtnJuIFTDtnBlbA==?= , kasan-dev@googlegroups.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] riscv: Move create_tmp_mapping() to init sections Date: Tue, 4 Jul 2023 09:43:57 +0200 Message-Id: <20230704074357.233982-2-alexghiti@rivosinc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230704074357.233982-1-alexghiti@rivosinc.com> References: <20230704074357.233982-1-alexghiti@rivosinc.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770475627887571427?= X-GMAIL-MSGID: =?utf-8?q?1770475627887571427?= This function is only used at boot time so mark it as __init. Fixes: 96f9d4daf745 ("riscv: Rework kasan population functions") Signed-off-by: Alexandre Ghiti --- arch/riscv/mm/kasan_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/mm/kasan_init.c b/arch/riscv/mm/kasan_init.c index b88914741f3d..435e94a5b1bb 100644 --- a/arch/riscv/mm/kasan_init.c +++ b/arch/riscv/mm/kasan_init.c @@ -439,7 +439,7 @@ static void __init kasan_shallow_populate(void *start, void *end) kasan_shallow_populate_pgd(vaddr, vend); } -static void create_tmp_mapping(void) +static void __init create_tmp_mapping(void) { void *ptr; p4d_t *base_p4d;