Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2443386rdg; Mon, 14 Aug 2023 02:41:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHIatrDgS5ojY8ns/e4JgUHVnWFjVYWVyVtXRF2wypMbcTziAEV88gdYZrFjSzTGzwE5nuJ X-Received: by 2002:aa7:c3c6:0:b0:523:47cf:5034 with SMTP id l6-20020aa7c3c6000000b0052347cf5034mr7233633edr.34.1692006102955; Mon, 14 Aug 2023 02:41:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692006102; cv=none; d=google.com; s=arc-20160816; b=wR7tmo1wOYotQfj73N2mEgxGY3hr4ONFw37zcOXki0K3OHIU79utImYxz2nmk9htmL gbqNHXozyTmmFof9eQCeFaZRTdoaTu/XOeuA3qu3SI4AcD/cTw/9mGqf2xtEC3ZvmaHe pdo0Um6qyIO3vEP19Y/8nUM3THEfeNyO/H9kMuEhGGfSZLyCsCytTjxtHOhByqZbNmb4 BP1Jz3nE2CHILV7+UWdH4CeE6t+M2TYtPTTjeTmiP7VRlirWUZVbD8L0vZblfVA11zpv JQte5fjz1rHdOZ/NRNkj7Fx9YnsNV4ydcbjgR85I9O9d9PbhWmxjs3+yXruJ8R3LVznf uAYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Fi0hpZtXuJlZdTjzC8tCZld5nq3jYcqPU/c/BrrA6pA=; fh=qdjc2CdRM1znN/0ctZ1+pRmMu16xDIDDQOW43BlOBK8=; b=KyCaC5yA7WWGC6J/REMvLCEGnJHcdiExHBsVzJZ+3WV7opfKlO1hYdJvFnw33JLOej w8cuWkEpQH/dOIfvfi5iU5Q/D5zhQ7x+lVP17LdljlJOw61RreTgem/yMCyFYGw1bbzD HbcSDxuao4As1hY7J6pYBnQL/vYq09V2v6PjezhK2I4g76nbcuOkYI20fZX3enhye0lO v+yD3Ip4Iz07Q22YyDtUdWAGIcPHP/luv3ShWmFkBlmchJxrmVanATlkF2polkMRhBnm 1Ojb7/QQitQTfIOPzWuUo18qHDHCwCnt5kdCsHm3V25tC0JFumPzvn0W9QQXYkqoABVv 3e7A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l25-20020a056402029900b0052563914cc5si1701994edv.508.2023.08.14.02.41.18; Mon, 14 Aug 2023 02:41:42 -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; 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 S234613AbjHNI0P (ORCPT + 99 others); Mon, 14 Aug 2023 04:26:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234843AbjHNIZ7 (ORCPT ); Mon, 14 Aug 2023 04:25:59 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D55B61997; Mon, 14 Aug 2023 01:25:36 -0700 (PDT) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 37E8PMSp017215; Mon, 14 Aug 2023 10:25:22 +0200 Date: Mon, 14 Aug 2023 10:25:22 +0200 From: Willy Tarreau To: Zhangjin Wu Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, tanyuan@tinylab.org, thomas@t-8ch.de Subject: Re: [PATCH v2 0/7] selftests/nolibc: customize CROSS_COMPILE for all supported architectures Message-ID: <20230814082522.GA17212@1wt.eu> References: <20230814071850.GC14322@1wt.eu> <20230814073854.13444-1-falcon@tinylab.org> <20230814082500.GB16761@1wt.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230814082500.GB16761@1wt.eu> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS 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 On Mon, Aug 14, 2023 at 10:25:00AM +0200, Willy Tarreau wrote: > On Mon, Aug 14, 2023 at 03:38:54PM +0800, Zhangjin Wu wrote: > > > On Sun, Aug 13, 2023 at 06:05:03PM +0800, Zhangjin Wu wrote: > > > > > I think that later I'll further extend XARCH with new variants to > > > > > support ARMv5 and Thumb2, because we have different code for this > > > > > and I continue to manually change the CFLAGS to test both. > > > > > > > > > > > > > Ok, what about further add x86_64 as the default variant for x86 (like ppc for > > > > powerpc)? and then it is able to only resereve the variables for x86_64. I have > > > > prepared a patch for this goal in our new tinyconfig patchset, it will further > > > > avoid adding the same nolibc-test-x86.config and nolibc-test-x86_64.config. > > > > > > I'm confused, x86 already defaults to x86_64, it's just that it depends > > > on the .config itself to figure whether to produce a 32- or 64-bit kernel. > > > But for example it starts qemu in 64-bit mode. Am I missing anything ? > > > > > > > In kernel side, it is, but in our nolibc-test, we have added a copy of x86_64 > > for x86: > > > > $ grep -E "_x86" tools/testing/selftests/nolibc/Makefile > > IMAGE_x86_64 = arch/x86/boot/bzImage > > IMAGE_x86 = arch/x86/boot/bzImage > > CROSS_COMPILE_x86_64 ?= x86_64-linux- x86_64-linux-gnu- > > CROSS_COMPILE_x86 ?= x86_64-linux- x86_64-linux-gnu- > > DEFCONFIG_x86_64 = defconfig > > DEFCONFIG_x86 = defconfig > > QEMU_ARCH_x86_64 = x86_64 > > QEMU_ARCH_x86 = x86_64 > > QEMU_ARGS_x86_64 = -M pc -append "console=ttyS0,9600 i8042.noaux panic=-1 $(TEST:%=NOLIBC_TEST=%)" > > QEMU_ARGS_x86 = -M pc -append "console=ttyS0,9600 i8042.noaux panic=-1 $(TEST:%=NOLIBC_TEST=%)" > > > > With 'XARCH', the "_x86" copy of them can be simply replaced with such a line: > > > > # configure default variants for target kernel supported architectures > > XARCH_powerpc = ppc > > +XARCH_x86 = x86_64 > > XARCH = $(or $(XARCH_$(ARCH)),$(ARCH)) > > > > And therefore, the future nolibc-test-x86_64.config is also enough for x86. > > > > But I have seen the 'x86' exception in tools/include/nolibc/Makefile, just a > > confirm on if this replacement is ok. > > Ah I thought you meant the opposite, i.e. that ppc did map to powerpc > that I was not seeing anywhere else. Yes we can probably do that and > remove the x86-specific lines later. by "later" I mean "further" in the file. Willy