From patchwork Sun Aug 6 03:36:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 710879 Delivered-To: patch@linaro.org Received: by 2002:a05:6359:d30:b0:129:c516:61db with SMTP id gp48csp826417rwb; Sat, 5 Aug 2023 20:40:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGX7A083BFXjNcyaYrS8LJa1JeOxMk0oo+zIkhhqZWfLcwxhvmF6JkeedBi7VM/tsLOF5td X-Received: by 2002:a05:620a:29d1:b0:768:11ff:7899 with SMTP id s17-20020a05620a29d100b0076811ff7899mr9099881qkp.64.1691293210603; Sat, 05 Aug 2023 20:40:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691293210; cv=none; d=google.com; s=arc-20160816; b=P9mRcSNkLJWUqzPvOhPCF9Tdj/Pl/AvA4pw+IxT+ZAzfaVjK1R8UCpABQ+QLLTJW9H fFFjmv7Ez1wn+5Mugq8ELXow1CKI68vxE7OZFTq0/lJbQ5qj0MKhZoFWUoZeX1d54nOK 1p/fZSyNYIIgRvNFX2XjSCniS5YxHQbBe5G56e106S/thokBPlGPs0tci7K4+CZ2ktU8 erWiMy0dSf4zHwN2ArPIi6bz6hvreZ2AFeTidarK2xYZmgUGJKGBi3AbElzzRS6ixotn d+c/KvtbQ399oe3nvCicE8xeAIw3VqG1YIiUUhKc92wolI/exYa7T0Eb3AyQ95zD22zN DlZg== 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=KbMqH8mq9CYjRSCjjAD/0kWfnvdKe1C4f7CRd7AraEQ=; b=t/9yVbnrIe2xOA7QeFA3XHY8xT7EsuF4T0iYCt+INRWmWCDiBKXCe60QmU5ROjnFxn aIs5L+7VMZFb7MTQr6NbaIWr5NTFFK7zoptz+7iUPptDFlBuzS4FZ/cBNtkUoGS27jKr H7Y2E6tqnqyQKdHgvD2cZv63H5Zzo/o7G4ZC5Dwfuw6bkYzXCh4LFjAL8Pxmx6lxkbCu +IetZ20CScFFFIROFADuVgHYQQC3treV/YHb9rCdwZwwIhA8PyEmDLG5vTl/QFw6N+Qa WvTbZC5mWYBP+lbxIDUu6ySAxRHlbXxXz3CsDh1u246F6O3Mr1WP2ymtGtuFCy/s8Vhl +3Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=efPZlL53; 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 ty10-20020a05620a3f4a00b0074ced1ef870si3199063qkn.650.2023.08.05.20.40.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 05 Aug 2023 20:40:10 -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=efPZlL53; 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 1qSUa7-0003ej-HO; Sat, 05 Aug 2023 23:37:27 -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 1qSUa5-0003di-R0 for qemu-devel@nongnu.org; Sat, 05 Aug 2023 23:37:25 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qSUa4-0007XJ-9W for qemu-devel@nongnu.org; Sat, 05 Aug 2023 23:37:25 -0400 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-26813478800so1955245a91.1 for ; Sat, 05 Aug 2023 20:37:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691293042; x=1691897842; 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=efPZlL53myMCIQE9tVKG0whB4O+nv6ewJYmCie8Xi8+I5rB2wtoqo3VE2SD2adP+Bz WUylhQpxkBvwiPliKQhN68r/EWuiszIdvM7I05h27floRwf2LPoiTlvvwQnGs/8KlYRD vNJnnoprxoDegqMjQl+GKYEmlqCljbqjVTcigLBo63zvANzczhH2RG/xOalksdewjYed zjZN8pQjFQmpt9MJn1c6nmPWWvhXqrUjcPihy9dQM4IA6+bb7z78E/3KlWvCeGGhyAo3 1ewBZHwXwfvggwwmPOvsQeJI5ae7F4JfD4NYGhCQlx5PLXE4Uq1FM/sbO5d0vRWwQyso f91Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691293042; x=1691897842; 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=EdL0fY2f8QW/jaRj01Z5Uf1J+UshMZbJmNDBRMUvT9l2LovzCMWUlNuVNzgt60InOt Sj1ejXPpOVwE1LOinvnhqh2AGyFdtskq6vdvX2sLzFhkkBXDEYH7Dl3Hc5EqOpZz3Rrf 9kJJbO50+G7ZXp97nli1Ca0jkbCWsinnwJiDQHNfs6AaUT7fJPZGZe6qqaIl+VRpNfTd 4iy5Q/W+Ccx5lyJ7ZWnCGMy+BlktvX6PZoTDD4y52T/S8REt0/l2qYnbowjs0ozt1hnO 4Q5zsA3TVSAwc1aJ6XLP9KiUv0f8o2NYy/pc+PCHf2TShLpk6DQfB2F5+/EUtfRh8uRl vAFA== X-Gm-Message-State: AOJu0YzL3yHaJehbEE2vAso2+HCDl+ysIixTuuJVJFgVrC4Nhcerdjr+ 0DFcY8dyiBRiqLb6hb+lsUuaiNuM87+zbwfjjqE= X-Received: by 2002:a17:90a:ce96:b0:262:e564:3ecb with SMTP id g22-20020a17090ace9600b00262e5643ecbmr5154812pju.36.1691293042111; Sat, 05 Aug 2023 20:37:22 -0700 (PDT) Received: from stoup.. ([2602:47:d490:6901:9454:a46f:1c22:a7c6]) by smtp.gmail.com with ESMTPSA id a5-20020a17090a740500b00262e604724dsm6306451pjg.50.2023.08.05.20.37.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Aug 2023 20:37:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Akihiko Odaki , Helge Deller Subject: [PULL 07/24] linux-user: Do not call get_errno() in do_brk() Date: Sat, 5 Aug 2023 20:36:58 -0700 Message-Id: <20230806033715.244648-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230806033715.244648-1-richard.henderson@linaro.org> References: <20230806033715.244648-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.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 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;