From patchwork Tue Feb 14 00:27:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Warner Losh X-Patchwork-Id: 13139208 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7FE81C636CC for ; Tue, 14 Feb 2023 00:28:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRjB0-0007Md-OD; Mon, 13 Feb 2023 19:28:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRjAz-0007MF-Ge for qemu-devel@nongnu.org; Mon, 13 Feb 2023 19:28:05 -0500 Received: from mail-io1-xd34.google.com ([2607:f8b0:4864:20::d34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRjAx-0005yV-9v for qemu-devel@nongnu.org; Mon, 13 Feb 2023 19:28:04 -0500 Received: by mail-io1-xd34.google.com with SMTP id j17so5166953ioa.9 for ; Mon, 13 Feb 2023 16:28:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=v82U4AeojucC3DQqhT5F05E7FmGdLYXG/H9YwykhwGc=; b=G9f82TVBnS8C8IYlQ6i1v7CLsB/lkOXnmH9ZYOme/UdqLotS2CoRDtUcxiMEDhdhPq UziTqt8yac02lvn+bgbUWDRQxvyPL6XhSG3LDob5SRQLQxyJK08Gym4AKkJHZUQpKQqv jJHKkmUkLSsoIrB4MoXU3HN7kBk38Q21v77BBb7lY1ewZmYy7/YxWqe6Q0h2dFW+k+Kw WwIovcCaX6YZn2nexVDtgdYEJOJs7lwfr4DSPzbYee+rXtchmYNxhsbbpbyOSZ58yjfk bK3bDHI/L/x8vIyPIiSaoXZD/e0RlnywO4QQEg0rmToLuoMfk0uz/8yGLNOhOFSo5mxk hCdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v82U4AeojucC3DQqhT5F05E7FmGdLYXG/H9YwykhwGc=; b=aKYxgmvtMDrjHnDq0PW+c/wMJvDLZWR8JWHydouz0CVqatbzPh0o/PkXxNUQNGodPx JNJvYpp8eYzmJkXSJfLM1EEUy8vRavkSbO9DPoqCo8A1flVmBiF1iMmyeLXGz6EOWTSp yIi3fWXPeMiM44hnZrlf5XB/2j+pfQgkkBNCC/ZA4qf/Ab0hI7cMkXvUipW5dtXht1eY yoAGQQag3ETb7l3VtPm6JNHNwfdkmewXDbEdSg31NkFlxpJ+SDXzaGxirWLwgpz6sWU5 c0JNO/LVSl0JSfs1d18uO7MU2t1uSomRhfMnRAz62ESr2MZoX6GP5sWQexpHePYlZmg8 or1A== X-Gm-Message-State: AO0yUKWd/Oozvhgqu1SjUVKBMeDCkVaxLRhKy/05AMUcB8zYKPvnZ52V ts0ux7xbJbLYPYLPmhvd6Mn19tslatBCleG0 X-Google-Smtp-Source: AK7set99Ybnb06IanBJXuVgq/vw5r1IaAenrXthhJRxTuFiaRIL0u8BAgBanGbpLDKgPGgV++/05uQ== X-Received: by 2002:a5e:a80b:0:b0:715:ba8c:3b14 with SMTP id c11-20020a5ea80b000000b00715ba8c3b14mr292304ioa.12.1676334481582; Mon, 13 Feb 2023 16:28:01 -0800 (PST) Received: from dune.bsdimp.com (c-71-237-47-177.hsd1.co.comcast.net. [71.237.47.177]) by smtp.gmail.com with ESMTPSA id r17-20020a028811000000b003af4300d670sm4500923jai.27.2023.02.13.16.28.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 16:28:01 -0800 (PST) From: Warner Losh To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Warner Losh , richard.henderson@linaro.org, Paolo Bonzini , kevans@freebsd.org, f4bug@amsat.org, Thomas Huth , Doug Rabson Subject: [PATCH v2 01/12] bsd-user: Don't truncate the return value from freebsd_syscall Date: Mon, 13 Feb 2023 17:27:46 -0700 Message-Id: <20230214002757.99240-2-imp@bsdimp.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214002757.99240-1-imp@bsdimp.com> References: <20230214002757.99240-1-imp@bsdimp.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::d34; envelope-from=imp@bsdimp.com; helo=mail-io1-xd34.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Doug Rabson System call return values on FreeBSD are in a register (which is spelled abi_long in qemu). This was being assigned into an int variable which causes problems for 64bit targets. Resolves: https://github.com/qemu-bsd-user/qemu-bsd-user/issues/40 Signed-off-by: Doug Rabson Reviewed-by: Warner Losh [ Edited commit message for upstreaming into qemu-project ] Signed-off-by: Warner Losh Reviewed-by: Richard Henderson --- bsd-user/freebsd/os-syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index 57996cad8ae..b4a663fc021 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -512,7 +512,7 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1, abi_long arg8) { CPUState *cpu = env_cpu(cpu_env); - int ret; + abi_long ret; trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); if (do_strace) {