From: Richard Henderson <richard.henderson@linaro.org>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: qemu-devel@nongnu.org, f4bug@amsat.org, mads@ynddal.dk,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v1 1/9] hw: encode accessing CPU index in MemTxAttrs
Date: Mon, 26 Sep 2022 07:33:13 +0000 [thread overview]
Message-ID: <45cbdafb-d3ad-dd58-c76c-d6268b581570@linaro.org> (raw)
In-Reply-To: <87h70vha2d.fsf@linaro.org>
On 9/25/22 13:02, Alex Bennée wrote:
>> I'm not keen on adding another field like this.
>
> Hmm I thought it was unavoidable from Edgar's comment:
>
> "CPU's can also have a Master-IDs (Requester IDs) which are unrelated to
> the Clusters CPU index. This is used for example in the Xilinx ZynqMP
> and Xilinx Versal and the XMPU (Memory Protection Units).
>
> Anyway, I think this approach is an improvement from the current state
> but would rather see a new separate field from requester_id. Overloading
> requester_id will break some of our use-cases (in the Xilinx tree)..."
>
> Of course we don't have to care about external use cases but it seemed
> to indicate we might need both.
I missed that one.
>> What bounds our max number of cpus at the moment? We use "int" in
>> struct CPUCore, but that's almost certainly for convenience.
>>
>> target/s390x/cpu.h:#define S390_MAX_CPUS 248
>> hw/i386/pc_piix.c: m->max_cpus = HVM_MAX_VCPUS;
>>
>> hw/i386/pc_q35.c: m->max_cpus = 288;
>>
>> hw/arm/virt.c: mc->max_cpus = 512;
>>
>> hw/arm/sbsa-ref.c: mc->max_cpus = 512;
>>
>> hw/i386/microvm.c: mc->max_cpus = 288;
>>
>> hw/ppc/spapr.c: mc->max_cpus = INT32_MAX;
>>
>>
>> Most of these are nicely bounded, but HVM_MAX_VCPUS is a magic number
>> from Xen, and ppc appears to be prepared for 31 bits worth of cpus.
>
> From 5642e4513e (spapr.c: do not use MachineClass::max_cpus to limit
> CPUs) I think it is being a little optimistic. Even with the beefiest
> hosts you start to see diminishing returns by ~12 vCPUs and it won't
> take long before each extra vCPU just slows you down.
Ok, I guess. If we decided to add an assert that the cpuid fit in this field, we'd want
to revisit this, I think. Not an issue for the moment.
> I was confused by the last comment because I forgot the TLBs are not
> shared between cores. So I can just bang:
>
> MemTxAttrs attrs = { .cpu_index = cs->cpu_index };
>
> into arm_cpu_tlb_fill and be done with it?
Yes, it looks like it. I don't see any bulk overwrite of attrs in get_phys_addr and
subroutines. Mostly modifications of attrs->secure, as expected.
r~
next prev parent reply other threads:[~2022-09-26 22:10 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-22 14:58 [PATCH v1 0/9] MemTxAttrs cpu_index and gdbstub/next Alex Bennée
2022-09-22 14:58 ` [PATCH v1 1/9] hw: encode accessing CPU index in MemTxAttrs Alex Bennée
2022-09-25 10:08 ` Richard Henderson
2022-09-25 13:02 ` Alex Bennée
2022-09-26 7:33 ` Richard Henderson [this message]
2022-09-22 14:58 ` [PATCH v1 2/9] qtest: make read/write operation appear to be from CPU Alex Bennée
2022-09-22 14:58 ` [PATCH v1 3/9] hw/intc/gic: use MxTxAttrs to divine accessing CPU Alex Bennée
2022-09-25 10:11 ` Richard Henderson
2022-09-26 10:56 ` mads
2022-09-26 11:01 ` Alex Bennée
2022-09-26 11:20 ` mads
2022-09-22 14:58 ` [PATCH v1 4/9] hw/timer: convert mptimer access to attrs to derive cpu index Alex Bennée
2022-09-25 10:11 ` Richard Henderson
2022-09-22 14:58 ` [PATCH v1 5/9] configure: move detected gdb to TCG's config-host.mak Alex Bennée
2022-09-25 10:11 ` Richard Henderson
2022-09-22 14:58 ` [PATCH v1 6/9] gdbstub: move into its own sub directory Alex Bennée
2022-09-25 10:13 ` Richard Henderson
2022-09-22 14:58 ` [PATCH v1 7/9] gdbstub: move sstep flags probing into AccelClass Alex Bennée
2022-09-22 21:49 ` Philippe Mathieu-Daudé via
2022-09-25 10:14 ` Richard Henderson
2022-09-22 14:58 ` [PATCH v1 8/9] gdbstub: move breakpoint logic to accel ops Alex Bennée
2022-09-25 10:18 ` Richard Henderson
2022-09-22 14:58 ` [PATCH v1 9/9] gdbstub: move guest debug support check to ops Alex Bennée
2022-09-22 21:51 ` Philippe Mathieu-Daudé via
2022-09-25 10:18 ` Richard Henderson
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=45cbdafb-d3ad-dd58-c76c-d6268b581570@linaro.org \
--to=richard.henderson@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=f4bug@amsat.org \
--cc=mads@ynddal.dk \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).