From patchwork Fri Mar 1 23:05:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777075 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1600771wrn; Fri, 1 Mar 2024 15:07:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVPHAYC5OHO+WCt2ED9miQ2iLg5iJIknAWV7vFOVUfUFQdBu14lOP1SS6JjSI4Tf+8ZBV9zsATH6ZvtKuEwSO/w X-Google-Smtp-Source: AGHT+IEOyGHCbq3nKd5txB6lrlKIL72+y02TD5a/cSzk8fyBu4wVIM7HjwSxVS3haA0K3XbxXYCc X-Received: by 2002:a05:620a:1786:b0:787:e42f:124a with SMTP id ay6-20020a05620a178600b00787e42f124amr3901837qkb.36.1709334425516; Fri, 01 Mar 2024 15:07:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709334425; cv=none; d=google.com; s=arc-20160816; b=KeqXseTAFAJ5QA1N9DUryTzFylj+3xReXWlqv46kRonmmsiSO8NhBHyHR/9bzmjz6v 9EvKpimud0j8Yf1ovhEG0FmAiKsix9a8M1O+MBAhWnB0miJ0WXtChbBP4yS9XXjp6mn4 TogeutfHSQXH9pJtgoemAuf+gb68/Hn4BC480KECL1vSZNvnGWWGrouNOBEy2b9tV0rt ZpNj3GgTDf6gbLK//3rg0CSqyqXuHmzFjseHH+/k3g8F2FJce7UWMFsoRkP0osu6MQap +pyD6+D4tq7iXTB11GXLtQR9PQr6DxEdoosz9USlbz+YcpEQjKBtYCHXzfy+zpqMKV0q 8ftg== 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=c1WCKXawMTZMOrVqL/DhlUtKi+hfbHIEOTuyKivWJBk=; fh=eu2DY09p+eeddYDiV+DalJS3Vr0kxK5BujclYkgWvDw=; b=QbxuI/KuaFp9M4VvfcCff+L/5YNNP3YrCEBUgtoOdZUDrOkOdOtA9pItXueN5DbL2h lIOGB6IIM4OXOzyoNp8EyX359osCoCKMpgBt+cGpUUfG8xZCiZR8vuYGU/QisZCO1Orb xP0EtkJBU6RpV17QTjF4d0HfQLRyg2aKBln3XhYSdO9xqtoaPC0aJbeCcmlZza7dF0wB jWk6jKsTq0HxmLYFn95KqQ+GkGgP6v2beOAQHT36B2M2HLFBok+QiXV/janAJfFMpSUs QwvbQJw2LNXRHXQRqGD46FqD+mapf5bDsccIDSvID8FYuJfaHTO+PxmZE01L6T0wEAzP Xcsw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q5IUtvV7; 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 bi4-20020a05620a318400b0078819a3098csi185929qkb.372.2024.03.01.15.07.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 15:07:05 -0800 (PST) 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=q5IUtvV7; 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 1rgBxY-0004qo-Te; Fri, 01 Mar 2024 18:06: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 1rgBxU-0004pm-9P for qemu-devel@nongnu.org; Fri, 01 Mar 2024 18:06:29 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgBxS-0004CK-Se for qemu-devel@nongnu.org; Fri, 01 Mar 2024 18:06:28 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1dcad814986so23696845ad.0 for ; Fri, 01 Mar 2024 15:06:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709334385; x=1709939185; 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=c1WCKXawMTZMOrVqL/DhlUtKi+hfbHIEOTuyKivWJBk=; b=q5IUtvV72ltONvA3wjmO4J7+0yBxTs4zRFqXZl4BD/GD3U9BYvy868l+ZkjzERNZVX 3Tn14kD9Vi+5M1onqgkdTEmX0b7/7xicBlQRu7dw9BLgj4gMmpp5t2U/rnO+3z5zyKko pYj4aDYnmyFG5lfyh88P/kzFVmSeqjYncCFLkNHrVac6B5MBykgOwr0071Gp3QWBYFMC aG6wlGO9kSWmibvrseAOD7i30yV3QaZY0Fb6UWNDPlBkAnVkb8sBAEq7uDTxjVmAbO/S IJFMSkGqJS+JNq7p/XkYmncmfddaYzwXFFXbYFVAT3zYRduNiQ/clIUrC7smyEWHa8bJ oPBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709334385; x=1709939185; 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=c1WCKXawMTZMOrVqL/DhlUtKi+hfbHIEOTuyKivWJBk=; b=UQQoSRWgEw/KWyihMfH4nVvVZfZ+HpR6TQyWFubYJQJznqvfOMjJ2VWOlwxLDnbdlB USiwigGG5NBtGBgZdAoeW6Gec+uwNMqfTu2BubnPl9N4vV613ij9EyVDlxuzAWT5FQXn R0R8X3nrOilLDYuMveUR5QOcf7XkevUp6EF96+ixKDeW+OE9neQF8Gtg3NtK+pUENaUW M2yzfUuBbZbUY4AF76LAsoCc7OwcnxJMyEF26Hf+3Gq+ppRgoGpikwMsmX/V5+aRfNgh Xa5HFeZL/Od0cmbZdN90JlT14SSxjWVaUr3HX4HLOZnnzG26kf5ZlAZjpPExQUbOUoH7 6ryA== X-Gm-Message-State: AOJu0YyZ6as8eJzixMQY1uFWww6S1kzVsjsF3a+Dk9GKcYoWpGSwNfcn WfyZ22aeoFFGUxYEwE/cI8usZYFQQQsRIhjS7zqd6pDZAx7l2beWEPzSHUCBVkew9LrVwMh4/pR k X-Received: by 2002:a17:902:d58b:b0:1dc:b6bf:fae8 with SMTP id k11-20020a170902d58b00b001dcb6bffae8mr4337694plh.59.1709334385266; Fri, 01 Mar 2024 15:06:25 -0800 (PST) Received: from stoup.. (098-147-055-211.res.spectrum.com. [98.147.55.211]) by smtp.gmail.com with ESMTPSA id lc11-20020a170902fa8b00b001dc668e145asm3988580plb.200.2024.03.01.15.06.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 15:06:24 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 02/60] linux-user/elfload: Merge init_note_info and fill_note_info Date: Fri, 1 Mar 2024 13:05:21 -1000 Message-Id: <20240301230619.661008-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240301230619.661008-1-richard.henderson@linaro.org> References: <20240301230619.661008-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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 Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- linux-user/elfload.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index fb47fe39c9..7b3a2c20f2 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -4514,16 +4514,6 @@ static void fill_thread_info(struct elf_note_info *info, const CPUArchState *env info->notes_size += note_size(&ets->notes[0]); } -static void init_note_info(struct elf_note_info *info) -{ - /* Initialize the elf_note_info structure so that it is at - * least safe to call free_note_info() on it. Must be - * called before calling fill_note_info(). - */ - memset(info, 0, sizeof (*info)); - QTAILQ_INIT(&info->thread_list); -} - static int fill_note_info(struct elf_note_info *info, long signr, const CPUArchState *env) { @@ -4532,6 +4522,9 @@ static int fill_note_info(struct elf_note_info *info, TaskState *ts = (TaskState *)cpu->opaque; int i; + memset(info, 0, sizeof (*info)); + QTAILQ_INIT(&info->thread_list); + info->notes = g_new0(struct memelfnote, NUMNOTES); if (info->notes == NULL) return (-ENOMEM); @@ -4665,8 +4658,6 @@ static int elf_core_dump(int signr, const CPUArchState *env) int segs = 0; int fd = -1; - init_note_info(&info); - errno = 0; if (prctl(PR_GET_DUMPABLE) == 0) {