From nobody Tue Feb 10 10:03:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.43 as permitted sender) client-ip=209.85.221.43; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f43.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1621252589; cv=none; d=zohomail.com; s=zohoarc; b=j048+A8nn8qWHOOxF1ILlBhClOt6eBtq1S3zFOZnG4WhBxkxt1A2qAoW7RafYA1nIqulixwpK3gevPMCs/RNKF8Y9AQ1cVE4jnpBFuodMUBKfMFvu4Unjkv33neTMj5r3sb7t96mXnOytgLJqvHN6TAmcu/bzqczV20XKWDlQUk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621252589; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=L0W+6Vm5qV+IHP9AnHmUXACYLiu+ypqABP540bBo9bI=; b=bWVtzcgb+cIA4rHSgFuGeAscQTXSOy5TFKeSFKZ2g+x0ckkvuilGPo56nyPO8hb2Y4aEIReyBqKZpVlVH8vWAPO78+oo9N/M0noAJgt4YM3lSdHBsq/s+saBuYcsBk8Yg0ihyLzGVKDeUl+2MsMvb0wVb/OfX7+RS14LsL3GetY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mx.zohomail.com with SMTPS id 1621252589555425.1575913565906; Mon, 17 May 2021 04:56:29 -0700 (PDT) Received: by mail-wr1-f43.google.com with SMTP id x8so6071289wrq.9 for ; Mon, 17 May 2021 04:56:26 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (31.red-83-51-215.dynamicip.rima-tde.net. [83.51.215.31]) by smtp.gmail.com with ESMTPSA id g66sm14216444wma.11.2021.05.17.04.56.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 04:56:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L0W+6Vm5qV+IHP9AnHmUXACYLiu+ypqABP540bBo9bI=; b=p7aCRUuiIQqNZEL/KM6qm+hMp6V/k7IJr2dwRFxI74sCv1KXT6RZd25oxWTPHqAJgp UFuZt7jAtfOJGfPxkpUCkDAEoYyyevkGfLfP5tZ4CKGeoC4eKHoaYfdWDHeFeR3/mxGZ HZLbY8cjDupY2O4mQ4g+LDqsedap9zIB26i9cXKjsTCdnJuo0SleqBlsJAp8v3CQkSXt 5+xqEw+nDZy6kNOJm1hE8F+M7W6T567rH3MxE30xeAkoRR/2N2caK4tEDgY613vHi0FS O/YyPmpvsIbhYKC6qQqO/P4oATdAzAnJeNzANnIT6Qg4ueRg9F0i7X2vgN6sDFOPCmZ1 Vm3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=L0W+6Vm5qV+IHP9AnHmUXACYLiu+ypqABP540bBo9bI=; b=NpXreGkeoFZWUvf2pS8wx/DGaDn00WqbxRo1FnWu83McstQ7cl/ofOo3TTzrf/HJjF At1kyB66LM3ovBjuhVoC2sTMuLZAnWK1VNITRyQuQMkX5NGDcyRVLHe0lemXk45B8ujl GjLXYcHnqM3gswWN1o7FzIuQY/kZ4Ivxx5FCPH/mgmePS2pMP3uZM2L306Ar3MnxJIMr Yjnx/5l7sIN5FSLaIM1klyylo3akFkbaBWjpaHCK4FhHhROBdTe4MxVUNiM6s6V1IOEm tjhQvaQeUl6kpU1ELIqzN7KCp6XWCpyWWGVVpcRmUJtmH+znZ9kl/70GlJ3Gr3OW9qH1 P6VQ== X-Gm-Message-State: AOAM530pBatJFa5lNHWL2/T2h0skyf5WGOtVW3DLAmVQtzIlDsD0DDfZ m5Oa3mYOYGzIAj9lP9KDDbI= X-Google-Smtp-Source: ABdhPJwYt+25OYRCGoVeScVAETWF3UjbAA+Dbj9Dq+/tdMxB3LOCZTCP3Jmk2/3eTBSyscywk9gq2A== X-Received: by 2002:a5d:6b43:: with SMTP id x3mr39863228wrw.263.1621252585741; Mon, 17 May 2021 04:56:25 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 11/15] exec/cpu: Make address_space_init/reloading_memory_map target agnostic Date: Mon, 17 May 2021 13:55:21 +0200 Message-Id: <20210517115525.1088693-12-f4bug@amsat.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210517115525.1088693-1-f4bug@amsat.org> References: <20210517115525.1088693-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) cpu_address_space_init() and cpu_reloading_memory_map() don't have to be target specific. Remove this limitation to be able to build softmmu/cpus.c once for all targets. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/exec/cpu-common.h | 23 +++++++++++++++++++++++ include/exec/exec-all.h | 25 ------------------------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index ccabed4003a..a4fb6813206 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -68,6 +68,28 @@ void qemu_ram_unset_migratable(RAMBlock *rb); size_t qemu_ram_pagesize(RAMBlock *block); size_t qemu_ram_pagesize_largest(void); =20 +/** + * cpu_address_space_init: + * @cpu: CPU to add this address space to + * @asidx: integer index of this address space + * @prefix: prefix to be used as name of address space + * @mr: the root memory region of address space + * + * Add the specified address space to the CPU's cpu_ases list. + * The address space added with @asidx 0 is the one used for the + * convenience pointer cpu->as. + * The target-specific code which registers ASes is responsible + * for defining what semantics address space 0, 1, 2, etc have. + * + * Before the first call to this function, the caller must set + * cpu->num_ases to the total number of address spaces it needs + * to support. + * + * Note that with KVM only one address space is supported. + */ +void cpu_address_space_init(CPUState *cpu, int asidx, + const char *prefix, MemoryRegion *mr); + void cpu_physical_memory_rw(hwaddr addr, void *buf, hwaddr len, bool is_write); static inline void cpu_physical_memory_read(hwaddr addr, @@ -80,6 +102,7 @@ static inline void cpu_physical_memory_write(hwaddr addr, { cpu_physical_memory_rw(addr, (void *)buf, len, true); } +void cpu_reloading_memory_map(void); void *cpu_physical_memory_map(hwaddr addr, hwaddr *plen, bool is_write); diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 6b036cae8f6..781ee62f395 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -84,31 +84,6 @@ static inline bool cpu_loop_exit_requested(CPUState *cpu) return (int32_t)qatomic_read(&cpu_neg(cpu)->icount_decr.u32) < 0; } =20 -#if !defined(CONFIG_USER_ONLY) -void cpu_reloading_memory_map(void); -/** - * cpu_address_space_init: - * @cpu: CPU to add this address space to - * @asidx: integer index of this address space - * @prefix: prefix to be used as name of address space - * @mr: the root memory region of address space - * - * Add the specified address space to the CPU's cpu_ases list. - * The address space added with @asidx 0 is the one used for the - * convenience pointer cpu->as. - * The target-specific code which registers ASes is responsible - * for defining what semantics address space 0, 1, 2, etc have. - * - * Before the first call to this function, the caller must set - * cpu->num_ases to the total number of address spaces it needs - * to support. - * - * Note that with KVM only one address space is supported. - */ -void cpu_address_space_init(CPUState *cpu, int asidx, - const char *prefix, MemoryRegion *mr); -#endif - #if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG) /* cputlb.c */ /** --=20 2.26.3