Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7837276rwp; Wed, 19 Jul 2023 00:38:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlHCbHhjD83KYsEHILbS7g6qvLOZIM9gV974H+Up9YGwspLkGNlbYJPUc1O5tAkKgqg8cMzM X-Received: by 2002:a17:902:d483:b0:1b8:b48a:5e7f with SMTP id c3-20020a170902d48300b001b8b48a5e7fmr4871559plg.25.1689752330364; Wed, 19 Jul 2023 00:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689752330; cv=none; d=google.com; s=arc-20160816; b=OOpyL8aSBRc16Btd07isisBDPRGDS+chtI9Jqcz//E8XiG7/ri+B/fOtKJ50YATWi4 KHof3i+x9FgjaLWa/KVvwBaTwyOQRzaeB7ITfyNVMXdmFghM+AfyHq0EuSnLz+V84q68 0oZoAY93fmG/M4C40rRjUa5V1tQiGTwRGy12G67KFcf23C4vyulLnCry70rvDPGOsUFV zVtKOMxQON1a+pKMnnICtpF9ucIWMU9B/pwX9hbVmbdIaXFQv1sqkTmVA3yvshoBKXLl qDCl5xcazWfdDNzmRK6iSfzd4YHVvi1muunv36DS9FhGGcgOm0vdJ/1QyhNlPqr58MZ7 YhPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:dkim-signature :dkim-signature; bh=hONm7Ls/e2QRNpgmgKsoRqqEthuvFVO93IbQBRvgv9E=; fh=coArhgs/pr9YUVoNS9K1oEy4sXkVUVdqbLpN3Mz7bp4=; b=AWiGihf0lbVjvP06ANUNaNf2hYaPuYI/Jr2u5vk55/l8V8C0abpZFYLlXpu0vBn+hA JkpXC7HuMDjR84jNKpgEBm88R+6lR/PNMI82hQX19dYUD3sr1kh6O5ckzukGfRdxIZJz pM2YmSJsE21gn50NWIfNZvwLyvfm8e11/GH7BUskB4ngMuo59EEfoynbRi8KES9mtaI+ DlQtrGf0z8sVJzoTDoKeDJKGi/UdrchlnbovpA1lqAgnTS6NMY2QzC+Qk5gxvojZQoEb pNLb8zCD+jFmlicrJ0tqDdhlQwIJrJzfy7vOr6UeewgtXDdyZkRPMhOd7J0ptwDA3/mC mXrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=vON1rA7M; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=qftf+9G9; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h5-20020a170902f54500b001b8ae69289dsi3113208plf.539.2023.07.19.00.38.38; Wed, 19 Jul 2023 00:38:50 -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=@suse.de header.s=susede2_rsa header.b=vON1rA7M; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=qftf+9G9; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229759AbjGSHWZ (ORCPT + 99 others); Wed, 19 Jul 2023 03:22:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230140AbjGSHWM (ORCPT ); Wed, 19 Jul 2023 03:22:12 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE992210D for ; Wed, 19 Jul 2023 00:21:51 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id C4C6D1F8BF; Wed, 19 Jul 2023 07:21:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1689751306; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hONm7Ls/e2QRNpgmgKsoRqqEthuvFVO93IbQBRvgv9E=; b=vON1rA7MNMPoAvcVN8XrUGucsMdIblZ14wP5bnlBdDYDP5NlTVh0nX0NcxwJWhcEVo6Dkd TlP79NH4jZ8qUCTadE8zjpMR3spSVY5//fKwBX2U8t6jx+MlI4LK9SGXamfVgIGi+gD1+G gnHrE3dPf6qDI9hNL4ofmlwn7ZSkvT0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1689751306; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hONm7Ls/e2QRNpgmgKsoRqqEthuvFVO93IbQBRvgv9E=; b=qftf+9G9cWwBYSlw4Umga0Mpci0c8TLY/8CbzPxBiFYzKjqwcAyVYHfPkYL9bfTOkLMq07 C49uYvWWthH9ohCg== Received: from hawking.nue2.suse.org (unknown [10.168.4.11]) by relay2.suse.de (Postfix) with ESMTP id DCB532C142; Wed, 19 Jul 2023 07:21:43 +0000 (UTC) Received: by hawking.nue2.suse.org (Postfix, from userid 17005) id BEAAF4A09FF; Wed, 19 Jul 2023 09:21:43 +0200 (CEST) From: Andreas Schwab To: Celeste Liu Cc: Palmer Dabbelt , Paul Walmsley , Albert Ou , Guo Ren , =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= , Conor Dooley , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Felix Yan , Ruizhe Pan , Shiqi Zhang Subject: Re: [PATCH v3] riscv: entry: set a0 = -ENOSYS only when syscall != -1 In-Reply-To: <20230718210037.250665-1-CoelacanthusHex@gmail.com> (Celeste Liu's message of "Wed, 19 Jul 2023 04:57:30 +0800") References: <20230718210037.250665-1-CoelacanthusHex@gmail.com> X-Yow: I'm receiving a coded message from EUBIE BLAKE!! Date: Wed, 19 Jul 2023 09:21:43 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Jul 19 2023, Celeste Liu wrote: > @@ -308,7 +312,7 @@ asmlinkage __visible __trap_section void do_trap_ecall_u(struct pt_regs *regs) > > if (syscall < NR_syscalls) > syscall_handler(regs, syscall); > - else > + else if ((long)syscall != -1L) You can also use syscall != -1UL or even syscall != -1. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."