[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1636158401.g3t5cp0jke.astroid@bobo.none>
Date: Sat, 06 Nov 2021 10:29:04 +1000
From: Nicholas Piggin <npiggin@...il.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Juergen Gross <jgross@...e.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, Marc Zyngier <maz@...nel.org>,
Paolo Bonzini <pbonzini@...hat.com>
Subject: Re: [PATCH] KVM: move struct kvm_vcpu * array to the bottom of struct
kvm
Excerpts from Sean Christopherson's message of November 6, 2021 12:49 am:
> +Juergen and Marc
>
> On Fri, Nov 05, 2021, Nicholas Piggin wrote:
>> Increasing the max VCPUs on powerpc makes the kvm_arch member offset
>> great enough that some assembly breaks due to addressing constants
>> overflowing field widths.
>>
>> Moving the vcpus array to the end of struct kvm prevents this from
>> happening. It has the side benefit that moving the large array out
>> from the middle of the structure should help keep other commonly
>> accessed fields in the same or adjacent cache lines.
>>
>> Signed-off-by: Nicholas Piggin <npiggin@...il.com>
>> ---
>>
>> It would next be possible to now make this a dynamically sized array,
>> and make the KVM_MAX_VCPUS more dynamic
>
> Marc has a mostly-baked series to use an xarray[1][2] that AFAICT would be well
> received. That has my vote, assuming it can get into 5.16. Marc or Juergen,
> are either of you actively working on that?
>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/log/?h=kvm-arm64/vcpu-xarray
> [2] https://lkml.kernel.org/r/871r65wwk7.wl-maz@kernel.org
Seems like a good idea if it can allow vcpu structs to be allocated to
preferred nodes.
>> however x86 kvm_svm uses its own scheme rather than kvm_arch for some reason.
>
> What's the problem in kvm_svm?
It embeds a struct kvm so it couldn't be variable sized.
Thanks,
Nick
Powered by blists - more mailing lists