From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Cameron Esfahani" <dirty@apple.com>,
"Alexandre Iooss" <erdnaxe@crans.org>,
"Yanan Wang" <wangyanan55@huawei.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Sunil Muthuswamy" <sunilmut@microsoft.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Mahmoud Mandour" <ma.mandourr@gmail.com>,
"Reinoud Zandijk" <reinoud@netbsd.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
kvm@vger.kernel.org, "Roman Bolshakov" <rbolshakov@ddn.com>
Subject: [PATCH 1/5] hw/core: expand on the alignment of CPUState
Date: Thu, 30 May 2024 20:42:46 +0100 [thread overview]
Message-ID: <20240530194250.1801701-2-alex.bennee@linaro.org> (raw)
In-Reply-To: <20240530194250.1801701-1-alex.bennee@linaro.org>
Make the relationship between CPUState, ArchCPU and cpu_env a bit
clearer in the kdoc comments.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
include/hw/core/cpu.h | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index bb398e8237..35d345371b 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -391,7 +391,8 @@ struct qemu_work_item;
#define CPU_UNSET_NUMA_NODE_ID -1
/**
- * CPUState:
+ * struct CPUState - common state of one CPU core or thread.
+ *
* @cpu_index: CPU index (informative).
* @cluster_index: Identifies which cluster this CPU is in.
* For boards which don't define clusters or for "loose" CPUs not assigned
@@ -439,10 +440,15 @@ struct qemu_work_item;
* @kvm_fetch_index: Keeps the index that we last fetched from the per-vCPU
* dirty ring structure.
*
- * State of one CPU core or thread.
+ * @neg_align: The CPUState is the common part of a concrete ArchCPU
+ * which is allocated when an individual CPU instance is created. As
+ * such care is taken is ensure there is no gap between between
+ * CPUState and CPUArchState within ArchCPU.
*
- * Align, in order to match possible alignment required by CPUArchState,
- * and eliminate a hole between CPUState and CPUArchState within ArchCPU.
+ * @neg: The architectural register state ("cpu_env") immediately follows CPUState
+ * in ArchCPU and is passed to TCG code. The @neg structure holds some
+ * common TCG CPU variables which are accessed with a negative offset
+ * from cpu_env.
*/
struct CPUState {
/*< private >*/
--
2.39.2
next prev parent reply other threads:[~2024-05-30 19:43 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-30 19:42 [PATCH 0/5] cpus: a few tweaks to CPU realization Alex Bennée
2024-05-30 19:42 ` Alex Bennée [this message]
2024-05-30 22:28 ` [PATCH 1/5] hw/core: expand on the alignment of CPUState Pierrick Bouvier
2024-06-03 11:32 ` Philippe Mathieu-Daudé
2024-05-30 19:42 ` [PATCH 2/5] cpu: move Qemu[Thread|Cond] setup into common code Alex Bennée
2024-05-30 22:29 ` Pierrick Bouvier
2024-05-31 13:46 ` Reinoud Zandijk
2024-06-03 11:28 ` Philippe Mathieu-Daudé
2024-05-30 19:42 ` [PATCH 3/5] cpu-target: don't set cpu->thread_id to bogus value Alex Bennée
2024-05-30 22:29 ` Pierrick Bouvier
2024-06-03 11:29 ` Philippe Mathieu-Daudé
2024-05-30 19:42 ` [PATCH 4/5] plugins: remove special casing for cpu->realized Alex Bennée
2024-05-30 22:30 ` Pierrick Bouvier
2024-06-03 11:31 ` Philippe Mathieu-Daudé
2024-06-03 14:11 ` Philippe Mathieu-Daudé
2024-06-03 14:19 ` Alex Bennée
2024-05-30 19:42 ` [PATCH 5/5] core/cpu-common: initialise plugin state before thread creation Alex Bennée
2024-05-30 22:31 ` Pierrick Bouvier
2024-05-31 8:59 ` Alex Bennée
2024-05-31 7:26 ` Philippe Mathieu-Daudé
2024-05-31 8:47 ` Alex Bennée
2024-06-03 14:10 ` Philippe Mathieu-Daudé
2024-06-03 12:47 ` [PATCH 0/5] cpus: a few tweaks to CPU realization Philippe Mathieu-Daudé
2024-06-03 14:11 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240530194250.1801701-2-alex.bennee@linaro.org \
--to=alex.bennee@linaro.org \
--cc=dirty@apple.com \
--cc=eduardo@habkost.net \
--cc=erdnaxe@crans.org \
--cc=kvm@vger.kernel.org \
--cc=ma.mandourr@gmail.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rbolshakov@ddn.com \
--cc=reinoud@netbsd.org \
--cc=richard.henderson@linaro.org \
--cc=sunilmut@microsoft.com \
--cc=wangyanan55@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).