Message ID | 20230920181731.2232453-1-maz@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Heh, "and other fixes" is quite the understatement :) This looks good to me, only issues I've spotted so far are a few typos that are easty enough to fix when I apply the series. I'll give it a couple days for folks to have a look, but otherwise intend on picking this up for 6.7. On Wed, Sep 20, 2023 at 07:17:20PM +0100, Marc Zyngier wrote: > This is a follow-up on [1], which contains the original patches, only > augmented with a bunch of fixes after Zenghui pointed out that I was > inadvertently fixing bugs (yay!), but that there were plenty more. > > The core of the issue is that we tend to confuse vcpu_id with > vcpu_idx. The first is a userspace-provided value, from which we > derive the default MPIDR_EL1 value, while the second is something that > used to represent the position in the vcpu array, and is now more of > an internal identifier.
Hi Marc, On 2023/9/21 2:17, Marc Zyngier wrote: > So this series, on top of trying to optimise SGI injection, also aims > at disambiguating this mess, and documenting some of the implicit > requirements for userspace. Apart from the minor comments, this series looks good. Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
diff --git a/kvm-cpu.c b/kvm-cpu.c index 1c566b3..520d759 100644 --- a/kvm-cpu.c +++ b/kvm-cpu.c @@ -287,7 +287,7 @@ int kvm_cpu__init(struct kvm *kvm) return -ENOMEM; } - for (i = 0; i < kvm->nrcpus; i++) { + for (i = kvm->nrcpus - 1; i >= 0; i--) { kvm->cpus[i] = kvm_cpu__arch_init(kvm, i); if (!kvm->cpus[i]) { pr_err("unable to initialize KVM VCPU");