From patchwork Tue Jul 12 06:20:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 589782 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:bb16:0:0:0:0 with SMTP id jd22csp3916218mab; Mon, 11 Jul 2022 23:34:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tUuq7bQJcttrOmQU2/6xaKry8yd+Dg5u96mPV6aoyOmLNrBT7SIdQz8vrOnDN78kxSuAnc X-Received: by 2002:a05:620a:261a:b0:6b2:6e4d:b607 with SMTP id z26-20020a05620a261a00b006b26e4db607mr14567188qko.414.1657607662139; Mon, 11 Jul 2022 23:34:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657607662; cv=none; d=google.com; s=arc-20160816; b=b79c15lWkZybWQEDJynywiP+ZHIIPuntSjV299PjaaAtPAdPfVMOid74D6/+x/05G6 qZnKtWW3aOOaiNcX06KYk0e/TF/QKT1OLg5RRGdO5hPvAwc9osODyFs1bD6UrdBmqvyB xsD1s0OjoheHD8x5BX/qutk156N0NSoCjBhDqd1872001w8atXTGVEu7xEzByRDjmd0J X+YAdvzDl9aoIqMvFVRiREs/nZ357yMOxBtSZmSCYiKL7i0bEbom7Yw2lqKrpZH0fA+Q MGP+nuWpWcOEZ6qhGiiKZnfZp/8PQwisMM47YMo7tCKfyuXwAp3zXaSSkArQ/k/NO694 Wo6A== 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=NKgbO3syVPPBCsmhbVDzMpoOrW9wAuvKeglhNug4je8=; b=yBKQ0CWHs8LDRwSMCHQsPCIiGpu1yf5g7NN8iBWr1km98ipMiczYXBgKRVEboqrY6n z6fA3UxT6FxhI1fyBKspSwamAZH6sK5Efo5nSUv+JwLDzjDRn79la/cDDKnqgxYyUfWd EcG208lJrwtjiIkM5kZBXzFYdWvZ9AQPqDVtIGkEUBoF4+q+1V6ojXbX+JJwtFaJxbr/ YOzzJJfVcvLnFr2eFlSvzOgfEn9DFfCKgX0kHMfyw868Qzh5iswpaqSj+98VIL+MYeXw BEII9cDF0IQrdCMTx7Xo1YrvOKddDDuHZj0VINwa8lVljVBJDR+8ETUS70Kq/2g2iSgF Bwzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ug9oUTbB; 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 do48-20020a05620a2b3000b006aee9a14691si3511299qkb.521.2022.07.11.23.34.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Jul 2022 23:34:22 -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=ug9oUTbB; 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]:59694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oB9TR-0002BF-IG for patch@linaro.org; Tue, 12 Jul 2022 02:34:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oB9G9-00044L-4Q for qemu-devel@nongnu.org; Tue, 12 Jul 2022 02:20:37 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]:38569) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oB9G7-0002Iw-Dx for qemu-devel@nongnu.org; Tue, 12 Jul 2022 02:20:36 -0400 Received: by mail-pg1-x52b.google.com with SMTP id e132so6706336pgc.5 for ; Mon, 11 Jul 2022 23:20:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NKgbO3syVPPBCsmhbVDzMpoOrW9wAuvKeglhNug4je8=; b=ug9oUTbB+WFA4/J0VCeH2DW3Th273vTRyh52yPW+O7DQZhB6jRwQ1uRhITEEePFd9d L0UZKZvHdSGSoZLdwyWIHk8vdT85gPtkAhV1C2LJWVwGnIZCOFkYE3vCBJMU5SAP/6FD aD0kPNV7TvWw2D89w/q76d9Mj83uHvMnNFniXoOHWVBVEYs7Lda6YeQyjWkiqKSmONA9 2gNu96FBFtvmiB0aA6u4J+8UzAIU2CRp6WwI2XczfvJQybLcCc5dNKMgIN5mdNxKTp+I ztJ4Wdh+OVrrlseVRYOpyH79X/llegPCh7ekSzwrQCEA+o7JBAKtzOjBCbGVJ3QhJbYb u0sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NKgbO3syVPPBCsmhbVDzMpoOrW9wAuvKeglhNug4je8=; b=OxUaCptumk2vaZnHqSqeaFaHKPuFyMxWDD3JBcwzYacqRutcMVMgGoPK/q/kzSGV1x 2oxQURmAYYd6J3Bb9UF8qEL2wefHIKyuZQ34vtkpf7kW+EfIN39dLFJKIoBTPvHEB+8e F/Od2ZTVHOqyBpqceYc0f+E3kAxB7h0tZdbc2+msX9nuvu/M+H/Dw4EqXpVl5fkyrkRK 1W+HL9Ir67aWQITAPBZpirzDGrAmPiXBHQGN7oFHgIY/4U5MhgTeqb4glHpTMOS+NjZ3 clVbag0US7nqC8RrZVzu0G1v5nIskH0GhHcD+j2fX/AlCDFYqR+mfwQ6zWl39wz/CaX8 5vCg== X-Gm-Message-State: AJIora/F3qNc18iwy/dHiZ3cPOpZ/Ocsq3Y1iEt5pcidl1DkJFsWW2Z7 8F3uVKIbdRNkrjYqJSqN2DquQFHeRLbEJ7rT X-Received: by 2002:a05:6a00:2487:b0:525:7c72:ee73 with SMTP id c7-20020a056a00248700b005257c72ee73mr21986951pfv.47.1657606833999; Mon, 11 Jul 2022 23:20:33 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id f2-20020aa79682000000b0052ab7144de8sm6040776pfk.10.2022.07.11.23.20.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 23:20:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Shaobo Song , qemu-stable@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PULL 1/2] tcg: Fix returned type in alloc_code_gen_buffer_splitwx_memfd() Date: Tue, 12 Jul 2022 11:50:24 +0530 Message-Id: <20220712062025.197634-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220712062025.197634-1-richard.henderson@linaro.org> References: <20220712062025.197634-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52b.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" From: Shaobo Song This fixes a bug in POSIX-compliant environments. Since we had allocated a buffer named 'tcg-jit' with read-write access protections we need a int type to combine these access flags and return it, whereas we had inexplicably return a bool type. It may cause an unnecessary protection change in tcg_region_init(). Cc: qemu-stable@nongnu.org Fixes: 7be9ebcf924c ("tcg: Return the map protection from alloc_code_gen_buffer") Signed-off-by: Shaobo Song Reviewed-by: Alex Bennée Message-Id: <20220624150216.3627-1-shnusongshaobo@gmail.com> Signed-off-by: Richard Henderson --- tcg/region.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/region.c b/tcg/region.c index 71ea81d671..88d6bb273f 100644 --- a/tcg/region.c +++ b/tcg/region.c @@ -548,7 +548,7 @@ static int alloc_code_gen_buffer_anon(size_t size, int prot, #ifdef CONFIG_POSIX #include "qemu/memfd.h" -static bool alloc_code_gen_buffer_splitwx_memfd(size_t size, Error **errp) +static int alloc_code_gen_buffer_splitwx_memfd(size_t size, Error **errp) { void *buf_rw = NULL, *buf_rx = MAP_FAILED; int fd = -1;