Message ID | 20231023191400.170052-4-jiaxun.yang@flygoat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1500443vqx; Mon, 23 Oct 2023 12:14:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUDlg6j8RREDYCGcuD5WjlBh+WnmREy5+joQAG+d3AsMFVHQL3nTDgozKbSRuRspeIyCul X-Received: by 2002:a17:903:11cc:b0:1c9:faef:5765 with SMTP id q12-20020a17090311cc00b001c9faef5765mr8533265plh.5.1698088494640; Mon, 23 Oct 2023 12:14:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698088494; cv=none; d=google.com; s=arc-20160816; b=qOXZz3VVGLOwyEJYtQr+bcJa+FSS86M0EVenUBtXcKKiHmwa/LORkj3e+xxFjmYTfP SreC07mdFd9ljU4H1wmg79nAGxpYY2lu9b8JXDIK/9lPNfDBYvtjLiljeYN9E9uoeYCS O0e3GljX3JQMRFB24oPp6ucfRh9yXfCFiATuccp6C6PKTUiLkjjySTN5MJhHF12U/ti7 r11SCZ7CN77gmzgabRcR4oTLWtio7l75VIZEkKvJIFGPah+I6AASUAxKCihgQ5uC/nBX kcI+K9RCE2cFmF5oOjrRfTjP3P2LwdFKcOY7v1XcqsTG9swUdbkItS39AEsnpH04OyeH 60Tg== 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:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=z1/hT0gfhZcXEOcRfnRggstjECOl2aSsJ7lZKpBlqTw=; fh=34VXqKbbbRVUWYKB0XlF9D4jmhXxe51P2+smd1zcTfU=; b=JOciQTKkwYcJUI1Zk46GJ1f7eO+MbKNywcrtg1/GcXFZI2nG3h8RACmmKloPoHenaG 3eW11mUQMac0OdzwB/uUKfFk3ByA4bxc1BdjjoVxdOJ66iFD8oOWfs2kNSxGPO/0Zzu3 dPInQ/aTvF3Ku2S26GsH4UiPxcysDqUaRgO4lbHaLhcejQ5zxTG5AZXazc+3OZC4TfCt eGQAvZ/TOB7FY+yXekqiTvWbRhxXGcJC6ba+dBgkfyt1eXE/5TFGdXmPZSTEOkKxnpfQ bvNOSuULF+TQQQxZj1mbPJZTFA0EoZcMOX9Gw4r1BK7MUej7IMYCKNGGVyWklDDyZ4cE j7VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=f9QS4lLR; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=d2RjKvnM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id j17-20020a170902c3d100b001c45291b6ebsi6695776plj.272.2023.10.23.12.14.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 12:14:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=f9QS4lLR; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=d2RjKvnM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 143838050037; Mon, 23 Oct 2023 12:14:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231998AbjJWTOT (ORCPT <rfc822;aposhian.dev@gmail.com> + 27 others); Mon, 23 Oct 2023 15:14:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231472AbjJWTOM (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 23 Oct 2023 15:14:12 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A34F694; Mon, 23 Oct 2023 12:14:10 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 187B15C039B; Mon, 23 Oct 2023 15:14:10 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 23 Oct 2023 15:14:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1698088450; x= 1698174850; bh=z1/hT0gfhZcXEOcRfnRggstjECOl2aSsJ7lZKpBlqTw=; b=f 9QS4lLRzjmlQ4M2TtMEPPxiHPJ+vzcEt7SZhYcO6LBu2QH9uiiySUVTl+WMKIWYb AZt9KnvxiyhG4gV72ECJkwQiMqWyOkz92FqFat09Trjcr9TyQVH7j65QZ/uTWmTY FP5bqK1LauBBqFBH6pJyzUxURLh0JxnRwqS0Xg8lo0yXu76/lT+Yj12EhqmG0MA2 kbRje4Ecf2dSe9Y7Uyiz+6oVVh+DAY5GJ73YUkkJvc1MHUc3wmeuVeT0p5SOmPGL QI0zXLGXlK58o+sPQsQmweBQIFb54KJimPmTGZZOKoh6Th6VSkVJG1D/JJ0LFrr2 4SC7QKLEeQSwBnLwX8EaQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1698088450; x= 1698174850; bh=z1/hT0gfhZcXEOcRfnRggstjECOl2aSsJ7lZKpBlqTw=; b=d 2RjKvnMMLLaoeUmXvajRFssG4MtP2LOedZgw75iBxoy5AFicoySNzIypJfs7CtMv UT3fubUxU3XzXhEcpbUY27WGjl4ZGz0fWVLad/nPZC1tzJiob2678hM8Ee2MnFhh OG/wq+XAwWQW6faxB8NGViTT0xxla4q8YWFbwFg3lKnMmzUBEO8X3BmIfPJf1zDa a4bIkyNaMA/dWM5dJ/YiUXGmiwn9tfo8/JJnwYL2mQyxgHEJB8Dq5yYfgbaBPgqg ai9E513EMYpR+VgvhctAAR13ugzQnNgBQ5J5BteMPm52ypP1cZ30hd2mMp1/3m35 sw1xxukf4EYQxoWP2z3rw== X-ME-Sender: <xms:AcY2ZTwXL1Rznd3ngdWlYMGvihGGJbjhJ5VUDM4v8yfA49I5_q3J3g> <xme:AcY2ZbToMuKGg3ibnkxG0mnawq3sY1nkG05iOHrDlsKygFvojj_cvNjSiVtspi5lr 6ktyvoY2NVHVjjDsYE> X-ME-Received: <xmr:AcY2ZdUkD6KZUSzDcetPtHPnnZQWVzRGIIgz9G6ETOhLKIyhQIAsVv3FYMigjKtM4KvkPP4bmsA> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrkeeigddufedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpeflihgrgihunhcujggrnhhguceojhhirgiguhhnrdihrghn ghesfhhlhihgohgrthdrtghomheqnecuggftrfgrthhtvghrnhepfeeludefheegvdeuvd dvgeekgfdvtdettdelieeihfegtedugeekhfdvhfejfedtnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhi hgohgrthdrtghomh X-ME-Proxy: <xmx:AcY2Zdh4yYqWMbhT0XgSo7pYfMygOBw1n_wL4pgmpU9frQLS8gOmJw> <xmx:AcY2ZVBIvg26kv12DQ9Vfw52WIlT29ao4TrZ9BuE5SD2D4onLnWEnw> <xmx:AcY2ZWJGo1nYQs4nMScUmxpCpVXm1EyNAgC8mG48vSMl6Q1EIGJBlg> <xmx:AsY2ZQ-MbdHv70zHfUSwDtVpMtc4qWaotStUGwLymXad3npi4so3pg> Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 23 Oct 2023 15:14:08 -0400 (EDT) From: Jiaxun Yang <jiaxun.yang@flygoat.com> To: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org, tsbogend@alpha.franken.de, gregory.clement@bootlin.com, vladimir.kondratiev@intel.com, Jiaxun Yang <jiaxun.yang@flygoat.com> Subject: [PATCH 3/5] MIPS: Fix set_uncached_handler for ebase in XKPHYS Date: Mon, 23 Oct 2023 20:13:58 +0100 Message-Id: <20231023191400.170052-4-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231023191400.170052-1-jiaxun.yang@flygoat.com> References: <20231023191400.170052-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 pete.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 23 Oct 2023 12:14:49 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780574841498779787 X-GMAIL-MSGID: 1780574841498779787 |
Series |
MIPS: Fix kernel in XKPHYS
|
|
Commit Message
Jiaxun Yang
Oct. 23, 2023, 7:13 p.m. UTC
ebase may be in XKPHYS if memblock unable to allocate memory within KSEG0 physical range. To map ebase into uncached space we just convert it back to physical address and then use platform's TO_UNCAC helper to create mapping. Co-developed-by: Vladimir Kondratiev <vladimir.kondratiev@intel.com> Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@intel.com> Co-developed-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> --- arch/mips/kernel/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi Jiaxun, kernel test robot noticed the following build errors: [auto build test ERROR on linus/master] [also build test ERROR on v6.6-rc7 next-20231024] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Jiaxun-Yang/MIPS-Export-higher-highest-relocation-functions-in-uasm/20231024-034657 base: linus/master patch link: https://lore.kernel.org/r/20231023191400.170052-4-jiaxun.yang%40flygoat.com patch subject: [PATCH 3/5] MIPS: Fix set_uncached_handler for ebase in XKPHYS config: mips-loongson1c_defconfig (https://download.01.org/0day-ci/archive/20231025/202310251032.BvEIZ6Xk-lkp@intel.com/config) compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231025/202310251032.BvEIZ6Xk-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202310251032.BvEIZ6Xk-lkp@intel.com/ All errors (new ones prefixed by >>): 1402 | asmlinkage void do_cpu(struct pt_regs *regs) | ^ arch/mips/kernel/traps.c:1402:12: note: declare 'static' if the function is not intended to be used outside of this translation unit 1402 | asmlinkage void do_cpu(struct pt_regs *regs) | ^ | static arch/mips/kernel/traps.c:1507:17: warning: no previous prototype for function 'do_msa_fpe' [-Wmissing-prototypes] 1507 | asmlinkage void do_msa_fpe(struct pt_regs *regs, unsigned int msacsr) | ^ arch/mips/kernel/traps.c:1507:12: note: declare 'static' if the function is not intended to be used outside of this translation unit 1507 | asmlinkage void do_msa_fpe(struct pt_regs *regs, unsigned int msacsr) | ^ | static arch/mips/kernel/traps.c:1527:17: warning: no previous prototype for function 'do_msa' [-Wmissing-prototypes] 1527 | asmlinkage void do_msa(struct pt_regs *regs) | ^ arch/mips/kernel/traps.c:1527:12: note: declare 'static' if the function is not intended to be used outside of this translation unit 1527 | asmlinkage void do_msa(struct pt_regs *regs) | ^ | static arch/mips/kernel/traps.c:1548:17: warning: no previous prototype for function 'do_mdmx' [-Wmissing-prototypes] 1548 | asmlinkage void do_mdmx(struct pt_regs *regs) | ^ arch/mips/kernel/traps.c:1548:12: note: declare 'static' if the function is not intended to be used outside of this translation unit 1548 | asmlinkage void do_mdmx(struct pt_regs *regs) | ^ | static arch/mips/kernel/traps.c:1560:17: warning: no previous prototype for function 'do_watch' [-Wmissing-prototypes] 1560 | asmlinkage void do_watch(struct pt_regs *regs) | ^ arch/mips/kernel/traps.c:1560:12: note: declare 'static' if the function is not intended to be used outside of this translation unit 1560 | asmlinkage void do_watch(struct pt_regs *regs) | ^ | static arch/mips/kernel/traps.c:1590:17: warning: variable 'prev_state' set but not used [-Wunused-but-set-variable] 1590 | enum ctx_state prev_state; | ^ arch/mips/kernel/traps.c:1587:17: warning: no previous prototype for function 'do_mcheck' [-Wmissing-prototypes] 1587 | asmlinkage void do_mcheck(struct pt_regs *regs) | ^ arch/mips/kernel/traps.c:1587:12: note: declare 'static' if the function is not intended to be used outside of this translation unit 1587 | asmlinkage void do_mcheck(struct pt_regs *regs) | ^ | static arch/mips/kernel/traps.c:1612:17: warning: no previous prototype for function 'do_mt' [-Wmissing-prototypes] 1612 | asmlinkage void do_mt(struct pt_regs *regs) | ^ arch/mips/kernel/traps.c:1612:12: note: declare 'static' if the function is not intended to be used outside of this translation unit 1612 | asmlinkage void do_mt(struct pt_regs *regs) | ^ | static arch/mips/kernel/traps.c:1648:17: warning: no previous prototype for function 'do_dsp' [-Wmissing-prototypes] 1648 | asmlinkage void do_dsp(struct pt_regs *regs) | ^ arch/mips/kernel/traps.c:1648:12: note: declare 'static' if the function is not intended to be used outside of this translation unit 1648 | asmlinkage void do_dsp(struct pt_regs *regs) | ^ | static arch/mips/kernel/traps.c:1656:17: warning: no previous prototype for function 'do_reserved' [-Wmissing-prototypes] 1656 | asmlinkage void do_reserved(struct pt_regs *regs) | ^ arch/mips/kernel/traps.c:1656:12: note: declare 'static' if the function is not intended to be used outside of this translation unit 1656 | asmlinkage void do_reserved(struct pt_regs *regs) | ^ | static arch/mips/kernel/traps.c:1832:17: warning: no previous prototype for function 'cache_parity_error' [-Wmissing-prototypes] 1832 | asmlinkage void cache_parity_error(void) | ^ arch/mips/kernel/traps.c:1832:12: note: declare 'static' if the function is not intended to be used outside of this translation unit 1832 | asmlinkage void cache_parity_error(void) | ^ | static arch/mips/kernel/traps.c:1880:17: warning: no previous prototype for function 'do_ftlb' [-Wmissing-prototypes] 1880 | asmlinkage void do_ftlb(void) | ^ arch/mips/kernel/traps.c:1880:12: note: declare 'static' if the function is not intended to be used outside of this translation unit 1880 | asmlinkage void do_ftlb(void) | ^ | static arch/mips/kernel/traps.c:1909:17: warning: no previous prototype for function 'do_gsexc' [-Wmissing-prototypes] 1909 | asmlinkage void do_gsexc(struct pt_regs *regs, u32 diag1) | ^ arch/mips/kernel/traps.c:1909:12: note: declare 'static' if the function is not intended to be used outside of this translation unit 1909 | asmlinkage void do_gsexc(struct pt_regs *regs, u32 diag1) | ^ | static arch/mips/kernel/traps.c:1944:6: warning: no previous prototype for function 'ejtag_exception_handler' [-Wmissing-prototypes] 1944 | void ejtag_exception_handler(struct pt_regs *regs) | ^ arch/mips/kernel/traps.c:1944:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1944 | void ejtag_exception_handler(struct pt_regs *regs) | ^ | static arch/mips/kernel/traps.c:1989:17: warning: no previous prototype for function 'nmi_exception_handler' [-Wmissing-prototypes] 1989 | void __noreturn nmi_exception_handler(struct pt_regs *regs) | ^ arch/mips/kernel/traps.c:1989:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1989 | void __noreturn nmi_exception_handler(struct pt_regs *regs) | ^ | static >> arch/mips/kernel/traps.c:2349:33: error: call to undeclared function 'TO_UNCAC'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 2349 | unsigned long uncached_ebase = TO_UNCAC(__pa(ebase)); | ^ 22 warnings and 1 error generated. vim +/TO_UNCAC +2349 arch/mips/kernel/traps.c 2337 2338 static const char panic_null_cerr[] = 2339 "Trying to set NULL cache error exception handler\n"; 2340 2341 /* 2342 * Install uncached CPU exception handler. 2343 * This is suitable only for the cache error exception which is the only 2344 * exception handler that is being run uncached. 2345 */ 2346 void set_uncached_handler(unsigned long offset, void *addr, 2347 unsigned long size) 2348 { > 2349 unsigned long uncached_ebase = TO_UNCAC(__pa(ebase)); 2350 2351 if (!addr) 2352 panic(panic_null_cerr); 2353 2354 memcpy((void *)(uncached_ebase + offset), addr, size); 2355 } 2356
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 60c513c51684..230728d76d11 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -2346,7 +2346,7 @@ static const char panic_null_cerr[] = void set_uncached_handler(unsigned long offset, void *addr, unsigned long size) { - unsigned long uncached_ebase = CKSEG1ADDR(ebase); + unsigned long uncached_ebase = TO_UNCAC(__pa(ebase)); if (!addr) panic(panic_null_cerr);