From nobody Tue Nov 26 17:44:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706005535; cv=none; d=zohomail.com; s=zohoarc; b=SNxQe9ChXtlsu8KUpiGUq5KaZrwhmo6TlWZDC0MS529z/0/lo9xssLV1uXQXhCj18unCz+Vdvmuqn/NEKRrzwpnQc/Vw6Tw8pGoI3kzFuLWz1ay5U0HOmwI5ZqSi03657HGQnxkc4RgAi1FtY/kwsTBAQcI2MfK+9a68qdJF9nQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706005535; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8KxhZwbZAcm1asBjHob1LgeGTJkXdHPPGTQpwmtvThw=; b=h/+7OzuPaeCh2uCRl3I6vbpxS+KYgqshYIn1qlegclXRiB8itdk5vaDuy/Id7pthYMXjS8AkPlV3bqBuYJ3Ke9EK+e8ElLcTHxDquznmA1ESCCIqZz3VZ5JS/xTRd666AXDq6aBLEILTEQrkPyTVE0xcX8tmZHljUao1bBuwrmk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706005535900965.8177652327137; Tue, 23 Jan 2024 02:25:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSDxC-0000N9-A3; Tue, 23 Jan 2024 05:24:26 -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 1rSDxA-0000MX-3M for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:24 -0500 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSDx8-0004cA-BV for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:23 -0500 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6dd7c5437b0so274851b3a.3 for ; Tue, 23 Jan 2024 02:24:21 -0800 (PST) Received: from stoup.lan (2001-44b8-2176-c800-b8a0-0408-58be-7d2e.static.ipv6.internode.on.net. [2001:44b8:2176:c800:b8a0:408:58be:7d2e]) by smtp.gmail.com with ESMTPSA id d8-20020a62f808000000b006d9ce7d3258sm11072408pfh.204.2024.01.23.02.24.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 02:24:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706005460; x=1706610260; darn=nongnu.org; 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=8KxhZwbZAcm1asBjHob1LgeGTJkXdHPPGTQpwmtvThw=; b=VDKntUHDe81VJEdB00Nl1mv1yloJGfFuvqU1j00MIgIaeXvAlZ04mK6jNUdjaDBEj4 l+8d9p/0h6tJLdTYoNacGce4qwcFvTU7aiIAtSrQeKZF1gOZG3ZIc9mK7DloxXDocQVL /uOhBU62I2cqb8SP4LHV7K/Nw48A0INZ+kig1T6GoroYKkDCUn52pm724RcHdPFRaR34 gtROoXWviTfpasy7fYgo2wqAHrMS9v0fqy9F1qKlLGgGrwBg0gtiVViIkiH17a4VP88r CfTYj1lnIdrk5C94eALwLTQzSgDfT51Zre1oG4wSbvasU8UPX4FHTtxMO2f/5PnjOxUN RcPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706005460; x=1706610260; 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=8KxhZwbZAcm1asBjHob1LgeGTJkXdHPPGTQpwmtvThw=; b=VZb6iJnnnIakva1VS5ipfWvtT12wr74BRANZB4wX18Pz2Dy5g4qOJbzIn0RPm+XD9Y EeW8BlrXuIwgvAeuus8VbkDRuDtxHW01Q1r8ZQZeDcFcUZ/xoBTY7hlu6wkf5Tmjtj+I iFC4kfZoaaQhYW3YM1hc0FEPyksLXIOAwrrZtxuAkVM23CWeG/xykNA/mRpGXANfYGGr adIg8MZgJxVGwEHa7ljBD88R/aBgngIEg7HKckTQ9vhsp+jbVBl0PkBScj3ny+PVduIf hpgD7m8+CKNCFF1M7tHwXMB6P2SK/H5HODB9OphB0eNTdSMDn8HU15fjYBBTv5b8st01 a+pA== X-Gm-Message-State: AOJu0YxraZFqkFicAqtJt+n/WMT+tuqqnrSCzASCvVIZhimvH5/ubyig odQkcC6HrLPtNQDga6zV592yH+d88TBep+WA36lQBP+O/9zkavc/lNdPwLbAiqaww8wUxsfrh39 Fo/k= X-Google-Smtp-Source: AGHT+IFbEITn4mA6lPyn6EPMoU5EJzjrqY6lMlUcma+KbLrF6SNmFFpxiU91cKUGgNpSwj5myZMDlA== X-Received: by 2002:a05:6a20:da83:b0:19a:29a4:4994 with SMTP id iy3-20020a056a20da8300b0019a29a44994mr6959060pzb.84.1706005460639; Tue, 23 Jan 2024 02:24:20 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Samuel Tardieu , Peter Maydell Subject: [PULL v2 1/8] tcg: Remove unreachable code Date: Tue, 23 Jan 2024 20:24:05 +1000 Message-Id: <20240123102412.4569-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123102412.4569-1-richard.henderson@linaro.org> References: <20240123102412.4569-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706005537898100007 Content-Type: text/plain; charset="utf-8" From: Samuel Tardieu The `fail_rx`/`fail` block is only entered while `buf_rx` is equal to its initial value `MAP_FAILED`. The `munmap(buf_rx, size);` was never executed. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2030 Signed-off-by: Samuel Tardieu Reviewed-by: Peter Maydell Message-Id: <20231219182212.455952-2-sam@rfc1149.net> Signed-off-by: Richard Henderson --- tcg/region.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tcg/region.c b/tcg/region.c index 86692455c0..467e51cf6f 100644 --- a/tcg/region.c +++ b/tcg/region.c @@ -597,9 +597,7 @@ static int alloc_code_gen_buffer_splitwx_memfd(size_t s= ize, Error **errp) fail_rx: error_setg_errno(errp, errno, "failed to map shared memory for execute= "); fail: - if (buf_rx !=3D MAP_FAILED) { - munmap(buf_rx, size); - } + /* buf_rx is always equal to MAP_FAILED here and does not require clea= nup */ if (buf_rw) { munmap(buf_rw, size); } --=20 2.34.1 From nobody Tue Nov 26 17:44:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706005534; cv=none; d=zohomail.com; s=zohoarc; b=UYJyZ59AE7CXW1Tsi7TEPQuSftkNnRai+G3EZiNrXJP2R/nH4NwZXNhpXVfnfJxdPYq7UnAfiFpbII+H5PL0+BTtG3NdlymbFDRBOEqTrxK2AGJn5sXucwAmDLdPTlWkKo6EODXNSp4GGuIyENPSZMUqNsm7kJC8sDsbfmJeVfQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706005534; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0EKsORzhcd/voY/5GCXD+0ZH5a0YI/B7BiYyHrdge+w=; b=mSjCNrdy291/8zEGZ1WGRMs1dY5YJNoTHssnAu7cw32hzsyqcWBv43oK2+hB8z5UVfjN0GmMeIlOd03d1bMbqTh5iF39O3xgqeFijj+q5piUI0c5t1qGTbyRLldh5gB0oaSZOuoJrmldLDFExLP1M6kSySjOktw24/3Bg97W2ak= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706005534750457.81282873657574; Tue, 23 Jan 2024 02:25:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSDxC-0000NH-Ro; Tue, 23 Jan 2024 05:24:26 -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 1rSDxC-0000N7-4m for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:26 -0500 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSDxA-0004cc-KL for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:25 -0500 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6db0fdd2b8fso1963398b3a.2 for ; Tue, 23 Jan 2024 02:24:24 -0800 (PST) Received: from stoup.lan (2001-44b8-2176-c800-b8a0-0408-58be-7d2e.static.ipv6.internode.on.net. [2001:44b8:2176:c800:b8a0:408:58be:7d2e]) by smtp.gmail.com with ESMTPSA id d8-20020a62f808000000b006d9ce7d3258sm11072408pfh.204.2024.01.23.02.24.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 02:24:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706005463; x=1706610263; darn=nongnu.org; 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=0EKsORzhcd/voY/5GCXD+0ZH5a0YI/B7BiYyHrdge+w=; b=yxQu3ZyMZCaD2wAE7x4g9Egl2XymqzQr4qaoPXv/KHXEsja4m1QApaZ7pTEcdOFUPV wYl2naZkkOsgMB2nYiEJsNYr2OCZYGU4k7VqPeU00Y/RbTfwSns6R8ADYqA7w2BbsAXa Y/jYOnF30P0+R+I1Uk5x2G2Nr1KsaS600DJPgXLVLkURViBPZ4T+bTsVRpDWDsAHmoWF tPXPjjVCJ4dWXn1x3RcAVjq3burNX9NR6yGgvbxpC0kGRE4JmKrJCQAjmOoKtalboj3T hPDvWEjWbFAPRseX43KlL5ENeM/dyaVkTQgDM2K1nZhTnrxfCsZKAw4jPJlimsIlWjuy l1Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706005463; x=1706610263; 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=0EKsORzhcd/voY/5GCXD+0ZH5a0YI/B7BiYyHrdge+w=; b=f3kNjJLRv0SCHR5PZvfT9cK6x3MRHMNWf20ZCBOGYpganuzRN5nPC6JemI0HPYyPHO RJuLQam/ZkiA69JyBGS8gCRQIGuaY7hSKRTGyceNAWB6BB2akVKEaiyMYHY25G32+Tgb va9PA63UEMlA/FPWQ8B7qz/XlXhM6xtRK09PWY73Sy6/HzMdMYK/uggg/XrP9enTjnml v3KBkFlNIzwBpejwE9iALhhjoP9r4FPDTE+ms7ckooOb0OJJg921StnuC/eg1+0mprTv ALgqfS4LI9P7PGaE9IDVgKbFIM4+/PhbZyMB+/c+UzLlQyWvonzKvtXuM1D8gvpzBo+o wN2A== X-Gm-Message-State: AOJu0Yz28xISiPtgIfuyNrVagV19oNI2wjI+amUE9qcvzxG/I0ZU15FV x6L3Mo11QW9vo4Sc4qL43FTOxWFDUHRAG/eXFPaErfpw7KXbOEBVHMZZ0h3+9u59nt7VtOiOEVf 7N6k= X-Google-Smtp-Source: AGHT+IFVTClaWd5fhBg8HC90hAnk276sCKk+j1+k7kVc3nWjf/DSMmUoWL0krVP9DDTZbsn9Zmvi0Q== X-Received: by 2002:a05:6a00:9281:b0:6dd:7ae5:9dd9 with SMTP id jw1-20020a056a00928100b006dd7ae59dd9mr487508pfb.3.1706005463234; Tue, 23 Jan 2024 02:24:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Samuel Tardieu , Peter Maydell Subject: [PULL v2 2/8] tcg: Make the cleanup-on-error path unique Date: Tue, 23 Jan 2024 20:24:06 +1000 Message-Id: <20240123102412.4569-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123102412.4569-1-richard.henderson@linaro.org> References: <20240123102412.4569-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706005536279100003 Content-Type: text/plain; charset="utf-8" From: Samuel Tardieu By calling `error_setg_errno()` before jumping to the cleanup-on-error path at the `fail` label, the cleanup path is clearer. Signed-off-by: Samuel Tardieu Reviewed-by: Peter Maydell Message-Id: <20231219182212.455952-3-sam@rfc1149.net> Signed-off-by: Richard Henderson --- tcg/region.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tcg/region.c b/tcg/region.c index 467e51cf6f..478ec051c4 100644 --- a/tcg/region.c +++ b/tcg/region.c @@ -584,7 +584,9 @@ static int alloc_code_gen_buffer_splitwx_memfd(size_t s= ize, Error **errp) =20 buf_rx =3D mmap(NULL, size, host_prot_read_exec(), MAP_SHARED, fd, 0); if (buf_rx =3D=3D MAP_FAILED) { - goto fail_rx; + error_setg_errno(errp, errno, + "failed to map shared memory for execute"); + goto fail; } =20 close(fd); @@ -594,8 +596,6 @@ static int alloc_code_gen_buffer_splitwx_memfd(size_t s= ize, Error **errp) =20 return PROT_READ | PROT_WRITE; =20 - fail_rx: - error_setg_errno(errp, errno, "failed to map shared memory for execute= "); fail: /* buf_rx is always equal to MAP_FAILED here and does not require clea= nup */ if (buf_rw) { --=20 2.34.1 From nobody Tue Nov 26 17:44:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706005497; cv=none; d=zohomail.com; s=zohoarc; b=SO0/Jj3FDjjAauPygzJdfTog4+WksfNmNoNbq8LmjWCIwsvlnLoqGKucN48L+VxbgSTOhCCjtZQrNWD6WNyzW1wOttJEtLdV/eEBL+ymR1zKdGAu338+z5kUxObTCs4Bg6AHNxygZdOKBqoTD/cd+jOS925qsTxV8VuHRO6xd1s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706005497; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=CJwQ5ZzhzO00+g0UGwDiX0qf7mCAm8ExrbTS/sZFCpk=; b=WjI4D+eC6hO8zyFiAwIXafWLajTE4+CQX7KXyGExhbLq452CPB9VRK/fz+loSFZAtR4GNJCTRAJcCnURr7jfEquNox09CicuoEGfoTMpQPcP1ILrYXJIFn0RixVW0brDySCQSD0DPa4f0/IQHAEcwBYLGKVuy2P+jXqP+w6Fa9Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706005497909183.87277611477487; Tue, 23 Jan 2024 02:24:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSDxH-0000OO-JH; Tue, 23 Jan 2024 05:24:31 -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 1rSDxF-0000Ni-Jn for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:29 -0500 Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSDxD-0004ct-GP for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:29 -0500 Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-6ddf1e88e51so3178686a34.0 for ; Tue, 23 Jan 2024 02:24:27 -0800 (PST) Received: from stoup.lan (2001-44b8-2176-c800-b8a0-0408-58be-7d2e.static.ipv6.internode.on.net. [2001:44b8:2176:c800:b8a0:408:58be:7d2e]) by smtp.gmail.com with ESMTPSA id d8-20020a62f808000000b006d9ce7d3258sm11072408pfh.204.2024.01.23.02.24.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 02:24:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706005466; x=1706610266; darn=nongnu.org; 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=CJwQ5ZzhzO00+g0UGwDiX0qf7mCAm8ExrbTS/sZFCpk=; b=wiw55JUkKxb5xsomSITLXgCKPi9KYKb6IFzsuwR0Tql8TdZSBa1BZxvpKdlcu1/2i/ RdTNxlnPh0WrSlm9Ma0czuaKYneKt8fBPgXY8VGSzSjJ48tEEQamGXs76n3SfrVMa8k5 LvhYRgQ+uITp0leEThapAYfLFBpfUoIPL+EAk4Az9Q3qFGLtiIeZ3Y0WbtsXCmNrngdv KGbcFv42/kRFKIVNQm92VdX60Lif522oVxoesYPH2fk8tuXs1JkGZYf1UYHCEqteAbBk sZzSttbqq5Eiiay11pQYnDWtrSlRPRZdkFYEvlV1Qu/ijZ2urwqUG3vgta//Hu3X4piJ VU1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706005466; x=1706610266; 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=CJwQ5ZzhzO00+g0UGwDiX0qf7mCAm8ExrbTS/sZFCpk=; b=ie2bAp2b233rw++bMA98DNTtHsu4+2iNyi1s85OpIuUN/u8JUx2YQNiV4Yy+QbFxnd nL56BmRdO1xntfHUyVrkJj/nKNAa4Ial4JIA+cLiS5mhZF+4Pck+M1i2g3yTzKxR3MUd DrmpoaUZ3HzaR8c5F3JzgIbdB9d56QmuBv0QG2Bjq6Btxds3NBo8iIMMjh8ZP2astRz7 Du2eIqbcUdQGr/hKcsj/StNwGh61dOVLsrwOH7Ex5RBwyWexYHPXQ7dtwkcl9LRIaAmO XukNhyYbve/uIJoa7PtNPA7+zIATENMqI0yyjWBDpObuto9SBM9zEGGJjjEJJzB9nefB zQ0g== X-Gm-Message-State: AOJu0Yyj+OkhLaGAQlDdXNKT90iz7A66Vhgls8ZPVBfsJMxWvBSTzJgo x3PUXo6Ybi37Jz4bdcqTKN6zzH+JjHwVqeUxvMPlDmER7UKFz9YI3z2uGEHeZVIBbI41BU0Cbia Pogo= X-Google-Smtp-Source: AGHT+IE2t0Uph2iLe4YGmMFrsR5ALkQCrhaqZ2uHsX3OqZLHi3OnMYqK1tuDvpraxwJxx5A47/81JQ== X-Received: by 2002:a05:6359:6241:b0:175:c293:68d0 with SMTP id sd1-20020a056359624100b00175c29368d0mr2665045rwb.60.1706005466146; Tue, 23 Jan 2024 02:24:26 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Robbin Ehn , Palmer Dabbelt Subject: [PULL v2 3/8] linux-user: Fixed cpu restore with pc 0 on SIGBUS Date: Tue, 23 Jan 2024 20:24:07 +1000 Message-Id: <20240123102412.4569-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123102412.4569-1-richard.henderson@linaro.org> References: <20240123102412.4569-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::331; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x331.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706005499792100007 Content-Type: text/plain; charset="utf-8" From: Robbin Ehn Commit f4e1168198 (linux-user: Split out host_sig{segv,bus}_handler) introduced a bug, when returning from host_sigbus_handler the PC is never set. Thus cpu_loop_exit_restore is called with a zero PC and we immediate get a SIGSEGV. Signed-off-by: Robbin Ehn Fixes: f4e1168198 ("linux-user: Split out host_sig{segv,bus}_handler") Reviewed-by: Palmer Dabbelt Message-Id: <33f27425878fb529b9e39ef22c303f6e0d90525f.camel@rivosinc.com> Signed-off-by: Richard Henderson --- linux-user/signal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index b35d1e512f..c9527adfa3 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -925,7 +925,7 @@ static void host_sigsegv_handler(CPUState *cpu, siginfo= _t *info, cpu_loop_exit_sigsegv(cpu, guest_addr, access_type, maperr, pc); } =20 -static void host_sigbus_handler(CPUState *cpu, siginfo_t *info, +static uintptr_t host_sigbus_handler(CPUState *cpu, siginfo_t *info, host_sigcontext *uc) { uintptr_t pc =3D host_signal_pc(uc); @@ -947,6 +947,7 @@ static void host_sigbus_handler(CPUState *cpu, siginfo_= t *info, sigprocmask(SIG_SETMASK, host_signal_mask(uc), NULL); cpu_loop_exit_sigbus(cpu, guest_addr, access_type, pc); } + return pc; } =20 static void host_signal_handler(int host_sig, siginfo_t *info, void *puc) @@ -974,7 +975,7 @@ static void host_signal_handler(int host_sig, siginfo_t= *info, void *puc) host_sigsegv_handler(cpu, info, uc); return; case SIGBUS: - host_sigbus_handler(cpu, info, uc); + pc =3D host_sigbus_handler(cpu, info, uc); sync_sig =3D true; break; case SIGILL: --=20 2.34.1 From nobody Tue Nov 26 17:44:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706005550; cv=none; d=zohomail.com; s=zohoarc; b=L2gDZlwxQloPgfKl9/NFI5zg+waUKfDr6G18FjilbTK1bY/efciiQc5C2CYpXOwBC+fgFn7it/tcqYS0SfMmmOaWg6UWqqkcG78hSyvn8ceJU2Uqh5iURNIEUcYaLmJfIv1uEnPAvaC25bxz1YI66xoNGowFO9w9+RdMhKnLZGU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706005550; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lU9aH7ZY0n7uAdgAxQsFLjxICAM1xx6kGJSgqsKuTsU=; b=Gwgy5R7UbGM/DqUxluRuj3mdF5enRN2jlvldJjHOe/2xTGNliUkFlbAf5L9N16lJcVl6tCwLb9TWtqtVJPAWxVH5OfbgI8X/779DzISfTdA4lXTDxryQtE6qkaTrdqIRBSS/bAB9DrKsULhOJ/HiSmd8jWjKmmx0gn/fEf70sbU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17060055505876.945342868881767; Tue, 23 Jan 2024 02:25:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSDxJ-0000Os-Il; Tue, 23 Jan 2024 05:24:33 -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 1rSDxI-0000OW-GA for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:32 -0500 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSDxG-0004dE-S8 for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:32 -0500 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3bd9030d68fso2540432b6e.3 for ; Tue, 23 Jan 2024 02:24:30 -0800 (PST) Received: from stoup.lan (2001-44b8-2176-c800-b8a0-0408-58be-7d2e.static.ipv6.internode.on.net. [2001:44b8:2176:c800:b8a0:408:58be:7d2e]) by smtp.gmail.com with ESMTPSA id d8-20020a62f808000000b006d9ce7d3258sm11072408pfh.204.2024.01.23.02.24.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 02:24:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706005469; x=1706610269; darn=nongnu.org; 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=lU9aH7ZY0n7uAdgAxQsFLjxICAM1xx6kGJSgqsKuTsU=; b=ClHIIabe9jdBX5l1dancxndVv4tsnIyEYyZYA3k1CGaAIgAW2qn9MogGwmF0fKFXql xVcYPJkG4KdKKexqBRla63+E596FH9yDN0tc64ZBql0YDTbbUk5mTAcoPfwVryk8yWxa xVPfU7at+7+Va2gniicAaALyvKYMp97UORiCaNA+Zt8HKXhNDvoKrI2d4zovDrcs13tZ ticVaZp8e4BacTBqHqGgaOyDXOpBvPO2zrRR7sY2FvGnIT4fgq5OWTqlXDa2s15jNYAv tLiwVY97CioNCZqoxS5tdjeNDI37xi0wBclA5NHBVa8l8oecsMod1Xxb9Fjm/pCxL8sE 46BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706005469; x=1706610269; 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=lU9aH7ZY0n7uAdgAxQsFLjxICAM1xx6kGJSgqsKuTsU=; b=Yt9re4UhD1vwpSNhbdHYwDxeJft5o/0SYFviJhbrLiTsQroqQa03EpEd2IOF0BEjPE 2EaXwKL6CA5DPBvEQVuG59JCkCpyzH6i52wWhXljmbsrkb0x765T24OocRdvWOi4ETiR 836XxBBy6/H2YMs8JyNqheu/1dh3zQ8QvG1FXt6HKpNaUPohys+6Cnx5Ehh4iE6Buedj HJerSMdnCHz9CugjCbKAURt2HWTN2lY6W2rW/qdGxy00UmJQusELMxBixomMIczYl1jb sGdEkJHVeItHN8/vhfRDSifEwMR1EafCJK+1Crf3+Tv53ctzjs/GxZpE6UxnSv1PHti4 RmhA== X-Gm-Message-State: AOJu0YyDH8abRGImdI6x67hAuv+lFTsEL1ZkiV4I48BYMm7nFCT9U/Jx M0G43EWSVtCgeKxEvZxta0OTGpUazyIhVmgKXWvJEgRI88/jyiYWLk/wQMgSXCwUAqQiPkhqvhk v8Uo= X-Google-Smtp-Source: AGHT+IGMv3XM0B+PZpvA1e6GdbfADmB4Z42FcPOZokGP+I0hzAU7gYDXgieyxcoP53uEosSAv5jiaA== X-Received: by 2002:a05:6808:1b26:b0:3bd:c997:4c55 with SMTP id bx38-20020a0568081b2600b003bdc9974c55mr198701oib.11.1706005469621; Tue, 23 Jan 2024 02:24:29 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Michael Tokarev , Thomas Huth Subject: [PULL v2 4/8] tcg/s390x: Fix encoding of VRIc, VRSa, VRSc insns Date: Tue, 23 Jan 2024 20:24:08 +1000 Message-Id: <20240123102412.4569-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123102412.4569-1-richard.henderson@linaro.org> References: <20240123102412.4569-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::230; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x230.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706005552140100007 Content-Type: text/plain; charset="utf-8" While the format names the second vector register 'v3', it is still in the second position (bits 12-15) and the argument to RXB must match. Example error: - e7 00 00 10 2a 33 verllf %v16,%v0,16 + e7 00 00 10 2c 33 verllf %v16,%v16,16 Cc: qemu-stable@nongnu.org Reported-by: Michael Tokarev Fixes: 22cb37b4172 ("tcg/s390x: Implement vector shift operations") Fixes: 79cada8693d ("tcg/s390x: Implement tcg_out_dup*_vec") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2054 Reviewed-by: Thomas Huth Tested-by: Michael Tokarev Message-Id: <20240117213646.159697-2-richard.henderson@linaro.org> Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.c.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index fbee43d3b0..7f6b84aa2c 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -683,7 +683,7 @@ static void tcg_out_insn_VRIc(TCGContext *s, S390Opcode= op, tcg_debug_assert(is_vector_reg(v3)); tcg_out16(s, (op & 0xff00) | ((v1 & 0xf) << 4) | (v3 & 0xf)); tcg_out16(s, i2); - tcg_out16(s, (op & 0x00ff) | RXB(v1, 0, v3, 0) | (m4 << 12)); + tcg_out16(s, (op & 0x00ff) | RXB(v1, v3, 0, 0) | (m4 << 12)); } =20 static void tcg_out_insn_VRRa(TCGContext *s, S390Opcode op, @@ -738,7 +738,7 @@ static void tcg_out_insn_VRSa(TCGContext *s, S390Opcode= op, TCGReg v1, tcg_debug_assert(is_vector_reg(v3)); tcg_out16(s, (op & 0xff00) | ((v1 & 0xf) << 4) | (v3 & 0xf)); tcg_out16(s, b2 << 12 | d2); - tcg_out16(s, (op & 0x00ff) | RXB(v1, 0, v3, 0) | (m4 << 12)); + tcg_out16(s, (op & 0x00ff) | RXB(v1, v3, 0, 0) | (m4 << 12)); } =20 static void tcg_out_insn_VRSb(TCGContext *s, S390Opcode op, TCGReg v1, @@ -762,7 +762,7 @@ static void tcg_out_insn_VRSc(TCGContext *s, S390Opcode= op, TCGReg r1, tcg_debug_assert(is_vector_reg(v3)); tcg_out16(s, (op & 0xff00) | (r1 << 4) | (v3 & 0xf)); tcg_out16(s, b2 << 12 | d2); - tcg_out16(s, (op & 0x00ff) | RXB(0, 0, v3, 0) | (m4 << 12)); + tcg_out16(s, (op & 0x00ff) | RXB(0, v3, 0, 0) | (m4 << 12)); } =20 static void tcg_out_insn_VRX(TCGContext *s, S390Opcode op, TCGReg v1, --=20 2.34.1 From nobody Tue Nov 26 17:44:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706005542; cv=none; d=zohomail.com; s=zohoarc; b=mHBC300ardtX5e0zaLODtTaxGlgch1pxj146aKO3VS49nP6nNPiZsVrGDrMxbvLkGTlz4Mo+87uQyp83uAbi7VZeST+6R3NTwk5EmUeg82FMav3zQiYM4HoDHu2OZVEMVrPdMijjrsBPIhVTkJAoselFmFhA+JWV9q5/E8xya2o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706005542; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gjWMZ9p5XTSuEC96EcRqyo4JXfEkDtPUT23udsatzbQ=; b=PPRE31ecR9oNQo68EPuzIrqgXQ5Z0YP1PtCow+/37/P2uZh1lDoDhiMOhrALOC6xMcYXXtqO0+WuHJ9HG+OlAlJDv8tpaf2knty2SAx4VlnXAd1cj1QFswNE6L/hYxYzvFX9sruhs02TG7QD9jyQVa3ODnvS8bek6hpuODqDBaY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706005542761736.2096212644101; Tue, 23 Jan 2024 02:25:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSDxN-0000Pg-3p; Tue, 23 Jan 2024 05:24:37 -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 1rSDxL-0000PL-S9 for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:35 -0500 Received: from mail-oo1-xc33.google.com ([2607:f8b0:4864:20::c33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSDxK-0004dZ-2h for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:35 -0500 Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-59883168a83so1438581eaf.2 for ; Tue, 23 Jan 2024 02:24:33 -0800 (PST) Received: from stoup.lan (2001-44b8-2176-c800-b8a0-0408-58be-7d2e.static.ipv6.internode.on.net. [2001:44b8:2176:c800:b8a0:408:58be:7d2e]) by smtp.gmail.com with ESMTPSA id d8-20020a62f808000000b006d9ce7d3258sm11072408pfh.204.2024.01.23.02.24.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 02:24:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706005472; x=1706610272; darn=nongnu.org; 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=gjWMZ9p5XTSuEC96EcRqyo4JXfEkDtPUT23udsatzbQ=; b=OCSbg8qf0HGuk00iTLaG6ofsvLUBr65RPSsmjcS8TAoUnxq/ftLRtfCsvKpfb91Ghd AtPjY3rro6VRviQq63uF8L/RebclLjuJPHIVXjiCYsvYEpMfuIt75XM4Hj2jkSQH/IWX Rzz1se5wZHoljFDipbEkaoprOD9L6NOS2k+rR9h6JbvdGuVHTa58adUWyy1Su1FLoAh6 c14DYdEe0iMyK07+udvrlSG6cegvYDxnNiBNqxrnWgc7AMvReDVqmEkSNSEIGA/qiLhn Ej23IFzI6NGGVoTAybkoa5bYNPrwowMxnbt03shuRUtXfXqzl68IZPtx0wKOmoZRegSB 7DBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706005472; x=1706610272; 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=gjWMZ9p5XTSuEC96EcRqyo4JXfEkDtPUT23udsatzbQ=; b=MB6kFjVKAWOev/WmE8/RFsOzqkKy5LVU66XJb+IFSW64tpqHbA198IzwwNuqSFOz3g 1T0MfFlua/b6hvfp6JsLqYtkFxQ2rp7JeUyDswrme236AWaJqapuFBKp7MiMu2KScpHi R0SJOL5s7Lvy7GC5tB1+/ZlWEngNm2eAH51ydu4xqTt/4Fg98r9XVoEsH3y9KCXE3EYj ZQ2MT7BAzs3kiUDFHhlpHPJlPUNglSyQqCTQ0HhDzbIGj2NiEYwS9fsMA7P9QT8vTfKM NfQu7K/rLMKYufC+HPKFI72zdVoW4qpJ4Cu7609v1rLUXN7QMAYhHwXbMdmRN9yhFp9G gDdA== X-Gm-Message-State: AOJu0YyC6EvLOLGGpGzGugKUJtuhZUwNYu9MCxWJilG4UufBe9oEtj/o eF0rdKQ4dM4gaveiUdYcWLQibpk73opM0RmsAL5UuUPU4vShNKK5Zxd3chkNDwihOBZa5Airmz1 qSC0= X-Google-Smtp-Source: AGHT+IEKZRqsVDebX6XTz+W8279Qs3dJ2OSCygo7NS8LbX0w9ViXZcR7mJMuQaGJ0hkn7sXOZRd6gA== X-Received: by 2002:a05:6358:524b:b0:176:40e2:8909 with SMTP id c11-20020a056358524b00b0017640e28909mr1705602rwa.27.1706005472634; Tue, 23 Jan 2024 02:24:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Vineet Gupta , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Alistair Francis Subject: [PULL v2 5/8] linux-user/riscv: Adjust vdso signal frame cfa offsets Date: Tue, 23 Jan 2024 20:24:09 +1000 Message-Id: <20240123102412.4569-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123102412.4569-1-richard.henderson@linaro.org> References: <20240123102412.4569-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::c33; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc33.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706005543922100001 A typo in sizeof_reg put the registers at the wrong offset. Simplify the expressions to use positive addresses from the start of uc_mcontext instead of negative addresses from the end of uc_mcontext. Reported-by: Vineet Gupta Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson --- linux-user/riscv/vdso-32.so | Bin 2900 -> 2980 bytes linux-user/riscv/vdso-64.so | Bin 3856 -> 3944 bytes linux-user/riscv/vdso.S | 8 ++++---- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/linux-user/riscv/vdso-32.so b/linux-user/riscv/vdso-32.so index 1ad1e5cbbbb8b1fe36b0fe4bcb6c06fab8219ecd..c2ce2a4757900a16b891bb98f7a= 027ac30c47a5f 100755 GIT binary patch delta 643 zcmYjPOH5Ni6ur|gwzc+9XhF0TMNp`GR6Zh~mKGzXLQ}j z)#}rFqIBkAs)(L%{#f{&3ii(}e_yh8Pgey7+LRKpj+~BYkcbM&LN$yL<+mtroa4HJ zZMB#&#N4vYgN#$Ed?)jGwn>u^j$uL6%5;@6#JIs26v~>`CEXn6`%uX09<>tLIBejZ zFY)AcUK{^`w8`*U60=3D@WX3@OR=3D)D9Xp?Lu9eduPPPr;Cc@g53huwxpgyD;B@WePiQ z!+Hz5CSkh?Bv5z*_UkB`K=3DC*n*Cd=3D*Q4&Y#73{u@vN7x##oicPmry ze%vHqR9p0zd0b`2Q|4;3R+vXr`7g}X=3D20v*GSM6w@2yKvwky9(Ht|*2WbKiW=3D;xN^G26tL(qVS~ E1D4W)y8r+H delta 565 zcmZ1?eno780^^#AispCEGBkVi#XS5FJ{d(y6ALK`0fjZ#F<&4uOCj9 zVB90Pf`x%0f`NfSh=3DGSe3rO=3D!e#$6sXaLm50TmSm(hNX850vi%q*ajQ?SOoV&8AHG zjA8N59(ymx)f3 z946aMv6*T$&0@OQ43n8gvkYeI&C!{wHBV!{+5(q_PELy)7TYbcS!%V+V!7E0la)rR z3|8x{(OIjtPGh~=3D29=3DFUn-n(7ZIRh3wM}BX*bb4MLc0WZ^X=3Di;%e9YVKO5Mwb2h(Z zS%t*xcjTq|2?Y1y{IoJiPMVG&Z%B2pwIB5I9(EFvNz z?)pL^MhuHse{pSyL_`lkFFpi~An2jTdJL*3ANrQJmv!LB`8el0AAG-~d%k&ezwB?w z2F6$=3Do7t~c%+g;}vY+2KKi``ijg36bKRDF->-VRR@qD&8Un;XH#&qseT&%$Rm2UT< z5wR{OC8yv~N7E5BABJ-bD-Xhz0JX&79!2Xuw2ffZFjf!2GYIbPUycy@b0)t*m;96aGkL08X> zzGUeUrG%_8_LX0>9{X?YDUqp`qVpeCm%D6~@^8O6!(HS))fFn#xbF-%SEEbG?2`}67j2EFQ> zo3}9LFfy7BQ|eju4WV! zVPs&i0SYMq=3D>Q<@1Ed)yJF+U*UjQfLI5JPe5rP#V`Xz00DDVP%r~yjRT`J z57PlQR)-eG#s?tWjs-3YofbJbEw)=3D?v(##t#d5P1CM%6r8LZY@qqA0P zoyK~#4JsRzHYseD+aj}7YMaD%u^l2ig?0(-=3DG()wmunx#evpSj4qh<1k!|y419kyW za5-|gGn!0n6rMbX!-TP6@k;>oa*G zP}TuWFGF&2M1Z-gk@Mz*obD`4Zx|+X@#%5GYydif&z`YjawDHTFrX$M;kzXAEcnEna diff --git a/linux-user/riscv/vdso.S b/linux-user/riscv/vdso.S index a86d8fc488..c37275233a 100644 --- a/linux-user/riscv/vdso.S +++ b/linux-user/riscv/vdso.S @@ -101,12 +101,12 @@ endf __vdso_flush_icache .cfi_startproc simple .cfi_signal_frame =20 -#define sizeof_reg (__riscv_xlen / 4) +#define sizeof_reg (__riscv_xlen / 8) #define sizeof_freg 8 -#define B_GR (offsetof_uc_mcontext - sizeof_rt_sigframe) -#define B_FR (offsetof_uc_mcontext - sizeof_rt_sigframe + offsetof_freg0) +#define B_GR 0 +#define B_FR offsetof_freg0 =20 - .cfi_def_cfa 2, sizeof_rt_sigframe + .cfi_def_cfa 2, offsetof_uc_mcontext =20 /* Return address */ .cfi_return_column 64 --=20 2.34.1 From nobody Tue Nov 26 17:44:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706005549; cv=none; d=zohomail.com; s=zohoarc; b=QaGfcjT3pXXswo7gGsMR7LMiRKaDjmbYSS2rGNjjBiBpNLZLTwgOz1LjBwYTdtoU1XSDfbpTFfiD8zxZ/Dnve2dNfp6LqX2LJIoEeFrbM3BcZCKX/jQOF6F8rhKzavoYF7SOfKO4a3yP/MI6zyTy7uioTG/xjThYs38E43Oo3uE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706005549; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=E554SzyD9ekZLsqgb3tmLUdyIwMdiLrTVwZboQHPuUo=; b=nz6+837Jlsc00mjm51sy9Da/kZ+Dis7vdD73FFVa8FvGHbVw0eLwUTjECLIC5hzxjviK9OimBwf1QlJUaB0sV1cciVAhi8b62J9OUz47PAzHXssqkEOLIv6Z/UGibtEkkO5Xv+yzYnNtapztBOjP6Nivkgf7ZfzNP5sMt8DrxI0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706005549329126.40082830499637; Tue, 23 Jan 2024 02:25:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSDxS-0000Qg-Fx; Tue, 23 Jan 2024 05:24:42 -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 1rSDxP-0000Q0-SZ for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:39 -0500 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSDxO-0004dl-9y for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:39 -0500 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6dd6c9cb6a8so301902b3a.1 for ; Tue, 23 Jan 2024 02:24:37 -0800 (PST) Received: from stoup.lan (2001-44b8-2176-c800-b8a0-0408-58be-7d2e.static.ipv6.internode.on.net. [2001:44b8:2176:c800:b8a0:408:58be:7d2e]) by smtp.gmail.com with ESMTPSA id d8-20020a62f808000000b006d9ce7d3258sm11072408pfh.204.2024.01.23.02.24.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 02:24:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706005477; x=1706610277; darn=nongnu.org; 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=E554SzyD9ekZLsqgb3tmLUdyIwMdiLrTVwZboQHPuUo=; b=Hh8uOy4QemhqM5K1zNY/TD39SOFkI/8kHXaUtvk2Qmz8vDe0sl1JCSxd2SXxNOX7kC iXJDz60jf5jzhSpGbeAHl+rPOZulhGZ6EUwVjs8jafpu0qNbsY+lSwVN+A1Yy7NRlc0r 2F3CiIFwZLBG4hzecQNPf7nVPY2QGaEL86+fswGQ/SjVMc93KGI2WX731ixC3EjL54Wd qcT+jZh74ciwbgXoC3kHghx/8vhbo89jj5PbYu74t91E1q4iI6xL8p9T15QqB8g4CpbV JKKILUwUKD9xiq8uPpHzPQjLUFSyt/1u8ZyqHo3z3WMGpZCDC3/uvDYzJ36NbGsRDhLa 4suw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706005477; x=1706610277; 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=E554SzyD9ekZLsqgb3tmLUdyIwMdiLrTVwZboQHPuUo=; b=nMwdMHmsLxznHJeEfaEAHghwUhRenfoPTcA/QXXK5jXItHCWlqcqp0QNAxhTdnKJBt 7SYeGiSrbbrOOa2SyBi6yd19beEwnEXRYoLztdbvCtzJOIyd6L7IYmE1b1EGCFw1HuHK MSxMBFgv7EGrGHQ+S+LqNVPUMr3x9VvIwbCYUEto+vjvi3TRXOJlQSFrftKy+kdFSaX9 StbY2W4Ui3AhaujeoQoKTerDSlaoygizcVki2A8NUPX720XWK49gaU3cv8dDXCr3MFpX sQuR3JYYn0CLMjFvnoABGHBuXXIQhNggbbbO9eU0kM+kWBI4XYDi/7Psj6xzt0H8RMj0 vlrQ== X-Gm-Message-State: AOJu0Ywim1YINCfD5JAryhOTSJ52KbobF1wYigrt3PabTpU234SS3qCE mXbrRi+mRJxCel1nNEkUVz96S81yz3h0BKM6GHRzzbBUfZhYmjdwP1E1dmpojD+yFBr9Zr3DvKx ilms= X-Google-Smtp-Source: AGHT+IFnc72Ezb/oA48Tuc+odgcgyC5HWoJuwyc4PEIkullDwBLzxgW6WM2G4GvObLitDAUtmgvlqw== X-Received: by 2002:aa7:9301:0:b0:6d9:8ccb:be1b with SMTP id cz1-20020aa79301000000b006d98ccbbe1bmr3684018pfb.29.1706005475273; Tue, 23 Jan 2024 02:24:35 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL v2 6/8] linux-user/elfload: test return value of getrlimit Date: Tue, 23 Jan 2024 20:24:10 +1000 Message-Id: <20240123102412.4569-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123102412.4569-1-richard.henderson@linaro.org> References: <20240123102412.4569-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706005549954100001 From: Thomas Wei=C3=9Fschuh Should getrlimit() fail the value of dumpsize.rlimit_cur may not be initialized. Avoid reading garbage data by checking the return value of getrlimit. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Signed-off-by: Thomas Wei=C3=9Fschuh Message-Id: <20240120-qemu-user-dumpable-v3-1-6aa410c933f1@t-8ch.de> Signed-off-by: Richard Henderson --- linux-user/elfload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index cf9e74468b..c596871938 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -4667,9 +4667,9 @@ static int elf_core_dump(int signr, const CPUArchStat= e *env) init_note_info(&info); =20 errno =3D 0; - getrlimit(RLIMIT_CORE, &dumpsize); - if (dumpsize.rlim_cur =3D=3D 0) + if (getrlimit(RLIMIT_CORE, &dumpsize) =3D=3D 0 && dumpsize.rlim_cur = =3D=3D 0) { return 0; + } =20 corefile =3D core_dump_filename(ts); =20 --=20 2.34.1 From nobody Tue Nov 26 17:44:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706005538; cv=none; d=zohomail.com; s=zohoarc; b=hrcaDISaAFcZukG7SNXFcQNHBpsvhMHRb4u7g8na6PlKshxiDWoSRChTx4c6vp5xudOuNtxUz+kUZ93AeC6ND5ndPIE5KDlVRbKG9FugtdNP4XKY1eMZ6BJlfaq7+bttSVvp3exiuJxPQdytwfEXE3O1qjUuAZJCZL6i7iYlNrE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706005538; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=McCaPLIJxvTbADv66BEO7sWToPqj2hCMM+otAiFa5d4=; b=S5x5dWAo4WQ9vTk3/uD7pHvWq+OI7xgZ3V7ikYYAU6JBLHiK9UI7ACMkWgMNtJLfe5TOTkBiXQ12OFKnai36Xt3eWz+dg65gg00AQz7jlhvZJq9PWZ5GpvheGOPkOAZ6Fq/1XEWLUHY4GEmf+RUY2auTa0XjEDVoWsEvdNiVsAw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706005538631864.151569459585; Tue, 23 Jan 2024 02:25:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSDxR-0000QJ-FS; Tue, 23 Jan 2024 05:24:41 -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 1rSDxQ-0000Q8-Ih for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:40 -0500 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSDxP-0004dp-0z for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:40 -0500 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6d9344f30caso2556378b3a.1 for ; Tue, 23 Jan 2024 02:24:38 -0800 (PST) Received: from stoup.lan (2001-44b8-2176-c800-b8a0-0408-58be-7d2e.static.ipv6.internode.on.net. [2001:44b8:2176:c800:b8a0:408:58be:7d2e]) by smtp.gmail.com with ESMTPSA id d8-20020a62f808000000b006d9ce7d3258sm11072408pfh.204.2024.01.23.02.24.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 02:24:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706005478; x=1706610278; darn=nongnu.org; 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=McCaPLIJxvTbADv66BEO7sWToPqj2hCMM+otAiFa5d4=; b=AQKv+fNArFTzeLgw7mDKhKdqnNm9cP0JQu4QCwk5UTbURygHnNhjDCEKUClHRjic9B rdTsPRLTyf2Rx3Pu6xMMT3Gz9DEBWB1EHxZsaXjeMTXypHOtG70W5uk/MnfqFJiRkGwy V4J24KJZOA11sNop/Bx8vM9Lopk9rtv49rNb+57s91phKK9T+jDde4tzEfkspLT1UXT1 hLHwoFLj3OcnYVkxHaI9DawFDLq8uEo/qhiHuy5yRpWPUgTIHnZdJ762Z9bSXs3tEAzO FOdocvJH8TSoLHEjzckUVQMFinvF/T15ptLA9CsjwiOuRdIu1YMJ9fXu0ITzsZ1tUe4J z+Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706005478; x=1706610278; 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=McCaPLIJxvTbADv66BEO7sWToPqj2hCMM+otAiFa5d4=; b=qBsBmmlT8fvMqm35Tn0taEhZN/m+jdBUFVRuGl33AlOr1wwB/HVwrB523DHZXLHuB4 k+s2o/Jv7i7NZUM0TWUiYGUG4fqEO6EMfrIzzhrm7KrQceLFs091nJ0ToXWQZMHc7LFb zvMfX3ZMbiqF4heelhPiJR5rof/Wd8dmYF/T4v2xIrOqM9iCMkyqr4RQfNulsyUHXnS1 JtP2HGEauuKxlmfL9VpMgFW0WmKo3V1cDHVzlfiDbm64Oad3Eg//f7ciqxBO/UgY7+lC 6nW6oaVFgAFuqutaak4taRa/9SKu+zQ7fjSK06/Qo1D4JvYxrvn1to6z7x1kybqmtLZs e8oA== X-Gm-Message-State: AOJu0YxNF/d3/K99CU/gx1Zste6L/VD6yqPZBG0YO+7+8ZvfuS+/f6w0 C4poTP3mzyhLNVWkRgbwSbohRsGxg4k5ABbGGJDWLJuMHfIqvvVEsEUoqNfuijidHkAQAktn4rH 8NJY= X-Google-Smtp-Source: AGHT+IFG63a/PFhuWVxUEhb9qe/0tUlKvJr3xTRvIjk+1oY3X3bFH6u9zHzH/1F7kvUtT/b0TJu0MA== X-Received: by 2002:a05:6a20:4329:b0:199:89a0:9f2b with SMTP id h41-20020a056a20432900b0019989a09f2bmr6537956pzk.26.1706005477681; Tue, 23 Jan 2024 02:24:37 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL v2 7/8] linux-user/elfload: check PR_GET_DUMPABLE before creating coredump Date: Tue, 23 Jan 2024 20:24:11 +1000 Message-Id: <20240123102412.4569-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123102412.4569-1-richard.henderson@linaro.org> References: <20240123102412.4569-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706005540083100011 From: Thomas Wei=C3=9Fschuh A process can opt-out of coredump creation by calling prctl(PR_SET_DUMPABLE, 0). linux-user passes this call from the guest through to the operating system. From there it can be read back again to avoid creating coredumps from qemu-user itself if the guest chose so. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Signed-off-by: Thomas Wei=C3=9Fschuh Message-Id: <20240120-qemu-user-dumpable-v3-2-6aa410c933f1@t-8ch.de> Signed-off-by: Richard Henderson --- linux-user/elfload.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index c596871938..daf7ef8435 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -2,6 +2,7 @@ #include "qemu/osdep.h" #include =20 +#include #include #include =20 @@ -4667,6 +4668,11 @@ static int elf_core_dump(int signr, const CPUArchSta= te *env) init_note_info(&info); =20 errno =3D 0; + + if (prctl(PR_GET_DUMPABLE) =3D=3D 0) { + return 0; + } + if (getrlimit(RLIMIT_CORE, &dumpsize) =3D=3D 0 && dumpsize.rlim_cur = =3D=3D 0) { return 0; } --=20 2.34.1 From nobody Tue Nov 26 17:44:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706005557; cv=none; d=zohomail.com; s=zohoarc; b=hqZg8a0fl+eONkrVRLUAOYa+DOe1cpDdBi+wsoiwwDOLNEGWEukFknTV5t05b+vj5YywKjUfU5scwa2Nfs2QEZ1BXYSPGGHLlTpuXgKYiFhxBQb3wChFkTnf9f/tnj8izSlgzXrO+ldd1W8TJ0bxnp9qLEvWfBSxzGCP3t0nn1c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706005557; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=oG4pU7qednB+jbhj9CwzPfU2NfzR3Eb/S1PuscRboM8=; b=aIUhE6T/8cCpwYdm1LRPlBg9GK4qfveUiZ+T/MacXuT0bwMR+v2hiSrAfZrhtsN5MEPzi+v1lZ2aPIECLZkoWwJsHKUJ4hoVeIAUv7SBX57EGgvC1Cil4SOhjqSfCtlL1aykF0JdtsFOKfcIbn2BxhwIzkpCC+n0ZFFmh3ikLYQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706005557167893.1366058971796; Tue, 23 Jan 2024 02:25:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSDxT-0000RB-Tj; Tue, 23 Jan 2024 05:24:43 -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 1rSDxS-0000Qh-Hu for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:42 -0500 Received: from mail-oo1-xc2d.google.com ([2607:f8b0:4864:20::c2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSDxQ-0004e0-VV for qemu-devel@nongnu.org; Tue, 23 Jan 2024 05:24:42 -0500 Received: by mail-oo1-xc2d.google.com with SMTP id 006d021491bc7-599a95e3fceso114238eaf.1 for ; Tue, 23 Jan 2024 02:24:40 -0800 (PST) Received: from stoup.lan (2001-44b8-2176-c800-b8a0-0408-58be-7d2e.static.ipv6.internode.on.net. [2001:44b8:2176:c800:b8a0:408:58be:7d2e]) by smtp.gmail.com with ESMTPSA id d8-20020a62f808000000b006d9ce7d3258sm11072408pfh.204.2024.01.23.02.24.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 02:24:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706005480; x=1706610280; darn=nongnu.org; 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=oG4pU7qednB+jbhj9CwzPfU2NfzR3Eb/S1PuscRboM8=; b=sw6mEeSYC48IuXb4k4Iz2grHSEw+Qg0n+eNpF1ZaQ6FBVRuC4XiuPhWjHjILiYyvOd k8L8Fxauht/wJb088Y2YRyn55u/qd/ESFRzwb60Pxzo0fxrtxud8p/NySgdiJSIjoZQG bsp9A40LWdemoeagXg2zKqMvEugkOCDxRg9aKDNqoaZPEcHb8MJAH65Mx6CYT5p/+hlG sMZWu+ch0UU5wQXZsH/Ccwe5gVSytqUm18XN/x9Onx9XP9DyH5+n4OHDdiWiVGp85lc3 Bf94IcdKFxHBn3d2hbEH80ryd1rf/kJi6A5x6ks8/cJmm2Jlb/FRJMe/rifotlvO/ojR AGwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706005480; x=1706610280; 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=oG4pU7qednB+jbhj9CwzPfU2NfzR3Eb/S1PuscRboM8=; b=BzewXAK2j2PjnMyzH32/rzvnVIkKM/EkBGpkhPQqjMPCSRfxVH3KFK0Gee0gvbbYID x4bY3S3IlXWsz1Ul3LcXpl4jIc6MosqmRfb0c5bAUB3pVyKSUelSsSMGO7xtTv8OTG2L t7MxNaWdj40ahMn2bLBdUjSVBnXFF5OJRhHfdykx7AgXe/7wWfa4XJE88Sq6DXzXnota Shg7OpFrxazfLESm7705lQME9ODm4e/v/CF/fX3OihHjiDhNzHJniF+JfBCje3ZVA8vV eYBdSXCzkDbF3ZsBqfFdCwjKP12/ddM7aYt2yVc3gM/CS89i1Gl8+3wxg+jOyzOvXPXA IVzw== X-Gm-Message-State: AOJu0YwgPppI3EzDVJklOX7QV8DDXua3pL+U3D2nPIp99boTgUcsGBmT HiiKIln9ZVHvHkOJ+H+yJmhnawijK4QqYlvEOLaANnpqkRFFOYWgf5IYX/mnNStA9ii+M3AkrwI idUw= X-Google-Smtp-Source: AGHT+IGHfdovhrTxr/GMvwqWofqOPiV6XNwKXYCA9NecYBxJ/NhK0HeXCXEhZ5lPAYYeUsg99hhJGA== X-Received: by 2002:a05:6358:d044:b0:175:b71f:6178 with SMTP id jb4-20020a056358d04400b00175b71f6178mr4543150rwb.32.1706005479827; Tue, 23 Jan 2024 02:24:39 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Joseph Burt Subject: [PULL v2 8/8] tcg/arm: Fix SIGILL in tcg_out_qemu_st_direct Date: Tue, 23 Jan 2024 20:24:12 +1000 Message-Id: <20240123102412.4569-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123102412.4569-1-richard.henderson@linaro.org> References: <20240123102412.4569-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::c2d; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706005557985100001 Content-Type: text/plain; charset="utf-8" From: Joseph Burt When tcg_out_qemu_st_{index,direct} were merged, the direct case for MO_64 was omitted, causing qemu_st_i64 to be encoded as 0xffffffff due to underflow when adding h.base and h.index. Fixes: 1df6d611bdc2 ("tcg/arm: Introduce HostAddress") Signed-off-by: Joseph Burt Message-Id: <20240121211439.100829-1-caseorum@gmail.com> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.c.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index fc78566494..a9aa8aa91c 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -1662,6 +1662,9 @@ static void tcg_out_qemu_st_direct(TCGContext *s, Mem= Op opc, TCGReg datalo, } else { tcg_out_strd_r(s, h.cond, datalo, h.base, h.index); } + } else if (h.index < 0) { + tcg_out_st32_12(s, h.cond, datalo, h.base, 0); + tcg_out_st32_12(s, h.cond, datahi, h.base, 4); } else if (h.index_scratch) { tcg_out_st32_rwb(s, h.cond, datalo, h.index, h.base); tcg_out_st32_12(s, h.cond, datahi, h.index, 4); --=20 2.34.1