From patchwork Thu Aug 3 01:52:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 709586 Delivered-To: patch@linaro.org Received: by 2002:ab3:5b92:0:b0:238:c968:2573 with SMTP id j18csp1354308ltf; Wed, 2 Aug 2023 18:55:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlFO2BI1XETN2fGjQBXNxLM0oynQx58URJIaqogOP1bZX1F2KLPKru+FS4CfR1lcGlYJh5Rg X-Received: by 2002:a05:620a:f88:b0:766:8b00:940b with SMTP id b8-20020a05620a0f8800b007668b00940bmr13568502qkn.48.1691027713934; Wed, 02 Aug 2023 18:55:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691027713; cv=none; d=google.com; s=arc-20160816; b=AvH4/JYN9Ko1BR0TbUebqhOURPEKdJzpICkIeSXZCebjWprZEtE9PTsZn6Sdh9xh5+ 8eHnBTrh8HVBHFHbYbzaggQgeIDgQFLzOYhhNwEuTT0G+jFYC3aX64SvOQS+s9WHRn3U e58dqov7SBCplkdtC/gwIYF96LX3Nf1ZmfzVY187iZsYx8Hv5QHf/s5jutn0uv7/Vkr+ Acn7poHtQe49yrQGZKdMtgz+6cEKAkiROp7AipK2QtYcipk2rFGq+RAO7Fyj2yeLcdz+ ScJvkJDtNVO0a+e3n8e2nPNftEA4Zn2eqoj7WiGjIXF8YCafhIIxGumPeMek1/dfaNTj OByg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zGlGyVbf5mAt3X+pirtJo2XZVAZPR2luQo7KvVPWG+g=; fh=fmVFRXV+XPDbp8+eafcQB359/x6dDRQDsVzPMZJ0Hao=; b=VDDom1K5/r6uWLI/CTAUxzNjVoc6nCQ+HoA3+0JNVq3yLqyggLfqvuDzEdxLPzvPOj TMwG+Nwospl5e6FQiBssSj1Q96/zCJjSCjhsG5ShsRBKZVmQtCHfzvfjRl8tXBHwxIox a6GYs54bZHBNwv+aJ/rTyjiKzWgrBAJrAYO1MjkQMh/IYNQf26+cGPMOE6Bs8FVD9AlI CgHisbk2g+LIuBOg9itt/+Ux0Yg6eWJU51Y5caWpuvq/ws8sKzuL5O8LZWGBL/R6Azhg URwwt6BnnIA3MS8jLTwyQVxUOGpLR0mt9RUnqR0SnkhScU8ORzx3jLSAXaxkefWZrfA0 uZuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PUQl7ewo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 26-20020a05620a049a00b0076ca993daa5si5369121qkr.712.2023.08.02.18.55.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 Aug 2023 18:55:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PUQl7ewo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRNWa-0000f0-Nm; Wed, 02 Aug 2023 21:53:12 -0400 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 1qRNWX-0000dd-KN for qemu-devel@nongnu.org; Wed, 02 Aug 2023 21:53:09 -0400 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qRNWW-0000jp-0d for qemu-devel@nongnu.org; Wed, 02 Aug 2023 21:53:09 -0400 Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3a741f46fadso329872b6e.0 for ; Wed, 02 Aug 2023 18:53:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691027587; x=1691632387; 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=zGlGyVbf5mAt3X+pirtJo2XZVAZPR2luQo7KvVPWG+g=; b=PUQl7ewocdGUKClZUVQqG1B4IFNhSQEA0NkasIpsB6kJPWpaH80fOs3xAMzKkHzoT6 Otyt0gKRn+vayvSPtKXvW1lM6EvDLOYEznIwqsnPhRj9OOhwEe3TiqxLD3ZQQnkGRS2o lVtDZdBMzzy9AyEb4CoRq8uEHyx6eg6P4pqIJm7uEOANfPhV41rfCGD1ov5KHU4jTZhS ims5AeaQIHF1+O3vh150617dYI541mjraCiNh8sx/5PuH+zsFDdAmunufh2MYf7WLn1o T4apSRVru2PYQG9oqgmjZMcQwZYG7nR1oRBbLWMPrYfJDUILOUU+yJDRMnRQi+sBg3MG uXnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691027587; x=1691632387; 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=zGlGyVbf5mAt3X+pirtJo2XZVAZPR2luQo7KvVPWG+g=; b=I/BlArIQ3++J/UqNHzHcN04+NrkyuQ+C6qgzMfXwcSH1eRcyan5UnstDVIQJwXZAgd XGgqCYxlTfKx52XOFi6C8sIMhAL+lmukstC7/FMqAea8H3X53lzWndY3r9KOP5hF0k/h U2GPP5Le7tU21tANMzlJlxvxGRl2PRo3MVXP0gz/HgQaywkVGCCnbn5YDKrRDNMHF/3b x/M/2bP3DZYU34s9yhmWNlyz2rYvqR77bKgVRX/z1biGihenl2fOqTyBygR6zIkdhBcR nsezNOSwJJG9vspDVCFbEkJlMb1XBVsxrWM6YRNfcdU6yOejaGDs0xXbIKZjQqm2R6TP 2ghw== X-Gm-Message-State: ABy/qLb8h9qQrX6bWVIRjq8O02KiTD+XQxfeVc7G4Ar4Uw+IQHDFK1U2 DEmTrGWSIcRPpR+Mpiz5ZMqR1XQ191DsnkaO44M= X-Received: by 2002:a54:4e11:0:b0:3a7:9d0:b71 with SMTP id a17-20020a544e11000000b003a709d00b71mr14241976oiy.53.1691027586704; Wed, 02 Aug 2023 18:53:06 -0700 (PDT) Received: from stoup.. ([2602:47:d490:6901:b659:bbad:1a22:7ef9]) by smtp.gmail.com with ESMTPSA id s25-20020a63a319000000b005649cee408fsm157123pge.0.2023.08.02.18.53.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 18:53:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de, laurent@vivier.eu, akihiko.odaki@daynix.com, joel@jms.id.au Subject: [PATCH v7 03/14] linux-user: Do not call get_errno() in do_brk() Date: Wed, 2 Aug 2023 18:52:51 -0700 Message-Id: <20230803015302.407219-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230803015302.407219-1-richard.henderson@linaro.org> References: <20230803015302.407219-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::22a; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Akihiko Odaki Later the returned value is compared with -1, and negated errno is not expected. Fixes: 00faf08c95 ("linux-user: Don't use MAP_FIXED in do_brk()") Reviewed-by: Helge Deller Signed-off-by: Akihiko Odaki Message-Id: <20230802071754.14876-4-akihiko.odaki@daynix.com> Signed-off-by: Richard Henderson --- linux-user/syscall.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 95727a816a..b9d2ec02f9 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -862,9 +862,9 @@ abi_long do_brk(abi_ulong brk_val) */ if (new_host_brk_page > brk_page) { new_alloc_size = new_host_brk_page - brk_page; - mapped_addr = get_errno(target_mmap(brk_page, new_alloc_size, - PROT_READ|PROT_WRITE, - MAP_ANON|MAP_PRIVATE, 0, 0)); + mapped_addr = target_mmap(brk_page, new_alloc_size, + PROT_READ|PROT_WRITE, + MAP_ANON|MAP_PRIVATE, 0, 0); } else { new_alloc_size = 0; mapped_addr = brk_page;