From patchwork Thu Apr 18 19:25:00 2024 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: 1925219 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=F4hSO3e6; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL76x0RkYz1yZP for ; Fri, 19 Apr 2024 05:26:16 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXO8-0007UB-BK; Thu, 18 Apr 2024 15:25:40 -0400 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 1rxXO6-0007Tu-TD for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:25:38 -0400 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXO5-0007FJ-5X for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:25:38 -0400 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-516ef30b16eso1519497e87.3 for ; Thu, 18 Apr 2024 12:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468335; x=1714073135; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=a05kQu+3IE9JJfcYC8SvHu7OLyLA4nojU3zTAPx26K0=; b=F4hSO3e6Nq99Q23RPlrRgQSJyhcKyRF0hhqc8N3XLNvNLL49i9X4li5zlFd1ZPaPbq AG/8vS8omBz05xV2R2lRam/vuW7m7cMl3plwui0WURyi6Kh7aHHwDXWwDpeNgYkVKgrJ mZ8eRXr+kvjm2jntI3kIgbO0zRE9hFY3uWMi2b0TVKf7xiGA8xEF/jyRVACn1ib0w46P +gTKAJLnDgGjo/8yoIOhjiH4guI+fpRUYfNQG95iUfBx2+IY6+9ezUL7VgyyIIwtE+nb f2MTmlfOZpgwu9YwSg3uHcCWOoyj3jDkhfpOMlw2sQIzrCYmBb8kS01hojo/IX3ss71q +fpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468335; x=1714073135; 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=a05kQu+3IE9JJfcYC8SvHu7OLyLA4nojU3zTAPx26K0=; b=FvbClMFx1VTamsW8OekxVzyPv05LZ3KYyEQkQWjITSGgWFhaStA2ZL1OVaLUDRnRNT c/JKMfSfM71SjMK0DvOlU5isC0rBL5fh4YCKubpdaTVizAP+9RFUrMagREFPSqb7UejX v+AlrZRfPYRaZbTXfkaRWC93bhG9PlUU2JgiJRsaXSQYdYz3CPcvJxD3ArWH98qmh2Ow kGqwAFpGo6ns1/2W2iy74MylUNNpz/3Zz+eOB/NOem3DLUlGL6cpFCSVpKnxgyAz0In+ 78CxSLOsu5yw0dYVAc8HB/T1rL50+FLXJorY8InmTHfsBBUHrlUF8JwQG29GXOIK79C8 JG/Q== X-Forwarded-Encrypted: i=1; AJvYcCW1HcGFOQxdT7cb2orMSROb/oBHPvBbQO3Tq/ldnO0jHmcYhZCVHpC4+y72o3LOWA6Lh8qbd/osMrh+tnCn/pJJKQP+ X-Gm-Message-State: AOJu0YzWXjg2NCHoR/ZFO9XpvIqVFVp/h7VvwgP+OmIDIrloThpwzVT9 rTWrKFZRw1/cBmm1i6i4qWv7+MQHzUVJrW95UkyuewlpR469xiX7Zf4Xuf9T2To= X-Google-Smtp-Source: AGHT+IHfNUYllVyhV+QY71Ro4Kj4dJNcZ5I4DM2/UYYkrguyOxfOHqu9Q/5fh3sLLZjgbH1NDAnw6A== X-Received: by 2002:a19:2d42:0:b0:519:67f6:cd93 with SMTP id t2-20020a192d42000000b0051967f6cd93mr2279810lft.49.1713468334923; Thu, 18 Apr 2024 12:25:34 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id h17-20020a1709070b1100b00a558206b2c5sm77249ejl.99.2024.04.18.12.25.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:25:34 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PATCH 01/24] exec: Declare MMUAccessType type in 'mmu-access-type.h' header Date: Thu, 18 Apr 2024 21:25:00 +0200 Message-ID: <20240418192525.97451-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12c; envelope-from=philmd@linaro.org; helo=mail-lf1-x12c.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org The MMUAccessType enum is declared in "hw/core/cpu.h". "hw/core/cpu.h" contains declarations related to CPUState and CPUClass. Some source files only require MMUAccessType and don't need to pull in all CPU* declarations. In order to simplify, create a new "exec/mmu-access-type.h" header. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/exec/cpu_ldst.h | 1 + include/exec/exec-all.h | 1 + include/exec/mmu-access-type.h | 18 ++++++++++++++++++ include/hw/core/cpu.h | 8 +------- 4 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 include/exec/mmu-access-type.h diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index 64e0319996..5b99666702 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -64,6 +64,7 @@ #include "exec/memopidx.h" #include "exec/abi_ptr.h" +#include "exec/mmu-access-type.h" #include "qemu/int128.h" #include "cpu.h" diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index e932d364b6..5cddfea01b 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -25,6 +25,7 @@ #include "exec/abi_ptr.h" #include "exec/cpu_ldst.h" #endif +#include "exec/mmu-access-type.h" #include "exec/translation-block.h" #include "qemu/clang-tsa.h" diff --git a/include/exec/mmu-access-type.h b/include/exec/mmu-access-type.h new file mode 100644 index 0000000000..28bbb05b94 --- /dev/null +++ b/include/exec/mmu-access-type.h @@ -0,0 +1,18 @@ +/* + * QEMU MMU Access type definitions + * + * Copyright (c) 2012 SUSE LINUX Products GmbH + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef EXEC_MMU_ACCESS_TYPE_H +#define EXEC_MMU_ACCESS_TYPE_H + +typedef enum MMUAccessType { + MMU_DATA_LOAD = 0, + MMU_DATA_STORE = 1, + MMU_INST_FETCH = 2 +#define MMU_ACCESS_COUNT 3 +} MMUAccessType; + +#endif diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 3a66d8581e..5f0422493b 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -25,6 +25,7 @@ #include "exec/hwaddr.h" #include "exec/vaddr.h" #include "exec/memattrs.h" +#include "exec/mmu-access-type.h" #include "exec/tlb-common.h" #include "qapi/qapi-types-run-state.h" #include "qemu/bitmap.h" @@ -80,13 +81,6 @@ DECLARE_CLASS_CHECKERS(CPUClass, CPU, typedef struct ArchCPU CpuInstanceType; \ OBJECT_DECLARE_TYPE(ArchCPU, CpuClassType, CPU_MODULE_OBJ_NAME); -typedef enum MMUAccessType { - MMU_DATA_LOAD = 0, - MMU_DATA_STORE = 1, - MMU_INST_FETCH = 2 -#define MMU_ACCESS_COUNT 3 -} MMUAccessType; - typedef struct CPUWatchpoint CPUWatchpoint; /* see accel-cpu.h */ From patchwork Thu Apr 18 19:25:01 2024 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: 1925222 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=UvG7XzXj; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL77q1PKkz1yZP for ; Fri, 19 Apr 2024 05:27:03 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXOg-0007p1-VB; Thu, 18 Apr 2024 15:26:16 -0400 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 1rxXOE-0007Yf-Cp for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:25:46 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXOC-0007GB-H5 for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:25:46 -0400 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-a55323f2ef9so148975466b.1 for ; Thu, 18 Apr 2024 12:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468341; x=1714073141; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Rg2JOTw5ouUti560CWKRK7poJqCPTKGwJpqCuG5tVqg=; b=UvG7XzXja7W/vpv+RxjXTKd/QJrmfmCasdlRzL7j4UFNjVz+dWb56rIjPtrlz9r4S2 kTzAClKeIX9oqw1TfXSytPPwuSL/m1H4cuvlvL6/gIk1/AEFYgcqk2/9p/MYxtlKzXZi D/FL/PutDeDnt0anMkXIvQF06JV47wMOKLt7rIhAIpTIqFWV+K1sP1GFZ5Chy9/BDSSO MQFqk8yxgw/5AdikOLmqsFfn4CNcNxgwyActLZeB5YT7xVFgNucDK4i3I0tPmEXmPOb7 BHLMwsaynffcNJJFBchrzbmwFsKO95z3ZxYzHBGOBYNbc8GQwU3S6wvxTjGqOHVX6Oep oH/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468341; x=1714073141; 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=Rg2JOTw5ouUti560CWKRK7poJqCPTKGwJpqCuG5tVqg=; b=fBfF/SmJxkp0/jFbuMgWGQVKh6WZZ+8DC7VqF0etQGa28RvtdeyK/0aSVh/1gP3h4q 8FIg6kiXH4hFAaZ60erXp/Vs0xHTOW2mf4R/JRSlB1P18R1JNwHI+5Q+tjXCfkXRZk0k CYVY3zyMoKofvOo2Yrwo0EoLx9RsnPY8vCOCu3Zgnm1ZipGFop+9MchOz1z7yggTmNfY 5loyd6vnrTV4cEagbU4UNLoFUAUMOJE3ZNHMLIWt9lPNycpbj8tejdXcvMNgYImy7HN8 q9QcpjYGOcMg511OQjtEA7HSL5/t42Bbv44fSGQf1Yqud2NhWMBkN91wawL9CkeJDrm9 /fRg== X-Forwarded-Encrypted: i=1; AJvYcCU2FZuop4/cNO8rfqERZOuxACYeJMMdp8+2wCoG2SBduNbEZDTEjVpxX+/O82xxfSH2l1nkoeP5ZmrDGJgoaUC73Dyk X-Gm-Message-State: AOJu0Yyb/bRSLEz/rpnjv7xu2VthU9Z63KsQv1JDHrXN2/QEg/3ikpmQ PHb2McWp49GRkupzP6PmEkKbF+HkqxTNobI6lStUK2QqITbNs2Xp656uA+CwYE8= X-Google-Smtp-Source: AGHT+IGASUllNpo0Va0P2dkaALouSNHWQpdA0Wzw0LXpl6pAHWuJa2Joj8M3jDkvfPrz+ilPpgnX1w== X-Received: by 2002:a17:906:2591:b0:a52:6cb2:9347 with SMTP id m17-20020a170906259100b00a526cb29347mr49043ejb.8.1713468341444; Thu, 18 Apr 2024 12:25:41 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id hx12-20020a170906846c00b00a5582324219sm68524ejc.16.2024.04.18.12.25.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:25:41 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Peter Maydell , Nicholas Piggin , Daniel Henrique Barboza , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Liu Zhiwei Subject: [PATCH 02/24] exec: Declare CPUBreakpoint/CPUWatchpoint type in 'breakpoint.h' header Date: Thu, 18 Apr 2024 21:25:01 +0200 Message-ID: <20240418192525.97451-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=philmd@linaro.org; helo=mail-ej1-x62b.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org The CPUBreakpoint and CPUWatchpoint structures are declared in "hw/core/cpu.h", which contains declarations related to CPUState and CPUClass. Some source files only require the BP/WP definitions and don't need to pull in all CPU* API. In order to simplify, create a new "exec/breakpoint.h" header. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/breakpoint.h | 23 +++++++++++++++++++++++ include/hw/core/cpu.h | 16 +--------------- target/arm/internals.h | 1 + target/ppc/internal.h | 1 + target/riscv/debug.h | 2 ++ 5 files changed, 28 insertions(+), 15 deletions(-) create mode 100644 include/exec/breakpoint.h diff --git a/include/exec/breakpoint.h b/include/exec/breakpoint.h new file mode 100644 index 0000000000..45038263e3 --- /dev/null +++ b/include/exec/breakpoint.h @@ -0,0 +1,23 @@ +#ifndef EXEC_BREAKPOINT_H +#define EXEC_BREAKPOINT_H + +#include "qemu/queue.h" +#include "exec/vaddr.h" +#include "exec/memattrs.h" //MemTxAttrs + +typedef struct CPUBreakpoint { + vaddr pc; + int flags; /* BP_* */ + QTAILQ_ENTRY(CPUBreakpoint) entry; +} CPUBreakpoint; + +typedef struct CPUWatchpoint { + vaddr vaddr; + vaddr len; + vaddr hitaddr; + MemTxAttrs hitattrs; + int flags; /* BP_* */ + QTAILQ_ENTRY(CPUWatchpoint) entry; +} CPUWatchpoint; + +#endif diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 5f0422493b..6f5a16e0fc 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -22,6 +22,7 @@ #include "hw/qdev-core.h" #include "disas/dis-asm.h" +#include "exec/breakpoint.h" #include "exec/hwaddr.h" #include "exec/vaddr.h" #include "exec/memattrs.h" @@ -347,21 +348,6 @@ typedef struct CPUNegativeOffsetState { bool can_do_io; } CPUNegativeOffsetState; -typedef struct CPUBreakpoint { - vaddr pc; - int flags; /* BP_* */ - QTAILQ_ENTRY(CPUBreakpoint) entry; -} CPUBreakpoint; - -struct CPUWatchpoint { - vaddr vaddr; - vaddr len; - vaddr hitaddr; - MemTxAttrs hitattrs; - int flags; /* BP_* */ - QTAILQ_ENTRY(CPUWatchpoint) entry; -}; - struct KVMState; struct kvm_run; diff --git a/target/arm/internals.h b/target/arm/internals.h index dd3da211a3..a7c5ec1849 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -25,6 +25,7 @@ #ifndef TARGET_ARM_INTERNALS_H #define TARGET_ARM_INTERNALS_H +#include "exec/breakpoint.h" #include "hw/registerfields.h" #include "tcg/tcg-gvec-desc.h" #include "syndrome.h" diff --git a/target/ppc/internal.h b/target/ppc/internal.h index 5b20ecbd33..601c0b533f 100644 --- a/target/ppc/internal.h +++ b/target/ppc/internal.h @@ -18,6 +18,7 @@ #ifndef PPC_INTERNAL_H #define PPC_INTERNAL_H +#include "exec/breakpoint.h" #include "hw/registerfields.h" /* PM instructions */ diff --git a/target/riscv/debug.h b/target/riscv/debug.h index 5794aa6ee5..c347863578 100644 --- a/target/riscv/debug.h +++ b/target/riscv/debug.h @@ -22,6 +22,8 @@ #ifndef RISCV_DEBUG_H #define RISCV_DEBUG_H +#include "exec/breakpoint.h" + #define RV_MAX_TRIGGERS 2 /* register index of tdata CSRs */ From patchwork Thu Apr 18 19:25:02 2024 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: 1925223 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=wezRyQWS; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL77t0TBrz1yZP for ; Fri, 19 Apr 2024 05:27:05 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXOp-00082G-MA; Thu, 18 Apr 2024 15:26:26 -0400 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 1rxXOJ-0007c4-22 for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:25:51 -0400 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXOH-0007Gx-4j for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:25:50 -0400 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-518b9527c60so1369788e87.0 for ; Thu, 18 Apr 2024 12:25:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468347; x=1714073147; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qM1+ePV7JI08UmjLq5CXr5Pnp/lUDlPFaqkC073bDHw=; b=wezRyQWSZWKwxXifmcQF0z7lKN6y241aje35cbC9rX6PjqiAeOiL6fvOXfYzbrivwP 0iqnvJKuzbpD4e0l3Qq5AQXY1poJryZQzbzVoV30r1hwGQYWMWOzZZqbNJSG4etVz4v8 e4VjqYNCaRq4o5NJhv8Bbfp5u4Sso1E+lXOjuagJrKnpMaIKFEA+a+hHYQ6+P5uF4Lqb H7HGkCq6oMQ9lZqUPNRTzksIMmUNr2CMPbh4HsyN8cx0v849vZt62j8xV6Ae/p5RNqWt oVhoOVIl94RLa+MXZLYl111APRJQvYF1aHgWDhD+PId81B27EIoHo/RvPFNIetgh7/Kb w6AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468347; x=1714073147; 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=qM1+ePV7JI08UmjLq5CXr5Pnp/lUDlPFaqkC073bDHw=; b=NTdTjvRo6ctjjUxIcNjv+jMZezJKt8i/YTwZKLsUDKvxtpkallMgMc8REyEePt8NpC 8FUZO8wH0nLxX1ghDv8rc1zdrizsVMJBF2wh5PYTO8ztdutlCebHSy9zKYM0EDae9WAT O9L3qP2BWemQp15V5MHU+R7tk/+j0ZPH6IxPFiLOulSNmPLuJhSUSC2kKYaNwKWT4Rec NSOvfUx9yX3UCOF0ocaVAsVyrGWhlchb/hnygBilW2dRVcomNZjItjys8/qxhlDaebQ5 X3FbDXxVlXeqqrhttRjbGVKiuiGD2j4yywFMVI3MpTtYPXWhsA7QmTCol7dNtu69VCK8 0zkg== X-Forwarded-Encrypted: i=1; AJvYcCUFidsjmauAa9ck7alnlFOSAZrVRFycTvfhNdpubT/lG7Gu/BoPs09dSi/N7XhD1amBlGejXg9BXJDZlsic4Co74Sun X-Gm-Message-State: AOJu0YwsJLkJ4HcyOZu11kAQc7P1Gavl8jxaR2gYxEM4o1RZuchur11J RTSNdYm7VygooEV83XBVcmmieB2zZDQ4vvygIvIiuHZrUFGJyenSWzgyo9FFMvY= X-Google-Smtp-Source: AGHT+IGbmgL9q5GYwqiriM3TxUUJmdVS5GsQvbF3Zc7lx0z/Cqw6N44I5tEaB6OpQn1vVifcnkd4Ww== X-Received: by 2002:a19:f616:0:b0:518:d6ea:9f5d with SMTP id x22-20020a19f616000000b00518d6ea9f5dmr2755246lfe.42.1713468347556; Thu, 18 Apr 2024 12:25:47 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id w23-20020a170907271700b00a556f2f18d6sm1195356ejk.57.2024.04.18.12.25.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:25:47 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 03/24] hw/core: Avoid including the full 'hw/core/cpu.h' in 'tcg-cpu-ops.h' Date: Thu, 18 Apr 2024 21:25:02 +0200 Message-ID: <20240418192525.97451-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=philmd@linaro.org; helo=mail-lf1-x12a.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Only include what is required, avoiding the full CPUState API from the huge "hw/core/cpu.h" header. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/hw/core/tcg-cpu-ops.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index dc1f16a977..9387d38748 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -10,7 +10,11 @@ #ifndef TCG_CPU_OPS_H #define TCG_CPU_OPS_H -#include "hw/core/cpu.h" +#include "exec/breakpoint.h" +#include "exec/hwaddr.h" +#include "exec/memattrs.h" +#include "exec/mmu-access-type.h" +#include "exec/vaddr.h" struct TCGCPUOps { /** From patchwork Thu Apr 18 19:25:03 2024 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: 1925236 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=w9Tvs5yd; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL7BB4rTjz1yZP for ; Fri, 19 Apr 2024 05:29:06 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXQ7-00014B-Jo; Thu, 18 Apr 2024 15:27:43 -0400 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 1rxXOQ-0007fd-4e for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:26:00 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXOO-0007I6-5G for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:25:57 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a5200afe39eso131756566b.1 for ; Thu, 18 Apr 2024 12:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468353; x=1714073153; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=akXy09tUeGr6mCjhMUDCOqgVvIVDrIu0xemDF/6ToBg=; b=w9Tvs5ydrAfdcvCpUw1hnTnuV0alj/n+NqHob3B5ivBx86udhY17/aiKGMoZH4sdI+ rtQ2xi5KMOV2HLdHrJD38edvafwScUwon3MvgaMsgWTNQE4rq8U/aZnZYv6ux5YnQCyL I6JCqTkwVWn8dFCXsv6A/J//ceza4QDI/4sVVyk0PYIYa5CtMvCSJ94pjLD6NvQb0Dcs 5nTEirbXjKM+H0lvuY98apBHTq8mvoqY2/bJnvSOAKtLi0vIbMjpnquxM/pf4/GxMI1q JzyXtbtV5BDXfv/6oOpPlaXsqrFjqhSSe4XrREPSwuj08P1EQW5fur/RuqHkPh+J/Bse 4OTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468353; x=1714073153; 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=akXy09tUeGr6mCjhMUDCOqgVvIVDrIu0xemDF/6ToBg=; b=R6HCHvmJ2R/ZX98CIiui5gh/mKS3klZ74wggcqonOZjykkfxEB6hnkueXtyytNyfFr 4Bs2IMx1AM1fWvHC34ry7CSNwdxDTJS3TG3PX7Jqky2cgyh4Bnt3iAlOXdVrMHIH8cru DSd+1h9ppY3kloKp1ugK2CtEOZCj6vyt67RajTnESbMvQZjkXAYi11o1oS/UkksrSuxS 9pNaf/52nHAAewQ2AhQuy9xvlzyPoU2IXBY2f6jiPWk5+eziq+1MUPl3dxtjoEMQFi25 b1jVWiF6cg9UTEHJDrIH+u2A7x+deiswwkvgX6yT59Q5tes9gNHxcO3CK5hDYDjoSU1N QbwQ== X-Forwarded-Encrypted: i=1; AJvYcCXF3hwPhg/K99zxaunWtsZjTIRsA9uL/WjB1H3CU6sLp/mPGgEi6M44VDpnDhGx7T6FDLVWc+m8pzoHEIsEut2ENGF8 X-Gm-Message-State: AOJu0YxBGXIFIVfChQ8ZYOEfsuG2mw9uqpY9Vgeh4ZMAHtjTXWAHMxg1 A+n0ipuWu1tBCYxyxSKwO0rawv7BK4sESSDj6BrxTVac2El1TU6MO40VlLsaQ/8= X-Google-Smtp-Source: AGHT+IGHWdMJNoXaAn2jkLARpnzm1AkwDW/nssSUAmn21RnLFR4YTnbmDPzOOELnW5gLZFOLDS380g== X-Received: by 2002:a17:906:915:b0:a51:c964:3cb7 with SMTP id i21-20020a170906091500b00a51c9643cb7mr50934ejd.61.1713468353390; Thu, 18 Apr 2024 12:25:53 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id i7-20020a1709061e4700b00a52244ab819sm1270026ejj.170.2024.04.18.12.25.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:25:53 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 04/24] exec: Restrict TCG specific declarations of 'cputlb.h' Date: Thu, 18 Apr 2024 21:25:03 +0200 Message-ID: <20240418192525.97451-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=philmd@linaro.org; helo=mail-ej1-x636.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Avoid TCG specific declarations being used from non-TCG accelerators. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/exec/cputlb.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/exec/cputlb.h b/include/exec/cputlb.h index 6da1462c4f..ef18642a32 100644 --- a/include/exec/cputlb.h +++ b/include/exec/cputlb.h @@ -22,9 +22,14 @@ #include "exec/cpu-common.h" +#ifdef CONFIG_TCG + #if !defined(CONFIG_USER_ONLY) /* cputlb.c */ void tlb_protect_code(ram_addr_t ram_addr); void tlb_unprotect_code(ram_addr_t ram_addr); #endif + +#endif /* CONFIG_TCG */ + #endif From patchwork Thu Apr 18 19:25:04 2024 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: 1925228 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=kWfD3cqy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL79373F3z1yZP for ; Fri, 19 Apr 2024 05:28:07 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXQS-0001iQ-Ur; Thu, 18 Apr 2024 15:28:05 -0400 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 1rxXOW-0007lH-Lc for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:26:07 -0400 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXOT-0007Ke-HB for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:26:04 -0400 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a524ecaf215so143769266b.2 for ; Thu, 18 Apr 2024 12:26:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468359; x=1714073159; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=A5AN2zfNkbZgNzq4yMXaRJrNHQuv3As8IXVhhvnN+gY=; b=kWfD3cqyKXkpJywFm4hz1taUSWiPgaOQYBWpLgXQVQj0bWi+YeQgPvJ+WLCJHiIX0N grwLsEFVrGWzc7ambiU7upeH+e1uujDt9a2EPAC0HXplilD8BdYmP+aLjWs+vorzCoiX +VjcyFPk01i0vtgHWioVZgyXfGrWIRk0s8g01FMAbjpwT6NogsoVraEONx7F+RCs1GqU EwjzHus+71ToGm0Ql2ALRzYJc1dL5J9dniYs/wiy77ocyonO8D31o+KeeWKXhejU+nPm dThiL3kaSD+uqU8d74EjZ/JCb/vClEVrFRYqdwNXp46ITQLshCIQ4ti0tgtjrYJs9iW8 fCmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468359; x=1714073159; 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=A5AN2zfNkbZgNzq4yMXaRJrNHQuv3As8IXVhhvnN+gY=; b=Rebd8ReHgYJd5Ny2yLAtNIcZwS+QbMvL6N+O8FDAX+bFxpo0/l7RE+xAkDPd11/17x CsVWLjONteJ7a+DJVrjMktXzJxAXt+O7IlxKS7rQ3mDo0AodA25LiWzT1JaXxGl+/JeT naQFFDFEa9yTUEB9oEfQQcUeEm48w4xJ4D+aSebNEpTUn+lWHCGyVp7e+UHjeUqqh4x9 1PMCqAaHF1AMyLsRWSNAwByScf22fXvVo+4stZ0blkvNl6G8r82TJbEGCDjbrhEn84K1 xvw5S1gwHoNcJFuxmuQEtQDS/YV+b/nsb7tD3fx6kMQ1N7/J7wlNUmHNhrbXGSaruH4p XNqw== X-Forwarded-Encrypted: i=1; AJvYcCVR1VxHJpf/vpLKljB/+4VbN9q3YwIHCy6nzGHb1hySjTd4jkFIqK9S4yHYMv3/wX3IVQhfwqoIC4ZVo2B4qBKX9HsX X-Gm-Message-State: AOJu0YyJRcVcu6YHqllXuKbfnoYdCG+W2OHKlcghZf+PtxStfEJIGzVN J6SJQCfLkMHMgjr2tzSHtGml012DFKbOPLdc9ANbwtppTk9ZseC49cMZpMLbQQg= X-Google-Smtp-Source: AGHT+IFLSLQi8pDowoTVpwvSQYRuYn13I7Tn86X4cb0qyEAJ8RLgeCtpawdlVQYvcABi9MDTksrlmA== X-Received: by 2002:a17:906:1949:b0:a52:5925:1f76 with SMTP id b9-20020a170906194900b00a5259251f76mr47729eje.47.1713468359292; Thu, 18 Apr 2024 12:25:59 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id z18-20020a170906435200b00a4e657a5f1asm1259445ejm.112.2024.04.18.12.25.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:25:58 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 05/24] exec: Restrict 'cpu_ldst.h' to TCG accelerator Date: Thu, 18 Apr 2024 21:25:04 +0200 Message-ID: <20240418192525.97451-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=philmd@linaro.org; helo=mail-ej1-x62d.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org "exec/cpu_ldst.h" is specific to TCG, do not allow its inclusion from other accelerators. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/exec/cpu_ldst.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index 5b99666702..f3c2a3ca74 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -1,5 +1,5 @@ /* - * Software MMU support + * Software MMU support (per-target) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -62,6 +62,10 @@ #ifndef CPU_LDST_H #define CPU_LDST_H +#ifndef CONFIG_TCG +#error Can only include this header with TCG +#endif + #include "exec/memopidx.h" #include "exec/abi_ptr.h" #include "exec/mmu-access-type.h" From patchwork Thu Apr 18 19:25:05 2024 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: 1925225 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Q7WYsWSZ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL78f08Y5z1yZP for ; Fri, 19 Apr 2024 05:27:46 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXPq-0000U0-Pp; Thu, 18 Apr 2024 15:27:28 -0400 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 1rxXOa-0007mH-Ri for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:26:11 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXOY-0007Ll-MV for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:26:08 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-57013379e17so1109792a12.0 for ; Thu, 18 Apr 2024 12:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468365; x=1714073165; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kMOTCzZ8G1QDoqpRuDm+110xUKe36YwlxUEiY1YFvik=; b=Q7WYsWSZ+N9wV4Y81fNy5BB3MIr7PNKoUY0ZECRnyrkpvvL9iBKP71IYNc3o9FYV/S fqsnn/qte7tZgNO8cVtB7BOdeNSZpy3VXmpzKubQtcGPaeQni7nhCQncwybTRquoo3TU vhqc0IXMvMeeMOoNxsc+yTBcI1AeyzJdFivQh9gBBozbHzDwiEGPNKGZ97rg2GeoH8Nx cKPkJ8aefyE+g7KjVC/2Nftx0pX7T/HNtAzKZ8p89HeX0D7QUtP7iErq+6NQBR47T3f0 2UWThA3ztsI7N6OES/CGSf+0ZN/0aSJjDVUPYq+EDXivRGBkdpOOJJfpShhgmIZxC5YH /HmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468365; x=1714073165; 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=kMOTCzZ8G1QDoqpRuDm+110xUKe36YwlxUEiY1YFvik=; b=B0sQkEXSYh0EX+8GAbLnZhsUUi00x+jnsQRjijS+IEQQGE8qhMEruQvY70pikNuevN o9yiToyOR8Iafe6Zr7F/S1t7Fb9rrNU7jPb9AvjrpKMNwSYicAHJNyIFGoj76FqrKSNB 9H80E8OlSi9tn0/denZGk/undGkvFYU+skpMnvJmgbf+YNF8niI+g248SLz6s/8P2lZw om4Y49jqdBVWStDOHrCsr0Ey50yBpxP3aFNID9LiueTlTXxFqnCRuuahLJxb4YLBj0VH DzRBpTh7uOnIgD64XZxaZTAhYw3JNTQSm8WZD96Lwpe2yG/XQvH1c3oMWcdv0gbYWTlv 8Jgg== X-Forwarded-Encrypted: i=1; AJvYcCUtbgwWPL/S8PnhCInNvVQu0zuQs+Zr0/Wx0XkQYfswY7RRIqXVFgFwyuUtZl1Hfz2FmPv6vlUS2ErzZw4pbO50cg+v X-Gm-Message-State: AOJu0YxLkcmshsuyYOt0mtDyVr0WWvaDPA8JcjZs9r6n1pyIMgstULRB ETsh1bUPIpmm1iiYsA7oGHvx2Ysb6vNkGKrLkwRE9zPgjPnxZUcmwIzqBOB4SwE= X-Google-Smtp-Source: AGHT+IGauXFub4OFdy7tZBt9c2yQKaEln2/oxE9Uk8pxg4A6jmXoRy5XQ4BNQTCVjKmFKW2y4HZUKg== X-Received: by 2002:a50:951a:0:b0:56e:2fb9:66d6 with SMTP id u26-20020a50951a000000b0056e2fb966d6mr107290eda.27.1713468365147; Thu, 18 Apr 2024 12:26:05 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id fj17-20020a0564022b9100b0056fe8f3eec6sm1194542edb.62.2024.04.18.12.26.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:26:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 06/24] exec: Have guest_addr_valid() methods take abi_ptr/size_t arguments Date: Thu, 18 Apr 2024 21:25:05 +0200 Message-ID: <20240418192525.97451-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=philmd@linaro.org; helo=mail-ed1-x52b.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org abi_ulong is target specific, replace by abi_ptr which isn't. Use size_t for the @len type. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu_ldst.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index f3c2a3ca74..63186b07e4 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -92,12 +92,12 @@ static inline void *g2h(CPUState *cs, abi_ptr x) return g2h_untagged(cpu_untagged_addr(cs, x)); } -static inline bool guest_addr_valid_untagged(abi_ulong x) +static inline bool guest_addr_valid_untagged(abi_ptr x) { return x <= GUEST_ADDR_MAX; } -static inline bool guest_range_valid_untagged(abi_ulong start, abi_ulong len) +static inline bool guest_range_valid_untagged(abi_ptr start, size_t len) { return len - 1 <= GUEST_ADDR_MAX && start <= GUEST_ADDR_MAX - len + 1; } From patchwork Thu Apr 18 19:25:06 2024 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: 1925240 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=OXhY/Buh; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL7Bq3fD0z1yZP for ; Fri, 19 Apr 2024 05:29:39 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXRP-0004Tz-Cj; Thu, 18 Apr 2024 15:29:03 -0400 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 1rxXOh-0007pF-8H for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:26:16 -0400 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXOf-0007PF-BK for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:26:14 -0400 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a53f131d9deso139195066b.3 for ; Thu, 18 Apr 2024 12:26:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468372; x=1714073172; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9U+h/wZIc3z+oX/TXzP2qUKxN0wKW4ADsCvM3ymjRp0=; b=OXhY/Buhko3s7UunL/ForDhnDCXTzNZnT86h9tZD2ta+Z+fJ0d64GwRu2JZ30LcfzM WjRuXcIe7y/BrLfY/QGRhwIzOeDHbJa3sqZS1IFnj2rHeKQy/P3zXw+x1sYcQZC+uMPL 6pu5jtSZJGgXHiYu0ZsmlVEVldbY+TWEJ0Mjr/RcmoGR83DbFcFNmKTm3Cg/erWPrrIk EwqC0YJOIvsqPzylwTXfMuxxRao7rhHw+NUMzqIBS5R6qMgSRen0KzSfdf0SwaNdGEaT 6t2o7prZZQpvS45bC9j5SE1qGf1BUMlnp82rxA3NQaEjCTJMnKnhURWBkyah+Q6Os0sM Wd4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468372; x=1714073172; 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=9U+h/wZIc3z+oX/TXzP2qUKxN0wKW4ADsCvM3ymjRp0=; b=rBSExzrNuIoyv8WjI2oYGJri+5d3cmn1l11FhoaJ5mWyuj+op+6OEgetKvFvkMMbCe v2DzFzIBhgZzqS70W3qwVCpcl+wU0lnxlbfC3H9yDrmPhokAcAi+isZYsmvnKbIFv0uY mQQ0gUdYCu/lzgzd7pI1sB70cjFtm2XmPb1dqg9ehY6YKrtKortql4nXu9LGmIkr5u5H 2PJX694fKMOx3ypPpyqu/+bO0anOaXQI/0LbJS6OBFatP5msdPJBg0mRqokgcWcUNcUH wspTX+hYFDeM+q+NrGgqDNbqD6fpNFseNw82Q8LHkFO9qc9Xmrjs05cTjJ8lMi8DGLi7 lA8w== X-Forwarded-Encrypted: i=1; AJvYcCXuIZMs4aYBRHVoSk22XUjL12A8SwjandHvvZnnqmxcOwIKQNDQ8KhjYUv5ywgpjQ8jxw8/XNQxfObqqCRM6AlcP5me X-Gm-Message-State: AOJu0YzNoI/BfiAbGEj+KHNL7l0oqv+KLkADtRiX4Mk37a7/83QSo1DP zuBNZjQ45ehtUih7JEWFItZe4IVXiiavEpmcyYe2dDohEgpTTw+bOn+HT3hmmpk= X-Google-Smtp-Source: AGHT+IF3G8X24RbaYze8VdVZ1kx3UyNMM7AzihIFYhjXkguw8ljWqt1FoAzlNUd5Ds9C7eQQOymXBQ== X-Received: by 2002:a17:906:2642:b0:a51:982e:b3f7 with SMTP id i2-20020a170906264200b00a51982eb3f7mr47184ejc.37.1713468371935; Thu, 18 Apr 2024 12:26:11 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id v18-20020a170906489200b00a46baba1a0asm1259512ejq.100.2024.04.18.12.26.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:26:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Riku Voipio , Peter Maydell , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , Mark Cave-Ayland , Artyom Tarasenko Subject: [PATCH 07/24] exec: Un-inline tlb_vaddr_to_host() and declare it in 'exec/cputlb.h' Date: Thu, 18 Apr 2024 21:25:06 +0200 Message-ID: <20240418192525.97451-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=philmd@linaro.org; helo=mail-ej1-x62a.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Declare tlb_vaddr_to_host() in "exec/cputlb.h" with the CPU TLB API. Un-inline the user emulation definition to avoid including "exec/cpu_ldst.h" (which declares g2h) in "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu_ldst.h | 24 ------------------------ include/exec/cputlb.h | 18 ++++++++++++++++++ accel/tcg/user-exec.c | 7 +++++++ target/arm/tcg/helper-a64.c | 1 + target/riscv/vector_helper.c | 1 + target/sparc/mmu_helper.c | 1 + 6 files changed, 28 insertions(+), 24 deletions(-) diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index 63186b07e4..7032949dba 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -418,28 +418,4 @@ static inline int cpu_ldsw_code(CPUArchState *env, abi_ptr addr) return (int16_t)cpu_lduw_code(env, addr); } -/** - * tlb_vaddr_to_host: - * @env: CPUArchState - * @addr: guest virtual address to look up - * @access_type: 0 for read, 1 for write, 2 for execute - * @mmu_idx: MMU index to use for lookup - * - * Look up the specified guest virtual index in the TCG softmmu TLB. - * If we can translate a host virtual address suitable for direct RAM - * access, without causing a guest exception, then return it. - * Otherwise (TLB entry is for an I/O access, guest software - * TLB fill required, etc) return NULL. - */ -#ifdef CONFIG_USER_ONLY -static inline void *tlb_vaddr_to_host(CPUArchState *env, abi_ptr addr, - MMUAccessType access_type, int mmu_idx) -{ - return g2h(env_cpu(env), addr); -} -#else -void *tlb_vaddr_to_host(CPUArchState *env, abi_ptr addr, - MMUAccessType access_type, int mmu_idx); -#endif - #endif /* CPU_LDST_H */ diff --git a/include/exec/cputlb.h b/include/exec/cputlb.h index ef18642a32..173eb98b9a 100644 --- a/include/exec/cputlb.h +++ b/include/exec/cputlb.h @@ -20,10 +20,28 @@ #ifndef CPUTLB_H #define CPUTLB_H +#include "exec/abi_ptr.h" #include "exec/cpu-common.h" +#include "exec/mmu-access-type.h" #ifdef CONFIG_TCG +/** + * tlb_vaddr_to_host: + * @env: CPUArchState + * @addr: guest virtual address to look up + * @access_type: 0 for read, 1 for write, 2 for execute + * @mmu_idx: MMU index to use for lookup + * + * Look up the specified guest virtual index in the TCG softmmu TLB. + * If we can translate a host virtual address suitable for direct RAM + * access, without causing a guest exception, then return it. + * Otherwise (TLB entry is for an I/O access, guest software + * TLB fill required, etc) return NULL. + */ +void *tlb_vaddr_to_host(CPUArchState *env, abi_ptr addr, + MMUAccessType access_type, int mmu_idx); + #if !defined(CONFIG_USER_ONLY) /* cputlb.c */ void tlb_protect_code(ram_addr_t ram_addr); diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 1c621477ad..54b35588b9 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -23,6 +23,7 @@ #include "tcg/tcg.h" #include "qemu/bitops.h" #include "qemu/rcu.h" +#include "exec/cputlb.h" #include "exec/cpu_ldst.h" #include "exec/translate-all.h" #include "exec/helper-proto.h" @@ -138,6 +139,12 @@ bool handle_sigsegv_accerr_write(CPUState *cpu, sigset_t *old_set, } } +void *tlb_vaddr_to_host(CPUArchState *env, abi_ptr addr, + MMUAccessType access_type, int mmu_idx) +{ + return g2h(env_cpu(env), addr); +} + typedef struct PageFlagsNode { struct rcu_head rcu; IntervalTreeNode itree; diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c index ebaa7f00df..9b3ae06207 100644 --- a/target/arm/tcg/helper-a64.c +++ b/target/arm/tcg/helper-a64.c @@ -29,6 +29,7 @@ #include "internals.h" #include "qemu/crc32c.h" #include "exec/exec-all.h" +#include "exec/cputlb.h" #include "exec/cpu_ldst.h" #include "qemu/int128.h" #include "qemu/atomic128.h" diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index fa139040f8..d3d9c33597 100644 --- a/target/riscv/vector_helper.c +++ b/target/riscv/vector_helper.c @@ -22,6 +22,7 @@ #include "cpu.h" #include "exec/memop.h" #include "exec/exec-all.h" +#include "exec/cputlb.h" #include "exec/cpu_ldst.h" #include "exec/helper-proto.h" #include "fpu/softfloat.h" diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c index ad1591d9fd..e79a33367a 100644 --- a/target/sparc/mmu_helper.c +++ b/target/sparc/mmu_helper.c @@ -21,6 +21,7 @@ #include "qemu/log.h" #include "cpu.h" #include "exec/exec-all.h" +#include "exec/cputlb.h" #include "qemu/qemu-print.h" #include "trace.h" From patchwork Thu Apr 18 19:25:07 2024 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: 1925227 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=ParLr1xC; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL78w1FVhz1yZP for ; Fri, 19 Apr 2024 05:28:00 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXQC-0001VG-LW; Thu, 18 Apr 2024 15:27:50 -0400 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 1rxXOm-0007y7-TS for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:26:23 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXOl-0007T2-6n for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:26:20 -0400 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-56e136cbcecso1750998a12.3 for ; Thu, 18 Apr 2024 12:26:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468378; x=1714073178; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zLjP+56aWYnnkz1DDDJchrnGcEe4NhmJ8So9/v4UjQ4=; b=ParLr1xCZ+NwFQaJIoKYvwj8nn1OnnhSqfv4v3rt2koBwPPNZh1u6rDxvG9owbfj2k S+880aDyVEfTPHmITZP4lnH9z8s3pzWjjke4MmziuxCa7JddgubhTnERenhAuIRCJ1uF +pDcqm59V/jzJlAhh4dEzrTT+cUY8jkC50mS19sqp/J6jmy/glOhcoB2zvf+IbUQAsOr uyqoqS6NzSWk/27+PMA/eafcGhko0q1OVVBJCIY/qM+qg9enrEYdkL1haltbK7eazq00 nC1keygEBxPz6ldSrLjJ6Cyz9r3h1BBS+4LLNrIhwnfrfa0UP26y5UX66ObLkCQiokbj 8BDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468378; x=1714073178; 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=zLjP+56aWYnnkz1DDDJchrnGcEe4NhmJ8So9/v4UjQ4=; b=FmClBK1VLcLIaP+8Ig8YYx3LeEwyac6loOgAwgWyfT6iLOmYtM0K7Ix4bUyU9EEE12 v/tq3flXH5pPFLEeQ9vCxU+lkOrkC/SBO8ZSVzi0KBC0wCywi5bRFDYvpnrzIKZSObiE jd5fYs57aCgQaVga2iraoJ5d1KFS6cHbgwT80T1yxs4RegB+o9yL4BElH6GRSv4DEIcH lu8qGqxZK0jA4j0mcCAN3LDtbdqksqGx7jtrJBgwbQg6cmSPPqc589cNKKk3IuoGKngs R9j/tH260IFJdAT4HmZsZIb+MTwe4wwrAw3b0bX5MH2Pgp3DkyQ279bGIH28YeEEKz8u VnVQ== X-Forwarded-Encrypted: i=1; AJvYcCXb2KdxrIh0G0QnLCAvVcoZegNDVjwUdDVamN5wA8tD6aZU46Ays+v+4aWbvqZyXCCqh2zVy0ByjnB3TJPRcn+GhD+M X-Gm-Message-State: AOJu0YxWVwkpfoAwPWGDCnelsa9oufLjGKLoFeAt7w199y1kbx/9ZmSo oWkRSz413wyfkFHuRbRd3oXApib75gf3aUf97qdpHpmKJK32H+kcz7NL1Q7MXZo= X-Google-Smtp-Source: AGHT+IGIyJcuxTWVzJ5A2zRDxQxrv2YI3QEWh/QF+lto57+gXutKQjVp9+gj3KNHJecg6m3omxb4CQ== X-Received: by 2002:a17:906:19cf:b0:a52:6fca:9151 with SMTP id h15-20020a17090619cf00b00a526fca9151mr48443ejd.49.1713468377872; Thu, 18 Apr 2024 12:26:17 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id f5-20020a1709067f8500b00a5559f0f9dcsm1275997ejr.79.2024.04.18.12.26.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:26:17 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu Subject: [PATCH 08/24] physmem: Move TCG CPU IOTLB methods around Date: Thu, 18 Apr 2024 21:25:07 +0200 Message-ID: <20240418192525.97451-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=philmd@linaro.org; helo=mail-ed1-x532.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org The next commit will restrict TCG specific code in physmem.c using some #ifdef'ry. In order to keep it simple, move iotlb_to_section() and memory_region_section_get_iotlb() around close together. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- system/physmem.c | 50 ++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/system/physmem.c b/system/physmem.c index dd7b222942..cf6334f3a3 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -736,6 +736,31 @@ translate_fail: return &d->map.sections[PHYS_SECTION_UNASSIGNED]; } +MemoryRegionSection *iotlb_to_section(CPUState *cpu, + hwaddr index, MemTxAttrs attrs) +{ + int asidx = cpu_asidx_from_attrs(cpu, attrs); + CPUAddressSpace *cpuas = &cpu->cpu_ases[asidx]; + AddressSpaceDispatch *d = cpuas->memory_dispatch; + int section_index = index & ~TARGET_PAGE_MASK; + MemoryRegionSection *ret; + + assert(section_index < d->map.sections_nb); + ret = d->map.sections + section_index; + assert(ret->mr); + assert(ret->mr->ops); + + return ret; +} + +/* Called from RCU critical section */ +hwaddr memory_region_section_get_iotlb(CPUState *cpu, + MemoryRegionSection *section) +{ + AddressSpaceDispatch *d = flatview_to_dispatch(section->fv); + return section - d->map.sections; +} + void cpu_address_space_init(CPUState *cpu, int asidx, const char *prefix, MemoryRegion *mr) { @@ -957,14 +982,6 @@ bool cpu_physical_memory_snapshot_get_dirty(DirtyBitmapSnapshot *snap, return false; } -/* Called from RCU critical section */ -hwaddr memory_region_section_get_iotlb(CPUState *cpu, - MemoryRegionSection *section) -{ - AddressSpaceDispatch *d = flatview_to_dispatch(section->fv); - return section - d->map.sections; -} - static int subpage_register(subpage_t *mmio, uint32_t start, uint32_t end, uint16_t section); static subpage_t *subpage_init(FlatView *fv, hwaddr base); @@ -2434,23 +2451,6 @@ static uint16_t dummy_section(PhysPageMap *map, FlatView *fv, MemoryRegion *mr) return phys_section_add(map, §ion); } -MemoryRegionSection *iotlb_to_section(CPUState *cpu, - hwaddr index, MemTxAttrs attrs) -{ - int asidx = cpu_asidx_from_attrs(cpu, attrs); - CPUAddressSpace *cpuas = &cpu->cpu_ases[asidx]; - AddressSpaceDispatch *d = cpuas->memory_dispatch; - int section_index = index & ~TARGET_PAGE_MASK; - MemoryRegionSection *ret; - - assert(section_index < d->map.sections_nb); - ret = d->map.sections + section_index; - assert(ret->mr); - assert(ret->mr->ops); - - return ret; -} - static void io_mem_init(void) { memory_region_init_io(&io_mem_unassigned, NULL, &unassigned_mem_ops, NULL, From patchwork Thu Apr 18 19:25:08 2024 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: 1925256 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=rGFJFJXq; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL7FD0HjSz1yPv for ; Fri, 19 Apr 2024 05:31:44 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXSM-0007x3-DE; Thu, 18 Apr 2024 15:30:02 -0400 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 1rxXOv-00086C-8y for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:26:31 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXOr-0007UG-OC for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:26:28 -0400 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-571bddd74c1so956111a12.0 for ; Thu, 18 Apr 2024 12:26:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468384; x=1714073184; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cz2i/C3VQ13wYP5OhAoy8JFwTzWM+gW+I5eQgS4AVJI=; b=rGFJFJXqayyEX3JVK8pZ5TI/WNYzNoTP4Dozlcd7Tk8SXB50Ez/w5Icno2lGsdWUqc d48ck1S386PiW1Kn1Uwei0YGNk5SVt7ItCQRd80wi+W3zCAxCkNrTOnlR5f2hg0qFxlf hXrs+V/ejuTgQ+Slof0BMzHJM1swRDY66f4CMIgEo5asri3fKu9IxlIBEHRmP3A8NRYk lqtN/7uuANzx0+Ww5JhuHzyEayBIAYzYEBLykLY7M5GczDdBFMT6kCkR2KzzJuKD3Ota n+R5w5jJRMZlfJq6BJJhDSZALe3jotGAgt5oFBh6r/vm5pSmnCLg7XQ8a9kEVIFCioG4 07OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468384; x=1714073184; 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=cz2i/C3VQ13wYP5OhAoy8JFwTzWM+gW+I5eQgS4AVJI=; b=XlNb7EX8IJVvqBzBRdBcjFukvTBuW/kvpDhnFtbG4RohLLa+FDbw2ztJxUHTRtlPoR XOT4nXHxYi51jvv8hHxJZMX73VGZzgQoyK8Xaste+rNyVD+vWP4hcN3HBZH5/DCZRfjO KIfvh+GPqVf1lDFzOEm+BQqao2KXjY4CjZW50IPafQpmbw7pRqMs6sq/cOpZwpufZVw/ jMxKGcjiPnrgeeIqZ0GTCXK7VVcqg1raLAPz8cFLmN7uL8D2QfddHY49jkTufLIjrzUO 2Avc9TtKEsH9xqF0VBH3XLFPYi1DGA73EPWgK73x1y5ElA/cO+TBZMP3wdSsgZzrXmXW U2lQ== X-Forwarded-Encrypted: i=1; AJvYcCXtfmz3YAg1X0yoVzRCbnVN70r0/Qlew553HHLQ/t2DaSsjaPSwwmX4dbwD9TDTN+YwU5sFAPxJT+Vn4nImaez/64dj X-Gm-Message-State: AOJu0YzdLXoywM6NSAsC5freYphjtIs+wm/Uv6nr2vU/cDmvr+7sDISI WZdEz6JtxZ72hnIZBk8PewkZFXQUAYwv+6lS4qT+kH3gylzPG/B19RbVQwk9gb0= X-Google-Smtp-Source: AGHT+IEvmItgMVF6C3/vVOPtGDziKuF0Mk9IzmEgs2m+jrdat7LuYqaRaUfsQ5Ozj1eVRXpxQ9qu5A== X-Received: by 2002:a17:906:c290:b0:a52:1e53:febf with SMTP id r16-20020a170906c29000b00a521e53febfmr42958ejz.69.1713468383981; Thu, 18 Apr 2024 12:26:23 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id s13-20020a170906bc4d00b00a553de860c6sm1262836ejv.133.2024.04.18.12.26.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:26:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu Subject: [PATCH 09/24] physmem: Restrict TCG CPU IOTLB code to TCG accel Date: Thu, 18 Apr 2024 21:25:08 +0200 Message-ID: <20240418192525.97451-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=philmd@linaro.org; helo=mail-ed1-x529.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Restrict iotlb_to_section(), address_space_translate_for_iotlb() and memory_region_section_get_iotlb() to TCG. Declare them in "exec/cputlb.h". Declare iotlb_to_section() using the MemoryRegionSection typedef. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cputlb.h | 25 +++++++++++++++++++++++-- include/exec/exec-all.h | 21 --------------------- system/physmem.c | 6 ++++++ 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/include/exec/cputlb.h b/include/exec/cputlb.h index 173eb98b9a..3594f904b4 100644 --- a/include/exec/cputlb.h +++ b/include/exec/cputlb.h @@ -21,6 +21,8 @@ #define CPUTLB_H #include "exec/abi_ptr.h" +#include "exec/hwaddr.h" +#include "exec/memattrs.h" #include "exec/cpu-common.h" #include "exec/mmu-access-type.h" @@ -43,10 +45,29 @@ void *tlb_vaddr_to_host(CPUArchState *env, abi_ptr addr, MMUAccessType access_type, int mmu_idx); #if !defined(CONFIG_USER_ONLY) -/* cputlb.c */ + void tlb_protect_code(ram_addr_t ram_addr); void tlb_unprotect_code(ram_addr_t ram_addr); -#endif + +/** + * iotlb_to_section: + * @cpu: CPU performing the access + * @index: TCG CPU IOTLB entry + * + * Given a TCG CPU IOTLB entry, return the MemoryRegionSection that + * it refers to. @index will have been initially created and returned + * by memory_region_section_get_iotlb(). + */ +MemoryRegionSection *iotlb_to_section(CPUState *cpu, + hwaddr index, MemTxAttrs attrs); +MemoryRegionSection * +address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr addr, + hwaddr *xlat, hwaddr *plen, + MemTxAttrs attrs, int *prot); +hwaddr memory_region_section_get_iotlb(CPUState *cpu, + MemoryRegionSection *section); + +#endif /* CONFIG_USER_ONLY */ #endif /* CONFIG_TCG */ diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 5cddfea01b..e4cff08db4 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -536,21 +536,6 @@ extern __thread uintptr_t tci_tb_ptr; smaller than 4 bytes, so we don't worry about special-casing this. */ #define GETPC_ADJ 2 -#if !defined(CONFIG_USER_ONLY) - -/** - * iotlb_to_section: - * @cpu: CPU performing the access - * @index: TCG CPU IOTLB entry - * - * Given a TCG CPU IOTLB entry, return the MemoryRegionSection that - * it refers to. @index will have been initially created and returned - * by memory_region_section_get_iotlb(). - */ -struct MemoryRegionSection *iotlb_to_section(CPUState *cpu, - hwaddr index, MemTxAttrs attrs); -#endif - /** * get_page_addr_code_hostp() * @env: CPUArchState @@ -659,12 +644,6 @@ void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length); void tlb_set_dirty(CPUState *cpu, vaddr addr); void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t length); -MemoryRegionSection * -address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr addr, - hwaddr *xlat, hwaddr *plen, - MemTxAttrs attrs, int *prot); -hwaddr memory_region_section_get_iotlb(CPUState *cpu, - MemoryRegionSection *section); #endif #endif diff --git a/system/physmem.c b/system/physmem.c index cf6334f3a3..38d3ede9f9 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -31,6 +31,7 @@ #endif /* CONFIG_TCG */ #include "exec/exec-all.h" +#include "exec/cputlb.h" #include "exec/target_page.h" #include "hw/qdev-core.h" #include "hw/qdev-properties.h" @@ -585,6 +586,7 @@ typedef struct TCGIOMMUNotifier { bool active; } TCGIOMMUNotifier; +#ifdef CONFIG_TCG static void tcg_iommu_unmap_notify(IOMMUNotifier *n, IOMMUTLBEntry *iotlb) { TCGIOMMUNotifier *notifier = container_of(n, TCGIOMMUNotifier, n); @@ -648,6 +650,7 @@ static void tcg_register_iommu_notifier(CPUState *cpu, notifier->active = true; } } +#endif void tcg_iommu_free_notifier_list(CPUState *cpu) { @@ -668,6 +671,7 @@ void tcg_iommu_init_notifier_list(CPUState *cpu) cpu->iommu_notifiers = g_array_new(false, true, sizeof(TCGIOMMUNotifier *)); } +#ifdef CONFIG_TCG /* Called from RCU critical section */ MemoryRegionSection * address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr orig_addr, @@ -761,6 +765,8 @@ hwaddr memory_region_section_get_iotlb(CPUState *cpu, return section - d->map.sections; } +#endif /* CONFIG_TCG */ + void cpu_address_space_init(CPUState *cpu, int asidx, const char *prefix, MemoryRegion *mr) { From patchwork Thu Apr 18 19:25:09 2024 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: 1925246 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=l6XJj1qe; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL7Cb6XkDz1yPv for ; Fri, 19 Apr 2024 05:30:19 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXRd-0006PH-AV; Thu, 18 Apr 2024 15:29:18 -0400 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 1rxXP1-00089S-6J for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:26:39 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXOz-0007VH-DK for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:26:34 -0400 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-5171a529224so1525507e87.0 for ; Thu, 18 Apr 2024 12:26:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468390; x=1714073190; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3p8Qs3F8jC3emGpbq1YTEbHVimCbjmiYVCccpiO4GlE=; b=l6XJj1qe8VBY4jrF6BnIYaBg1AZu9OvyIfJD48OAGLmANCcO1rhrkC05Q9IQo78mPl XE1ZA0h1h+zQXBqauPdX0ackVXtdbEoJ7/18OrxCKs44Q+dKCgDdkVsLuY0+CL5DZBZF finkyr1zD+WmcefH3/KSWPryCHp1BiBiFXDUpaajv7jVj0l0ToFtwNJHUs8uLmAcqOT9 Ibn6KrhTSzJhoet94eUFR6kTCLJGGQX3nCURcUBLRE0v56p+Ha8F1qJXsSK8bVxo0Z+T NxFSlbtbNsZJVgsYAHHHOFYg+MeQjqNkz/KVA06nINvI1tIJ37DE3SClCbRS8yZZVC6P vShQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468390; x=1714073190; 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=3p8Qs3F8jC3emGpbq1YTEbHVimCbjmiYVCccpiO4GlE=; b=bWWQX2i3lLO95fs92y/9S0j9Ynh66h0kN0eA/KfMeKwUWJeKXym+8oNZf6WVXhChdJ 2jIhxY5qRi8jmZw6AzdUDEOKDuwy2c1CUfCFTMEmaQCPyKviRTfuZkpzQ7Ru6Gulswpa PdkI+i3qMGjvOzfcrR652xDBdxvf/8wRfXXG3JmX332Rjt8QJ8CxUevJhwVI/rTafFcV jR4tSOjuXJMnNRwv5ajdVfwvH8ssNIUspIonadmo2WyU6trTEw9ZtVm+jmxE0PvdHRMt 4k4SdN2AH8SsMnMRCnXhQAA8+GzYtQrcYjDXrZu1ZCe7ytetQTnxx6ctJqMQY/vvMYeF kiKg== X-Forwarded-Encrypted: i=1; AJvYcCWWNOHFKbfipIM6B/fwNcMoxxTrFE25yY8uPH0s5dNIX40wO/CUMKeh9vNHv7ZvZrt4yQ6PdBdIZ5xYNEus4lIielPU X-Gm-Message-State: AOJu0Yzl5nmg4rDNgCCTV4lMTvSTPoL9myLErQ5UHrXbFgS2Dt8Givjy zv65eDeEEUk7FkQTUoBdioI2feg9MiahQU6mQWbZDdEFMHTlTe0G+6aMPfwAQ3BbPyByzhsEgXt l X-Google-Smtp-Source: AGHT+IGc0qRkEMLMTGegLV4EypFFITOzOda0O4GHRkc0UB5yO1McHeMMwCZLkgpZNT6hPX4mXdod/A== X-Received: by 2002:a05:6512:34c3:b0:51a:affe:2526 with SMTP id w3-20020a05651234c300b0051aaffe2526mr460238lfr.62.1713468390092; Thu, 18 Apr 2024 12:26:30 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id es13-20020a056402380d00b0056c249798absm1211244edb.71.2024.04.18.12.26.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:26:29 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 10/24] exec: Reduce tlb_set_dirty() declaration scope Date: Thu, 18 Apr 2024 21:25:09 +0200 Message-ID: <20240418192525.97451-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=philmd@linaro.org; helo=mail-lf1-x134.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org tlb_set_dirty() is only used in accel/tcg/cputlb.c, where it is defined. Declare it statically, removing the stub. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/exec/exec-all.h | 1 - accel/stubs/tcg-stub.c | 4 ---- accel/tcg/cputlb.c | 2 +- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index e4cff08db4..778c82ba8e 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -641,7 +641,6 @@ static inline void mmap_unlock(void) {} #define WITH_MMAP_LOCK_GUARD() void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length); -void tlb_set_dirty(CPUState *cpu, vaddr addr); void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t length); #endif diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c index 8a496a2a6f..dd890d6cf6 100644 --- a/accel/stubs/tcg-stub.c +++ b/accel/stubs/tcg-stub.c @@ -18,10 +18,6 @@ void tb_flush(CPUState *cpu) { } -void tlb_set_dirty(CPUState *cpu, vaddr vaddr) -{ -} - int probe_access_flags(CPUArchState *env, vaddr addr, int size, MMUAccessType access_type, int mmu_idx, bool nonfault, void **phost, uintptr_t retaddr) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 93b1ca810b..e16d02a62c 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1039,7 +1039,7 @@ static inline void tlb_set_dirty1_locked(CPUTLBEntry *tlb_entry, /* update the TLB corresponding to virtual page vaddr so that it is no longer dirty */ -void tlb_set_dirty(CPUState *cpu, vaddr addr) +static void tlb_set_dirty(CPUState *cpu, vaddr addr) { int mmu_idx; From patchwork Thu Apr 18 19:25:10 2024 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: 1925233 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=H9ay9pzy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL79j2Ky9z1yZP for ; Fri, 19 Apr 2024 05:28:41 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXQg-0002et-Nx; Thu, 18 Apr 2024 15:28:19 -0400 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 1rxXP9-0008D8-9n for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:26:48 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXP6-0007W2-2Q for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:26:42 -0400 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a51a1c8d931so134302766b.0 for ; Thu, 18 Apr 2024 12:26:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468396; x=1714073196; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Jio+r+AEUkjjrU5gDZl4zBsemaqAFeHzEWFaXnqFrOQ=; b=H9ay9pzyZ3ABmD/RWdVRSmHZJ7NF0E3NBJrceLHGEJzh6D7hJPH+8f2V1ryKITt3ud /B3wppTVSXUgTFlvB63p+1EKTKSIGLDYekYP/JSXjD5ogQiuK89yM44cC6X0kRqw8VMq dPP4gljVL+cBnfA8M4m3V67fVvUoorMzwLr3wSy4Wg9JOhVtV8WbmGtvc/rN1bn4rP94 IfkdTDv83Dfn+TueCEwTIv5uOmw7J30z3m9GIha/9F5lkqNUyooZOiYbjS0Y81TSqkC7 qD+ALB49Pq+ZT8OnjAnk4roeyzf99jWE4yIgwVTFCCDLa+0kj5jnEdP6ueDv9/pMbc+l RIag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468396; x=1714073196; 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=Jio+r+AEUkjjrU5gDZl4zBsemaqAFeHzEWFaXnqFrOQ=; b=VzNUzUsoETVZ4RH7Nl24dmanHbg3DPN/vexr2V/QC+MAuEhs/7dr3NckI2FyEttSnU uSLCRZ3TcJ0T0Hp1GUzva3ppYnTjHzVA6eIk0tcpDaZJkQ10YYCiTeoliIOkqruMarfX +PR2KrfaTPj9OAt9ywNcx7Q/YP1Vvh8jrEew5YPJWJ1l5HsLTHWefZAHpnkKmNf3i67B iRQjlYteY7nOrn8LjC0/lJ5HnJliICtDZdyHxuZSf2Aes3zP0L7XluY5MpeyiNRcnR7R v0EgQuqEQdL9eOVnMKU+q1KgxThKO2dluKD8Y0m0QXqulc1s8nZk3hOuRmw97xONbWD+ LaIw== X-Forwarded-Encrypted: i=1; AJvYcCU7F8BZm6HKQhB1qQL2vqeU+l8XyrYB6oxGjayHa6GFyKBtUyktF/eHZZ2yZ9n4r3YFF+dB7hdigtQG4i5huX8mtBy9 X-Gm-Message-State: AOJu0YytFDdKw9bnZJsHXn4TdfvPUB+1fV0YgE0tN9p2Vl94S3ELa94S bg2vHrLxa5BOLaAShuTczBSo60XM6lpS5at7bcfELhtUaSN/lYdJHMEBp1OD8Dw= X-Google-Smtp-Source: AGHT+IGvos0mZIxaTBgDhPQVJFUlHPzRnRLeB+2FoZuf4Lvw2zFvFjAnSJwEUd4r5lLo33Y0Jgv61A== X-Received: by 2002:a17:906:1f48:b0:a4e:cd5c:da72 with SMTP id d8-20020a1709061f4800b00a4ecd5cda72mr43114ejk.63.1713468396179; Thu, 18 Apr 2024 12:26:36 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id lu10-20020a170906faca00b00a52299d8eecsm1238430ejb.135.2024.04.18.12.26.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:26:35 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu Subject: [PATCH 11/24] exec: Move tlb_reset_dirty*() declarations to 'exec/cputlb.h' Date: Thu, 18 Apr 2024 21:25:10 +0200 Message-ID: <20240418192525.97451-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=philmd@linaro.org; helo=mail-ej1-x630.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Declare tlb_reset_dirty() and tlb_reset_dirty_range_all() in "exec/cputlb.h". Restrict tlb_reset_dirty_range_all() to TCG accel. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cputlb.h | 12 +++++++++++- include/exec/exec-all.h | 3 --- include/exec/ram_addr.h | 1 + system/physmem.c | 2 ++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/include/exec/cputlb.h b/include/exec/cputlb.h index 3594f904b4..dc92befb93 100644 --- a/include/exec/cputlb.h +++ b/include/exec/cputlb.h @@ -49,6 +49,9 @@ void *tlb_vaddr_to_host(CPUArchState *env, abi_ptr addr, void tlb_protect_code(ram_addr_t ram_addr); void tlb_unprotect_code(ram_addr_t ram_addr); +void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length); +void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t length); + /** * iotlb_to_section: * @cpu: CPU performing the access @@ -69,6 +72,13 @@ hwaddr memory_region_section_get_iotlb(CPUState *cpu, #endif /* CONFIG_USER_ONLY */ -#endif /* CONFIG_TCG */ +#else /* !CONFIG_TCG */ + +static inline void tlb_reset_dirty_range_all(ram_addr_t start, + ram_addr_t length) +{ +} + +#endif /* !CONFIG_TCG */ #endif diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 778c82ba8e..6f46015ab4 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -640,9 +640,6 @@ static inline void mmap_lock(void) {} static inline void mmap_unlock(void) {} #define WITH_MMAP_LOCK_GUARD() -void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length); -void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t length); - #endif #endif diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index 3fc83587c0..f06ae9b516 100644 --- a/include/exec/ram_addr.h +++ b/include/exec/ram_addr.h @@ -26,6 +26,7 @@ #include "exec/ramlist.h" #include "exec/ramblock.h" #include "exec/exec-all.h" +#include "cputlb.h" #include "qemu/rcu.h" extern uint64_t total_dirty_pages; diff --git a/system/physmem.c b/system/physmem.c index 38d3ede9f9..7a7876a375 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -850,6 +850,7 @@ found: return block; } +#ifdef CONFIG_TCG void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t length) { CPUState *cpu; @@ -869,6 +870,7 @@ void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t length) tlb_reset_dirty(cpu, start1, length); } } +#endif /* Note: start and end must be within the same ram block. */ bool cpu_physical_memory_test_and_clear_dirty(ram_addr_t start, From patchwork Thu Apr 18 19:25:11 2024 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: 1925235 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=SJS0cwg9; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL7B63vbPz1yZP for ; Fri, 19 Apr 2024 05:29:02 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXRA-0003X4-Ud; Thu, 18 Apr 2024 15:28:53 -0400 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 1rxXPC-0008E3-0p for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:26:55 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXP9-0007Wi-Lh for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:26:45 -0400 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5708d8beec6so1618143a12.0 for ; Thu, 18 Apr 2024 12:26:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468402; x=1714073202; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cb1njxsoj9fqYLqI6LbCARFpOVdltqpYC3ClFHXZbjY=; b=SJS0cwg9zXXPVFCnpbkYs2cKU0yYG9UVSqhn2+Hh4aGmIjTsOnQF6DSlN7+AXnHgy2 GCPIYLsZrJRj8Kaw6VoU9pmm+fWNZ2k5FpA5x7Gk/0zTbbUQXTo6TFNZ1Dsfn0zu/chK PB7mHawBoCPYgHgI70cj3wzqd3miOGv07CSU5y7X3QeiX9eGPj9Cunk2PNj+YVfm7eq8 wuGKIh+uFZJMsh5I9QqpX7ncpWV3VpOvLwG+6qGJthe81qgcKcg3cqBh72lf5gY/aS4y NT+XGZkxsLXVhX6ZswB2EpkIAjZKTulposrNzshoi9OlpZWS2g7mgucAkznygdvasDII I7/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468402; x=1714073202; 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=cb1njxsoj9fqYLqI6LbCARFpOVdltqpYC3ClFHXZbjY=; b=FjZHPHpD769ebqvvhHJVgPPvEdj1iWI2Ao6OzVZTxAgT2CQUeqq/gSTkyvKnKWlCzf 2VW6RH4+4iTQPc6qjnjJPRwfQfwr9fm3ZWt9zyzPovScdacdjBfys1oIAMmZOz0C13DK V4ZnWf8vTqU1+z2U8Y9DBt76Un/mQZeRRivsnPnD6C9qTaI9tvGRvNmlAKAE1oFfodnG DSKofc5KKl6LjT0SBJa76l+KDJk28vYvTWoBUuUvBALqL4jDZu7HrY3BsQtd5iwKDEQM ad5hO6oROEpHidwIE7HETuAz5JEPAye3bZyyWFjFh+3V8xfV1bkcyaGXYtXEqTKEsWjE 1mhg== X-Forwarded-Encrypted: i=1; AJvYcCVbmrse/f82mPzLCVrvrQtoVc9XuR1dEChqC7/lmtWaxAQQI0yicWxHH5vHwvobqCOanGDaLP1u4XThYLjjcr8QAmGo X-Gm-Message-State: AOJu0Yz7sBFanuuUVGKV2DkMuKz+yq1R8rSQWnHptGxwhJJZR3FVeAP1 NeeJCA76BNe3tquEbH8vsKuymWI1sZIFTvB/qkmh03Zwkmw5jwm+bOFFqm8HXF4= X-Google-Smtp-Source: AGHT+IE+0wbmWgIFnPU7i6VoBuSEKx6idnpuhGmJGfEUKBYV1liUnXM/8gEwZP44oUl1tDGVCvsLvw== X-Received: by 2002:a50:d7db:0:b0:56e:d9e:f4d3 with SMTP id m27-20020a50d7db000000b0056e0d9ef4d3mr95268edj.18.1713468402179; Thu, 18 Apr 2024 12:26:42 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id d3-20020a50f683000000b0056e59d747b0sm1276471edn.40.2024.04.18.12.26.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:26:41 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 12/24] exec: Move CPUTLBEntry helpers to cputlb.c Date: Thu, 18 Apr 2024 21:25:11 +0200 Message-ID: <20240418192525.97451-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=philmd@linaro.org; helo=mail-ed1-x529.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org The following CPUTLBEntry helpers are only used in accel/tcg/cputlb.c: - tlb_index() - tlb_entry() - tlb_read_idx() - tlb_addr_write() Move them to this file, allowing to remove the huge "cpu.h" header inclusion from "exec/cpu_ldst.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/exec/cpu_ldst.h | 55 ----------------------------------------- accel/tcg/cputlb.c | 51 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 55 deletions(-) diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index 7032949dba..2c5a0a5c81 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -70,7 +70,6 @@ #include "exec/abi_ptr.h" #include "exec/mmu-access-type.h" #include "qemu/int128.h" -#include "cpu.h" #if defined(CONFIG_USER_ONLY) @@ -294,60 +293,6 @@ Int128 cpu_atomic_cmpxchgo_be_mmu(CPUArchState *env, abi_ptr addr, Int128 cmpv, Int128 newv, MemOpIdx oi, uintptr_t retaddr); -#if !defined(CONFIG_USER_ONLY) - -#include "tcg/oversized-guest.h" - -static inline uint64_t tlb_read_idx(const CPUTLBEntry *entry, - MMUAccessType access_type) -{ - /* Do not rearrange the CPUTLBEntry structure members. */ - QEMU_BUILD_BUG_ON(offsetof(CPUTLBEntry, addr_read) != - MMU_DATA_LOAD * sizeof(uint64_t)); - QEMU_BUILD_BUG_ON(offsetof(CPUTLBEntry, addr_write) != - MMU_DATA_STORE * sizeof(uint64_t)); - QEMU_BUILD_BUG_ON(offsetof(CPUTLBEntry, addr_code) != - MMU_INST_FETCH * sizeof(uint64_t)); - -#if TARGET_LONG_BITS == 32 - /* Use qatomic_read, in case of addr_write; only care about low bits. */ - const uint32_t *ptr = (uint32_t *)&entry->addr_idx[access_type]; - ptr += HOST_BIG_ENDIAN; - return qatomic_read(ptr); -#else - const uint64_t *ptr = &entry->addr_idx[access_type]; -# if TCG_OVERSIZED_GUEST - return *ptr; -# else - /* ofs might correspond to .addr_write, so use qatomic_read */ - return qatomic_read(ptr); -# endif -#endif -} - -static inline uint64_t tlb_addr_write(const CPUTLBEntry *entry) -{ - return tlb_read_idx(entry, MMU_DATA_STORE); -} - -/* Find the TLB index corresponding to the mmu_idx + address pair. */ -static inline uintptr_t tlb_index(CPUState *cpu, uintptr_t mmu_idx, - vaddr addr) -{ - uintptr_t size_mask = cpu->neg.tlb.f[mmu_idx].mask >> CPU_TLB_ENTRY_BITS; - - return (addr >> TARGET_PAGE_BITS) & size_mask; -} - -/* Find the TLB entry corresponding to the mmu_idx + address pair. */ -static inline CPUTLBEntry *tlb_entry(CPUState *cpu, uintptr_t mmu_idx, - vaddr addr) -{ - return &cpu->neg.tlb.f[mmu_idx].table[tlb_index(cpu, mmu_idx, addr)]; -} - -#endif /* !defined(CONFIG_USER_ONLY) */ - #if TARGET_BIG_ENDIAN # define cpu_lduw_data cpu_lduw_be_data # define cpu_ldsw_data cpu_ldsw_be_data diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index e16d02a62c..953c437ba9 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -27,6 +27,9 @@ #include "exec/tb-flush.h" #include "exec/memory-internal.h" #include "exec/ram_addr.h" +#include "exec/mmu-access-type.h" +#include "exec/tlb-common.h" +#include "exec/vaddr.h" #include "tcg/tcg.h" #include "qemu/error-report.h" #include "exec/log.h" @@ -95,6 +98,54 @@ static inline size_t sizeof_tlb(CPUTLBDescFast *fast) return fast->mask + (1 << CPU_TLB_ENTRY_BITS); } +static inline uint64_t tlb_read_idx(const CPUTLBEntry *entry, + MMUAccessType access_type) +{ + /* Do not rearrange the CPUTLBEntry structure members. */ + QEMU_BUILD_BUG_ON(offsetof(CPUTLBEntry, addr_read) != + MMU_DATA_LOAD * sizeof(uint64_t)); + QEMU_BUILD_BUG_ON(offsetof(CPUTLBEntry, addr_write) != + MMU_DATA_STORE * sizeof(uint64_t)); + QEMU_BUILD_BUG_ON(offsetof(CPUTLBEntry, addr_code) != + MMU_INST_FETCH * sizeof(uint64_t)); + +#if TARGET_LONG_BITS == 32 + /* Use qatomic_read, in case of addr_write; only care about low bits. */ + const uint32_t *ptr = (uint32_t *)&entry->addr_idx[access_type]; + ptr += HOST_BIG_ENDIAN; + return qatomic_read(ptr); +#else + const uint64_t *ptr = &entry->addr_idx[access_type]; +# if TCG_OVERSIZED_GUEST + return *ptr; +# else + /* ofs might correspond to .addr_write, so use qatomic_read */ + return qatomic_read(ptr); +# endif +#endif +} + +static inline uint64_t tlb_addr_write(const CPUTLBEntry *entry) +{ + return tlb_read_idx(entry, MMU_DATA_STORE); +} + +/* Find the TLB index corresponding to the mmu_idx + address pair. */ +static inline uintptr_t tlb_index(CPUState *cpu, uintptr_t mmu_idx, + vaddr addr) +{ + uintptr_t size_mask = cpu->neg.tlb.f[mmu_idx].mask >> CPU_TLB_ENTRY_BITS; + + return (addr >> TARGET_PAGE_BITS) & size_mask; +} + +/* Find the TLB entry corresponding to the mmu_idx + address pair. */ +static inline CPUTLBEntry *tlb_entry(CPUState *cpu, uintptr_t mmu_idx, + vaddr addr) +{ + return &cpu->neg.tlb.f[mmu_idx].table[tlb_index(cpu, mmu_idx, addr)]; +} + static void tlb_window_reset(CPUTLBDesc *desc, int64_t ns, size_t max_entries) { From patchwork Thu Apr 18 19:25:12 2024 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: 1925242 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=AkYNy8cZ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL7Bv1xNNz1yZP for ; Fri, 19 Apr 2024 05:29:43 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXRO-0004Ly-EK; Thu, 18 Apr 2024 15:29:03 -0400 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 1rxXPH-0008HT-Di for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:26:58 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXPF-0007Xd-M9 for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:26:51 -0400 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a52223e004dso121561166b.2 for ; Thu, 18 Apr 2024 12:26:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468408; x=1714073208; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KYZzt8h+xfLtt/f9EJkGkN8nzUXLIiHe8tAqM2sJg8A=; b=AkYNy8cZkrIeC2UlaNyVYL+Dl8CmRsdJxbOf0Q5Ja1NxpWPTEkYuiKXG8fK/Y1Exoa 5e30y84zHPVWK/RXqc3HZ7SUFrkbZtEPIh5CxObnd51HaSdvEzbSmhSnp7ONtRsoIUZs Zy0tR+inQKdLuFafn6WVW8P8jRpjihOX8SYJGj/TKrH8obeaNiQXGdZ3Gs0XkuWB8zwc orthIHWxjlnsCUGGzSLgaNwMndfXyMslvlCtUvkxHYTJ8ijR1SGtAvfkamqIkpeDTMOE Hd42Lf6YK2QY7Kmq0hZ5X2h7EewqNBwQHzQ/1ZvHTqbqlDfueNPlShMhdeeRVmaFpKhD Y0bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468408; x=1714073208; 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=KYZzt8h+xfLtt/f9EJkGkN8nzUXLIiHe8tAqM2sJg8A=; b=M/y82s0iCizgTf/nRhojpw1j1zgaPDXg4GfmMfLTrelc7BVTGYzuhjbDD1ln1I2+ga o17TovzZNNtBcbthoOPKRpd6xAABDX5UiAF0BXJJfJWI0u59mAiHAu3oYKhQO5Mcs/kx Q5DuGQhcH5VAZ6D6sW6u66mxPMROTTFyY/WPpmz8QepLhtpPN26SDWI/v7ODJO+9anXg 7eNmsa/sa9W5vIT5sxx+Bsc1PheFXQALoYsCVg5cC0yaWuvZwrzC56XlwoYbLw2Dvv2B 8bAkV/EsBmXxUSTs6cvfciDf/hWzp4tZ65WfenuE9fhmhujYyH33kPxfXWrEaXsuukbD QWiw== X-Forwarded-Encrypted: i=1; AJvYcCVisa9KbbFdgFDSc6orOQ8ZXKfR9wPmz9DXWZF/LRdejUiCDH4wNt4OuTvz5w4osYOxGf8Strch2JaaVeBXUzjdGpWc X-Gm-Message-State: AOJu0Yxcnw4fXKUPdJTzX/RUKKlRrsjkwAORHW3DY9P9Jn3B+QykKs2g SJ3q64JuojjzKUfodipMysrOpT9NRdYW7pXvv7wCeyoBLfwxiaXrnC0BMb7Rz+dTZ1oZUPXG31b 8 X-Google-Smtp-Source: AGHT+IGGSoNOPuz4j2WvvNGODM+4AEJcNNx0Thxm9FrMRXdYVHLgsSyAWa6ZsVOCsEkdfnN1Xh2oBQ== X-Received: by 2002:a17:906:34da:b0:a52:2e08:207e with SMTP id h26-20020a17090634da00b00a522e08207emr43995ejb.77.1713468408261; Thu, 18 Apr 2024 12:26:48 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id u21-20020a1709064ad500b00a47423b4c33sm1255791ejt.128.2024.04.18.12.26.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:26:47 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Artyom Tarasenko Subject: [PATCH 13/24] target/sparc: Replace abi_ulong by uint32_t for TARGET_ABI32 Date: Thu, 18 Apr 2024 21:25:12 +0200 Message-ID: <20240418192525.97451-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=philmd@linaro.org; helo=mail-ej1-x629.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org We have abi_ulong == uint32_t for the 32-bit ABI. Use the generic type to avoid to depend on the "exec/user/abitypes.h" header. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/sparc/gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/sparc/gdbstub.c b/target/sparc/gdbstub.c index 07ea81ab5f..ec0036e9ef 100644 --- a/target/sparc/gdbstub.c +++ b/target/sparc/gdbstub.c @@ -108,7 +108,7 @@ int sparc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) SPARCCPU *cpu = SPARC_CPU(cs); CPUSPARCState *env = &cpu->env; #if defined(TARGET_ABI32) - abi_ulong tmp; + uint32_t tmp; tmp = ldl_p(mem_buf); #else From patchwork Thu Apr 18 19:25:13 2024 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: 1925238 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=JjvbdB1E; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL7Bj0JL4z1yZP for ; Fri, 19 Apr 2024 05:29:33 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXRK-0003pW-QF; Thu, 18 Apr 2024 15:28:59 -0400 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 1rxXPa-000062-4X for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:27:12 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXPY-0007aW-DJ for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:27:09 -0400 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-56e1f3462caso1673149a12.3 for ; Thu, 18 Apr 2024 12:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468427; x=1714073227; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VHCcAuBE/LTzo7Jv3JWIaIvZFf+gAOHGRyRvAagXUpM=; b=JjvbdB1EI4R2c/uPHtkX0rPFYOizmp27XThfBJjjFopev2/Z+y64mfPJ9iVpt1R4wH KoEgA7n4Zx+wPyXZvzaXmA4kLAqrTm1RanPMuM5x865qxc+QRDdikgxO2sxxfWO8U6Nd j9bg2ZnlqvWGdXsvEu559nDpPw0v5dTONhXXvdrYPxG8pFQxWw55URZWcAzZcIKqc+lA 3L5Rqu//7FjpMHFq01rPL7gWOkC61EvpDYJ6y8DzOjf6m2qhP7EJ7IGL+D+MbRsT7L32 NpYNp9Ph2EGScz9JO1yAbtx/BjJS5/KoibjSnburEOHuX25BzQSjxEDpV9uutGmLNVvW a5mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468427; x=1714073227; 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=VHCcAuBE/LTzo7Jv3JWIaIvZFf+gAOHGRyRvAagXUpM=; b=FSQ5/B3g4bi8hQ0uNB9F5INVXFmt/OYQWwCyQPcVi9FA2MKjikUO6uw3VTFjFfxBt4 fBjP6jImYWBmDR36rKkRdRIpdANwL5XVsLvHkBJ0QVI6zMpqOnDLF34djypcAMfM+lZ7 ZIM5i31bTk4Pgp3h6nwvnrdhqF/oj6nsSBP25+3BbnTEfWY+QtAF8nN3G5LgcX/z/ltm eucdh97mbqd1K42xH8F8paV+tTmXsjq48ikE7kyhSyFU4NU7DWVMXeA+ThOZTiq1tJB1 w/AIvE96YiC2HRtygAqhZgjCABc5DbWVxEX4GR/0CW/2PAVvt0krt4CQYfNxTkrzySS2 OLvQ== X-Forwarded-Encrypted: i=1; AJvYcCVUsXTnZTU4hTL49lEnPAUOvmJI8AXv4VpK17UNxn+afVjr7r7fv8DQ+mxhCqmu1HVOlb4/5FreCcsbgAne29531p35 X-Gm-Message-State: AOJu0YzHWP9YCqxafdPRsm3Ttadylq0RlP1NaWX6z0/yK7tbqOxLXQEB l6Y33+jTnWrVFGNKvgQzXw7A5/hYZYGACrkDUiiCLUQ+4ijS53cipUYzZn+SAoQ= X-Google-Smtp-Source: AGHT+IHCVKWH0+AZiuPsOyJcP3T0HcQ3oNxiRJGIC+ivVe0T0x2KkBJdxwuTUWOtC8MRPWBviUHknA== X-Received: by 2002:a17:906:3502:b0:a52:277d:c1c9 with SMTP id r2-20020a170906350200b00a52277dc1c9mr53891eja.50.1713468427063; Thu, 18 Apr 2024 12:27:07 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id j21-20020a170906431500b00a521e5856f6sm1256588ejm.51.2024.04.18.12.27.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:27:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Riku Voipio Subject: [PATCH 14/24] exec: Rename 'exec/user/guest-base.h' as 'user/guest-base.h' Date: Thu, 18 Apr 2024 21:25:13 +0200 Message-ID: <20240418192525.97451-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=philmd@linaro.org; helo=mail-ed1-x532.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org The include/user/ directory contains the user-emulation specific headers. Move guest-base.h there too. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-all.h | 2 +- include/{exec => }/user/guest-base.h | 4 ++-- tcg/tcg.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename include/{exec => }/user/guest-base.h (72%) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 78848f018c..027f19e052 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -65,7 +65,7 @@ #if defined(CONFIG_USER_ONLY) #include "exec/user/abitypes.h" -#include "exec/user/guest-base.h" +#include "user/guest-base.h" extern bool have_guest_base; diff --git a/include/exec/user/guest-base.h b/include/user/guest-base.h similarity index 72% rename from include/exec/user/guest-base.h rename to include/user/guest-base.h index afe2ab7fbb..1e42bca5db 100644 --- a/include/exec/user/guest-base.h +++ b/include/user/guest-base.h @@ -4,8 +4,8 @@ * Copyright (c) 2003 Fabrice Bellard */ -#ifndef EXEC_USER_GUEST_BASE_H -#define EXEC_USER_GUEST_BASE_H +#ifndef USER_GUEST_BASE_H +#define USER_GUEST_BASE_H extern uintptr_t guest_base; diff --git a/tcg/tcg.c b/tcg/tcg.c index 0c0bb9d169..6a32656cd4 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -57,7 +57,7 @@ #include "tcg-internal.h" #include "tcg/perf.h" #ifdef CONFIG_USER_ONLY -#include "exec/user/guest-base.h" +#include "user/guest-base.h" #endif /* Forward declarations for functions declared in tcg-target.c.inc and From patchwork Thu Apr 18 19:25:14 2024 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: 1925262 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=s0GWNpWb; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL7FS2C8Fz1yPv for ; Fri, 19 Apr 2024 05:31:56 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXRT-00052j-0r; Thu, 18 Apr 2024 15:29:07 -0400 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 1rxXPh-0000Fl-QD for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:27:19 -0400 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXPf-0007bJ-5L for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:27:17 -0400 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a5200202c1bso150501066b.0 for ; Thu, 18 Apr 2024 12:27:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468433; x=1714073233; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Dml4vJCRKxCVY1uFtRIPG5lLzhQacgo/ZMSZt5sIQXk=; b=s0GWNpWbxlSuPx0vJ7p9ynQSeHaNOyYRX7Amfsgw8O4d/p11qNn2v5a4XpEuS1JXGo rQWrWIlD16vjIGqjWJzeUbh3WObU3OVpVG6L9bUAIz29fbNXfsb7MBnClZveoINehthx xook377/S9V4/YkCOrRrp73n4JJfenHHvrFyA+UYrCJ+uSXE1JKF7pKSJctNw1oPMznt EsMdeygEerSsbqmjmXfuZj5LmdF+A13jUx8gYLHLQ+ULwKAdGpuIXbvDUyKAzjZpB1PT yNsMmi2MhmmN1NFmITn8rHiSXZgUh3ViMW4tzD5j70brvYrIftV89SE+dgrAkkoWczax suuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468433; x=1714073233; 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=Dml4vJCRKxCVY1uFtRIPG5lLzhQacgo/ZMSZt5sIQXk=; b=skGtS14TJkhhajqpQrtDeKvJKaGU/OV8LT1e6rELJVVXlYFsTlsacsUq/F9LfCUetX xuOO/+cxc3ql6EpsBCzdLQKt/NchZ6IsH7QwTAsiJDUdiVAaG4RadwFQFypW/gzA8/Tm PS2OfRg8CQMl1VxyQkmtM0Al1f/Etmwn0gHb2PGoTvNpeKoPuTFGnZwz9am4HiHDht2o eKgzvTeqkuynvXacS+ARb0lkPRH7+303F57r7gQicBffoedneSoudlXO16hp7TyA4kr7 jNRtcToCDCzt4miTPUKpZ4tsYevqVqOUZ2DM7iy7H+YgG4xdS+hBX72OhzVdJ2I/aTVF qE8g== X-Forwarded-Encrypted: i=1; AJvYcCUc5S+R8FGBnU5VUnsSfbfoQlOj19yGG0Q41LCJ45qv/EZQxsGAR2zGMVtudGG9G4l+vBuHrEj0LS+GnTCysonU7M7f X-Gm-Message-State: AOJu0YxORYyCIveC/VLapYrPdMxcIUNUSHsDzNiIqD21aCdduXZBnbwC sKyK6uwjI1ktvhXWcsP4EXJfr6BnBT7yhjcIjUIX/ys10ymehZqB/jNE9XXMVM8= X-Google-Smtp-Source: AGHT+IErWPr/zfg0WmvCw3RKPanQkeAYRatbBUwaG2fx37IV0JpOFdDvX+lUOlTZSWvTHHNC9ulpZw== X-Received: by 2002:a17:906:6bc7:b0:a52:13ee:8124 with SMTP id t7-20020a1709066bc700b00a5213ee8124mr59241ejs.35.1713468433364; Thu, 18 Apr 2024 12:27:13 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id x16-20020a1709060a5000b00a5575c9d5b4sm967734ejf.63.2024.04.18.12.27.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:27:12 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Warner Losh , Kyle Evans , Riku Voipio , Laurent Vivier Subject: [PATCH 15/24] exec: Restrict inclusion of 'user/guest-base.h' Date: Thu, 18 Apr 2024 21:25:14 +0200 Message-ID: <20240418192525.97451-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=philmd@linaro.org; helo=mail-ej1-x632.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Declare 'have_guest_base' in "user/guest-base.h". Very few files require this header, so explicitly include it there instead of "exec/cpu-all.h" which is used in many source files. Assert this user-specific header is only included from user emulation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20231211212003.21686-23-philmd@linaro.org> --- include/exec/cpu-all.h | 3 --- include/exec/cpu_ldst.h | 2 ++ include/user/guest-base.h | 6 ++++++ bsd-user/main.c | 1 + linux-user/elfload.c | 1 + linux-user/main.c | 1 + 6 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 027f19e052..e75ec13cd0 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -65,9 +65,6 @@ #if defined(CONFIG_USER_ONLY) #include "exec/user/abitypes.h" -#include "user/guest-base.h" - -extern bool have_guest_base; /* * If non-zero, the guest virtual address space is a contiguous subset diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index 2c5a0a5c81..6d47d3114a 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -73,6 +73,8 @@ #if defined(CONFIG_USER_ONLY) +#include "user/guest-base.h" + #ifndef TARGET_TAGGED_ADDRESSES static inline abi_ptr cpu_untagged_addr(CPUState *cs, abi_ptr x) { diff --git a/include/user/guest-base.h b/include/user/guest-base.h index 1e42bca5db..055c1d14fe 100644 --- a/include/user/guest-base.h +++ b/include/user/guest-base.h @@ -7,6 +7,12 @@ #ifndef USER_GUEST_BASE_H #define USER_GUEST_BASE_H +#ifndef CONFIG_USER_ONLY +#error Cannot include this header from system emulation +#endif + extern uintptr_t guest_base; +extern bool have_guest_base; + #endif diff --git a/bsd-user/main.c b/bsd-user/main.c index 01b313756e..29a629d877 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -36,6 +36,7 @@ #include "qemu/help_option.h" #include "qemu/module.h" #include "exec/exec-all.h" +#include "user/guest-base.h" #include "tcg/startup.h" #include "qemu/timer.h" #include "qemu/envlist.h" diff --git a/linux-user/elfload.c b/linux-user/elfload.c index fc60c01d57..9ed4baa2ac 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -8,6 +8,7 @@ #include "qemu.h" #include "user/tswap-target.h" +#include "user/guest-base.h" #include "user-internals.h" #include "signal-common.h" #include "loader.h" diff --git a/linux-user/main.c b/linux-user/main.c index 149e35432e..94e4c47f05 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -38,6 +38,7 @@ #include "qemu/help_option.h" #include "qemu/module.h" #include "qemu/plugin.h" +#include "user/guest-base.h" #include "exec/exec-all.h" #include "exec/gdbstub.h" #include "gdbstub/user.h" From patchwork Thu Apr 18 19:25:15 2024 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: 1925259 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=zqKavEvU; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL7FG1wxwz1yPv for ; Fri, 19 Apr 2024 05:31:46 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXSc-0000iI-Lm; Thu, 18 Apr 2024 15:30:18 -0400 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 1rxXPn-0000QW-4o for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:27:25 -0400 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXPk-0007c8-Jv for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:27:22 -0400 Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-56e56ee8d5cso1908156a12.2 for ; Thu, 18 Apr 2024 12:27:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468439; x=1714073239; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=koVgyajCEgUVl/LMvNKONPGr1ZhJ2eug5WfoAqRNjUs=; b=zqKavEvUwmpktzeC+ZkyMOS6iqmafM6qsXVAEzNYS8OxOXD0h7Li/SUtH2QlGSV42v gtGr1aErMgYhJG8t6ttnlJYHRlT5s6csBUSDJvKUUgKwztK9bgxfoht0Jo8n566f9xw5 WJCPSisaHKLFFhBiVCqkCZGHBtCeSRgWZo/nc6Va/Nx+1SGtZ3etaTNi0SHVMgrMNSd5 jZTvmsADsT/EuGy7blU6vJQ1I46vFsxOrstT972mzuA6rwqIh7SOEPKHLLGWIo1TYQ6o /W9EqRv6gjsOqagQZSxouEan0y/1CtFQ/QmvNJhe7Oz7fTIPkMAVefFne69uufMQ5WuQ XPJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468439; x=1714073239; 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=koVgyajCEgUVl/LMvNKONPGr1ZhJ2eug5WfoAqRNjUs=; b=CRIXPwTNxArHxzpvAxwG6CA3rLAVPr87Dk1bUjwTXUQrm6KipX+GntCjetXI5RRj5D LFyFL+EshIcc2J8C5U9LoiBVfN2pbSvQSpI7F0jCH1T/5JGiT31lbVCaw8kT4B6vKJl7 m1dzSf97HW/BjIKkhYm8fG56qWCTW87rrJ24Rp/fTOs6Ms29HkP77tBb7BGNbaZWzFok Yx4wrR2l56AHR7T7MA18BHHZyFIofWvVDqwDa4BlLYWDW9d15/IGcXE6MX+1Ha7eENax CWky0q8un87Sy7D/0fzaPCwHTtBBfZK3O5fmi8JoDItWAUT/rcqNptr8HmDXSqUTSsqD 5HTQ== X-Forwarded-Encrypted: i=1; AJvYcCWpyLxmBZfrToFbe6chesF0dVgxOTxWU8qEourLwwkcUICKwPKWBn//ETGWPv+LQMIyckMk0JZbdrLFAUPlj4uDaEks X-Gm-Message-State: AOJu0YwekPiyfiYEe5cqm4/ym+e4mL1Lny3IET8ESwlds+8wYI/rjm8b 6H3WihjO9BBfZEfGnvWNBcnh0r6ZenFSsacVg2fX3laSw+pjWDnt/9h7d2RG+VI= X-Google-Smtp-Source: AGHT+IGUKx1BaAucoqEBkcKvR0ggaq6VcW3+/vbLpdXj+U90uCMnnNyN02Af7LhJb66dZ9m1Y8QZCA== X-Received: by 2002:a17:906:6013:b0:a52:ec:a87d with SMTP id o19-20020a170906601300b00a5200eca87dmr48021ejj.74.1713468439142; Thu, 18 Apr 2024 12:27:19 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id n22-20020a170906119600b00a51a9d87570sm1269573eja.17.2024.04.18.12.27.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:27:18 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 16/24] exec: Move GUEST_ADDR_MAX definition to 'cpu_ldst.h' Date: Thu, 18 Apr 2024 21:25:15 +0200 Message-ID: <20240418192525.97451-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=philmd@linaro.org; helo=mail-ed1-x529.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org GUEST_ADDR_MAX is only used in accel/tcg/user-exec.c and "exec/cpu_ldst.h". Move it from "exec/cpu-all.h" to "exec/cpu_ldst.h" so we can avoid including "exec/cpu-all.h" in accel/tcg/user-exec.c. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-all.h | 34 +--------------------------------- include/exec/cpu_ldst.h | 30 ++++++++++++++++++++++++++++++ accel/tcg/cpu-exec.c | 1 - 3 files changed, 31 insertions(+), 34 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index e75ec13cd0..554b937ddb 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -63,39 +63,7 @@ /* MMU memory access macros */ -#if defined(CONFIG_USER_ONLY) -#include "exec/user/abitypes.h" - -/* - * If non-zero, the guest virtual address space is a contiguous subset - * of the host virtual address space, i.e. '-R reserved_va' is in effect - * either from the command-line or by default. The value is the last - * byte of the guest address space e.g. UINT32_MAX. - * - * If zero, the host and guest virtual address spaces are intermingled. - */ -extern unsigned long reserved_va; - -/* - * Limit the guest addresses as best we can. - * - * When not using -R reserved_va, we cannot really limit the guest - * to less address space than the host. For 32-bit guests, this - * acts as a sanity check that we're not giving the guest an address - * that it cannot even represent. For 64-bit guests... the address - * might not be what the real kernel would give, but it is at least - * representable in the guest. - * - * TODO: Improve address allocation to avoid this problem, and to - * avoid setting bits at the top of guest addresses that might need - * to be used for tags. - */ -#define GUEST_ADDR_MAX_ \ - ((MIN_CONST(TARGET_VIRT_ADDR_SPACE_BITS, TARGET_ABI_BITS) <= 32) ? \ - UINT32_MAX : ~0ul) -#define GUEST_ADDR_MAX (reserved_va ? : GUEST_ADDR_MAX_) - -#else +#if !defined(CONFIG_USER_ONLY) #include "exec/hwaddr.h" diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index 6d47d3114a..07649a01c1 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -73,8 +73,38 @@ #if defined(CONFIG_USER_ONLY) +#include "user/abitypes.h" #include "user/guest-base.h" +/* + * If non-zero, the guest virtual address space is a contiguous subset + * of the host virtual address space, i.e. '-R reserved_va' is in effect + * either from the command-line or by default. The value is the last + * byte of the guest address space e.g. UINT32_MAX. + * + * If zero, the host and guest virtual address spaces are intermingled. + */ +extern unsigned long reserved_va; + +/* + * Limit the guest addresses as best we can. + * + * When not using -R reserved_va, we cannot really limit the guest + * to less address space than the host. For 32-bit guests, this + * acts as a sanity check that we're not giving the guest an address + * that it cannot even represent. For 64-bit guests... the address + * might not be what the real kernel would give, but it is at least + * representable in the guest. + * + * TODO: Improve address allocation to avoid this problem, and to + * avoid setting bits at the top of guest addresses that might need + * to be used for tags. + */ +#define GUEST_ADDR_MAX_ \ + ((MIN_CONST(TARGET_VIRT_ADDR_SPACE_BITS, TARGET_ABI_BITS) <= 32) ? \ + UINT32_MAX : ~0ul) +#define GUEST_ADDR_MAX (reserved_va ? : GUEST_ADDR_MAX_) + #ifndef TARGET_TAGGED_ADDRESSES static inline abi_ptr cpu_untagged_addr(CPUState *cs, abi_ptr x) { diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 225e5fbd3e..7bfd558027 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -31,7 +31,6 @@ #include "exec/log.h" #include "qemu/main-loop.h" #include "sysemu/cpus.h" -#include "exec/cpu-all.h" #include "sysemu/cpu-timers.h" #include "exec/replay-core.h" #include "sysemu/tcg.h" From patchwork Thu Apr 18 19:25:16 2024 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: 1925244 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=x5wRfVcO; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL7C615BLz1yZP for ; Fri, 19 Apr 2024 05:29:54 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXRe-0006T9-IQ; Thu, 18 Apr 2024 15:29:19 -0400 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 1rxXQC-0001V9-IA for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:27:50 -0400 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXQA-0007dz-FR for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:27:47 -0400 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-56e136cbcecso1753111a12.3 for ; Thu, 18 Apr 2024 12:27:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468465; x=1714073265; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zuWZ6VCaeCTfKgGM+fcYzWiSC9LIi21t46RdwEg8Jqc=; b=x5wRfVcOKCY5n9oADH2ZhfSsE7uQ3MTtfu3jpEtNiUvAAHPMo1BquWtLKtkybqxbEm gPDRlQ3Mj0VkWEoUQ9OyDIB8CtJb1QdYZJxN7lVi6jvFB4gs9CpPSrVUb0EwBLeYUlT6 JuZE0gTxGt1pcM9rGcvud/K99h+Y/rAOVPSR61hWV2uQ/p97UzO4AuuCVW/updWH9ug7 G35x6dDVLgYjsCpXsfCp5Ya0G0eWuiL9vdjWvcwtOyBSmulb13vPTnn5HZRdExejIreg GGzzhWN5k/fBlDPyn0JHcTgrXac4s9qJlCoNDdGrV9rxpC6t654/oM839wBzGYwKhj69 bxQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468465; x=1714073265; 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=zuWZ6VCaeCTfKgGM+fcYzWiSC9LIi21t46RdwEg8Jqc=; b=ibp1HlTaSiCZJD5g1BViqaNrvDEyJ3hiRF60TZSSjKOECPMaCkHgLvk9/8bFdpMnrA alSOTzI6qmRk21YFMF4jLTGvBzIY1k+SwTdaeVEor2sQtWHBHmT8cmIdnR80Zx9R7dEq r+YL9c+YCZtvNyLUVJPPRyqZZQCygFHpb9D8gSDm9yVTCTVtHK/LzyAHjrOJ+w/ld1xt OB3YNbKKc2Ozdd6BxujQzl6Pf6q0nGdN47dKL9pOSOaJB/TGh9VlTH6cmrR1rLULJ6aY g9gViSzy9lnbLLppBfKTbEHEr7VIwoRVTo7T+E+SX8gSh4Y82kCoFkyh4GcEn/GoEEOj q+KQ== X-Forwarded-Encrypted: i=1; AJvYcCWXseozLr9SRhUsp0XQD0V0WWGCn4wQxd4HGQIcfUgjEgyGzRC1GzX+iq1OK7ow2sPqKfOpzBOxck9kaddZMcYsW/mu X-Gm-Message-State: AOJu0YyjtVLs5X5GM04oLZwqK7rtp1CVtwaJJY1BtieL8SRda8qvwPhw ZHlb20R36rEfoWL+Vl6v2PmVh1omOyn+cvDswc55vvlK9zqf6rO1ANNwz10wRLk= X-Google-Smtp-Source: AGHT+IHNrvZlZ7Uei/H294UHaKVP1n4MPQEnwPA0Hao+SxNQsQzhpCkD7PK2coUvXZVR5L3VPti1CA== X-Received: by 2002:a50:aad4:0:b0:56d:fca8:d209 with SMTP id r20-20020a50aad4000000b0056dfca8d209mr113241edc.10.1713468464845; Thu, 18 Apr 2024 12:27:44 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id fi5-20020a056402550500b0056e598155fasm1213489edb.64.2024.04.18.12.27.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:27:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 17/24] exec: Include missing 'qemu/log-for-trace.h' header in 'exec/log.h' Date: Thu, 18 Apr 2024 21:25:16 +0200 Message-ID: <20240418192525.97451-18-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=philmd@linaro.org; helo=mail-ed1-x535.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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org "exec/log.h" accesses the qemu_loglevel variable, which is declared in "qemu/log-for-trace.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/log.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/exec/log.h b/include/exec/log.h index 4a7375a45f..e0ff778a10 100644 --- a/include/exec/log.h +++ b/include/exec/log.h @@ -2,6 +2,7 @@ #define QEMU_EXEC_LOG_H #include "qemu/log.h" +#include "qemu/log-for-trace.h" #include "hw/core/cpu.h" #include "disas/disas.h" From patchwork Thu Apr 18 19:25:17 2024 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: 1925264 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=ZwyPaKn3; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL7GF5Kq2z1yPv for ; Fri, 19 Apr 2024 05:32:37 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXSg-0001FZ-7i; Thu, 18 Apr 2024 15:30:22 -0400 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 1rxXQL-0001XE-G4 for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:27:57 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXQH-0007f3-6a for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:27:56 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-518a56cdbcfso2058874e87.2 for ; Thu, 18 Apr 2024 12:27:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468470; x=1714073270; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zNTjYBQSXlJdcfDAGNfhN/k6Tw+ZuKx0L+6ToWVAoUI=; b=ZwyPaKn3Ee4HVquN364xaRf+LilSRpTtrJ8VmCW+TGl1THY1hUvfr8bJkbPCVzTL0O eOfFSGovndkedIMQESYB4sfNRG3VeIayto6YgEZujgdXS5yw9LxH7MCYweGwZrWnG1Nr uXNOrw/epMEXW1V5da6QQq4zwoyehC4IqsDYwlfq1NHmZakLWDwaIzmVs85LErki8gkR YWrMZqt1mKSt+2xFOvAyK9TYopkQETpvPlSHgQoBFJBW9pVB63e6xv6m1RuBONfJZ34y jyj/LX9VHhv+0ne8ET2lSC6rssyBbzaOPr0yEMKmkrFGIsvIaV5Ki4XNhkY0OZuUQ9nS Sl8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468470; x=1714073270; 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=zNTjYBQSXlJdcfDAGNfhN/k6Tw+ZuKx0L+6ToWVAoUI=; b=PmjFWRG2hpi84ae1IRr7dmOOLwCsLIPVQZBVJQ+Zs2TodQwVNV+tWX9qJHnrXrC3Wk af7euS1/83aTYP2Pc6IzolOUG9CAFFjhcyrvL1UFsUwP5POYOStYLcrf7ssVgXAwopFn ebf48tzJzbiA3mt1m5UNdnzHffZx1Uvj5AAh27O0k+VXbtWZk/M2HMDKf55nEsidi40O InenwxLXuccaoR0HbZdKTR6OejGlD3aNehEIwq0CmKN4uip0y8va2M58ZZR6lvjjCFXe sWayfFNl2Ivoaay7vNw3vgA+9jzbf9njMIQVwvOceLxR6bG/k0PNHe6CM6zm6RsBa6s9 /GMw== X-Forwarded-Encrypted: i=1; AJvYcCXJC5WM0yQPKoiXLIjv10ssb7cjUCecvXc27NxeEO49XwhbPJ28Jaq/byLnIMX6tEanhLhm3ME12XX54vP/ubPvQdwm X-Gm-Message-State: AOJu0Yw2i3EW4H9WQ17/c1hx+RGGRqdi6D1P/QSIWHl8tECVUtuj8Fvd QkEOXvRU8slv500SlzamwdeHtIJPUOW0PlsmUQ3tak0iKCdabHTLPbpVFUhlsWE= X-Google-Smtp-Source: AGHT+IGRtbT7LlcI6CQVHjULTyTQXTmBNJ6XYFrkIeD3sIOYqal3qJsUOamHWsXIg/SR6F1S1/+Vaw== X-Received: by 2002:a19:550e:0:b0:516:d250:91a7 with SMTP id n14-20020a19550e000000b00516d25091a7mr8569lfe.12.1713468470564; Thu, 18 Apr 2024 12:27:50 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id z5-20020a170906714500b00a51bbee7e55sm1259679ejj.53.2024.04.18.12.27.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:27:50 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 18/24] plugins: Include missing 'qemu/bitmap.h' header Date: Thu, 18 Apr 2024 21:25:17 +0200 Message-ID: <20240418192525.97451-19-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=philmd@linaro.org; helo=mail-lf1-x133.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org "qemu/plugin.h" uses DECLARE_BITMAP(), which is declared in "qemu/bitmap.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- include/qemu/plugin.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index 12a96cea2a..41db748eda 100644 --- a/include/qemu/plugin.h +++ b/include/qemu/plugin.h @@ -13,6 +13,7 @@ #include "qemu/queue.h" #include "qemu/option.h" #include "qemu/plugin-event.h" +#include "qemu/bitmap.h" #include "exec/memopidx.h" #include "hw/core/cpu.h" From patchwork Thu Apr 18 19:25:18 2024 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: 1925249 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=wyC/eYyo; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL7Cg5Wbcz1yPv for ; Fri, 19 Apr 2024 05:30:23 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXRU-0005Mk-SC; Thu, 18 Apr 2024 15:29:09 -0400 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 1rxXQP-0001ZS-84 for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:28:03 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXQM-0007gr-NL for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:28:00 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-56e4a148aeeso562326a12.2 for ; Thu, 18 Apr 2024 12:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468476; x=1714073276; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/V78U8y8hgVchZketDvNFCqr9+uicpA2z97iCqadZGc=; b=wyC/eYyoz//UopNQW2IrLAYje4uYdyEW4RD1c5JxS/M+q4Z/a6vNGDtKPhOveYFsi8 qx+GSFHAhWtRkLfrGLZ/bnJ7wy7w25mLuhzEITbI5BUeW3qrfM8fZGZfyzmO/zeayZxk nof+a9Z5wYD9DKupd8gVsfekXI0VYQV6fIrdUYS+iMmU1UfrF0wBDd2+j11Tk1C34hMt nObOA4Gyik2MHqb1FB1MYwEsrbgAlrtUoS/7NSHIwcNaMDm9ptbVa6hee9ODAubCRmYk EohyjTKSautlagCgDNeKLAQNFKzNfKkS/66Vt+OncqQzEoBXIvTbmbxyMTutYy+I0byO WFkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468476; x=1714073276; 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=/V78U8y8hgVchZketDvNFCqr9+uicpA2z97iCqadZGc=; b=qr7BVzhe6pPWUl/w+nR+Z6vCIuxz52XnSBhgH9jD6eCEAJJf7UR1vqIMCsymZbqTvj DRUj2PILRpbSrvRVnb/zG6e/T+cPlVU0NZ+PpPB0KveOcHYviS/rd1hiEFOIHIGsHm0Q ZBBx6VRlIWbSLdEGvVCuKD6c5r7Qvxpe+HCYBfXVNLsaMC/1ApLiaxUwl3hmFZ12Uw8W vQqeqU0cLihw+NDdsIBiq9JTBFnAh/gFE/LU/RlQVBRj/n2eNzSr2TWHaU1rhLURz2kh PYWoGdsKg0VuXTo2BfTndADzG0GmSvBioYy/fEz72k5KOSWc5Y4njPC7NPNJLuBfEkot meQg== X-Forwarded-Encrypted: i=1; AJvYcCXTehtTLAqlksgNAzGpTU8RPVdx4ozLl7jVYSuEJQhl9rVC9l7G4tFcHf+ZpFaa976rSqVw+bYXcLrWpfPha+y06uOO X-Gm-Message-State: AOJu0YxfxsJ99rW8/oHxD3kFZk7UyMpwVQigC6AD3kSgvWm/0ZdLIN/j XswLeVp98Tn7GDU7/T5GqaIFrqXrff+vLWrWHr76m2CHIj9SdJb962d9LPcVS3I= X-Google-Smtp-Source: AGHT+IHrcqo2UHAx8u+9jCAFEincYHzZAP1Wb8pNWMNf4c7FJye8uQUKnPM8ZPTzpZx3xyIVm80lkw== X-Received: by 2002:a50:cd1d:0:b0:56e:d54:6d63 with SMTP id z29-20020a50cd1d000000b0056e0d546d63mr104698edi.15.1713468476332; Thu, 18 Apr 2024 12:27:56 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id fe7-20020a056402390700b00571c16323b4sm736740edb.48.2024.04.18.12.27.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:27:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Michael Rolnik , Bastian Koppelmann Subject: [PATCH 19/24] gdbstub: Avoid including 'cpu.h' in 'gdbstub/helpers.h' Date: Thu, 18 Apr 2024 21:25:18 +0200 Message-ID: <20240418192525.97451-20-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=philmd@linaro.org; helo=mail-ed1-x530.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org We only need the "exec/tswap.h" and "cpu-param.h" headers. Only include "cpu.h" in the target gdbstub.c source files. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/gdbstub/helpers.h | 3 ++- target/avr/gdbstub.c | 1 + target/tricore/gdbstub.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/gdbstub/helpers.h b/include/gdbstub/helpers.h index 6277a858a1..26140ef1ac 100644 --- a/include/gdbstub/helpers.h +++ b/include/gdbstub/helpers.h @@ -16,7 +16,8 @@ #error "gdbstub helpers should only be included by target specific code" #endif -#include "cpu.h" +#include "exec/tswap.h" +#include "cpu-param.h" /* * The GDB remote protocol transfers values in target byte order. As diff --git a/target/avr/gdbstub.c b/target/avr/gdbstub.c index 2eeee2bf4e..d6d3c1479b 100644 --- a/target/avr/gdbstub.c +++ b/target/avr/gdbstub.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "gdbstub/helpers.h" +#include "cpu.h" int avr_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n) { diff --git a/target/tricore/gdbstub.c b/target/tricore/gdbstub.c index f9309c5e27..29a70051ff 100644 --- a/target/tricore/gdbstub.c +++ b/target/tricore/gdbstub.c @@ -19,6 +19,7 @@ #include "qemu/osdep.h" #include "gdbstub/helpers.h" +#include "cpu.h" #define LCX_REGNUM 32 From patchwork Thu Apr 18 19:25:19 2024 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: 1925261 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=c/IqhHd5; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL7FM0l4Xz1yPv for ; Fri, 19 Apr 2024 05:31:51 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXSP-000878-1I; Thu, 18 Apr 2024 15:30:05 -0400 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 1rxXQT-0001jc-BD for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:28:05 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXQR-0007hu-MJ for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:28:05 -0400 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a5565291ee7so135185866b.2 for ; Thu, 18 Apr 2024 12:28:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468482; x=1714073282; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=o0/TLkq+0Cek1YtUvPVSPSPpKhvNS+eTx919tWRRKxo=; b=c/IqhHd5rFyjt+7/J95u+CqZ/4ldYN50hoEPLJKba9lPKy7MpeSLefEkTpcz5JoQ4O CBiWKCiUfjjOvSKTCfb15XrgZjhtj9cIZWuUiLKVVPXBaW1D+1flaxxUhxNT4pjv6Y7N YnMnBNIUL1Myu8RfcYbTS31Yu6qcQsO0neVxU403/R4Y5YMFaBQyfdVzcb5OWCZLjIjM IBJjrygxBlciJYz+6QlUvR4zL9P5S1GfS65mrIfAfGOlaT3fjPPWlO+W5ZTQHimOClcx gKamW+i3ipHuJ/v9X2+2mb7t1ttilolgru3Gdmolj4UiYaecm6mFz41fGhdOhY661VDt 8WSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468482; x=1714073282; 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=o0/TLkq+0Cek1YtUvPVSPSPpKhvNS+eTx919tWRRKxo=; b=AHLGNTldm0GEMxWyK8CXCh3h4Stt4sS7b71A89OmfrWmIJKqYNOAJvIBcqsBRiiJ/i AotrRahLKKupSmEIwHLLTxhiHhrl5WkgJQlVfxBZmq8Ar4wxrVr8HCZBVDSoMB4UQheA BKZAkCjs+NTy421NwZLWzbsUalxdCH4yEURxV400vDh/QBID1LTqnsp84gfLBIEGQ4cN BD459VDXd8x3wGzG3wSfaBdsCXQXO2V/u4mH81Pxh6RnBMV8CnzZ7HA1dwNjYRgdLW+c 0BvdarejFaXBGRV5JH1TaEWkGCQ8JhRW0SQlNJwVzEUJyuaXjxih5UZ08q63uuMIkplP KsQg== X-Forwarded-Encrypted: i=1; AJvYcCUCa3w8HLAxBlmRHSwNSiq6uYb5gLaEHKFtxs5Utncu+mTkojKvT9qUZKji6xSzrUTaiU6Exa3qDp6d7JwKX+N3YtMO X-Gm-Message-State: AOJu0YzVGlOqU/20epu5xLJnllrhoPPBUlGmgdAIb6/NdA/ECKL4HP7O nfIRTHj4EMiiV6qNP+Z+g7r2/FbnphPqLIT75ONI3UkTpt3eA+jd0cx1KYdWJUw= X-Google-Smtp-Source: AGHT+IH9yyvoNEN3HFm6hHVceIDsgByTLejuLf3ciPZ1cvgkKcJXZJEDKVJuDdc5pS0wuniEfSC/cQ== X-Received: by 2002:a17:906:a008:b0:a55:4d24:6f9a with SMTP id p8-20020a170906a00800b00a554d246f9amr59518ejy.6.1713468482236; Thu, 18 Apr 2024 12:28:02 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id z13-20020a170906434d00b00a51e5813f4fsm1286099ejm.19.2024.04.18.12.28.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:28:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Max Filippov Subject: [PATCH 20/24] hw/xtensa: Include missing 'exec/cpu-common.h' in 'bootparam.h' Date: Thu, 18 Apr 2024 21:25:19 +0200 Message-ID: <20240418192525.97451-21-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=philmd@linaro.org; helo=mail-ej1-x62c.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org cpu_physical_memory_write() is declared in "exec/cpu-common.h". Signed-off-by: Philippe Mathieu-Daudé --- hw/xtensa/bootparam.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/xtensa/bootparam.h b/hw/xtensa/bootparam.h index ade7891ec5..f57ff850bc 100644 --- a/hw/xtensa/bootparam.h +++ b/hw/xtensa/bootparam.h @@ -1,6 +1,8 @@ #ifndef HW_XTENSA_BOOTPARAM_H #define HW_XTENSA_BOOTPARAM_H +#include "exec/cpu-common.h" + #define BP_TAG_COMMAND_LINE 0x1001 /* command line (0-terminated string)*/ #define BP_TAG_INITRD 0x1002 /* ramdisk addr and size (bp_meminfo) */ #define BP_TAG_MEMORY 0x1003 /* memory addr and size (bp_meminfo) */ From patchwork Thu Apr 18 19:25:20 2024 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: 1925241 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=U+62dtAQ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL7Br3y75z1yZP for ; Fri, 19 Apr 2024 05:29:40 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXRY-0005jl-Aa; Thu, 18 Apr 2024 15:29:12 -0400 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 1rxXQc-0002Os-CW for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:28:15 -0400 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 1rxXQX-0007j7-TN for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:28:13 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-34665dd7744so791913f8f.1 for ; Thu, 18 Apr 2024 12:28:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468488; x=1714073288; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Hca3+XmwqR0YOlaHOdTYyVt5U6rBmejaVD76pmxE3UI=; b=U+62dtAQYNMKJwbQefk4ISLFHpeNHmL1Te0MJWqzNfXZEF0rTZHRzYuPj4YhZEHMMa r0LuvJ0KYTUbsg6ovg9wb8qdJ4JRL62m+Y21kPaBtLg5E1tG0QaudMbBexhkUhFJMW8a n+bF6a7xxTugAFPyioN/F9lsTWTaOFRjJIjL8Ju5QXrUUNBFx8/M/8/XjuxPGsaTy+xZ ER4F347ydE9OkgffZftt89c1OlMk9AhciLYP2KZpQR4d+612P3fAT4q28crMCMqLFYVT 39t9YLO1cQC+Qr9VqK6WvV94Bi3u1AYIK2jlJ+FjE/9V4RsPJHLbcqBQwaxq8UGqq/zb vlfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468488; x=1714073288; 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=Hca3+XmwqR0YOlaHOdTYyVt5U6rBmejaVD76pmxE3UI=; b=N1El3eJsvXFff5EwQFJHB0ik8JyE38nmRpQH8aEpMxUaue0FnkNIQRBuKBYUTX03Wf tj30g/0ry0/BdOUYwne9/U6+0+bTpj67HItde0PzCwphHeVAYOS/E3eW0l84Gl4DLbbD QkAPmF5M6cICxLf1KU37agGspnMJmpcug/apeHYTv4I+4fkwGknw4rJnZpTbLo+Xb2qQ 9ZFggCSDnZw7aQurCFVECUydgMLaBbTFbhw+KLe13x8FndaKE4uL2HHUb48HJq5/vKHQ oxOeGLeWakDf/XKH/V4rSWwPp/TLl0itE1zKCNCnP5LQTXvMHnNi+K2PtdDy0fR8fDSu ewXQ== X-Forwarded-Encrypted: i=1; AJvYcCXepBTR08k7tPWTZRqiN4aU2AzRqx3AozwXJgtbsLROfGTOsNQ2KS+bfFFaV6LR2wGnXsG+qRfmlSOgY8v/RR4bSRY3 X-Gm-Message-State: AOJu0YyTH1I9skwOsXt4uPmww8cAEZmDkdhVhn7aXBN07G7yqsZ2EhLL Z2OjiiZ2gKa3U+JuP4Ld8r0JaLBcgFMJh9v0fl9pdNwcuAAQwPuzZhpXnSi7Cvw= X-Google-Smtp-Source: AGHT+IFY7dL6kQPENW/Gj6CBDv/d1qDFxnP7kZvuVmZ8Q0jxIs8r9dKZcEdctT8ubfxSRPUALhnlPg== X-Received: by 2002:adf:e40e:0:b0:34a:3eec:c379 with SMTP id g14-20020adfe40e000000b0034a3eecc379mr650087wrm.67.1713468488275; Thu, 18 Apr 2024 12:28:08 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id f5-20020a170906138500b00a5531e61002sm1247131ejc.206.2024.04.18.12.28.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:28:07 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alexandre Iooss , Mahmoud Mandour , Pierrick Bouvier Subject: [PATCH 21/24] plugins: Un-inline qemu_plugin_disable_mem_helpers() Date: Thu, 18 Apr 2024 21:25:20 +0200 Message-ID: <20240418192525.97451-22-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-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, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org "qemu/plugin.h" only include the huge "hw/core/cpu.h" because qemu_plugin_disable_mem_helpers() accesses CPUState::plugin_mem_cbs. In order to avoid including it, un-inline qemu_plugin_disable_mem_helpers(). Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/plugin.h | 6 +----- plugins/core.c | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index 41db748eda..28467c4a28 100644 --- a/include/qemu/plugin.h +++ b/include/qemu/plugin.h @@ -15,7 +15,6 @@ #include "qemu/plugin-event.h" #include "qemu/bitmap.h" #include "exec/memopidx.h" -#include "hw/core/cpu.h" /* * Option parsing/processing. @@ -227,10 +226,7 @@ void qemu_plugin_atexit_cb(void); void qemu_plugin_add_dyn_cb_arr(GArray *arr); -static inline void qemu_plugin_disable_mem_helpers(CPUState *cpu) -{ - cpu->plugin_mem_cbs = NULL; -} +void qemu_plugin_disable_mem_helpers(CPUState *cpu); /** * qemu_plugin_user_exit(): clean-up callbacks before calling exit callbacks diff --git a/plugins/core.c b/plugins/core.c index 11ca20e626..b25092abb5 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -493,6 +493,11 @@ void exec_inline_op(struct qemu_plugin_dyn_cb *cb, int cpu_index) } } +void qemu_plugin_disable_mem_helpers(CPUState *cpu) +{ + cpu->plugin_mem_cbs = NULL; +} + void qemu_plugin_vcpu_mem_cb(CPUState *cpu, uint64_t vaddr, MemOpIdx oi, enum qemu_plugin_mem_rw rw) { From patchwork Thu Apr 18 19:25:21 2024 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: 1925253 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=aYkuFhDx; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL7DY00g8z1yPv for ; Fri, 19 Apr 2024 05:31:08 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXSX-00007D-CC; Thu, 18 Apr 2024 15:30:13 -0400 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 1rxXQg-0002ek-Rl for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:28:19 -0400 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXQe-0007kB-QP for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:28:18 -0400 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a44f2d894b7so124150066b.1 for ; Thu, 18 Apr 2024 12:28:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468495; x=1714073295; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZdGtqepmHp/hs0/Z1yrPy9JbSuxwne+2qc6kJd/9zb0=; b=aYkuFhDxu0z/m0eHlNwToFwvxtSqdEXlxcHuIiK5otrmQjPGhTtAn5uj/VhCGOoAFd 0b1F7y7r8gYIAf6mr+WvgPr/NlzXWNuy30NsHxh/VyzrROg1smcjh8cd3MqKzRn1VPe0 LPExxJsgnvhtuKyGlhz1CfRgSXERxp//6YB93ZNdp+Xjo7CTDAceu16R/VPs7o+XLAI3 BRTgxNlUfsh87FpY5C6dgv8ScTAchndt4Hz5/HbakoIRSVIoDhCCqS6sAhhF/9BXGVsn +dnEQaeL4m0IcuMH5dPuItZcLQjkYhF2EyRTqUHN0kH797Z/RWTxsDkU8c5wiosKFZ/7 0+ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468495; x=1714073295; 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=ZdGtqepmHp/hs0/Z1yrPy9JbSuxwne+2qc6kJd/9zb0=; b=YSq8c/rHVjQFvpPjMHrU5gSyTnokWS4RpjMnNcMGccHdYgWAZ+Nr+qZEaVLQMTTtOj EsijNgF4v6fub10HuYO9H4vkZfluzju9r+ANpj6urad2JcOksMxwmkbvBU4b8pnO1eDL loOYHt4AVU7YXMyjPeNC7MBx0xrJSIP71ddTQoLf/LMW5uajXG+UegQKakke2o+cPSgx wjYQTpQUpbHAtbV5bbJCrv36YXyes2nG+Cjy/ApcNbUP/kJrz3SEmQmIxBMquEJ1MtsS wDn0pFJMigUx0otFOnojt4aWvhKaCEZKcyCsP38DJ3PZuUDkXIeBAklrQWqXtioMEJEf N7Yw== X-Forwarded-Encrypted: i=1; AJvYcCV4WPUOpg36rChtrzTUwsceRiaYHPoAsgOcVUlFO0Q8Gm1oBkwptn/x/gBsZPVwFB+Q0ipp4O0XNmEzH570MniAOeDJ X-Gm-Message-State: AOJu0YwVlRJOITOloPfIEiuWffwtsobBzFbbq8JR03gs+mbSuNbJyUAZ DP4Yj5u3+njgECrB6sC/QV/Qq0CE6uHLdvgsW5JlBIqcB7m1JPzpG2nWKvUpvII= X-Google-Smtp-Source: AGHT+IFOIY5gAThTWZwjM0+HF7s5tNrh3iGimgDUj1yFPdFdyFFdGwZS1SuNu7kuksfDMB5GlMY4Wg== X-Received: by 2002:a17:906:f0d9:b0:a51:b666:b372 with SMTP id dk25-20020a170906f0d900b00a51b666b372mr61046ejb.27.1713468495043; Thu, 18 Apr 2024 12:28:15 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id jp4-20020a170906f74400b00a4734125fd2sm1265134ejb.31.2024.04.18.12.28.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:28:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Tyrone Ting , Hao Wu , Huacai Chen , Jiaxun Yang , Aurelien Jarno , BALATON Zoltan , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , "Edgar E. Iglesias" , Yoshinori Sato , Magnus Damm , Max Filippov Subject: [PATCH 22/24] exec: Remove 'exec/tswap.h' from 'exec/cpu-all.h' Date: Thu, 18 Apr 2024 21:25:21 +0200 Message-ID: <20240418192525.97451-23-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=philmd@linaro.org; helo=mail-ej1-x62a.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org "exec/cpu-all.h" doesn't require "exec/tswap.h". Remove it, including it in the sources when required. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Harsh Prateek Bora --- hw/xtensa/bootparam.h | 1 + include/exec/cpu-all.h | 1 - accel/tcg/translator.c | 1 + hw/arm/boot.c | 1 + hw/arm/npcm7xx.c | 1 + hw/mips/fuloong2e.c | 1 + hw/mips/malta.c | 1 + hw/ppc/sam460ex.c | 1 + hw/ppc/spapr.c | 1 + hw/ppc/virtex_ml507.c | 1 + hw/sh4/r2d.c | 1 + target/arm/gdbstub.c | 1 + target/xtensa/xtensa-semi.c | 1 + 13 files changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/xtensa/bootparam.h b/hw/xtensa/bootparam.h index f57ff850bc..e1d47b503c 100644 --- a/hw/xtensa/bootparam.h +++ b/hw/xtensa/bootparam.h @@ -1,6 +1,7 @@ #ifndef HW_XTENSA_BOOTPARAM_H #define HW_XTENSA_BOOTPARAM_H +#include "exec/tswap.h" #include "exec/cpu-common.h" #define BP_TAG_COMMAND_LINE 0x1001 /* command line (0-terminated string)*/ diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 554b937ddb..cfbf51822c 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -21,7 +21,6 @@ #include "exec/cpu-common.h" #include "exec/memory.h" -#include "exec/tswap.h" #include "hw/core/cpu.h" /* some important defines: diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 6832e55135..85950377d9 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -12,6 +12,7 @@ #include "qemu/error-report.h" #include "exec/exec-all.h" #include "exec/translator.h" +#include "exec/tswap.h" #include "exec/cpu_ldst.h" #include "exec/plugin-gen.h" #include "tcg/tcg-op-common.h" diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 84ea6a807a..93945a1a15 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -22,6 +22,7 @@ #include "sysemu/reset.h" #include "hw/loader.h" #include "elf.h" +#include "exec/tswap.h" #include "sysemu/device_tree.h" #include "qemu/config-file.h" #include "qemu/option.h" diff --git a/hw/arm/npcm7xx.c b/hw/arm/npcm7xx.c index cc68b5d8f1..1ef303415b 100644 --- a/hw/arm/npcm7xx.c +++ b/hw/arm/npcm7xx.c @@ -27,6 +27,7 @@ #include "qemu/units.h" #include "sysemu/sysemu.h" #include "target/arm/cpu-qom.h" +#include "exec/tswap.h" /* * This covers the whole MMIO space. We'll use this to catch any MMIO accesses diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c index a45aac368c..1d0613a76f 100644 --- a/hw/mips/fuloong2e.c +++ b/hw/mips/fuloong2e.c @@ -40,6 +40,7 @@ #include "sysemu/reset.h" #include "sysemu/sysemu.h" #include "qemu/error-report.h" +#include "exec/tswap.h" #define ENVP_PADDR 0x2000 #define ENVP_VADDR cpu_mips_phys_to_kseg0(NULL, ENVP_PADDR) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index af74008c82..3dca0f100c 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -56,6 +56,7 @@ #include "semihosting/semihost.h" #include "hw/mips/cps.h" #include "hw/qdev-clock.h" +#include "exec/tswap.h" #include "target/mips/internal.h" #include "trace.h" #include "cpu.h" diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c index d42b677898..abc02f0817 100644 --- a/hw/ppc/sam460ex.c +++ b/hw/ppc/sam460ex.c @@ -24,6 +24,7 @@ #include "hw/loader.h" #include "elf.h" #include "exec/memory.h" +#include "exec/tswap.h" #include "ppc440.h" #include "hw/pci-host/ppc4xx.h" #include "hw/block/flash.h" diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index e9bc97fee0..b4b1f43983 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -74,6 +74,7 @@ #include "hw/virtio/virtio-scsi.h" #include "hw/virtio/vhost-scsi-common.h" +#include "exec/tswap.h" #include "exec/ram_addr.h" #include "hw/usb.h" #include "qemu/config-file.h" diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c index d02f330650..fd23afebf5 100644 --- a/hw/ppc/virtex_ml507.c +++ b/hw/ppc/virtex_ml507.c @@ -38,6 +38,7 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/option.h" +#include "exec/tswap.h" #include "hw/intc/ppc-uic.h" #include "hw/ppc/ppc.h" diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index e5ac6751bd..5f4420f534 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -43,6 +43,7 @@ #include "hw/loader.h" #include "hw/usb.h" #include "hw/block/flash.h" +#include "exec/tswap.h" #define FLASH_BASE 0x00000000 #define FLASH_SIZE (16 * MiB) diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c index a3bb73cfa7..f2b001afdd 100644 --- a/target/arm/gdbstub.c +++ b/target/arm/gdbstub.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "cpu.h" #include "exec/gdbstub.h" +#include "exec/tswap.h" #include "gdbstub/helpers.h" #include "sysemu/tcg.h" #include "internals.h" diff --git a/target/xtensa/xtensa-semi.c b/target/xtensa/xtensa-semi.c index fa21b7e11f..dbc42d1587 100644 --- a/target/xtensa/xtensa-semi.c +++ b/target/xtensa/xtensa-semi.c @@ -29,6 +29,7 @@ #include "cpu.h" #include "chardev/char-fe.h" #include "exec/helper-proto.h" +#include "exec/tswap.h" #include "semihosting/semihost.h" #include "qapi/error.h" #include "qemu/log.h" From patchwork Thu Apr 18 19:25:22 2024 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: 1925258 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=X7vURuSv; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL7FG0b18z1ymh for ; Fri, 19 Apr 2024 05:31:46 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXTS-0003l7-06; Thu, 18 Apr 2024 15:31:11 -0400 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 1rxXQm-0002tF-G8 for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:28:28 -0400 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 1rxXQk-0007lK-K4 for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:28:24 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-349c4505058so846188f8f.3 for ; Thu, 18 Apr 2024 12:28:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468501; x=1714073301; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/Yz7aRuiYxkABVdFEv0r+XjMMhiAPKgmd2KiD0xHfQg=; b=X7vURuSvQT07cVgIi989oUl+bZhnHoK29CgeeFQxYymNaWLK5OblSHmRF7Tjg51WnB zPhuB/xUeh58Z3cFClgBHDZdfXm7Y22Sk3JtlAlHTQ1c9Yh7El2odjwatSrrZIxmEgwn 2br76v9t3LeU4lzGfIr0l2mrqtqlG+w7ZLmcS8mFSt37dyfcDtlskn5YXqrH9cUB97vB D6cT0QmeYMqGNrPOmDGhzyFs/bFcpKGl02M0qCOMil47F0Zo+kguv0rSefT25UtDH7ex Z0bT17Ga/g3rFh3+2gUVgrVugdXzkszACplAFYd63RIvyRWj9j/Rfy/to+KSq41I0e5L MuYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468501; x=1714073301; 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=/Yz7aRuiYxkABVdFEv0r+XjMMhiAPKgmd2KiD0xHfQg=; b=uftDyPOmZHRpgUIgda1WcAGFqjsJ0buOCglWkAB1C92dSZQJnCOxv8iA08G2RHL4pG FL9guJE58QxjgQZ9NqBtkGROZSPiKRVtcX35soiUWGy0FCfBgoAnM6+JcQxNQXyXEIT7 Jv0k90kNtLGAg5FzF+G3iNAktn5LxpbEH7GZlFxrM2R2t7/sgkSpGMDAUZT8zDweYkmQ Qk+0YFwGb/ra+NAlDsYlwGtHRKUqu7P+qnvsjdtLry2Elv/MbNHD0PM3m1mMsK5Byo/r ZSU8aJYisyVtBsqAlc/L+k5FOzRi4fxdjn/e09z3zA0zBfvstaLGM2eTV3kYGQvFAWwz hklQ== X-Forwarded-Encrypted: i=1; AJvYcCWVoivS/32SQvQH0YOflB0ZT3OB4ekEu7ZxgCpiwH8liw4CYSlK1ZbuJwH0TNwGt7HUoie+7spoDHsAKoxRaIAtBFs7 X-Gm-Message-State: AOJu0YyazckIarQVcO32t5Iiy571tccTP1GVJV9O5OWMJNC8V+cvtzfR 0ebZ4KCtVOq5UBT6Nmf7E5yUe9WdU4UhFJsfRRs9SNWBjkkGw2C2Uk5sXC32C1w= X-Google-Smtp-Source: AGHT+IE562H6bYcdnvQhGKG5MNuVHbGU/S9+AnWWXJN4YRjw79fzPiSU1R9hf/G0jjN+LtZRXHV9Vw== X-Received: by 2002:a5d:64ca:0:b0:346:44:3910 with SMTP id f10-20020a5d64ca000000b0034600443910mr2930235wri.49.1713468501071; Thu, 18 Apr 2024 12:28:21 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id u21-20020a1709064ad500b00a47423b4c33sm1256988ejt.128.2024.04.18.12.28.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:28:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Michael Rolnik , Brian Cain , Song Gao , Yoshinori Sato Subject: [PATCH 23/24] exec: Remove 'disas/disas.h' from 'exec/log.h' Date: Thu, 18 Apr 2024 21:25:22 +0200 Message-ID: <20240418192525.97451-24-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-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-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org "exec/log.h" doesn't require "disas/disas.h". Remove it, including it in the sources when required. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/log.h | 1 - target/avr/translate.c | 1 + target/hexagon/translate.c | 1 + target/loongarch/tcg/translate.c | 1 + target/rx/translate.c | 1 + tcg/tcg.c | 1 + 6 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/exec/log.h b/include/exec/log.h index e0ff778a10..ee33981aab 100644 --- a/include/exec/log.h +++ b/include/exec/log.h @@ -4,7 +4,6 @@ #include "qemu/log.h" #include "qemu/log-for-trace.h" #include "hw/core/cpu.h" -#include "disas/disas.h" /* cpu_dump_state() logging functions: */ /** diff --git a/target/avr/translate.c b/target/avr/translate.c index 87e2bd5ef1..b2005f3cbe 100644 --- a/target/avr/translate.c +++ b/target/avr/translate.c @@ -29,6 +29,7 @@ #include "exec/helper-gen.h" #include "exec/log.h" #include "exec/translator.h" +#include "disas/disas.h" #define HELPER_H "helper.h" #include "exec/helper-info.c.inc" diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c index 47a870f42d..6bec38404e 100644 --- a/target/hexagon/translate.c +++ b/target/hexagon/translate.c @@ -25,6 +25,7 @@ #include "exec/translation-block.h" #include "exec/cpu_ldst.h" #include "exec/log.h" +#include "disas/disas.h" #include "internal.h" #include "attribs.h" #include "insn.h" diff --git a/target/loongarch/tcg/translate.c b/target/loongarch/tcg/translate.c index 7567712655..ae87a68c69 100644 --- a/target/loongarch/tcg/translate.c +++ b/target/loongarch/tcg/translate.c @@ -14,6 +14,7 @@ #include "exec/helper-proto.h" #include "exec/helper-gen.h" #include "exec/log.h" +#include "disas/disas.h" #include "qemu/qemu-print.h" #include "fpu/softfloat.h" #include "translate.h" diff --git a/target/rx/translate.c b/target/rx/translate.c index f6e9e0ec90..4259ad6d74 100644 --- a/target/rx/translate.c +++ b/target/rx/translate.c @@ -27,6 +27,7 @@ #include "exec/helper-gen.h" #include "exec/translator.h" #include "exec/log.h" +#include "disas/disas.h" #define HELPER_H "helper.h" #include "exec/helper-info.c.inc" diff --git a/tcg/tcg.c b/tcg/tcg.c index 6a32656cd4..e7e0ab6846 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -51,6 +51,7 @@ #endif #include "elf.h" +#include "disas/disas.h" #include "exec/log.h" #include "tcg/tcg-ldst.h" #include "tcg/tcg-temp-internal.h" From patchwork Thu Apr 18 19:25:23 2024 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: 1925239 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=QNPxqinr; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VL7Bm6Jtmz1yZP for ; Fri, 19 Apr 2024 05:29:36 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxXRZ-0005v3-RR; Thu, 18 Apr 2024 15:29:13 -0400 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 1rxXQu-0002xU-3Y for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:28:33 -0400 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rxXQq-0007m7-VQ for qemu-ppc@nongnu.org; Thu, 18 Apr 2024 15:28:31 -0400 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a557044f2ddso123000466b.2 for ; Thu, 18 Apr 2024 12:28:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713468507; x=1714073307; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1RS5jD62Ba4lXsw4t8DJy1DGdcN7GiTei/ES6lsX54Q=; b=QNPxqinriTRgMpcl66cpBmTca9NapujWI8A914HTs2AZytmXxDyZuyES/ThX5NTLGz B6SXVdgFp5QD4jTtap3xeFLzQuBh19+75iZQtcSAqYHzwS9nYhdkzYnZUSyKhTsc1wHN Y0kNz13zIdJB8ssHasoD+dmDjrqicVa0GL6wX+0CZcP0Ean2tPnFHzvdpfi/mq4oZkyy B0GLy53rlYamUBE45ODkynCmPSf8iyNMQiFxDqBTa56BLiLJyFQemsv9D458B7tnqyxJ rFOCueYVBbleHS99YwL5G1/wVZfl5ExEledz7VRu4zN2CE7DLG9pTQ48J+oNkjKCulDm Wjpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713468507; x=1714073307; 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=1RS5jD62Ba4lXsw4t8DJy1DGdcN7GiTei/ES6lsX54Q=; b=ZcdtrckXPT6pjTPxUwirTpmeR7X0dBNmidj1s9WMCGJzY0q/NUW32twa6pz6UfhbWz BtSmUn0NRRQx66Xzcmw1L5Zf/y9nWvd53Kh7QPON+CLxQkI2TcNGeOv/kAzZ4w7tjccR zc2liDwf2jyZLomE4/M8B5GYbMXJqQN5m/B7E7SoGWRnWLCqT7A6GtlJFCzGXnGTtMqE 2+SwGkopl3SREVZQaJGtwF+z0cCb8Y8hqv7YlLJcH4EROtwGItfyNxchYmzhoHpd2FNv JUk5Q+1KErAYnoEMMzhyd5prTaGdnlaZ1zmAYW5kyLDoIqZ4WeQOkj+l2fP1AmrFQbEv 2IOQ== X-Forwarded-Encrypted: i=1; AJvYcCUDuGR4U3A2ZL9ljdbxCagxSl6cZxepFSw/imkvC9JgZuwaMuW80fbLwf0RAEbYamGV6ZUrRQnJylyRwPBCIIhrtU/l X-Gm-Message-State: AOJu0YxSXbrJalOggSx53ckQGDJeOmoGA4ov5tcYLKxbEP3rwwK1dQCE f+JcylgYN4rb2OqZ08xG0NwNRX7wi9lO7Q8NmoXn0F7sVj9yXBTYKbWYCuK7lRs= X-Google-Smtp-Source: AGHT+IGnTKynFh1txoZ9rF9Vyl15tlc6kOiNOpj1xrRbtFLNtjZUfEfbPneu9vzj/dXaKDU0HdxgVA== X-Received: by 2002:a17:906:f87:b0:a51:b463:6b41 with SMTP id q7-20020a1709060f8700b00a51b4636b41mr56034ejj.61.1713468507162; Thu, 18 Apr 2024 12:28:27 -0700 (PDT) Received: from m1x-phil.lan ([176.176.151.213]) by smtp.gmail.com with ESMTPSA id s17-20020a170906bc5100b00a4660b63502sm1277805ejv.12.2024.04.18.12.28.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Apr 2024 12:28:26 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Mark Cave-Ayland Subject: [PATCH 24/24] exec: Remove unnecessary inclusions of 'hw/core/cpu.h' Date: Thu, 18 Apr 2024 21:25:23 +0200 Message-ID: <20240418192525.97451-25-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240418192525.97451-1-philmd@linaro.org> References: <20240418192525.97451-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=philmd@linaro.org; helo=mail-ej1-x629.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org When "hw/core/cpu.h" is not required, remove it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/exec/cpu-all.h | 1 - include/exec/cpu-defs.h | 1 - include/hw/boards.h | 1 - include/hw/ppc/openpic.h | 1 - include/sysemu/hw_accel.h | 1 - 5 files changed, 5 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index cfbf51822c..03963442a0 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -21,7 +21,6 @@ #include "exec/cpu-common.h" #include "exec/memory.h" -#include "hw/core/cpu.h" /* some important defines: * diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h index 0dbef3010c..2b88db71a8 100644 --- a/include/exec/cpu-defs.h +++ b/include/exec/cpu-defs.h @@ -29,7 +29,6 @@ #include "exec/hwaddr.h" #endif #include "exec/memattrs.h" -#include "hw/core/cpu.h" #include "cpu-param.h" diff --git a/include/hw/boards.h b/include/hw/boards.h index 8b8f6d5c00..2daa23082f 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -9,7 +9,6 @@ #include "qapi/qapi-types-machine.h" #include "qemu/module.h" #include "qom/object.h" -#include "hw/core/cpu.h" #define TYPE_MACHINE_SUFFIX "-machine" diff --git a/include/hw/ppc/openpic.h b/include/hw/ppc/openpic.h index 9c6af8e207..8fe3a5902f 100644 --- a/include/hw/ppc/openpic.h +++ b/include/hw/ppc/openpic.h @@ -2,7 +2,6 @@ #define OPENPIC_H #include "hw/sysbus.h" -#include "hw/core/cpu.h" #include "qom/object.h" #define MAX_CPU 32 diff --git a/include/sysemu/hw_accel.h b/include/sysemu/hw_accel.h index c71b77e71f..6aca3c6178 100644 --- a/include/sysemu/hw_accel.h +++ b/include/sysemu/hw_accel.h @@ -11,7 +11,6 @@ #ifndef QEMU_HW_ACCEL_H #define QEMU_HW_ACCEL_H -#include "hw/core/cpu.h" #include "sysemu/kvm.h" #include "sysemu/hvf.h" #include "sysemu/whpx.h"