From patchwork Fri Feb 24 07:38:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 656245 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp763535wrb; Thu, 23 Feb 2023 23:40:05 -0800 (PST) X-Google-Smtp-Source: AK7set+vFrNu/HdpuLabdkyp7vqX/oxxO8he8SApiKWLVTlUSn1DN04GIRLc2+Ef77h0SIQOspMR X-Received: by 2002:ad4:5bcb:0:b0:56b:f1f7:c67f with SMTP id t11-20020ad45bcb000000b0056bf1f7c67fmr25452745qvt.6.1677224404998; Thu, 23 Feb 2023 23:40:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677224404; cv=none; d=google.com; s=arc-20160816; b=PlmThRFlXOdgxUARWHDBPfv7EhhfOyJevD3XFcu6wOaaOChqpVzmJElZupmnpOqHeb VEDI/LVTbZsOut5XoE3jn40WhqVI0B5JoJpXnJq7XaUItgAlEPh4O8xNgWPav484I9bQ 9Yli4Ke5tQbF0rkv6vghpDRIjPnbSBrKxezaO02lRkEdv8lyp9cj3r4FsFk2LoaiRWwr KKqY8UzxgmGwDgxG9hgj3MXxOOpqprxVvbK42EMD+lEW5wcEI3GJMECxHZ0KCc0ggWlw oQn6r/00l/wBcAiVzeVnkJY0DQSTSMmte7AZ82MFWn4mOTo1pgL4urc3jUcNgVhZZ0D3 k2iw== 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=bAATd33pSc/j3eZSZHA0QRA2qTENQnY0OI3ynPM+aM8=; b=mQfIpvt+P5rUtBpg3hgjfgQtBsi9SOqV8YiG08nMjig33dhlZsfGFRIL1hw63Z5eWq cwNwq66CwV1raDd4U42zzImBobuD7n1cxNVLpX3sOMaf2oF0vTAXrx7oEJz0MlHPMJ/Z 5xv5YmYR/COEFTjt95FkY5aXsD+YjfjVdEYcw9jHh1aATBI3CrzDy1gYtjklsyM7FL7R 56AutE65E8a2TsW4WxnwPz3eCF9dUmvIYT8GMgBNRzOFaREeLctVcXb7N/nLsqUtQdir eb6g+xrPh2GkfUdIhhKh19PSLvA4Eri6tXGtvPbzOjEC+mwOOZ2xlEClRWYKINelJeFh NUXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iZu9TK+4; 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 i1-20020a378601000000b0072bada6129bsi5292914qkd.625.2023.02.23.23.40.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Feb 2023 23:40:04 -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=iZu9TK+4; 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 1pVSfX-0006TQ-Js; Fri, 24 Feb 2023 02:39:03 -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 1pVSfV-0006T5-Sw for qemu-devel@nongnu.org; Fri, 24 Feb 2023 02:39:02 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450: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 1pVSfT-0006nN-FU for qemu-devel@nongnu.org; Fri, 24 Feb 2023 02:39:01 -0500 Received: by mail-wr1-x42c.google.com with SMTP id c12so12958189wrw.1 for ; Thu, 23 Feb 2023 23:38:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=bAATd33pSc/j3eZSZHA0QRA2qTENQnY0OI3ynPM+aM8=; b=iZu9TK+4KhrU2gs88QFvqTwwRzk4IABfC9EUw85/XnoDvjXWQaczw7HGHj8/aHdXd0 YoWFE9FouxfoQSB2FjCkzEVq9zBZEf0TeN7rcvyE4DoYQWuMrXTnEXdrZDvDKfg6VYPK 9pjRUK9iTvRQvjoc2gT98g4PN5cm47epG4a6939pyDhlHGUJflEgTc6Dyy7q+g83+KaA bHHMHf0WL02bXDCFYjsUyiP0EolkTJwPu8Ahbkz45EVOvQVi27eB4j5klR/qzH75gVZb TItq6RvoWhneN/+V/mIzYfP80YxIwsGy4LVJ/lxdJ6ZRcXo8RmsypJnZIutinxC/r60V Gong== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=bAATd33pSc/j3eZSZHA0QRA2qTENQnY0OI3ynPM+aM8=; b=KQyu0kwNG3vjlOjDxQ9wXZ4uVY1pFem8SWsEMAe+0NxcbrWVrTcRxlbToHfOX0duWg xQjGiuMhPLuU4mz+9VF+VM2uysTwb/bP6WfbFWavSe1jZkd3OHdGiAXkLIH/bJqd7/xP ox6Ij0UUlKYMsDyMq92FH0rlvru9aP11b/0WCpn7R3xMhTmJFhTE5IZxS74q0aX3+9nV PsP+RWKLDs709oHCQwEmRZletKJ/pL9bK1bi9QvMmiDrEwMoCO7zGLs2xlVHPT0cfv/H 7ltvuIXQ4QWqEbdhJ9vCKKYyjUSjH5h8IM4J+30e3nEt/EqzV3gxXB45QA0VpMbpPCl6 s7+A== X-Gm-Message-State: AO0yUKWSGFrWHTQYaMoElJFVNn0+hYia3joYBfGy6FoMppWgW+bBhzgD jpNlsHvy95Nmt2lGQKFejvawerhcPn1EdK9n X-Received: by 2002:adf:e788:0:b0:2c5:585e:334f with SMTP id n8-20020adfe788000000b002c5585e334fmr13488638wrm.41.1677224337330; Thu, 23 Feb 2023 23:38:57 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id d10-20020adfe84a000000b002c71d206329sm918169wrn.55.2023.02.23.23.38.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Feb 2023 23:38:56 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Janosch Frank , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v5 1/5] dump: Replace tswapN() -> cpu_to_dumpN() Date: Fri, 24 Feb 2023 08:38:46 +0100 Message-Id: <20230224073850.84913-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230224073850.84913-1-philmd@linaro.org> References: <20230224073850.84913-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-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 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 All uses of tswap in that file are wrong, and should be using cpu_to_dumpN, which correctly tests the endianness of the output. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- dump/dump.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 279b07f09b..7101169ecb 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -907,13 +907,13 @@ static void get_note_sizes(DumpState *s, const void *note, if (dump_is_64bit(s)) { const Elf64_Nhdr *hdr = note; note_head_sz = sizeof(Elf64_Nhdr); - name_sz = tswap64(hdr->n_namesz); - desc_sz = tswap64(hdr->n_descsz); + name_sz = cpu_to_dump64(s, hdr->n_namesz); + desc_sz = cpu_to_dump64(s, hdr->n_descsz); } else { const Elf32_Nhdr *hdr = note; note_head_sz = sizeof(Elf32_Nhdr); - name_sz = tswap32(hdr->n_namesz); - desc_sz = tswap32(hdr->n_descsz); + name_sz = cpu_to_dump32(s, hdr->n_namesz); + desc_sz = cpu_to_dump32(s, hdr->n_descsz); } if (note_head_size) { From patchwork Fri Feb 24 07:38:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 656243 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp763489wrb; Thu, 23 Feb 2023 23:39:57 -0800 (PST) X-Google-Smtp-Source: AK7set+by2Cokl8isay5nqCTxgv3HTx8PnxXYuiCpvMHY68PpHNR5e6M6V2D4bZeGHRP92czuskt X-Received: by 2002:a05:622a:393:b0:3b9:b1ea:2d1b with SMTP id j19-20020a05622a039300b003b9b1ea2d1bmr25156665qtx.58.1677224397434; Thu, 23 Feb 2023 23:39:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677224397; cv=none; d=google.com; s=arc-20160816; b=BJWWJzKpQrq396k7/q8RKRipGbOeuZdtK5lMXE6lI1POzjIDg3nYM2zDTGOP7zDaNL DCVLAfDRjT7FgUmW6hEcIi3inYDv7SIlJ7TVTBpSVdrej4nKmwy8NYV+MvGgID5t/Mhi C81IbvJvqy8XkDK+SSfnYGaKauPDNM3qHr0EhM770+Uy5JPiQb5hnAxE2KuVBEfB0tmY +1Ts/nI7U299WlvRSPyF+rBOAVjfKur1Vr94990guX3GoPwYalT9MNZHliSe1IEDEuyf oIIhExnRl54FnLu2IpjixUHnI3kUXXJ0TEPc50xJbn855nrVQGMbYCURhSJcFjgxgMPB u6Cw== 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=navyt3q4SPPjZARlijLLytRWCegL0Xe7XVQDuE6V1ZA=; b=hYu06OXe+40F6ORIkpePzm/+DbOM6vmSLyVmMEJ8eUhFXvyxzYISxaszCiprG3IvFT JiHrNStkQggHuVTSH7X8akNw8c5Pr/t1GE6U8vsmB7PGT7zGF5KJIOhXsxODhAbUlcRg SuNEBcLV/j1HvjIbqyAFDde42g3sulUj2ILqNGO8UIonsDFKvwDPHrSdbggnpAnJQ8UI ZELofR34BppkzKA+NuRx3wmpGfpTOHZlgx2q9Bcxa112AtmZP+Zf8Nlhsq3o2gof4jfm 3mgg7WYPENr+EXWNYht5HL6LGRnhYAvHH7Swal6jZiGTfihma8dYYWoGAoJ7bOf0fT1l lnJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I3Zjtrmi; 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 g17-20020ac842d1000000b003bd06c84115si468916qtm.427.2023.02.23.23.39.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Feb 2023 23:39:57 -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=I3Zjtrmi; 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 1pVSfc-0006US-3Z; Fri, 24 Feb 2023 02:39:08 -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 1pVSfZ-0006Tw-PJ for qemu-devel@nongnu.org; Fri, 24 Feb 2023 02:39:05 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVSfY-0006o3-6q for qemu-devel@nongnu.org; Fri, 24 Feb 2023 02:39:05 -0500 Received: by mail-wm1-x32e.google.com with SMTP id p18-20020a05600c359200b003dc57ea0dfeso1530471wmq.0 for ; Thu, 23 Feb 2023 23:39:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=navyt3q4SPPjZARlijLLytRWCegL0Xe7XVQDuE6V1ZA=; b=I3ZjtrmiPLLgr8s6oROp3VpXvsEYc+YE+kYlcYhgwTdXS1XTfrAKC82Q13uh5SGumI GDeL6f0PNZo4z+JqhviWNtIlzDodQJ9xSz/YDJcXAH4Tc9YBldU8zQa5FDUzac5E2zqr RIVjO3Yzxqg8l/R7CDhG8soRdRLc3iCdpCW9S+iQtfJfNdAui2VLi2QjK6zDZkeC+0od d8FJVZV4Xf08O7nINszLm06oqKDFREhJoRF0qnyPT+4Cp3zKxz6ghO1/XR5Pm1RKTWuG LjuTbcm94d9WXbvT+qLF7OuPk9Wbz3JMMU+rh2msqg8Q1MWimkuF5GtdFt1B3iF+vjH2 i6Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=navyt3q4SPPjZARlijLLytRWCegL0Xe7XVQDuE6V1ZA=; b=PKCZL6S7dmEoZdtxqqOkrTkq1xwGKmieNdhHEQIHVUZvu8O++UFArPJzY+ngqsdTeR Q7RTxoUZG+bZQw2E/RK1rCadRMaxwzz0tWWkcrHg+I/ZdgCC6EUOv+kjV4twE6ipTxzQ t82Q4SCh+wRFwkO9OEmVRVteArDCcfnE3Lak5rfMKT7do06sSzFjlwTbIauIcg+/JnkE iEnTkyWAYs8DzCjpF+3dTvj8Y/EBdHXA2YkT8PPC35hE5CEXV7CmT8UTHa7P+hW5SgOk VsdcO88/4BzCV/0cJLKvWNTxMZ1nlsztdXtWwE6EAwBiTD5SvxD6NyJ423TS4H1n1jAY Z/IA== X-Gm-Message-State: AO0yUKXCLghUz54WZbb8mKAkgEgPXrtfwhYHVmNLJO4RnZw6eer8o0i1 q1hfMnpyUmfls/VGpO8+oO594UTTMvi0psoX X-Received: by 2002:a05:600c:1652:b0:3eb:248f:a133 with SMTP id o18-20020a05600c165200b003eb248fa133mr295564wmn.38.1677224342299; Thu, 23 Feb 2023 23:39:02 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id e8-20020a7bc2e8000000b003e6efc0f91csm1806573wmk.42.2023.02.23.23.39.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Feb 2023 23:39:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Janosch Frank , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v5 2/5] dump: Replace TARGET_PAGE_SIZE -> qemu_target_page_size() Date: Fri, 24 Feb 2023 08:38:47 +0100 Message-Id: <20230224073850.84913-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230224073850.84913-1-philmd@linaro.org> References: <20230224073850.84913-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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 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 TARGET_PAGE_SIZE is target specific. In preparation of making dump.c target-agnostic, replace the compile-time TARGET_PAGE_SIZE definition by runtime qemu_target_page_size(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- dump/dump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dump/dump.c b/dump/dump.c index 7101169ecb..3784a9054d 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -15,6 +15,7 @@ #include "qemu/cutils.h" #include "elf.h" #include "exec/hwaddr.h" +#include "exec/target_page.h" #include "monitor/monitor.h" #include "sysemu/kvm.h" #include "sysemu/dump.h" @@ -1859,7 +1860,7 @@ static void dump_init(DumpState *s, int fd, bool has_format, } if (!s->dump_info.page_size) { - s->dump_info.page_size = TARGET_PAGE_SIZE; + s->dump_info.page_size = qemu_target_page_size(); } s->note_size = cpu_get_note_size(s->dump_info.d_class, From patchwork Fri Feb 24 07:38:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 656244 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp763490wrb; Thu, 23 Feb 2023 23:39:57 -0800 (PST) X-Google-Smtp-Source: AK7set/+wB7f8oo/3wlZkGRxij8MCVBMbS4OwgJizlncrs5+z9XoK6K9KDZqnIHw3B2gzSiu7oV9 X-Received: by 2002:a05:622a:183:b0:3ba:1acd:4f8 with SMTP id s3-20020a05622a018300b003ba1acd04f8mr24952355qtw.42.1677224397522; Thu, 23 Feb 2023 23:39:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677224397; cv=none; d=google.com; s=arc-20160816; b=blTWveKM9Ru8uxWag/GTTmhHC3ftPv7IYPkRVJGvDGL1S/4LULn7GetZzk5YKfzTe3 utE93oeiriNeR4VADHio/r+dh510Rq/Jb+hTUcfWWVsoVlwd++NRj0cEYqO9whkcuR8d o/dyEpbrb/blvcjCD+bwLBjJwtpPuK23AgTEguMCeBS6f0lbYDnq9+PzYuDWuNpvDdkB sD99XdnUs9I6l5Ei95P/Bg22HzPxOjv0sCwYXPjtyqdaC5csYfHEGEuw4EdQtuSM6Gz2 g/QCW8Rp0INZNQhR5OwxmT8pOUI83qLCAsPiE2J499E11LjDCqiX5ktufDjaKa1l1wwz HKCg== 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=yAwFBuxW+pqDLBjdDqPuG5n5VeTuwKH7wxgCavcpmd0=; b=dlC9wOlbxaRTt2dPcP30oeB5VQMY7BaxU9QWv32VTTPM7hF7tVaNZengmh8keEaLAX G0XT0qC1TVx+Sz6iQPRQ0LU1AeSixUdwYwtSFZBR7gyIs3KGEYJi6x18HSkuARoRV3Ad 3cXy07cO46e5oYTYWdeORDEww9+2nu9jrixHc7hPUYzb4P+AixyvMR39nave4emHTb3t I5uFpu89MWZWa9sHlIB7XhJWm1IXgef45SslRLy4M3Dkl3OKv5GvvM2aKS9pdnmohoNb dh+nR8baFc/t951oRYEx05G6R5/k7LvbiFjskWkyQXIzD5GASlZ0I51k3wjY6xS2uob/ xjGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tiQvA86H; 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 e7-20020ac85987000000b003ba250e6204si10331443qte.194.2023.02.23.23.39.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Feb 2023 23:39:57 -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=tiQvA86H; 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 1pVSff-0006Uw-T7; Fri, 24 Feb 2023 02:39:11 -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 1pVSfe-0006Ub-Lx for qemu-devel@nongnu.org; Fri, 24 Feb 2023 02:39:10 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVSfd-0006op-1w for qemu-devel@nongnu.org; Fri, 24 Feb 2023 02:39:10 -0500 Received: by mail-wm1-x32f.google.com with SMTP id m14-20020a7bce0e000000b003e00c739ce4so1145775wmc.5 for ; Thu, 23 Feb 2023 23:39:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=yAwFBuxW+pqDLBjdDqPuG5n5VeTuwKH7wxgCavcpmd0=; b=tiQvA86HtU6ZDAyxcS1mPZux7f+HELZ/1CuOIo4ovlwRMLHC3HwwlSRXoTImuzG2Xh SniCrqsR8albKQOamS3s+GlBhKoHGz7xDeiRshjE4uf9iZQLnJh71JE62u18/5jHLUnk QcfoD13zELx7Girtk7pvwjVLA4uf1VLa1CXzPumzCxfi3kkCI9iPk+jv93JsHMJbXNA7 fnj6T4e08AXwV9HcthicYzrYTnodKfddbqhSi0mMW3dopgA/utkndTQDPotwMuZTR3WD 0c6A/d+Hd8QeI9p3/mm+0tv5dTW2Z9Ri6CRY8ftkQDkBBYavJWjLUE2nyea3K8LQCy3N 8o/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=yAwFBuxW+pqDLBjdDqPuG5n5VeTuwKH7wxgCavcpmd0=; b=DXyS1jW0ifAkBZVhnmNYoA+DK/ZJe1jHRrnrTNN89w4nQgRnPBqVtQfyU4NhgLavk5 Km4My3CxPb5S995yaLKinVe/3qyNW6FYo8qmc3BJvs3xqlfDpuLVM8z5CMU9NnAsMbVr PBFtsishWa56x4qdmgccr6/rDjXSNLc150awfsFb0oRo88rDadQHKnI/ePEBfHrYlytv E/xVCezClCesZzc4AcpTTFyrjkos2MqGdSMYKJ0A4K/o8AFre08xne6NVBQ8nsapIRyB n8D9keZfBT25KgEfN14DMfjsv7Fwxvnxmqo8wqen3ZhFihMfXHAs7lYqIONG+Yjs8/zW gmdA== X-Gm-Message-State: AO0yUKWJ7NUCRCqsoXmMeTMOkZMMVmosCrn/SsgJEswwNDAC0MkGG+CX 57JzjBFqaTS4mG3oN0LJvniNRe6A3wBgxM7q X-Received: by 2002:a05:600c:34cb:b0:3eb:a4e:a2b2 with SMTP id d11-20020a05600c34cb00b003eb0a4ea2b2mr1154737wmq.4.1677224347217; Thu, 23 Feb 2023 23:39:07 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id y7-20020a1c4b07000000b003daf672a616sm1844499wma.22.2023.02.23.23.39.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Feb 2023 23:39:06 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Janosch Frank , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v5 3/5] dump: Clean included headers Date: Fri, 24 Feb 2023 08:38:48 +0100 Message-Id: <20230224073850.84913-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230224073850.84913-1-philmd@linaro.org> References: <20230224073850.84913-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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 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 "qemu/win_dump_defs.h" is only required by win_dump.c, but win_dump.h requires "sysemu/dump.h" which declares the DumpState type. Remove various unused headers. Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé --- dump/dump-hmp-cmds.c | 2 +- dump/dump.c | 6 ++---- dump/win_dump.c | 15 +++++---------- dump/win_dump.h | 2 +- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/dump/dump-hmp-cmds.c b/dump/dump-hmp-cmds.c index e5053b04cd..b038785fee 100644 --- a/dump/dump-hmp-cmds.c +++ b/dump/dump-hmp-cmds.c @@ -1,5 +1,5 @@ /* - * Human Monitor Interface commands + * Windows crashdump (Human Monitor Interface commands) * * This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. diff --git a/dump/dump.c b/dump/dump.c index 3784a9054d..a84f78738a 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -14,22 +14,20 @@ #include "qemu/osdep.h" #include "qemu/cutils.h" #include "elf.h" -#include "exec/hwaddr.h" +#include "qemu/bswap.h" #include "exec/target_page.h" #include "monitor/monitor.h" -#include "sysemu/kvm.h" #include "sysemu/dump.h" -#include "sysemu/memory_mapping.h" #include "sysemu/runstate.h" #include "sysemu/cpus.h" #include "qapi/error.h" #include "qapi/qapi-commands-dump.h" #include "qapi/qapi-events-dump.h" #include "qapi/qmp/qerror.h" -#include "qemu/error-report.h" #include "qemu/main-loop.h" #include "hw/misc/vmcoreinfo.h" #include "migration/blocker.h" +#include "hw/core/cpu.h" #ifdef TARGET_X86_64 #include "win_dump.h" diff --git a/dump/win_dump.c b/dump/win_dump.c index f20b6051b6..ba7fa404fe 100644 --- a/dump/win_dump.c +++ b/dump/win_dump.c @@ -1,5 +1,5 @@ /* - * Windows crashdump + * Windows crashdump (target specific implementations) * * Copyright (c) 2018 Virtuozzo International GmbH * @@ -9,19 +9,14 @@ */ #include "qemu/osdep.h" -#include "qemu/cutils.h" -#include "elf.h" -#include "exec/hwaddr.h" -#include "monitor/monitor.h" -#include "sysemu/kvm.h" #include "sysemu/dump.h" -#include "sysemu/memory_mapping.h" -#include "sysemu/cpus.h" #include "qapi/error.h" #include "qapi/qmp/qerror.h" -#include "qemu/error-report.h" -#include "hw/misc/vmcoreinfo.h" +#include "exec/cpu-defs.h" +#include "hw/core/cpu.h" +#include "qemu/win_dump_defs.h" #include "win_dump.h" +#include "cpu.h" static size_t win_dump_ptr_size(bool x64) { diff --git a/dump/win_dump.h b/dump/win_dump.h index b8c25348f4..56f63683c3 100644 --- a/dump/win_dump.h +++ b/dump/win_dump.h @@ -11,7 +11,7 @@ #ifndef WIN_DUMP_H #define WIN_DUMP_H -#include "qemu/win_dump_defs.h" +#include "sysemu/dump.h" void create_win_dump(DumpState *s, Error **errp); From patchwork Fri Feb 24 07:38:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 656247 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp763738wrb; Thu, 23 Feb 2023 23:40:48 -0800 (PST) X-Google-Smtp-Source: AK7set8NazhQWeQK82v3Go3AXzuc7fhrAoo8zy80WBXL4rexQxAWrRVlYTiHJofTeFxAoENAhAIY X-Received: by 2002:ac8:7d96:0:b0:3bf:a1e2:be3 with SMTP id c22-20020ac87d96000000b003bfa1e20be3mr21645199qtd.62.1677224448003; Thu, 23 Feb 2023 23:40:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677224447; cv=none; d=google.com; s=arc-20160816; b=RtkmugFxXFkaN/bAiLjfIduzUIlttWeg2zlMTaJkQAQj6rBKNA8aRWIbxFa7/A1dyL ecXwgCsG6iDMWIaT5RNaydRYpJ0ikIXQrW7rpjupbCyhA350QMFdSWrfnqVHKHHWJ6iK M8DxC6AGrC8Ov3tPEdGkXmk6LmmmIB7EIfOqbqibnAuTfbsQ3vAoNnymt4SD57EJMxzp tfEJXSIZAVawbThHTx8JKw5BSXkjlVFXoGsoQ9rKnCBx0q3Z56mioj+xRh9NLnrvBw2P COYUD+Wqzj1dwFNwnRg610BCE5lyA7z2LB+bVncP0o+Dx+rSL3Z8ARQBM7lyOi0K3akm bxbw== 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=9ZaRLGS+UsXq7QOBPAlysCOmaXDe7m6nmzn2gCUNK2s=; b=C0zVbOoraSbf7EZ5O2NESSFPJG+QxULv26R9QKQZoCRFXf0hTRU0ba/6hIrDNjFcNx ohkvVjb3twQ4JFuskcr8WaiSpiqqpaa+6W6+6mleAxwZxDz9+GdgUy893fA9ZvuwK88j u37fI2ccS+cHFRgToH0nf1boECM9yLS/yxU6MIzZYKjAb7WpGZm5PBnN0sNAStP85iLj kj6Ce6JT4r0EVPgOcVw482vnUvfwjzmAJgqZydA8Rqw2U4rdnUXnylF1QNvlW1DvCj/h YQ4brhisldD1/Gvue4L1Otgc3y+PBiu4Mnfah6TcTYjruIZULAtQt9zOokNMTiuViCq5 qLhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mDK+unA+; 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 f5-20020a05620a280500b00738dd5fd4d1si8832795qkp.573.2023.02.23.23.40.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Feb 2023 23:40:47 -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=mDK+unA+; 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 1pVSfm-0006Wy-LQ; Fri, 24 Feb 2023 02:39:21 -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 1pVSfj-0006Wl-FS for qemu-devel@nongnu.org; Fri, 24 Feb 2023 02:39:15 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVSfh-0006pH-SV for qemu-devel@nongnu.org; Fri, 24 Feb 2023 02:39:15 -0500 Received: by mail-wm1-x32b.google.com with SMTP id az36so1204252wmb.1 for ; Thu, 23 Feb 2023 23:39:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=9ZaRLGS+UsXq7QOBPAlysCOmaXDe7m6nmzn2gCUNK2s=; b=mDK+unA+UobpE/At4UULbnHHpurnAPbgvCEyDpO2RIEqeYhB0dXwabJBrirswzTFj1 nqSVcVghFkAnhth+zuIRlpoUCJFjK2luK4ripGCKRvIToQlKIpldPFwnDzR3sDDTLVfH XqzyeICvgys6W8eM3jzjMr1uh4UwgpPbCsVid1aWzOurVMJM2qNemnzwxNjYigb96POp cGjEp/3KSPsGe6PIiW3zI8Ezf79+PJ1n4xmbyt5LffZXRz5cpMoHWp6mSdTyYIRcmwjZ blS7YgAt1TyBdAYdq8Fm5DJempbVd0H+VFqF1TihWKsFf7s9l3yk+XISjBzoBNi+21ON JmPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=9ZaRLGS+UsXq7QOBPAlysCOmaXDe7m6nmzn2gCUNK2s=; b=jFQwEA+LEIs+9M4mc9GxbYFuRpuPpyunGOr4awmTHlFy02wU0PeilcKjzaAUzHMPvw 2K6gsL2RgkTntccVYUp8HLn3lNGk20FHVb/LznrOm2sfP75Ymcj6kxAOCrm9Kp2ucB0H IhtKWUEMCc+pADwtDO/38knztJOxVjXxu1YEWhR1i1yLKjTEnlM/4WcQIf8c1hfIyOMk c+GiRXAbuiIvtROQ4/omBx4417ahUjmEzyVubHrvvUFfUtAR6QMSMFgI711CKHTEuBTr VSL0Cn59yQfSnbfbE5+jKeGBAC+iU1qKkkKmV0ylPM9tmJH9z0E8wVpCGQRwoJ78xWQX fxrw== X-Gm-Message-State: AO0yUKUyZor9MKkhdsaL/cRq83UGa/agaJYyZCB32TZ+TIOiB9XiqMxU RQXJsj/8iISFhlSElEWZVV9raXOf2Ic9/Azf X-Received: by 2002:a05:600c:3b8b:b0:3ea:ea6b:f9ad with SMTP id n11-20020a05600c3b8b00b003eaea6bf9admr2162638wms.31.1677224352066; Thu, 23 Feb 2023 23:39:12 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id x15-20020a1c7c0f000000b003e20a6fd604sm1854794wmc.4.2023.02.23.23.39.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Feb 2023 23:39:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Janosch Frank , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v5 4/5] dump: Introduce win_dump_available() Date: Fri, 24 Feb 2023 08:38:49 +0100 Message-Id: <20230224073850.84913-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230224073850.84913-1-philmd@linaro.org> References: <20230224073850.84913-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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 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 Remove a pair of TARGET_X86_64 #ifdef'ry by introducing the win_dump_available() method. Doing so we can build win_dump.c on any target, and simplify the meson rule. Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé --- dump/dump.c | 16 +++++----------- dump/meson.build | 2 +- dump/win_dump.c | 18 ++++++++++++++++++ dump/win_dump.h | 3 +++ 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index a84f78738a..0c96c6e735 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -28,10 +28,7 @@ #include "hw/misc/vmcoreinfo.h" #include "migration/blocker.h" #include "hw/core/cpu.h" - -#ifdef TARGET_X86_64 #include "win_dump.h" -#endif #include #ifdef CONFIG_LZO @@ -2128,12 +2125,10 @@ void qmp_dump_guest_memory(bool paging, const char *file, } #endif -#ifndef TARGET_X86_64 - if (has_format && format == DUMP_GUEST_MEMORY_FORMAT_WIN_DMP) { - error_setg(errp, "Windows dump is only available for x86-64"); + if (has_format && format == DUMP_GUEST_MEMORY_FORMAT_WIN_DMP + && !win_dump_available(errp)) { return; } -#endif #if !defined(WIN32) if (strstart(file, "fd:", &p)) { @@ -2215,10 +2210,9 @@ DumpGuestMemoryCapability *qmp_query_dump_guest_memory_capability(Error **errp) QAPI_LIST_APPEND(tail, DUMP_GUEST_MEMORY_FORMAT_KDUMP_SNAPPY); #endif - /* Windows dump is available only if target is x86_64 */ -#ifdef TARGET_X86_64 - QAPI_LIST_APPEND(tail, DUMP_GUEST_MEMORY_FORMAT_WIN_DMP); -#endif + if (win_dump_available(NULL)) { + QAPI_LIST_APPEND(tail, DUMP_GUEST_MEMORY_FORMAT_WIN_DMP); + } return cap; } diff --git a/dump/meson.build b/dump/meson.build index 2eff29c3ea..f13b29a849 100644 --- a/dump/meson.build +++ b/dump/meson.build @@ -1,4 +1,4 @@ softmmu_ss.add(files('dump-hmp-cmds.c')) specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files('dump.c'), snappy, lzo]) -specific_ss.add(when: ['CONFIG_SOFTMMU', 'TARGET_X86_64'], if_true: files('win_dump.c')) +specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files('win_dump.c')) diff --git a/dump/win_dump.c b/dump/win_dump.c index ba7fa404fe..ff9c5bd339 100644 --- a/dump/win_dump.c +++ b/dump/win_dump.c @@ -18,6 +18,13 @@ #include "win_dump.h" #include "cpu.h" +#if defined(TARGET_X86_64) + +bool win_dump_available(Error **errp) +{ + return true; +} + static size_t win_dump_ptr_size(bool x64) { return x64 ? sizeof(uint64_t) : sizeof(uint32_t); @@ -470,3 +477,14 @@ out_cr3: return; } + +#else /* !TARGET_X86_64 */ + +bool win_dump_available(Error **errp) +{ + error_setg(errp, "Windows dump is only available for x86-64"); + + return false; +} + +#endif diff --git a/dump/win_dump.h b/dump/win_dump.h index 56f63683c3..c9b49f87dc 100644 --- a/dump/win_dump.h +++ b/dump/win_dump.h @@ -13,6 +13,9 @@ #include "sysemu/dump.h" +/* Check Windows dump availability for the current target */ +bool win_dump_available(Error **errp); + void create_win_dump(DumpState *s, Error **errp); #endif /* WIN_DUMP_H */ From patchwork Fri Feb 24 07:38:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 656248 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp764086wrb; Thu, 23 Feb 2023 23:42:06 -0800 (PST) X-Google-Smtp-Source: AK7set8t6KP/jilqo8i9lOQDSNBFRxmMymvfa+pyKBX4xrZbjodHxLygxqsHyiSrplgimCJzDRVw X-Received: by 2002:ad4:5dea:0:b0:56e:a96a:2beb with SMTP id jn10-20020ad45dea000000b0056ea96a2bebmr22926425qvb.43.1677224526532; Thu, 23 Feb 2023 23:42:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677224526; cv=none; d=google.com; s=arc-20160816; b=s1nD38iMErltw2JxFS+WvHqUO24Y36mUDX/wqH+6OEuNRt15c/Ac5P+skofoCVfwLF DA37VypeW1gKMH0PUqY+pQnn2BHHE9Abc9UIzemumYZZ8HTNpbng3QBGvoP4V277BEvX 9C0DblHNEfBvxIfisDMVo7oI7xkEzpICKsqGL5aV9jvIL5f3U48kWzSgLkC21JDXs8Vj JdOa1CLgoycfrPlQUn1p0UUuzRAVAroobrNxFfGnNg76g+9Rs932/zpPQ0CQonH7dYb8 ghnGw7pwxUi9ZMUaL+P3Kl52dnp6itOnlUJk7I1lV+tZznANew7sJ8p337O57BUlTTVs Jm/A== 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=AEhfImWzx09NEJBcXw8tReL+2FfS3ZaQ631ZC4GD570=; b=QJUCH9sVDJcF56j1YpvVzNuH1hv0m0KkqTRf3OR1x67/G/S3fAaE6pa7hAUs5hDik7 SmBCIfPg1n5TB8arDSXlXyAjhWq2XeRO2L0oAF7AMdZRHdb6HcoL/z2jbWkNt7nQjdTy UetzcIs0kW40tSD2yAyp+p6Cqrh7gPdSosrdn+veCUfYuPCBsmL6Y7pnxRRvlltDhesZ ytgHN7KOY9M9dhYJZdeNPj1le/C7lNbRbbNpmFbtbUtO4jNaW2+dcOMLBxFUk1zjzKYZ iF11qim+3ndTjrzgL03e9u47l0Y2S2RoJ2AiGWAvEz/UBe3u+0X+KEk26craOh6j1UjG CdiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Pk6PXgSa; 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 d5-20020a0cf0c5000000b00534f9174377si11943471qvl.219.2023.02.23.23.42.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Feb 2023 23:42:06 -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=Pk6PXgSa; 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 1pVSft-0006YC-HO; Fri, 24 Feb 2023 02:39:25 -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 1pVSfp-0006XI-94 for qemu-devel@nongnu.org; Fri, 24 Feb 2023 02:39:21 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVSfn-0006pl-DX for qemu-devel@nongnu.org; Fri, 24 Feb 2023 02:39:21 -0500 Received: by mail-wr1-x42e.google.com with SMTP id p8so13084542wrt.12 for ; Thu, 23 Feb 2023 23:39:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=AEhfImWzx09NEJBcXw8tReL+2FfS3ZaQ631ZC4GD570=; b=Pk6PXgSa+iqoLCQxj/X8jZme2ana5q2pCuqROPaeb5SsBsgu6ozC4lLKf4idqRHFx8 JRxZE6OIWruNQ6d4Kfij8pzC7V9t9r8gE1et1KDEWGjsE+0EDBzvDJBMCubDJMBCojsL YDXVUI05GwlQPakP86qM18KpKjQXnobOgOlyCRzXcC05wbUMXUfZSX7IKJoFwmoldheY 8+sYc2oWQMDUZNK6bDAM2bhjvHaw9XO6IspJLjqv3L1FLpxx2Hcwks9xgw/zO4rzekiT 1FeRZBy3XxmVon++jM+L1Dr9QW68W1UmWVOTvAcMBy0TsXEXeLsZ0IfqxKsbdyt0M0+a dNIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=AEhfImWzx09NEJBcXw8tReL+2FfS3ZaQ631ZC4GD570=; b=u2Lc0gfMhwonyOaHx4o/VK2nuVapaOhwj1qZSaAgNsdw5n6J04S4xBdom5znW+9fBs mMDfVgB5047FtUh/frk/q9cm9O0heKOYV/KTMlprxb0AtLdFhn96dDh+8QkUSnMEqviv jmbasyexzoBGsOUqaORKmsRWytK6o+sRufP8+40k26tcHs0J79Ya9i+yGW0LsLqNfOtD 3MuTIQeE0bAQubOKmRvNCII3ln0oolYwk5hoM7L5fX6HLy5ry5hLiJzyiPCd4lwjkhNq Gnhd3o9WKgWG9YDT6+9QKDk/eeLudBMPpVzRC85/5hZ1CtS+wgoeU6FFA+Beq/Af1Xxv tCAQ== X-Gm-Message-State: AO0yUKV/SiDtFfcb8bRsUQFkr/8Ncv0ElpLs6734ITQb26V6wwKq4PTz qY6GvTQNJNLbqh8TrvZ0XlOuhyR6pm1xfvNY X-Received: by 2002:a5d:62c9:0:b0:2c7:1dd5:7918 with SMTP id o9-20020a5d62c9000000b002c71dd57918mr1039772wrv.28.1677224356991; Thu, 23 Feb 2023 23:39:16 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id d1-20020a5d4f81000000b002c5526234d2sm11800632wru.8.2023.02.23.23.39.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Feb 2023 23:39:16 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Janosch Frank , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v5 5/5] dump: Add create_win_dump() stub for non-x86 targets Date: Fri, 24 Feb 2023 08:38:50 +0100 Message-Id: <20230224073850.84913-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230224073850.84913-1-philmd@linaro.org> References: <20230224073850.84913-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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 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 Implement the non-x86 create_win_dump(). We can remove the last TARGET_X86_64 #ifdef'ry in dump.c, which thus becomes target-independent. Update meson accordingly. Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé --- dump/dump.c | 2 -- dump/meson.build | 2 +- dump/win_dump.c | 5 +++++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 0c96c6e735..7260558852 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -2020,9 +2020,7 @@ static void dump_process(DumpState *s, Error **errp) DumpQueryResult *result = NULL; if (s->has_format && s->format == DUMP_GUEST_MEMORY_FORMAT_WIN_DMP) { -#ifdef TARGET_X86_64 create_win_dump(s, errp); -#endif } else if (s->has_format && s->format != DUMP_GUEST_MEMORY_FORMAT_ELF) { create_kdump_vmcore(s, errp); } else { diff --git a/dump/meson.build b/dump/meson.build index f13b29a849..7b116f1bd7 100644 --- a/dump/meson.build +++ b/dump/meson.build @@ -1,4 +1,4 @@ softmmu_ss.add(files('dump-hmp-cmds.c')) -specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files('dump.c'), snappy, lzo]) +softmmu_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files('dump.c'), snappy, lzo]) specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files('win_dump.c')) diff --git a/dump/win_dump.c b/dump/win_dump.c index ff9c5bd339..0152f7330a 100644 --- a/dump/win_dump.c +++ b/dump/win_dump.c @@ -487,4 +487,9 @@ bool win_dump_available(Error **errp) return false; } +void create_win_dump(DumpState *s, Error **errp) +{ + win_dump_available(errp); +} + #endif