Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6058623rwi; Tue, 18 Oct 2022 07:38:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4SjWoyiBXhdIuOvI0Oe9hhKZs7/NO7/FlZKf+3yMGO9oDNnBXW1vQQs//RhJYT1D5rEdCE X-Received: by 2002:a17:906:6a8d:b0:741:6a3b:536e with SMTP id p13-20020a1709066a8d00b007416a3b536emr2773467ejr.11.1666103903142; Tue, 18 Oct 2022 07:38:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666103903; cv=none; d=google.com; s=arc-20160816; b=emjzMaLUAZSOqsQ7eSc12VkSNwAL6uXG2CvT1J3DiBO/P6blWW4gsN2Xd8alABGEsK aWnaplB8PECWTVNCJAdOdMRGvcApVOqhBPIzFPV4T60R9QI9bLHbL4rWuU0Y4RWkdk3X 4MypmoUg+LXkpVWHePXpeMKbRrVpYS4AUvY/htLcPwcOynh7De8VvSgLmOg82tpK9hro C7bD4miCxNjgokq2xjtKQdyDmxu0FXPfJQIP9RlPfbC8Vh+Y0uggwFrefqg45drHwo7F DW0so7J4sV+6Gplx0EXA36tLC2cKoAONSuSECNUnEM3S9IBwO8LNrUTEFtsLfBl6jMIw srpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=wcJzlEsI0Q0Zkw3UiSk1AeQ+ZeMU0Uy0FowbXkpqvqY=; b=bGoA+FWWAXwU7Xn5o3vB0rVoin2EbbDvKvGZF4plPzw+MEUq+E8t4W4eqgBneDw1L0 W0BfA8gvGrNlNC7uksAhmpl3Tv8SLMbOcsP59jbLSePhlE8Y8pAT4vL9744JGIs7ArjI UoSK1M/7JTj/FJaRr74qMjwJSpTzoAyKIGivQjlQ7JF93ruIFMUBe+SpJV+osa1ojiq9 iDxTh2yCV4H7mAwbAuzIQAXKLmkgUNywgudW3Q/JbkM+zNGmFf/G/TUqXkYtqBnm2yuQ Rn0oEhx/4t6UZCYUJDaZD2g0KVo6q6ElleSg/RX1+ZNAQurCI+xEJof+YSTzHqf5Gxg+ OPNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eEqeweMg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y18-20020a056402271200b0045d2c253a61si13077789edd.351.2022.10.18.07.37.35; Tue, 18 Oct 2022 07:38:23 -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=@linaro.org header.s=google header.b=eEqeweMg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229651AbiJRN3L (ORCPT + 99 others); Tue, 18 Oct 2022 09:29:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230433AbiJRN3G (ORCPT ); Tue, 18 Oct 2022 09:29:06 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F9DC6C74C for ; Tue, 18 Oct 2022 06:29:04 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id f11so23447679wrm.6 for ; Tue, 18 Oct 2022 06:29:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=wcJzlEsI0Q0Zkw3UiSk1AeQ+ZeMU0Uy0FowbXkpqvqY=; b=eEqeweMgoAha2gA3agmhPrwheBhBw4LuItboa3KIkd3futKzMLro4OSFn/+GsHoO2q 1g0UsVLbq6G7LYgkvrjjF0/aK9i1HtM2ftwQjwVtT+HxYmYOQu0iXWkYvn5R2pCAGqs4 s9cqF+SV17FECoYNEG3BbIsBfCDRYocVPcCDrmyfVwRyAV9hx0spYE9DLW1VgzgBS4tr UbQ3nKR9UHhV4a0DtNBqTW1c7Zei2Dx2gjoyD+xI5pcx7YWlyHGRsdGlvYb4iC3lrx8I 5fNhFiugt5kE/2K8pSWMOmRr7GxD0aGVofbLzCMH3mgH/+99nu8B3Ir/+6nZinH/MMQ3 hyTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wcJzlEsI0Q0Zkw3UiSk1AeQ+ZeMU0Uy0FowbXkpqvqY=; b=5H+LgAAlLW3iATyOh7bY93lXyvgIl4/oM8roinzdlIGZTW+NpkEB0OoQNO/IAL2Rl6 AijQLLF7IRRsY7x4710T9HfirUUyIDocZWf+fksvySRiZbRT/LoVqKXMDtL+UJalESeF VlupE7HAQszw588JGIseXuvvEjQUTJSiy7rLXilI88pIQwC79aX5UB5SSM5zv2Ci4M8v 3LXMg9us5HzvLYSa4SHOWHzotTeMCGbqVYk73k0q9g9K/aJbMcWMzkaOGUa/Drr+KaRg V0aP9YWJZFIpMLHpnRFE5u96ETzA7EB3UUQ6gBWe37o4CHM2s4u4lQ1Vypc6La6YtFOj tKjw== X-Gm-Message-State: ACrzQf3Dle5Ng9+pgm0iFL7OMoE2naGy466KMRZGx1XJQD06Ro+4m7/p ON1NmA/IMb5kpvm/y/6jifb5x1KBX5Vb6kPal7o= X-Received: by 2002:a05:6000:1190:b0:232:c73d:7524 with SMTP id g16-20020a056000119000b00232c73d7524mr1991986wrx.371.1666099742541; Tue, 18 Oct 2022 06:29:02 -0700 (PDT) Received: from [192.168.1.115] ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id l19-20020a05600c089300b003c409244bb0sm12880231wmp.6.2022.10.18.06.28.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Oct 2022 06:29:01 -0700 (PDT) Message-ID: <95a0537f-27b2-adc9-d44e-527281326b0d@linaro.org> Date: Tue, 18 Oct 2022 15:28:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [PATCH V11 1/4] MIPS&LoongArch&NIOS2: Adjust prototypes of p?d_init() Content-Language: en-US To: Huacai Chen , Arnd Bergmann , Huacai Chen , Thomas Bogendoerfer , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Catalin Marinas , Will Deacon , Dinh Nguyen Cc: loongarch@lists.linux.dev, linux-arch@vger.kernel.org, Xuefeng Li , Guo Ren , Xuerui Wang , Jiaxun Yang , Andrew Morton , linux-mm@kvack.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Feiyang Chen References: <20221017024027.2389370-1-chenhuacai@loongson.cn> <20221017024027.2389370-2-chenhuacai@loongson.cn> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= In-Reply-To: <20221017024027.2389370-2-chenhuacai@loongson.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 On 17/10/22 04:40, Huacai Chen wrote: > From: Feiyang Chen > > We are preparing to add sparse vmemmap support to LoongArch. MIPS and > LoongArch need to call pgd_init()/pud_init()/pmd_init() when populating > page tables, so adjust their prototypes to make generic helpers can call > them. > > NIOS2 declares pmd_init() but doesn't use, just remove it to avoid build > errors. > > Reviewed-by: Jiaxun Yang > Signed-off-by: Feiyang Chen > Signed-off-by: Huacai Chen > --- > arch/loongarch/include/asm/pgalloc.h | 13 ++----------- > arch/loongarch/include/asm/pgtable.h | 8 ++++---- > arch/loongarch/kernel/numa.c | 4 ++-- > arch/loongarch/mm/pgtable.c | 23 +++++++++++++---------- > arch/mips/include/asm/pgalloc.h | 10 +++++----- > arch/mips/include/asm/pgtable-64.h | 8 ++++---- > arch/mips/kvm/mmu.c | 3 +-- > arch/mips/mm/pgtable-32.c | 10 +++++----- > arch/mips/mm/pgtable-64.c | 18 ++++++++++-------- > arch/mips/mm/pgtable.c | 2 +- > arch/nios2/include/asm/pgalloc.h | 5 ----- > 11 files changed, 47 insertions(+), 57 deletions(-) > diff --git a/arch/mips/mm/pgtable-32.c b/arch/mips/mm/pgtable-32.c > index 61891af25019..88819a21d97e 100644 > --- a/arch/mips/mm/pgtable-32.c > +++ b/arch/mips/mm/pgtable-32.c > @@ -13,9 +13,9 @@ > #include > #include > > -void pgd_init(unsigned long page) > +void pgd_init(void *addr) > { > - unsigned long *p = (unsigned long *) page; > + unsigned long *p = (unsigned long *)addr; > int i; > > for (i = 0; i < USER_PTRS_PER_PGD; i+=8) { > @@ -61,9 +61,9 @@ void __init pagetable_init(void) > #endif > > /* Initialize the entire pgd. */ > - pgd_init((unsigned long)swapper_pg_dir); > - pgd_init((unsigned long)swapper_pg_dir > - + sizeof(pgd_t) * USER_PTRS_PER_PGD); > + pgd_init(swapper_pg_dir); > + pgd_init((void *)((unsigned long)swapper_pg_dir > + + sizeof(pgd_t) * USER_PTRS_PER_PGD)); Pre-existing, but why not use: pgd_init(&swapper_pg_dir[USER_PTRS_PER_PGD]); ? Otherwise: Reviewed-by: Philippe Mathieu-Daudé