From patchwork Tue Feb 27 18:48:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 776273 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp308253wro; Tue, 27 Feb 2024 10:49:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWJdTvn/oLlErzgGoKVEr3H31iKC/prDbNkiQs3177OhsMGldRIds4k7tRRvaxLJX9vdatiUs4cJyM4JpsnGiqc X-Google-Smtp-Source: AGHT+IE/n3V45wNWIZkU12uRh1xlB6OibZakNpTpEs4HDLNpuMOXZiKiU1fweqw+RhMTHGDewMst X-Received: by 2002:ac8:5807:0:b0:42e:74a8:592d with SMTP id g7-20020ac85807000000b0042e74a8592dmr10038644qtg.41.1709059750389; Tue, 27 Feb 2024 10:49:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709059750; cv=none; d=google.com; s=arc-20160816; b=0e22oiLCRcDxXnP0Lke0Scjm1Oado348U2YBldKvale6QmU1vwZkG2BP1/S+6++z4S RAVc4RbDoVR/T9Rjo4AA6KoxY58AEFfieVzdEwrG/qbnZMyAFz9sa+wZWErFR6EuZisO bUVrIFmuIKl3PwxYnNrRJGn/fgXlY4BwqvH8vuGDLAcdC7Z4+5NzeA52QFAcQ809bP18 x2oiBf9n1yR1bqeRnVHrbW5eTWj+2A+agyNDntPjBS16XPiWSObOmrI4DIcEjYHXIIhh Er9zcg1LvvWm0Iu/qmUfiamK8H04ohYsddziVnlnPuDteLq05RkXbPF3HLSRYS+TRCgU 1e3w== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=e9+eTESZCMSFYJ8iDTWx5tX4AIfT8tMIe2dsYwY0Y98=; fh=Vvliz9ENSk/yCY42nG87aL5dW+Zo0lduSx74U3lH2V8=; b=FpUFn5QsgrkbMLCcFeyY6XC2FWuxBBBS12Q/6vrXWjDdnHxGsguKvlaTxfc1QF+2d4 eHHKDkQW78UglIXUK0kaqFFSuV/Rce8F70JRhNSieOJ1AQLdX2xJOX0Eso1Uq24QU/BS h4b55ClHeGQy9imcmpRUhKJlz/rJhpAFN24vvJsyJNtBJyC8HpUsGelF+PYou0JARlmW 9udJGx76hjqQzzhboDZ0qv/E7gywBgjoXv1y/0MotAtxuDufkSdV33ovOrL6HrzWAZ7A RSKp2UTzfYVizFYiArcJks7dLuRCoRZIIL5SKVEjNVNnSjHagcvYyV4KBiO7xoyN9c0G sxDg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D6FFqtGU; 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 t15-20020ac8738f000000b0042e74a4a8acsi7617527qtp.252.2024.02.27.10.49.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 10:49:10 -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=D6FFqtGU; 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 1rf2VP-0006VR-Gl; Tue, 27 Feb 2024 13:48: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 1rf2VN-0006U3-62 for qemu-devel@nongnu.org; Tue, 27 Feb 2024 13:48:41 -0500 Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rf2VL-0001SJ-J6 for qemu-devel@nongnu.org; Tue, 27 Feb 2024 13:48:40 -0500 Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-6e4b03f0903so333957a34.3 for ; Tue, 27 Feb 2024 10:48:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709059717; x=1709664517; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=e9+eTESZCMSFYJ8iDTWx5tX4AIfT8tMIe2dsYwY0Y98=; b=D6FFqtGUTmZOtYIH01UsW1J5kUk1pF/+ps3mUYxeCsZGODUPHb9huAVIH3+rmcQYCE 6eS0zHcHNiB4CLO2AUlL/T5x80nwoFn/56+/N9e/RsPp7qfOX+cLQM0tatXKktcXobdn X2Jci+9pPRGSm7h6y9ErxWhESCc7qGUGxSc6PM/ZMQGPBXbbYtBoWkHp+xSM/ZclCSaQ ITUTz3AgN1CgR/N0y//WYtVJhvXIVLHnPcS1GcoiJ8kHfTWw5OTqtVTaFs/Qe66qB4PA vsii0DUjmUS6BvEZZM4kOAlWwUOh+byajXGjIBv2BGVTNkDB0DHHS305KNXRQ/KW3in4 NNAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709059717; x=1709664517; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=e9+eTESZCMSFYJ8iDTWx5tX4AIfT8tMIe2dsYwY0Y98=; b=wjEXluAL55NcBMVBEvcFjSnPIDsRPCU8304tkLSJV1Gxxss8I8Ci8vWpB7Mh3GFHQ9 raC8M/RlPg+uT/+U6zzx732oIAaBaNMUq+32AOZpCvLCwB/gfdhs8Hqify8qj7pLhIdh 169Ihq8lhVaWimB3FV4uVY7/emYFBbLLTldIEFJlizbShBjCCIbN87zwDWR9YNyI0Gix VYiIkij3jk7P/9RuCYUL9XVc8elBxqvMP9seuG1KwFhippeZxAnRti0J7RLdxrs6Z64f uiU6bHy1li85mq03bYMWu4ddGdsH0qORzKef/nfUcPkpxp0TKHUokXjl+luqYwbKDLoB p9Xw== X-Gm-Message-State: AOJu0Yw6bXge5n4SwFwrDDhIG2OjA3dBFCxSyRJiJlMx3be5KVek382/ K4S6/vy7Fobsk5DJFrnPKQa0kaFDfRdksB57Cv02X9krqDbJ4SZTnGz4V+1a8IPd0SLjYcyAIOj 2 X-Received: by 2002:a05:6830:3495:b0:6e4:971d:942d with SMTP id c21-20020a056830349500b006e4971d942dmr9351352otu.3.1709059717106; Tue, 27 Feb 2024 10:48:37 -0800 (PST) Received: from stoup.. (098-147-055-211.res.spectrum.com. [98.147.55.211]) by smtp.gmail.com with ESMTPSA id h26-20020aa786da000000b006e555d40951sm533465pfo.188.2024.02.27.10.48.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 10:48:36 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org Subject: [PATCH 00/14] linux-user: Rewrite core dump Date: Tue, 27 Feb 2024 08:48:19 -1000 Message-Id: <20240227184833.193836-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::32d; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32d.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 This started simply to remove the two page[TARGET_PAGE_SIZE] instances. These turn into variable length arrays, when I start to allow the page size to vary for linux-user. However, the first thing I noticed is that it is silly to write out target memory to the corefile page by page. As I started to clean that up, I noticed some actual errors in the writing of notes. Finally, we can stop creating local data structures to represent vmas and rely on the ones over in user-exec.c. r~ Richard Henderson (14): linux-user/elfload: Disable core dump if getrlimit fails linux-user/elfload: Merge init_note_info and fill_note_info linux-user/elfload: Tidy fill_note_info and struct elf_note_info linux-user/elfload: Stack allocate struct mm_struct linux-user/elfload: Latch errno before cleanup in elf_core_dump linux-user/elfload: Open core file after vma_init linux-user/elfload: Truncate core file on open linux-user/elfload: Lock cpu list and mmap during elf_core_dump linux-user/elfload: Size corefile before opening linux-user/elfload: Write corefile elf header in one block linux-user/elfload: Write process memory to core file in larger chunks linux-user/elfload: Simplify vma_dump_size linux-user/elfload: Rely on walk_memory_regions for vmas linux-user/elfload: Unprotect regions before core dump linux-user/elfload.c | 721 +++++++++++++------------------------------ 1 file changed, 221 insertions(+), 500 deletions(-)