From patchwork Wed Nov 30 13:52:37 2022 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: 629480 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp872511pvb; Wed, 30 Nov 2022 05:53:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf63/UvJST8o6JFoVI5WPcBYbGFmOpdnLYJFqDNr8fnPTMbIbW8dfcbdYF5yrU5pCXPlhS2G X-Received: by 2002:a05:620a:2728:b0:6fa:1d3b:fa74 with SMTP id b40-20020a05620a272800b006fa1d3bfa74mr54637331qkp.123.1669816430803; Wed, 30 Nov 2022 05:53:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669816430; cv=none; d=google.com; s=arc-20160816; b=B9Q2GnJwZ/3I5NFjx61IKJSR6lvvZ1J1hmFeH/Jp4VMvDeyMrmWKR+L9oWFRfoJ0KJ v3HvgSq0QU0FhRW4kE5sb9owo6vOVr4cAa8kk7r5vdwOvRj09gLVRRYYQ6Zjnim7PmN0 sBXsaC2ais1rEPoytfiPOW4VnKL3PJShAAKC0qAW3+GoLBn/qJe1rsb7lh/exPnoDjwP 3tyOEcl56IjhjBmoB8SNR0fYiDY0QRPlSpuym+tvuvs7GYX8xnH5uNsj3PFzgLgB3iZO EzTfRugBD4KM94TTBgTSz1jDNMvSBhKJHmQCxyk2UoFBgSyTbSn/m8O5T9BljwHMNbRk eCdA== 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=oOTQltOdTxtnQ/3wWM8lgpKU0ST3q4Ht7vQjM64PuTE=; b=j0/lj1PgrxhjuOecq/3zHUKOM3zI+76Tytnnqh5QGWrHdc0A9/k/SubRb7y6i4NM63 s07h7nG7+ve3/cbMIvyFuC8NUE8iL1nE1Rzesg3320IPv2y350K19Rc87BLoof+3H1DB /gdrOj4YH47VdC8jplwm8oY/AHFVa0LeWToXX1TtXL9fgW6Cb5XPTxfpPs3NbLeQm53r Aj6g/UxEjn1+U0t+FFe4UwAUbezQQNcP/k0XGL+jWcTAs2+Kiw/R80HZjWn9Ri+oUs7X 5YIhoWpG+dAkp+NlEWI53SCxevQI094td/yG02QdxsDwMyHtFyKDhNJHySGAhlwpHSy4 przg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xKB9jpvI; 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 u14-20020a05620a0c4e00b006fc25c4b1e6si880337qki.348.2022.11.30.05.53.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Nov 2022 05:53:50 -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=xKB9jpvI; 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 1p0NWt-0004pM-QI; Wed, 30 Nov 2022 08:53:39 -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 1p0NWp-0004lx-MZ for qemu-devel@nongnu.org; Wed, 30 Nov 2022 08:53:35 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p0NWi-0003bY-Vi for qemu-devel@nongnu.org; Wed, 30 Nov 2022 08:53:35 -0500 Received: by mail-wr1-x42d.google.com with SMTP id z4so27227120wrr.3 for ; Wed, 30 Nov 2022 05:52:50 -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=oOTQltOdTxtnQ/3wWM8lgpKU0ST3q4Ht7vQjM64PuTE=; b=xKB9jpvIH26ooj6X1ObxsqHtEJAdFPHxaUalDlqUf7ikQXQVmAwoaJZOf3PJSnWADm vi3aP0hlaUbiTooJ3P+8RHIGr9/ffPE9rDQQk3Lu9RXP3YuEQw+PpLulC+sJQtqRukK0 37/9D6T0CGm/1Jy9cmHR69MmJV8R6xTIhFqqHyW6KNzMnCMX3B6f5VUmhERSUARYvidr KtzMvNLxXrj8zjczUw6yNmSbI1lxeEt3jdAKnC3By8uYDF5kQCAxLTdYSF2Xe5TeYWnu 7QgqVsprSi+D/K3VfjGAsX52uCllDGHBaNLgxL7OYxRnMyE9pTZyAxT+LWyqpoydn9lB nHoQ== 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=oOTQltOdTxtnQ/3wWM8lgpKU0ST3q4Ht7vQjM64PuTE=; b=o+uW8zaKiXNKnIjPaXSTfuosm6khl7eOz6vewKHNoSneMF26GpeRloSx8mdpAC3PaU 9YqDQdN1pdAXsyiM7gMYCj6mNC65PJWX03M8kdA+S5GHMgxfl/r3aC7zfZubWXkl8KaV DZaUJpF4/MPTlda+cPs6dTdGD5CLxUSIfZC2sh2Ei4HRMT9y2SAOIzGdEhbWKhAxIkpK mr9Wel09z9fDnGvqo45ljTiZXoShAyaB8Y+F2RRvI4Q7AadvQ8FWv5Mp20NknHeIvlI2 tjEzaC6lIAG8GIeaTzC92+NoVjZxxiC0rWrv0b3v1wurlIOzUP027amH0gN3vevEQVWk mWZA== X-Gm-Message-State: ANoB5pn/9ekqQ2kLnHcNTZStXTHFN4GKGyXGa0u0Tt2mrpVD+lmfAdau 98aj+dPpD2GrZO8f0zHROmEiDA8MI2U3AR3I X-Received: by 2002:adf:eb8a:0:b0:22e:31b2:ecb9 with SMTP id t10-20020adfeb8a000000b0022e31b2ecb9mr38594604wrn.693.1669816369110; Wed, 30 Nov 2022 05:52:49 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id n29-20020a05600c3b9d00b003c21ba7d7d6sm2402263wms.44.2022.11.30.05.52.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 30 Nov 2022 05:52:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson , Paolo Bonzini , Yanan Wang , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Thomas Huth Subject: [PATCH-for-8.0 1/5] cpu: Remove capstone meson dependency Date: Wed, 30 Nov 2022 14:52:37 +0100 Message-Id: <20221130135241.85060-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221130135241.85060-1-philmd@linaro.org> References: <20221130135241.85060-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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, T_SPF_TEMPERROR=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 Only disas.c requires capstone CFLAGS, not cpu.c. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 5c6b5a1c75..92d449f854 100644 --- a/meson.build +++ b/meson.build @@ -3097,11 +3097,12 @@ if have_block endif common_ss.add(files('cpus-common.c')) +specific_ss.add(files('cpu.c')) subdir('softmmu') common_ss.add(capstone) -specific_ss.add(files('cpu.c', 'disas.c'), capstone) +specific_ss.add(files('disas.c'), capstone) # Work around a gcc bug/misfeature wherein constant propagation looks # through an alias: From patchwork Wed Nov 30 13:52:38 2022 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: 629481 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp872623pvb; Wed, 30 Nov 2022 05:54:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf56nG4MCBBDJbOHalJiy5RTO5rL7Xy876hbzIjsLva+DAcdqUYI38NgxKsQUf5Oj34HhjS8 X-Received: by 2002:ac8:4555:0:b0:398:353c:fe2e with SMTP id z21-20020ac84555000000b00398353cfe2emr57274609qtn.507.1669816445580; Wed, 30 Nov 2022 05:54:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669816445; cv=none; d=google.com; s=arc-20160816; b=X4U4AyohQImuvcIo9nquD0GwmoZqPcJJQe2JsRierTzQCpOf+QjCzW97kzUB5dMdWb gYOH3kFlJrnYUvBcDUztgVaHjelImXdjkBQUCWAjwA/Gq5BEgEhbNnTDs3dWwMm6yqBv OcWdaiVyE5FWVRA71TQWQV572Y3GqQPncAaf4duSGimIPrwoNMkGtW4GuoMbfZbxiVcv U9O4ppXJ1hBRNo/H3O3hTar29pouIDd5QZ51pi+LAsCmLH0w4k6rt9VqS6drFm6iIVG0 0AggEQRqjXsq/dInEoZHKbyjoI8rHDvj7RVQJ95CFLncCIL0aQDNpzhWJ9b1InAzyU/E J9Bw== 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=TjwwaNh2aYs+3FpXFQtWY38JR8kt7/RLknMm10DQ6GY=; b=Ux/nzOg5injWKyvaQos7UiytY0g3zFZjbAL/4MSXlzK+ZRA6U7k07x5YTJaqmmkiPS xjzD5ShvmoSDzMKb6UESiHOcd5pX+ZWRxXxFK4tFSdkz6AEYJ3LXMuVcyBTCAD6HJ7MS 4v9b2A1fsPgNuPD7Sr1HzbJ9Kf4SaSZPexlDELU/UxBP5YdCDoR1B7cK0AqVcXnAkr/N J1CU/VdZ8lkmFD7r5ceotqJJgA5RmYatpwtJBkImfeE1iIa2/K6Fv1fkT1xt5zQBxaLl EYWRhK/y4zqknzz+9Of94hrGXnBA/9PfRR/bhHHx3NrHPOLWUn0brJ/QYM5zehvcgiwZ kXoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="hmox/PGr"; 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 gf12-20020a056214250c00b004bbd357546fsi828842qvb.347.2022.11.30.05.54.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Nov 2022 05:54: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="hmox/PGr"; 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 1p0NWr-0004mM-BP; Wed, 30 Nov 2022 08:53:39 -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 1p0NWo-0004km-P1 for qemu-devel@nongnu.org; Wed, 30 Nov 2022 08:53:34 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p0NWk-0003bu-Kr for qemu-devel@nongnu.org; Wed, 30 Nov 2022 08:53:34 -0500 Received: by mail-wr1-x430.google.com with SMTP id y16so7442117wrm.2 for ; Wed, 30 Nov 2022 05:52:55 -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=TjwwaNh2aYs+3FpXFQtWY38JR8kt7/RLknMm10DQ6GY=; b=hmox/PGrHmsdiB3XtiKBqkjDJAcsylQAexqdzjEKJ7hHcfhtC2wiQXVDND6/D6AF6R PkGFQJwtSyMik+dCpYisHgrIdqpQ/TETwn7hgTmwUVIYXxRZu5SUOQM9RM/o1z5GTs2V ruv2ZLFTRuVlJ2RvHFNqwwam3vWc2rb10XoWfEVNXEXKSjwWVOptvOzyq2TWmy7psS5x OQw36Yj6g8vKaA9X9Zgp5qvV5O48yhHUgZw4hvUH+3CtTzjBkrzWe+l/Hpa0V0cNsMZi ftpmtkOKX89sfzxsIqI1AbeQSuAO/cBeJo7sCpcnsp+QdEXrkEx9yOlBabIPjPutRQtH RBAg== 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=TjwwaNh2aYs+3FpXFQtWY38JR8kt7/RLknMm10DQ6GY=; b=UTqDrWeQYLKYYGH3qvTiJh4zJ8+mmK4+N92NHO0SQB9aBJ8MpsSxXI2Nv/jZnjy0k3 59TnsmiGC2NY1r8BDDY7Z9NKHnv/twSNJIDULLHkI2TNq3RczJy7GYV01ACx40dozq7w hxxXAvNa3PIskliTaYM2wXR4SXT9P6cgpqs41/4SY0CbDk/Sli/qG2BDDUQLoqOu57kO g8NiDJt5kv36E6POTHI3TwFlf5UeVJwqbsnzG54tnFXcU6doNEkOpJU3OXHeg1bBP4Z6 /gGg6jYwZtqR5KZSIMYg4zQjhMslXJL1JdaTtWtpia13j6m3UdoW5PcgxSRCrJDyBkrG F0uQ== X-Gm-Message-State: ANoB5pkJjZGrRakmnvkrmpJS1Wrmq8S41X4QfGNxEQNhNJWvoabbuu2F 0LZ+LwS2+CXt/ibX6B3ricnUJ7sD/WgKVAbS X-Received: by 2002:a5d:4741:0:b0:242:140d:43be with SMTP id o1-20020a5d4741000000b00242140d43bemr10249704wrs.623.1669816374323; Wed, 30 Nov 2022 05:52:54 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id b4-20020a5d45c4000000b00242209dd1ffsm1761552wrs.41.2022.11.30.05.52.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 30 Nov 2022 05:52:53 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson , Paolo Bonzini , Yanan Wang , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Thomas Huth Subject: [PATCH-for-8.0 2/5] cpu: Move cpu_class_init_props() to common code Date: Wed, 30 Nov 2022 14:52:38 +0100 Message-Id: <20221130135241.85060-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221130135241.85060-1-philmd@linaro.org> References: <20221130135241.85060-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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 This code is not target-specific. Signed-off-by: Philippe Mathieu-Daudé --- cpu.c | 53 --------------------------------------------------- cpus-common.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 53 deletions(-) diff --git a/cpu.c b/cpu.c index 4a7d865427..d4b24ea39a 100644 --- a/cpu.c +++ b/cpu.c @@ -21,8 +21,6 @@ #include "qapi/error.h" #include "exec/target_page.h" -#include "hw/qdev-core.h" -#include "hw/qdev-properties.h" #include "qemu/error-report.h" #include "migration/vmstate.h" #ifdef CONFIG_USER_ONLY @@ -183,57 +181,6 @@ void cpu_exec_unrealizefn(CPUState *cpu) cpu_list_remove(cpu); } -/* - * This can't go in hw/core/cpu.c because that file is compiled only - * once for both user-mode and system builds. - */ -static Property cpu_common_props[] = { -#ifdef CONFIG_USER_ONLY - /* - * Create a property for the user-only object, so users can - * adjust prctl(PR_SET_UNALIGN) from the command-line. - * Has no effect if the target does not support the feature. - */ - DEFINE_PROP_BOOL("prctl-unalign-sigbus", CPUState, - prctl_unalign_sigbus, false), -#else - /* - * Create a memory property for softmmu CPU object, so users can - * wire up its memory. The default if no link is set up is to use - * the system address space. - */ - DEFINE_PROP_LINK("memory", CPUState, memory, TYPE_MEMORY_REGION, - MemoryRegion *), -#endif - DEFINE_PROP_END_OF_LIST(), -}; - -static bool cpu_get_start_powered_off(Object *obj, Error **errp) -{ - CPUState *cpu = CPU(obj); - return cpu->start_powered_off; -} - -static void cpu_set_start_powered_off(Object *obj, bool value, Error **errp) -{ - CPUState *cpu = CPU(obj); - cpu->start_powered_off = value; -} - -void cpu_class_init_props(DeviceClass *dc) -{ - ObjectClass *oc = OBJECT_CLASS(dc); - - device_class_set_props(dc, cpu_common_props); - /* - * We can't use DEFINE_PROP_BOOL in the Property array for this - * property, because we want this to be settable after realize. - */ - object_class_property_add_bool(oc, "start-powered-off", - cpu_get_start_powered_off, - cpu_set_start_powered_off); -} - void cpu_exec_initfn(CPUState *cpu) { cpu->as = NULL; diff --git a/cpus-common.c b/cpus-common.c index 793364dc0e..9151cf4240 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -20,6 +20,8 @@ #include "qemu/osdep.h" #include "qemu/main-loop.h" #include "exec/cpu-common.h" +#include "exec/memory.h" +#include "hw/qdev-properties.h" #include "hw/core/cpu.h" #include "sysemu/cpus.h" #include "qemu/lockable.h" @@ -360,3 +362,54 @@ void process_queued_cpu_work(CPUState *cpu) qemu_mutex_unlock(&cpu->work_mutex); qemu_cond_broadcast(&qemu_work_cond); } + +/* + * This can't go in hw/core/cpu.c because that file is compiled only + * once for both user-mode and system builds. + */ +static Property cpu_common_props[] = { +#ifdef CONFIG_USER_ONLY + /* + * Create a property for the user-only object, so users can + * adjust prctl(PR_SET_UNALIGN) from the command-line. + * Has no effect if the target does not support the feature. + */ + DEFINE_PROP_BOOL("prctl-unalign-sigbus", CPUState, + prctl_unalign_sigbus, false), +#else + /* + * Create a memory property for softmmu CPU object, so users can + * wire up its memory. The default if no link is set up is to use + * the system address space. + */ + DEFINE_PROP_LINK("memory", CPUState, memory, TYPE_MEMORY_REGION, + MemoryRegion *), +#endif + DEFINE_PROP_END_OF_LIST(), +}; + +static bool cpu_get_start_powered_off(Object *obj, Error **errp) +{ + CPUState *cpu = CPU(obj); + return cpu->start_powered_off; +} + +static void cpu_set_start_powered_off(Object *obj, bool value, Error **errp) +{ + CPUState *cpu = CPU(obj); + cpu->start_powered_off = value; +} + +void cpu_class_init_props(DeviceClass *dc) +{ + ObjectClass *oc = OBJECT_CLASS(dc); + + device_class_set_props(dc, cpu_common_props); + /* + * We can't use DEFINE_PROP_BOOL in the Property array for this + * property, because we want this to be settable after realize. + */ + object_class_property_add_bool(oc, "start-powered-off", + cpu_get_start_powered_off, + cpu_set_start_powered_off); +} From patchwork Wed Nov 30 13:52:39 2022 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: 629482 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp872919pvb; Wed, 30 Nov 2022 05:54:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf6NElGT9QEjLTQQ5vsLwwYuKF1ose6TQ0FBJXBAYnR0JKHOVXqAqxqJ+eKL53UWiq+lP5vw X-Received: by 2002:ad4:4e85:0:b0:4c6:fa37:1d16 with SMTP id dy5-20020ad44e85000000b004c6fa371d16mr16557476qvb.106.1669816484882; Wed, 30 Nov 2022 05:54:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669816484; cv=none; d=google.com; s=arc-20160816; b=h5rvG/HFnby+cgRg+HnjqjRDTAZFtwRaFAX+qBLA7i8cQWYObNo5L9z9PiVGIB46SN wOCT6BMgZAkR1a3gDR3Hs088qGnGY620sziH8jxXJpCQRRO/URNkQthtBMtZz5qBf3KJ QW84QG8harrO0TDnnfH8/ta+y1YB8geQK1IrdaHOVji8i1/rBN6ar17R2rnomhYjzoJe YKsZsPcY35JLpk240yZtGKlvi7O5l4ERb8AJfSsIrdxLJA2alaMpfsCCx17qaNdWYQbV jfEa2Ac33gxGrwOB1Zhx7U/REvkG/70j0RdGJFbt3DX2y8k5Sncu6aTE8QkYxfbSNXbV WB6Q== 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=i26w1+Nc68c0mRJL8cSUmFt0Pqis/V1/amcsjWFUuSM=; b=tsSW4I57fsMVEKbCL9tYZVjAdbwZerd5KDwwmLs4vvhFK4jHS61OpOfXjfMZlea5hr uv4av7a09x8dPqo9TDp6QAWVLkGa4ao/5SRk13+Am3ARaiqWqHaIZhzx4R0Zu/brfZwz wBX6diScUPan789cF2V7hNRielz+F/KjgSU9uX1M9GDuBZwFNOPjIHQa4yk25DaaZcbG HGc/KMhUQRSV+SAs7ylQSHdJ61hwi7a7xvQ7jxEABIwANpourPA7GY6AUfiZPxYUxHXq fIgSOqn/UXWh3tFgK3obTWD/zz2sJRZdmqUGRg75O7+FVgjNIEoAlJ9iW6f7G0A/DDOJ LouQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l62qh5h4; 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 q1-20020a056214194100b004c68b67b7ebsi909331qvk.9.2022.11.30.05.54.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Nov 2022 05:54:44 -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=l62qh5h4; 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 1p0NWu-0004qZ-Bi; Wed, 30 Nov 2022 08:53:40 -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 1p0NWq-0004me-Hh for qemu-devel@nongnu.org; Wed, 30 Nov 2022 08:53:36 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p0NWl-0003d8-Gn for qemu-devel@nongnu.org; Wed, 30 Nov 2022 08:53:35 -0500 Received: by mail-wr1-x436.google.com with SMTP id bs21so27190060wrb.4 for ; Wed, 30 Nov 2022 05:53:00 -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=i26w1+Nc68c0mRJL8cSUmFt0Pqis/V1/amcsjWFUuSM=; b=l62qh5h4hzqWEJdH6UzhDtdxP+G6po2JzvJjNXwQjOP64pwr3kvTv0Xu4tbXPjIWT9 BIWY3EFBOO2wVUiQ+tlZADUIB8VN9GAwupN0vcn7BRGidOj3LegBKFN7RZb4X+QuCDDZ LQr44ZnyMY6EYQTfgZd9qd+N0Hu//7V6J2C5kGHOdETdPlsJKZIM0HNGUYqJMd0v5Jku aCk/BgrI5N3w9PyWbKBTAl7IXBl6ZQ33BL5CS28CyaIBhb1ibfZ3eLGeCIY8L/mWp7b+ A1zRY6XGg3KLQrH4de0+mKbO4EGDO3JN6TKB25W9h75Pa+s6nrc67p1Kq5rq9UIGNaan eFgA== 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=i26w1+Nc68c0mRJL8cSUmFt0Pqis/V1/amcsjWFUuSM=; b=wr5ejuch1G4EUKWgnA/3uTYkt1qj7UzkF/fLkJCdaePXnR3dg8psEOjofM548qK4Pp iJAwYpejoPqtp5I+dSxwoIsCYxRwKB5G7JzhdSkEarR4oRPqUbwbCSRXVAAstm2jTNGd r+neOa4cIN331PPw22cfWHD5C8FBWwceoyisMNrClpTzn/RK22Rn5nKbOkQW9Zot4yxZ Q+AIJaigZNYq3TtTT6KWbiHnXTBDk2ku824pO/Xs4L0LDJHCK/XvbQLVqMah5vDh4JoT F/rBlaezgZbW3Lnsg4uFfAmW3iulQ3iCO7Da31ysK/GQ+9G+PsGsmCRaBnTKJWyzQ2j1 5cww== X-Gm-Message-State: ANoB5pnn2bzQlv5P8yBEa/CGVSmZulCKfFhurFInCvZdfdZLuMOJk+5y eVa4NJdTd92gf+5C+VNhgIONXRqEMxBK0V0j X-Received: by 2002:a5d:6646:0:b0:242:164b:c58a with SMTP id f6-20020a5d6646000000b00242164bc58amr10022103wrw.45.1669816379438; Wed, 30 Nov 2022 05:52:59 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id l28-20020a05600c1d1c00b003c6b7f5567csm5001397wms.0.2022.11.30.05.52.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 30 Nov 2022 05:52:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson , Paolo Bonzini , Yanan Wang , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Thomas Huth Subject: [PATCH-for-8.0 3/5] cpu: Move breakpoint helpers to common code Date: Wed, 30 Nov 2022 14:52:39 +0100 Message-Id: <20221130135241.85060-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221130135241.85060-1-philmd@linaro.org> References: <20221130135241.85060-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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 This code is not target-specific. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- cpu.c | 71 -------------------------------------------------- cpus-common.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 71 deletions(-) diff --git a/cpu.c b/cpu.c index d4b24ea39a..385e72e140 100644 --- a/cpu.c +++ b/cpu.c @@ -257,77 +257,6 @@ void tb_invalidate_phys_addr(AddressSpace *as, hwaddr addr, MemTxAttrs attrs) } #endif -/* Add a breakpoint. */ -int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags, - CPUBreakpoint **breakpoint) -{ - CPUClass *cc = CPU_GET_CLASS(cpu); - CPUBreakpoint *bp; - - if (cc->gdb_adjust_breakpoint) { - pc = cc->gdb_adjust_breakpoint(cpu, pc); - } - - bp = g_malloc(sizeof(*bp)); - - bp->pc = pc; - bp->flags = flags; - - /* keep all GDB-injected breakpoints in front */ - if (flags & BP_GDB) { - QTAILQ_INSERT_HEAD(&cpu->breakpoints, bp, entry); - } else { - QTAILQ_INSERT_TAIL(&cpu->breakpoints, bp, entry); - } - - if (breakpoint) { - *breakpoint = bp; - } - - trace_breakpoint_insert(cpu->cpu_index, pc, flags); - return 0; -} - -/* Remove a specific breakpoint. */ -int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, int flags) -{ - CPUClass *cc = CPU_GET_CLASS(cpu); - CPUBreakpoint *bp; - - if (cc->gdb_adjust_breakpoint) { - pc = cc->gdb_adjust_breakpoint(cpu, pc); - } - - QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) { - if (bp->pc == pc && bp->flags == flags) { - cpu_breakpoint_remove_by_ref(cpu, bp); - return 0; - } - } - return -ENOENT; -} - -/* Remove a specific breakpoint by reference. */ -void cpu_breakpoint_remove_by_ref(CPUState *cpu, CPUBreakpoint *bp) -{ - QTAILQ_REMOVE(&cpu->breakpoints, bp, entry); - - trace_breakpoint_remove(cpu->cpu_index, bp->pc, bp->flags); - g_free(bp); -} - -/* Remove all matching breakpoints. */ -void cpu_breakpoint_remove_all(CPUState *cpu, int mask) -{ - CPUBreakpoint *bp, *next; - - QTAILQ_FOREACH_SAFE(bp, &cpu->breakpoints, entry, next) { - if (bp->flags & mask) { - cpu_breakpoint_remove_by_ref(cpu, bp); - } - } -} - /* enable or disable single step mode. EXCP_DEBUG is returned by the CPU loop after each instruction */ void cpu_single_step(CPUState *cpu, int enabled) diff --git a/cpus-common.c b/cpus-common.c index 9151cf4240..8fdb34740e 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -25,6 +25,7 @@ #include "hw/core/cpu.h" #include "sysemu/cpus.h" #include "qemu/lockable.h" +#include "trace/trace-root.h" static QemuMutex qemu_cpu_list_lock; static QemuCond exclusive_cond; @@ -413,3 +414,74 @@ void cpu_class_init_props(DeviceClass *dc) cpu_get_start_powered_off, cpu_set_start_powered_off); } + +/* Add a breakpoint. */ +int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags, + CPUBreakpoint **breakpoint) +{ + CPUClass *cc = CPU_GET_CLASS(cpu); + CPUBreakpoint *bp; + + if (cc->gdb_adjust_breakpoint) { + pc = cc->gdb_adjust_breakpoint(cpu, pc); + } + + bp = g_malloc(sizeof(*bp)); + + bp->pc = pc; + bp->flags = flags; + + /* keep all GDB-injected breakpoints in front */ + if (flags & BP_GDB) { + QTAILQ_INSERT_HEAD(&cpu->breakpoints, bp, entry); + } else { + QTAILQ_INSERT_TAIL(&cpu->breakpoints, bp, entry); + } + + if (breakpoint) { + *breakpoint = bp; + } + + trace_breakpoint_insert(cpu->cpu_index, pc, flags); + return 0; +} + +/* Remove a specific breakpoint. */ +int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, int flags) +{ + CPUClass *cc = CPU_GET_CLASS(cpu); + CPUBreakpoint *bp; + + if (cc->gdb_adjust_breakpoint) { + pc = cc->gdb_adjust_breakpoint(cpu, pc); + } + + QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) { + if (bp->pc == pc && bp->flags == flags) { + cpu_breakpoint_remove_by_ref(cpu, bp); + return 0; + } + } + return -ENOENT; +} + +/* Remove a specific breakpoint by reference. */ +void cpu_breakpoint_remove_by_ref(CPUState *cpu, CPUBreakpoint *bp) +{ + QTAILQ_REMOVE(&cpu->breakpoints, bp, entry); + + trace_breakpoint_remove(cpu->cpu_index, bp->pc, bp->flags); + g_free(bp); +} + +/* Remove all matching breakpoints. */ +void cpu_breakpoint_remove_all(CPUState *cpu, int mask) +{ + CPUBreakpoint *bp, *next; + + QTAILQ_FOREACH_SAFE(bp, &cpu->breakpoints, entry, next) { + if (bp->flags & mask) { + cpu_breakpoint_remove_by_ref(cpu, bp); + } + } +} From patchwork Wed Nov 30 13:52:40 2022 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: 629479 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp872483pvb; Wed, 30 Nov 2022 05:53:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf6KgZ0qy9keObnpG8Dprti/7kWDhAl27qnGoMrqx4dumdRH3DMtRRjz7y+DmPM+gOoDIPIx X-Received: by 2002:a05:620a:19:b0:6fb:aa94:7c0e with SMTP id j25-20020a05620a001900b006fbaa947c0emr40517785qki.37.1669816425779; Wed, 30 Nov 2022 05:53:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669816425; cv=none; d=google.com; s=arc-20160816; b=Sg8N/ZJ+p6NViTZK6pDHNIwLG/t4Jka7GSQzzjeAfWHGR8c+qQPyLTaJXBf9uU61ui X40g2S4zqoVGJxM2CRlT9iz115TAKOlC69aIMwYJdA+EaCQGvS42YhhbO7uO3lH1/VAa awLOrqQ5pZA5CZw/a4dyShHwzZH8LdTMkAP2I+e87LyYDcs2MCQm7GregGtIFZlOit35 PUelghN30McI7LjmSTH3am1lNz2U0NVxSH2zqy7CYZGZ8aanG13Ol1o5JBhhVU3ki3gh BMd5AWVVsqLyt3UCNdGuDT3LZXfyBq3euHwB3f/DCUuCVuoEJtrf+0QaJ+a/FAnp5ZrE QSwA== 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=d2D8gJ+u9rseKSVrwYnsWFuYWA6EcjaA0owyEfm4plA=; b=vIVJo+jkGKMRtAIBFQ0tvQURGf3a3T/J/3XtPgiP3F52IcBlNdw/LoenTqK7uH4zGU eV7XxDMKlRcoGuX8ReI+zef6SRJise1apGO1sUtnGJmM601/FprUDxYUhNQDntmHKXjy K/BFFl0nrbPQdoqnqBnqBtvpvsScf6eFI+v01V/LhqglJpW+WNqJcjemm3LTFN/VW03e kDRNlsQOZR28fU3uM/bRh5CFzAsdLsSoz/VBgSm9vVHQHyWoUDQhNSSwCIEDw5qNnBLc ugMO3y3ocmmIc8csucgIrWIv6rb4qgYqiifpf8gl+/LGFbeR6bw0Mr9+hpmx7ldY7KUo WHug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CWevHTtw; 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 m3-20020ac866c3000000b0039cc8b04405si759336qtp.210.2022.11.30.05.53.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Nov 2022 05:53:45 -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=CWevHTtw; 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 1p0NWt-0004oc-Kn; Wed, 30 Nov 2022 08:53:39 -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 1p0NWq-0004m7-83 for qemu-devel@nongnu.org; Wed, 30 Nov 2022 08:53:36 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p0NWl-0003dY-Fr for qemu-devel@nongnu.org; Wed, 30 Nov 2022 08:53:35 -0500 Received: by mail-wr1-x432.google.com with SMTP id w15so13998288wrl.9 for ; Wed, 30 Nov 2022 05:53:05 -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=d2D8gJ+u9rseKSVrwYnsWFuYWA6EcjaA0owyEfm4plA=; b=CWevHTtwLkk3ujn5/M50yn4UCM4w0Rna3JRUWm7pyqGr5o+HM4XziNLjDYAzbtK9GK D1ZrHfwhAd4V0Hy5jyFn5p0IeQvumH3Bw9IDnGXgjGmNLz4/UFMCedfsDjsNFSuXCD5S 5bEF8TlozJwkfVZEPlF+4ST8CKkocHVEB+9h4lEvJmqakXo2bgC1qyQ14OYOLRKCAjcu ixJAWf3JtW2x0X/Ld6vFO3L24oFRz7RnhwRmKWSF6adL2u3RwkQPdyiGZtFdMR+634Wd sts4t+QQy821JKef208+3flN7RoBJwAMYWZdwSGYLPmoyyaBX+w9YORevMSwYbFQRnJd xOWg== 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=d2D8gJ+u9rseKSVrwYnsWFuYWA6EcjaA0owyEfm4plA=; b=NNOd4Mmc4sf92EAybua1O4f0ps9TSa1LWhIwFkMWAu5CyKba0ob+gckvbhMDZlcLgC l0A+xl/g+ZlZNto910sd/wGqdRNyw05ITv3h3IoEpisA2AYCa61YDUb5o2J9tRTJMHRR 9YDgxe7YKYr87LGzWF0OVII2mpry7AdbTWjuZNkwZOgYnBTzGSTy0/R3W+/E2n/m4REF ZTZCDRA8du99mC7N5u4lNXVlwqyefwWhWBhtf/+fbjCdxK2CW2+Xs6KdwzQunNdSniY9 XKfueLqtgqKj5h1TLZA0ik69u/27K5emkLYbO5rI/PMWZWgDNmLCTTWSsYF+14N4sywG OQZA== X-Gm-Message-State: ANoB5pmNTcEtE5yPHO18ySqiwmWRLo1WkhhZj89I1iYpFW9GyeQ+WFd9 spIsj4k8Owu2cdklaW+Ob+3iDZmaUwVh/FUl X-Received: by 2002:adf:f7c8:0:b0:236:720a:e391 with SMTP id a8-20020adff7c8000000b00236720ae391mr30615553wrq.368.1669816384585; Wed, 30 Nov 2022 05:53:04 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id g3-20020a5d5543000000b0022cc0a2cbecsm1689153wrw.15.2022.11.30.05.53.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 30 Nov 2022 05:53:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson , Paolo Bonzini , Yanan Wang , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Thomas Huth Subject: [PATCH-for-8.0 4/5] cpu: Move cpu_abort() to common code Date: Wed, 30 Nov 2022 14:52:40 +0100 Message-Id: <20221130135241.85060-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221130135241.85060-1-philmd@linaro.org> References: <20221130135241.85060-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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 This code is not target-specific. Signed-off-by: Philippe Mathieu-Daudé --- cpu.c | 38 -------------------------------------- cpus-common.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/cpu.c b/cpu.c index 385e72e140..d6936a536b 100644 --- a/cpu.c +++ b/cpu.c @@ -31,11 +31,9 @@ #endif #include "sysemu/tcg.h" #include "sysemu/kvm.h" -#include "sysemu/replay.h" #include "exec/cpu-common.h" #include "exec/exec-all.h" #include "exec/translate-all.h" -#include "exec/log.h" #include "hw/core/accel-cpu.h" #include "trace/trace-root.h" #include "qemu/accel.h" @@ -270,42 +268,6 @@ void cpu_single_step(CPUState *cpu, int enabled) } } -void cpu_abort(CPUState *cpu, const char *fmt, ...) -{ - va_list ap; - va_list ap2; - - va_start(ap, fmt); - va_copy(ap2, ap); - fprintf(stderr, "qemu: fatal: "); - vfprintf(stderr, fmt, ap); - fprintf(stderr, "\n"); - cpu_dump_state(cpu, stderr, CPU_DUMP_FPU | CPU_DUMP_CCOP); - if (qemu_log_separate()) { - FILE *logfile = qemu_log_trylock(); - if (logfile) { - fprintf(logfile, "qemu: fatal: "); - vfprintf(logfile, fmt, ap2); - fprintf(logfile, "\n"); - cpu_dump_state(cpu, logfile, CPU_DUMP_FPU | CPU_DUMP_CCOP); - qemu_log_unlock(logfile); - } - } - va_end(ap2); - va_end(ap); - replay_finish(); -#if defined(CONFIG_USER_ONLY) - { - struct sigaction act; - sigfillset(&act.sa_mask); - act.sa_handler = SIG_DFL; - act.sa_flags = 0; - sigaction(SIGABRT, &act, NULL); - } -#endif - abort(); -} - /* physical memory access (slow version, mainly for debug) */ #if defined(CONFIG_USER_ONLY) int cpu_memory_rw_debug(CPUState *cpu, vaddr addr, diff --git a/cpus-common.c b/cpus-common.c index 8fdb34740e..38af2ab840 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -21,9 +21,11 @@ #include "qemu/main-loop.h" #include "exec/cpu-common.h" #include "exec/memory.h" +#include "exec/log.h" #include "hw/qdev-properties.h" #include "hw/core/cpu.h" #include "sysemu/cpus.h" +#include "sysemu/replay.h" #include "qemu/lockable.h" #include "trace/trace-root.h" @@ -485,3 +487,39 @@ void cpu_breakpoint_remove_all(CPUState *cpu, int mask) } } } + +void cpu_abort(CPUState *cpu, const char *fmt, ...) +{ + va_list ap; + va_list ap2; + + va_start(ap, fmt); + va_copy(ap2, ap); + fprintf(stderr, "qemu: fatal: "); + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + cpu_dump_state(cpu, stderr, CPU_DUMP_FPU | CPU_DUMP_CCOP); + if (qemu_log_separate()) { + FILE *logfile = qemu_log_trylock(); + if (logfile) { + fprintf(logfile, "qemu: fatal: "); + vfprintf(logfile, fmt, ap2); + fprintf(logfile, "\n"); + cpu_dump_state(cpu, logfile, CPU_DUMP_FPU | CPU_DUMP_CCOP); + qemu_log_unlock(logfile); + } + } + va_end(ap2); + va_end(ap); + replay_finish(); +#if defined(CONFIG_USER_ONLY) + { + struct sigaction act; + sigfillset(&act.sa_mask); + act.sa_handler = SIG_DFL; + act.sa_flags = 0; + sigaction(SIGABRT, &act, NULL); + } +#endif + abort(); +} From patchwork Wed Nov 30 13:52:41 2022 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: 629478 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp872479pvb; Wed, 30 Nov 2022 05:53:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf7+IfNVrtRwpWnzTApbmHxChGep4gSB4gWDbqir4Oe4dWXTQNHvtgu0I6ONYlRn4Kt+N/r1 X-Received: by 2002:ad4:5808:0:b0:4c6:bcdd:3164 with SMTP id dd8-20020ad45808000000b004c6bcdd3164mr36632058qvb.12.1669816425631; Wed, 30 Nov 2022 05:53:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669816425; cv=none; d=google.com; s=arc-20160816; b=woasddB/NwNBH6bH1NbKhEGD5AACDzFYWtNH9rD/Od1tx4D0rHjbPBx9MhlgQiWtnV L81XVv0Bipef5IF6bqPSce++uICo2yM/9Lj0R/6DrP6i88nzmPasCM5TWAGcMjIy9um1 JrmjW/VPM6NzxeqnTS1hgTh4gt6+4+9SQHZRGrNtEo73rXxiKxGmyIl9W48XN3Pkfa8j B/yXQjG57Ho8HsZjsoWXvAOvgQMz1sZVcbl+nvbvI0BFhvIbQLmYVmT6I+WE9mSc+TPC /S+iiGwVy6VNrDHufgLleotksrTmiNcK/0Kftm4iCGRYbsRqQOIO1PIySeYaKhH3Jgus 7JvQ== 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=YrUtSE5dC3cHHgtF+qcazL1snDSkIkTilGiwDbpeyUM=; b=YcQ31VI6TY/9YBBAndt2rPqsURri4lpQcbIpKkAdpbyTGoQ62iEgyxqSOZIpE/rJXC tLpcptOjoPaBvolwk+Y8uPkyedI8DrrgwFRWmBq47IVkOKme22sCDk2RXLSr9g6WuyLa XSmijK4tONXiC6J+nLE0A5UwvPuwZsRFZ5KsRhyRrRh2iVfRHOiw0TMBgKb+/FtvmTli dgVDQ1MFBReuzdipONizkAz4ghtqw4/SHfGNf2fL4YsvO2wVu1J8R/lTAF0q94/OYj0n u6wZsd9qANp/1us2j+SZm2qsEicxdipuBDNQ04U3b8XjpS+X/U1j2by+biYzDTWZdE/O 6jiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=koOOJDDM; 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 u2-20020a05620a0c4200b006fc9f416608si536388qki.728.2022.11.30.05.53.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Nov 2022 05:53:45 -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=koOOJDDM; 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 1p0NWp-0004lb-Ap; Wed, 30 Nov 2022 08:53:35 -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 1p0NWo-0004kE-FO for qemu-devel@nongnu.org; Wed, 30 Nov 2022 08:53:34 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p0NWl-0003ds-ED for qemu-devel@nongnu.org; Wed, 30 Nov 2022 08:53:34 -0500 Received: by mail-wr1-x434.google.com with SMTP id bs21so27190808wrb.4 for ; Wed, 30 Nov 2022 05:53:10 -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=YrUtSE5dC3cHHgtF+qcazL1snDSkIkTilGiwDbpeyUM=; b=koOOJDDMECgcrMAPmzHZIaijEQdWdIeOTLqT72Py4/cOtWC15p+rlT1Cgg3HKQkjjO df2fjAxX8dnZz9dawtVKcUF2egCK5kII2DuagEnUTM6RkNm+7m/YPfyGXwi4+clCXlgG thveWqsBo67yRIXoP9QzZpKKpc80e2FnBAgAik7ea8IlrGbP70BaBrKvyjRxo6HL86sf WMJzIwljNDkg0f2rJzIi/u+0akPc5b+5BgirpEDn8KAIrI7iS/yapFm2YiBqahzWCSrn JdhZl05guzqyXV1Juh9mGqUstD7GDPW+aui753UunNDLlellj7ULPSosxDBwn0u+QHJj aYQw== 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=YrUtSE5dC3cHHgtF+qcazL1snDSkIkTilGiwDbpeyUM=; b=rSrPRbbOaZDU9B6xbtXymfAAxvl31QcnVssvq9Ue0lwlREgGfmxEIGokZEZgq+niFn M1h59taw4K6DOcAJfrDxAnp/Mg6UsVdWu/flJ885y/SWPg6+7d+JjJ1TSBRTBW6qFJoZ CGJRy3497OURz8puY0it0/L83tq3g6ErG+aN2RHPDohyq1UmUnbWKk3mz7X09llHb3tE eiXbR3DJDP8O2rTkIVDD+R2V92e7SBCpAt1bNW8vC0O8E04wahmzXkVFBo9YjX61OW4E QuFjlbU1pQe7d/L8qnFVsag2Jzbw5FORRUbk8MU7qq478M40nuhc8OcUUi6GqCBJddxR LMbA== X-Gm-Message-State: ANoB5pmjl1Hv6GNroE51ZmkXJj28U9yun2enEhTUq392CUpXvs43YNuj Rmd6zRzxfKPBvSfjetHbOw8bMqXgfbVQ81/a X-Received: by 2002:a05:6000:10c6:b0:242:2368:dd00 with SMTP id b6-20020a05600010c600b002422368dd00mr4584392wrx.88.1669816389417; Wed, 30 Nov 2022 05:53:09 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id j8-20020adfff88000000b0023677fd2657sm1666959wrr.52.2022.11.30.05.53.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 30 Nov 2022 05:53:09 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Richard Henderson , Paolo Bonzini , Yanan Wang , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , Thomas Huth Subject: [PATCH-for-8.0 5/5] cpu: Remove unused includes Date: Wed, 30 Nov 2022 14:52:41 +0100 Message-Id: <20221130135241.85060-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221130135241.85060-1-philmd@linaro.org> References: <20221130135241.85060-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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 Signed-off-by: Philippe Mathieu-Daudé Acked-by: Richard Henderson --- cpu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/cpu.c b/cpu.c index d6936a536b..d512b24c0a 100644 --- a/cpu.c +++ b/cpu.c @@ -31,10 +31,7 @@ #endif #include "sysemu/tcg.h" #include "sysemu/kvm.h" -#include "exec/cpu-common.h" -#include "exec/exec-all.h" #include "exec/translate-all.h" -#include "hw/core/accel-cpu.h" #include "trace/trace-root.h" #include "qemu/accel.h"