Message ID | 20231027221106.405666-1-jiaxun.yang@flygoat.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp913112vqb; Fri, 27 Oct 2023 15:11:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGikN7qtZOxKgmbv6+PBQdKltoRVWkW8JZfreL/7nl2mqk92JM9XRtXIdRhWZI5U7ZEJ0Ty X-Received: by 2002:a05:6a00:248b:b0:6be:130a:22a0 with SMTP id c11-20020a056a00248b00b006be130a22a0mr4789727pfv.14.1698444715581; Fri, 27 Oct 2023 15:11:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698444715; cv=none; d=google.com; s=arc-20160816; b=DZrKeLGYX/9yY5mM3Btt02dBkHZMuOXErv4HGZ46Sauz/qKB156nKYS5yNSa2W6+d1 PpbcpWuKxTI2cVYmao4e+lVTfHhXjhX0yf3xDNyfG+thImXtkYlGlTivYt+itbVk5nbF iql1sLCOi01D1Vs3SqmLqiqBmSbhcUCTZYNkRkdcSlTeqAwFOFyXGzNBp/2O0o3EMtft Ns59TPYGSsY/b8MJbRs/nChKWXGwwnfAAzH9GjBrEliT7BK5uquzD079fzUNeNESsdGJ iqO6JWgQVb8BMdVpBGmpRmmB5P1KOThJr6LwDGHd3jfHTM/kx18QJQ3W0+7F+i7CCAlW MEzQ== 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:feedback-id:dkim-signature :dkim-signature; bh=+pfzMKfDeQMzwHOXJDWiQZICV087zj2gVTi0fZPI8qs=; fh=34VXqKbbbRVUWYKB0XlF9D4jmhXxe51P2+smd1zcTfU=; b=DitRyNmDSovLO/pQsyn1EXQ3hwn72PwJjOfq+AG8FaZB9dv1mEX1cg0o7bKruvIZl+ dqTJsdA+BMcdm4fJ2y2ozM8dzF86BzvxHi8dxOP6MdsyILk1xtG/InY6xu26TlKOveW1 iCkKzP/KF0HDqssETbpRyFwswXfbZ72lnRfFWD5I3zzRLpT8Eo6WG9O86HnIJBfyYa5E cqLhU7/Cvec5vQA1rQ4AMjtKsobPV3+KxV5cyrQLhtbNDncvk+RY+0MHKYef6mmm52Dk gKvy/oiLLjwvJqj1p41P7X6THoXOWuzW1Z190ofox8ecDuLwcvySdgCxa96XXTAMBqrs p0tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=DlDiXG06; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="s9Q/EuMY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id b63-20020a62cf42000000b006be062ed5c6si1521443pfg.276.2023.10.27.15.11.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 15:11:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm1 header.b=DlDiXG06; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="s9Q/EuMY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 9D73E83EE9E8; Fri, 27 Oct 2023 15:11:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346645AbjJ0WL1 (ORCPT <rfc822;yuanzuo1009@gmail.com> + 27 others); Fri, 27 Oct 2023 18:11:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346636AbjJ0WLV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 27 Oct 2023 18:11:21 -0400 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E66AF1B8; Fri, 27 Oct 2023 15:11:19 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 665E932008FB; Fri, 27 Oct 2023 18:11:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 27 Oct 2023 18:11:11 -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:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm1; t=1698444670; x=1698531070; bh=+pfzMKfDeQ MzwHOXJDWiQZICV087zj2gVTi0fZPI8qs=; b=DlDiXG06ZTpS7+rF7PHhLhBPke vPw3vAnkgNQvrzJJ5/tZAf7oOe9Ae/yoYrQoJorQXD3ah8Hvmw4oanD95umtHXqK geRq4C6Ou4QRinj6vZ27OqYwAjTtcREVEjel1WNdUubtsnp1lbseHdf4knYiNHv7 lVDaGypXMLK8nIdnTvDHMSe7SkYxuUdQMA/oN2sAA7EnW+xV1GlBWT57VVUXUopm sVZOHTymsWdAAT4BL9lZZzOmgSnqGcUTatVh5wstIdMGK8jrtKt9VhDIvMlUX7yo EIVWGQv0YfmgCpbT+VJti/CuY3RGKz3plE/R6qN7x+/ZOzKeEi9SeUTVDIfA== 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:message-id:mime-version: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=1698444670; x=1698531070; bh=+pfzMKfDeQMzw HOXJDWiQZICV087zj2gVTi0fZPI8qs=; b=s9Q/EuMYvqX25dUrxABgywfoOe0jZ /KS0NViMkVHM6vuY92nZ4O7J3JHZ2sns3pPAUsEKZNkEpvv7X+ytq56Il0UTiXzz V00oikWpuKDlA1ip4iypQQaEsNKZwqpAL2ioEi7D0VN8zfJjTVAZtVWbmSJNSuaW NNpaeJOxZmEMSTgeyC8FDAqacenUnVllaoW1wFJ88da3zGQu+K9ECo2JiMDdZKPe 5xmi4lSLZmMSTZGmgadHcarkAYWKCTJFPtZfFdIRpiGgMTmABx+DXPbTMrUqjnK6 jPkBvARayTKj4gBa4IWNTzVRlNIZEtmLkql58suPlf/LUDZCPJP1yCE1A== X-ME-Sender: <xms:fjU8ZViwRGx-FfAbbZgaAlAPckfOfDD4vHEBaXNS13H13mF5NwxxXA> <xme:fjU8ZaBBxPiCTCSlGeLEUrSDnxiH9gIl6MEMnJ-lpIGpZWcgtRMdEkQ8Zp-OgQZxy lLchyNyJU_KaHgVilU> X-ME-Received: <xmr:fjU8ZVEJZnWqv4aLbhhl710OAfGvBlFS7E3huGuDo4Av0N7s6xpSQlZoaluG36O1LmNsGJwobLs> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrleehgddtiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofgggfestdekredtre dttdenucfhrhhomheplfhirgiguhhnucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehf lhihghhorghtrdgtohhmqeenucggtffrrghtthgvrhhnpedvueetkeeluedugfeuteehtd dutdfhtdelffeghfeiheefieegvddtueevteeiudenucffohhmrghinhepkhgvrhhnvghl rdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: <xmx:fjU8ZaQpYMJjw5T9BfqZvYuudFxOCSLCytLt_K6YD1bdBZw-9ADNTw> <xmx:fjU8ZSzXzv8b-v7JnYrNCjH4XEEEUkuf3NS7Ee42H6t5t0df-VsyKw> <xmx:fjU8ZQ7C2cX9FUtP30SkcF1tbSKEJw9rbC9WO6asv2MtVuTuKJT9yQ> <xmx:fjU8ZcsH1PnJsa5UlmxXlTsKidy5ZiU9TpjY4TzjDDP3n5udum9XOw> Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 27 Oct 2023 18:11:09 -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 v2 00/10] MIPS: Fix kernel in XKPHYS Date: Fri, 27 Oct 2023 23:10:56 +0100 Message-Id: <20231027221106.405666-1-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.34.1 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 howler.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 (howler.vger.email [0.0.0.0]); Fri, 27 Oct 2023 15:11:45 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780574803682158930 X-GMAIL-MSGID: 1780948366347470729 |
Series |
MIPS: Fix kernel in XKPHYS
|
|
Message
Jiaxun Yang
Oct. 27, 2023, 10:10 p.m. UTC
Hi all, This series fixes support for loading kernel to XKPHYS space. It is derived from "MIPS: use virtual addresses from xkphys for MIPS64" [1]. Boot tested on boston and QEMU with loading address set to 0xa800000090000000. QEMU patch on the way. For EyeQ5's memory layout, I think you just need to write devicetree memory node as: memory@0 { device_type = "memory"; reg = < 0x0 0x08000000 0x0 0x08000000 0x8 0x08000000 0x0 0x78000000>; }; And set kernel load addesss to somewhere in RAM, everything should work. It makes me a little bit confused that in EyeQ5 enablement patch, you set load address to: > +else > +load-$(CONFIG_MIPS_GENERIC) += 0xa800000080100000 > +endif Where does not have memory aviailable. I guess you might want to set it to 0xa800000800100000? Though I would suggest you to set it to 0xa800000808000000, to avoid collisions with low mem and reserved mem. Gregory and Vladimir, do let me know if I missed anything. Thanks - Jiaxun [1]: https://lore.kernel.org/lkml/20231004161038.2818327-3-gregory.clement@bootlin.com/ Jiaxun Yang (10): MIPS: Export higher/highest relocation functions in uasm MIPS: spaces: Define a couple of handy macros MIPS: genex: Fix except_vec_vi for kernel in XKPHYS MIPS: Fix set_uncached_handler for ebase in XKPHYS MIPS: Refactor mips_cps_core_entry implementation MIPS: Allow kernel base to be set from Kconfig for all platforms MIPS: traps: Handle CPU with non standard vint offset MIPS: Avoid unnecessary reservation of exception space MIPS: traps: Enhance memblock ebase allocation process MIPS: Get rid of CONFIG_NO_EXCEPT_FILL arch/mips/Kconfig | 27 ++-- arch/mips/include/asm/addrspace.h | 5 + arch/mips/include/asm/mach-generic/spaces.h | 5 +- arch/mips/include/asm/mips-cm.h | 1 + arch/mips/include/asm/smp-cps.h | 4 +- arch/mips/include/asm/traps.h | 1 - arch/mips/include/asm/uasm.h | 2 + arch/mips/kernel/cps-vec.S | 110 +++++-------- arch/mips/kernel/cpu-probe.c | 5 - arch/mips/kernel/cpu-r3k-probe.c | 2 - arch/mips/kernel/genex.S | 19 ++- arch/mips/kernel/head.S | 7 +- arch/mips/kernel/smp-cps.c | 167 +++++++++++++++++--- arch/mips/kernel/traps.c | 85 +++++++--- arch/mips/mm/uasm.c | 6 +- 15 files changed, 293 insertions(+), 153 deletions(-)
Comments
Hello Jiaxun, > Hi all, > > This series fixes support for loading kernel to XKPHYS space. > It is derived from "MIPS: use virtual addresses from xkphys for MIPS64" [1]. > Thanks for this new series, I was able to test it this week and I have a few comments. > Boot tested on boston and QEMU with loading address set to 0xa800000090000000. > QEMU patch on the way. > > For EyeQ5's memory layout, I think you just need to write devicetree memory > node as: > > memory@0 { > device_type = "memory"; > reg = < 0x0 0x08000000 0x0 0x08000000 > 0x8 0x08000000 0x0 0x78000000>; > }; > > And set kernel load addesss to somewhere in RAM, everything should > work. With this setup and a workaround that I had to do and I will comment in for the patch "MIPS: Refactor mips_cps_core_entry implementation", I managed to boot the kernel and the 8 core of my setup are detected. > > It makes me a little bit confused that in EyeQ5 enablement patch, you set > load address to: >> +else >> +load-$(CONFIG_MIPS_GENERIC) += 0xa800000080100000 >> +endif > Where does not have memory aviailable. > > I guess you might want to set it to 0xa800000800100000? > Though I would suggest you to set it to 0xa800000808000000, to avoid > collisions with low mem and reserved mem. Indeed I used CONFIG_PHYSICAL_START=0xa800000808000000 Gregory > > Gregory and Vladimir, do let me know if I missed anything. > > Thanks > - Jiaxun > > [1]: https://lore.kernel.org/lkml/20231004161038.2818327-3-gregory.clement@bootlin.com/ > > Jiaxun Yang (10): > MIPS: Export higher/highest relocation functions in uasm > MIPS: spaces: Define a couple of handy macros > MIPS: genex: Fix except_vec_vi for kernel in XKPHYS > MIPS: Fix set_uncached_handler for ebase in XKPHYS > MIPS: Refactor mips_cps_core_entry implementation > MIPS: Allow kernel base to be set from Kconfig for all platforms > MIPS: traps: Handle CPU with non standard vint offset > MIPS: Avoid unnecessary reservation of exception space > MIPS: traps: Enhance memblock ebase allocation process > MIPS: Get rid of CONFIG_NO_EXCEPT_FILL > > arch/mips/Kconfig | 27 ++-- > arch/mips/include/asm/addrspace.h | 5 + > arch/mips/include/asm/mach-generic/spaces.h | 5 +- > arch/mips/include/asm/mips-cm.h | 1 + > arch/mips/include/asm/smp-cps.h | 4 +- > arch/mips/include/asm/traps.h | 1 - > arch/mips/include/asm/uasm.h | 2 + > arch/mips/kernel/cps-vec.S | 110 +++++-------- > arch/mips/kernel/cpu-probe.c | 5 - > arch/mips/kernel/cpu-r3k-probe.c | 2 - > arch/mips/kernel/genex.S | 19 ++- > arch/mips/kernel/head.S | 7 +- > arch/mips/kernel/smp-cps.c | 167 +++++++++++++++++--- > arch/mips/kernel/traps.c | 85 +++++++--- > arch/mips/mm/uasm.c | 6 +- > 15 files changed, 293 insertions(+), 153 deletions(-) > > -- > 2.34.1 >