From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6FE45CCA470 for ; Wed, 1 Oct 2025 15:19:16 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1v3ySO-0004K5-GY; Wed, 01 Oct 2025 11:09:29 -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 1v3ySK-0004Ew-Va for qemu-arm@nongnu.org; Wed, 01 Oct 2025 11:09:25 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1v3yQN-0000rM-Mt for qemu-arm@nongnu.org; Wed, 01 Oct 2025 11:09:24 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-46e2c3b6d4cso56538285e9.3 for ; Wed, 01 Oct 2025 08:07:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1759331234; x=1759936034; 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=AoPTdg5MwxI4gUrOUKUWisdEEc5+5afMb5BWjaZNRgo=; b=ssUBkp0QeGEDnWPL6KPrBCD9w1eJOiMDYWR9p5u3R9v6/U+eMNp7hnpFO4dVhpNLB9 ui+r38KglthQnSA+/LQPPCwcIU7ymQq8QV3k4o8GiJmoZa5l07tl5g53z7O4YnDFWqG7 U0DPnQPwwcrxUCOucic3Kl+pjXzgJl1X97RAght4T8G6WtKzDLbl3airma8NemJvAA9R UrjkXoK6vmUstXQ2zyCk17lQnwPazDW1j8xlZQjowG8kX7U5MEdKvU6PxSyFPUhvr7DA 7qwZo7bf9+88u7437HuwQy+l3CLtiTzmM52B9JAcauidovix6Et535LxymVDAibWhOO1 B3Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759331234; x=1759936034; 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=AoPTdg5MwxI4gUrOUKUWisdEEc5+5afMb5BWjaZNRgo=; b=Tt8N3YhTFYQMdJ+a1t/OiZMYTpyC+J708B8IMAVk7QtcJuW8j73jxPHmFJiYSjtJ75 58RtHpVhMMWn+qPqEb2xq8srXVjhKQdjbhWtYyouK6W372BCKfxKEZs7DA3VGyfbkEHf B/1u++W2AR+e+qKm5h6DhxFBBU1wHjhJAJOrNoG/7yEPdOV4k9332Kc9LiWj05YOJsrY XJiUiE/NKKlCi0CpGOqZjwHnOK+lJp3gvsZ+gZ/3aCazXXBfH9c7WMnlv2qshs1m1qWf R5TUO4v6xY5/R+ySHh5zs2EGf7LYXYRKo6iy+JnzBX/djwhQzOzzdcuhezvAXbPwyaIT UIWA== X-Gm-Message-State: AOJu0Yzc7Mzr8JJA1bWyrYesiqRZMYgF0DrjrTnHJmgKfPYduNUvPWOk munNVSzw+Dv3Wp6qZ/WdutW3OwkwPLq+ueGyyMSdd9qHLbhOJWcXLR20KFa4iLctRUs= X-Gm-Gg: ASbGncuOY5ANhsV+qCZMFKCleDepl09lqaHa+FsOP2dXDWxvx1ysrJg69MMDeqT3LzC LCQgO6jLvic7PrkqYcOY7xpUAMmJtDGAAM29qB03kkWy0vQ0dpkLvVmA1EvprIK5tEC5lOrp0pQ nTX9Zq1InMVMs2iG0GqBiRLhvs0d1tzpeq95m3D4+HOsEmfsrk6/qbpH2sIWL1yN8XuL37h0SHx CEQsF3D3b5Yhip8Bmm4dOY1N1Xij/S17OSCaEp3kvRPd6Wx87xcnmtJUpHx1HgqmeGqxhDjuZA8 +TyolTsKeyS5YZCtLvnpF39ZtoSf9xZIACxEH0nmeHFRP+8uK/ycgNmW4hmXbNl56E6JkbNqk6j EmYxlNj6RvSbrubj6en91VOnXZ2UN8L1rNHyAaBHvapL17/5n+LgZdzNaslaxmROvlZRzlCqUcz /x2bdmwyc7UGXR5j2GYpYk X-Google-Smtp-Source: AGHT+IG4XxMj0/+XRjkxBKqGWeT9h7Y0BLEBnyZwHWXRoLQtC3MKtNYoHlq4F6Q4cvmSoGl7zqJatA== X-Received: by 2002:a05:600c:6094:b0:45d:d88b:cca with SMTP id 5b1f17b1804b1-46e6125cf67mr30505065e9.1.1759331233664; Wed, 01 Oct 2025 08:07:13 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46e611970easm25177495e9.2.2025.10.01.08.07.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 01 Oct 2025 08:07:13 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, Richard Henderson , qemu-riscv@nongnu.org, Peter Maydell , qemu-ppc@nongnu.org, Paolo Bonzini , Pierrick Bouvier , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Zhao Liu , David Hildenbrand Subject: [PATCH 20/22] hw/core/cpu: Remove @CPUState::as field Date: Wed, 1 Oct 2025 17:05:25 +0200 Message-ID: <20251001150529.14122-21-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251001150529.14122-1-philmd@linaro.org> References: <20251001150529.14122-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.com X-BeenThere: qemu-arm@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-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org All code now get the vcpu first address space using cpu_get_address_space(). Nothing uses the CPUState::as field anymore: remove it. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 3 --- hw/core/cpu-common.c | 1 - system/cpus.c | 2 +- system/physmem.c | 10 ---------- 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index c9f40c25392..0f7eda1a10d 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -443,8 +443,6 @@ struct qemu_work_item; * @cpu_ases: Pointer to array of CPUAddressSpaces (which define the * AddressSpaces this CPU has) * @num_ases: number of CPUAddressSpaces in @cpu_ases - * @as: Pointer to the first AddressSpace, for the convenience of targets which - * only have a single AddressSpace * @gdb_regs: Additional GDB registers. * @gdb_num_regs: Number of total registers accessible to GDB. * @gdb_num_g_regs: Number of registers in GDB 'g' packets. @@ -517,7 +515,6 @@ struct CPUState { struct CPUAddressSpace *cpu_ases; int cpu_ases_count; int num_ases; - AddressSpace *as; MemoryRegion *memory; struct CPUJumpCache *tb_jmp_cache; diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 41a339903ca..e46863d9e1d 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -307,7 +307,6 @@ static void cpu_common_initfn(Object *obj) cpu->cpu_index = UNASSIGNED_CPU_INDEX; cpu->cluster_index = UNASSIGNED_CLUSTER_INDEX; - cpu->as = NULL; cpu->num_ases = 0; /* user-mode doesn't have configurable SMP topology */ /* the default value is changed by qemu_init_vcpu() for system-mode */ diff --git a/system/cpus.c b/system/cpus.c index aa7bfcf56e5..ecd025a611d 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -704,7 +704,7 @@ void qemu_init_vcpu(CPUState *cpu) cpu->stopped = true; cpu->random_seed = qemu_guest_random_seed_thread_part1(); - if (!cpu->as) { + if (cpu->num_ases == 0) { /* If the target cpu hasn't set up any address spaces itself, * give it the default one. */ diff --git a/system/physmem.c b/system/physmem.c index b245cd14d43..31286b3c13f 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -791,11 +791,6 @@ void cpu_address_space_init(CPUState *cpu, int asidx, /* Target code should have set num_ases before calling us */ assert(asidx < cpu->num_ases); - if (asidx == 0) { - /* address space 0 gets the convenience alias */ - cpu->as = as; - } - if (!cpu->cpu_ases) { cpu->cpu_ases = g_new0(CPUAddressSpace, cpu->num_ases); cpu->cpu_ases_count = cpu->num_ases; @@ -827,11 +822,6 @@ void cpu_address_space_destroy(CPUState *cpu, int asidx) address_space_destroy(cpuas->as); g_free_rcu(cpuas->as, rcu); - if (asidx == 0) { - /* reset the convenience alias for address space 0 */ - cpu->as = NULL; - } - if (--cpu->cpu_ases_count == 0) { g_free(cpu->cpu_ases); cpu->cpu_ases = NULL; -- 2.51.0