From mboxrd@z Thu Jan 1 00:00:00 1970 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 D0802C43334 for ; Fri, 24 Jun 2022 15:27:46 +0000 (UTC) Received: from localhost ([::1]:36982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o4lDl-000498-RN for qemu-devel@archiver.kernel.org; Fri, 24 Jun 2022 11:27:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4krl-0002yO-Jt for qemu-devel@nongnu.org; Fri, 24 Jun 2022 11:05:01 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:42652) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o4krk-0002f0-3e for qemu-devel@nongnu.org; Fri, 24 Jun 2022 11:05:01 -0400 Received: by mail-pl1-x62a.google.com with SMTP id jb13so2346311plb.9 for ; Fri, 24 Jun 2022 08:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RuXEFKGu+IvP8WBaKfeHy5hcr+avx7dIecUIVYdVqiY=; b=gYO1d0JN10SS2Ej3PVuC4ybRsUzZ1fZifozyeHDHC58bSHUgpjB5kBawHJPYgf/pwN qGERTMrMZjeQLsqcqAPD8AH7ajZZ2m3pAUsnxCwsPax1sdtDp4dTixjhmErnVQrwfmg7 qqWMZcqjt/IZhk+lDUpaVt7PLNflDeumRgZS6AJOwmye0UdYmd27g+Odp3jg1ozciKLP K/67rrJiEtMi5Ub1UgxqOGQaKYAig9Ykf7/q3CchHxa6+8wWQ0r2gHcg/cTpG0/4GNLc oT3Epfis7qbCr4MNueg1Lc8PZfaGvMfGacVqRJBtT6OTEJbUrTpdGhk/B00EMoIcOLpJ bELQ== 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:mime-version :content-transfer-encoding; bh=RuXEFKGu+IvP8WBaKfeHy5hcr+avx7dIecUIVYdVqiY=; b=c3NTySmfD/CaIuB0NxY92vItduy0BWUDB0DXk/080aMCStPeA17tiShMHMKPsquFlO PRFCbISw7f0CHAd3nESJU3RUN06QgBvXF5NXXabdEQnCrTSCQ7nBS+JNDRvB5sbTYW0B Ww5pAVTNdNQPTacdGj1WQVOKt6B9uovgT9R8oC/fz5ufCTxia4vzEW05ytczIp1tDpvh 7hWe07PaqSnZLmEFEKvnx+BzDEytedkFLseu0Uk0KZ6XVsA0mBSFHPiDoaK/XwDjKs8f j9RYXGbU79ri8636Jy8tFvvfFY1EsEATXpJJkBVrwkoiftsLdqTo3FvH2qu7Y4lJ03b7 Ea1A== X-Gm-Message-State: AJIora/6RCDCqs37AQQFRBJyCGKNv8h6f95qAC6J131Rl5IYYmi8NX8B cU9VqRVjNYLPglJvVGnhva00KAz0hSnUyQ== X-Google-Smtp-Source: AGRyM1sq4MBB9RFGFm7T4mF3OAXkMPyc4rqHmTd5ADGQFOwSm7rIH2lHCo5W47ib20f7ZgMiNbBA5Q== X-Received: by 2002:a17:902:cf10:b0:168:ef35:5bee with SMTP id i16-20020a170902cf1000b00168ef355beemr44546698plg.99.1656083098504; Fri, 24 Jun 2022 08:04:58 -0700 (PDT) Received: from DESKTOP-VGAJ4S3.localdomain ([111.3.43.17]) by smtp.gmail.com with ESMTPSA id f1-20020a654001000000b0040d22243295sm1746191pgp.79.2022.06.24.08.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 08:04:58 -0700 (PDT) From: Shaobo Song To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, Shaobo Song Subject: [PATCH] tcg: Fix returned type in alloc_code_gen_buffer_splitwx_memfd() Date: Fri, 24 Jun 2022 23:02:17 +0800 Message-Id: <20220624150216.3627-1-shnusongshaobo@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=shnusongshaobo@gmail.com; helo=mail-pl1-x62a.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, FREEMAIL_FROM=0.001, 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-Mailman-Approved-At: Fri, 24 Jun 2022 11:26:20 -0400 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" 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(). Signed-off-by: Shaobo Song --- 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; -- 2.25.1