Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp3746437rwl; Tue, 27 Dec 2022 14:33:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXtP033WbE3Z5RNG7PJKL+JiF/nKOP9Lx469E8Km9LUn0hSDG6eQFhaJu2UuKrnZYvF8kKjK X-Received: by 2002:a05:6402:538d:b0:487:2ce6:2b80 with SMTP id ew13-20020a056402538d00b004872ce62b80mr2944250edb.8.1672180412558; Tue, 27 Dec 2022 14:33:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672180412; cv=none; d=google.com; s=arc-20160816; b=tno4Q/3wS9koqX3dGLjI5T3mGgy93pxFGpEwnzp4EGWRxlMoWNeR9xNMyrfk1lVrze 2zVMb40ZYG4R22p38LsJCuVtaNllsE5uY2uiPT6pMOhEqRgP+FMrHsSq/RVFiqSTpaj6 RivceqCy99GHAGm6BfWtAvO1KwgkXEn05J6UsL8S3xdUwe0P+U0BtQwAO1EZpSFXivkj XY9eRJsUrvHVLWegPz0ql58xpOiK60763CZcUTAhN5sQTFUc9szO4kssNwVC/b+SNd9I z2ZRqpA0zPZIHserPriN2Kpt0ESEhh787CLojAoOSTjsNJ8UbBGQf7+qbqPNzmYT6kiI IS0g== 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=mRAjvWwS30vo02bu2BdBkaY7IICErKMc+ihialJcy3A=; b=Gx9necmRGfOCb6TGdKQA+SK4uMRUpkbZt3MCFEJG0ihnLWG2MQj93ILTkLZ1irldxW cYqxZZGhx+RRdnebcjRVPeGRoeH6o8lCRozdHg5qGhsPSIeyQ2fbgks15ce5jaaQsCt0 Fx8OP7nhyC+g0w7XwD/8M3u6Ba+JZ20HwGdxj1mPHogU0xcdXiSFOxsPdaEn6OPmlfs6 nVRxHqaTq+x12MzEfi/8W8IqIDBZiiQ168d5ZrgDmqK88aYX16N3eQraEMcRSm0eTKlc FmPEAV+XrPMPGyTCoirBawyee2ysBX45oXZjnIg98R1cWzwdoBO920fZzD7NLjy50b2w BoZg== 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 cb23-20020a0564020b7700b004798880a0adsi11685640edb.596.2022.12.27.14.33.15; Tue, 27 Dec 2022 14:33:32 -0800 (PST) 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 S231289AbiL0Vf7 (ORCPT + 66 others); Tue, 27 Dec 2022 16:35:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230037AbiL0Vfy (ORCPT ); Tue, 27 Dec 2022 16:35:54 -0500 Received: from 1wt.eu (wtarreau.pck.nerim.net [62.212.114.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 766BCD5E for ; Tue, 27 Dec 2022 13:35:49 -0800 (PST) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 2BRLZUlp006457; Tue, 27 Dec 2022 22:35:30 +0100 Date: Tue, 27 Dec 2022 22:35:30 +0100 From: Willy Tarreau To: Sven Schnelle Cc: "Paul E . McKenney" , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/5] nolibc: add support for s390 Message-ID: <20221227213530.GA6390@1wt.eu> References: <20221209141939.3634586-1-svens@linux.ibm.com> <20221209141939.3634586-3-svens@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221209141939.3634586-3-svens@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 Hi Sven, On Fri, Dec 09, 2022 at 03:19:36PM +0100, Sven Schnelle wrote: > Use arch-x86_64 as a template. Not really different, but > we have our own mmap syscall which takes a structure instead > of discrete arguments. (...) This evening I downloaded an s390 toolchain from kernel.org's nolibc toolchains and expected to test the code under qemu, but I met two build errors. The first one is that __maybe_unused breaks the build below: > +static __maybe_unused > +void *sys_mmap(void *addr, size_t length, int prot, int flags, int fd, > + off_t offset) And indeed, __maybe_unused is not defined here in userland. The following patch allows to go further: diff --git a/tools/include/nolibc/arch-s390.h b/tools/include/nolibc/arch-s390.h index 34b744e2f7d6..effae6e3d9e2 100644 --- a/tools/include/nolibc/arch-s390.h +++ b/tools/include/nolibc/arch-s390.h @@ -194,7 +194,7 @@ struct s390_mmap_arg_struct { unsigned long offset; }; -static __maybe_unused +static __attribute__((unused)) void *sys_mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) { But with this addressed, I'm facing this next error: $ make nolibc-test LDFLAGS= ARCH=s390 CC=/f/tc/nolibc/gcc-12.2.0-nolibc/s390-linux/bin/s390-linux-gcc MKDIR sysroot/s390/include make[1]: Entering directory '/g/public/linux/master/tools/include/nolibc' make[2]: Entering directory '/g/public/linux/master' make[2]: Leaving directory '/g/public/linux/master' make[2]: Entering directory '/g/public/linux/master' INSTALL /g/public/linux/master/tools/testing/selftests/nolibc/sysroot/sysroot/include make[2]: Leaving directory '/g/public/linux/master' make[1]: Leaving directory '/g/public/linux/master/tools/include/nolibc' CC nolibc-test /tmp/ccCzaBgD.s: Assembler messages: /tmp/ccCzaBgD.s:9: Error: Unrecognized opcode: `lg' /tmp/ccCzaBgD.s:12: Error: Unrecognized opcode: `lay' /tmp/ccCzaBgD.s:15: Error: Unrecognized opcode: `lghi' make: *** [Makefile:108: nolibc-test] Error 1 Thus I'm wondering if specific options are required for the compiler (it's gcc 12.2.0 + binutils 2.39), if I'm not using the proper compiler, or if there's anything wrong in the asm code (e.g. maybe by accident you sent the patch from an earlier development branch), or anything else ? FWIW I've used the patches from Paul's dev branch: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/log/?h=dev And the s390 toolchain from here: https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/12.2.0/ Thanks in advance for any help, Willy