Re: [PATCH 03/26] KVM: arm64: Factor out stage 2 page table data from struct kvm

2020-05-05 Thread Andrew Scull
> > > + /* VTCR_EL2 value for this VM */ > > > + u64vtcr; > > > > VTCR seems quite strongly tied to the MMU config. Is it not controlled > > independently for the nested MMUs and so remains in this struct? > > This particular instance of VTCR_EL2 is the host's version. Which > means it

Re: [PATCH 06/26] arm64: Add level-hinted TLB invalidation helper

2020-05-05 Thread Andrew Scull
> +#define __tlbi_level(op, addr, level) > \ > + do {\ > + u64 arg = addr; \ > +

Re: [PATCH 05/26] arm64: Document SW reserved PTE/PMD bits in Stage-2 descriptors

2020-05-05 Thread Andrew Scull
On Wed, Apr 22, 2020 at 01:00:29PM +0100, Marc Zyngier wrote: > Advertise bits [58:55] as reserved for SW in the S2 descriptors. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/include/asm/pgtable-hwdef.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git

[PATCH v5 3/4] KVM: arm64: Change CONFIG_KVM to a menuconfig entry

2020-05-05 Thread Fuad Tabba
From: Will Deacon Changing CONFIG_KVM to be a 'menuconfig' entry in Kconfig mean that we can straightforwardly enumerate optional features, such as the virtual PMU device as dependent options. Signed-off-by: Will Deacon Signed-off-by: Fuad Tabba --- arch/arm64/kvm/Kconfig | 16

[PATCH v5 1/4] KVM: arm64: Kill off CONFIG_KVM_ARM_HOST

2020-05-05 Thread Fuad Tabba
From: Will Deacon CONFIG_KVM_ARM_HOST is just a proxy for CONFIG_KVM, so remove it in favour of the latter. Signed-off-by: Will Deacon Signed-off-by: Fuad Tabba --- arch/arm64/kernel/asm-offsets.c | 2 +- arch/arm64/kernel/cpu_errata.c | 2 +- arch/arm64/kernel/smp.c | 2 +-

[PATCH v5 0/4] KVM: arm64: Tidy up arch Kconfig and Makefiles

2020-05-05 Thread Fuad Tabba
Hi, This small patch series tidies up the arm64 KVM build system by rejigging config options, removing some redundant help text, and consolidating some of the Makefile rules. The changes are cosmetic, but it seemed worthwhile to send this out for consideration. This series is a refresh on top

[PATCH v5 4/4] KVM: arm64: Clean up kvm makefiles

2020-05-05 Thread Fuad Tabba
Consolidate references to the CONFIG_KVM configuration item to encompass entire folders rather than per line. Signed-off-by: Fuad Tabba --- arch/arm64/kvm/Makefile | 38 + arch/arm64/kvm/hyp/Makefile | 15 --- 2 files changed, 17

[PATCH v5 2/4] KVM: arm64: Update help text

2020-05-05 Thread Fuad Tabba
From: Will Deacon arm64 KVM supports 16k pages since 02e0b7600f83 ("arm64: kvm: Add support for 16K pages"), so update the Kconfig help text accordingly. Signed-off-by: Will Deacon Signed-off-by: Fuad Tabba --- arch/arm64/kvm/Kconfig | 2 -- 1 file changed, 2 deletions(-) diff --git

Re: [PATCH 03/26] KVM: arm64: Factor out stage 2 page table data from struct kvm

2020-05-05 Thread Andrew Scull
Having a go at reviewing. Might turn out to be more useful as a learning exercise for me rather than useful feedback but we've got to start somewhere.. > -struct kvm_arch { > +struct kvm_s2_mmu { > struct kvm_vmid vmid; > > - /* stage2 entry level table */ > - pgd_t *pgd; > -

Re: [PATCH 03/26] KVM: arm64: Factor out stage 2 page table data from struct kvm

2020-05-05 Thread Marc Zyngier
On Tue, 05 May 2020 18:23:51 +0100, Andrew Scull wrote: > > > > > + /* VTCR_EL2 value for this VM */ > > > > + u64vtcr; > > > > > > VTCR seems quite strongly tied to the MMU config. Is it not controlled > > > independently for the nested MMUs and so remains in this struct? > >

Re: [PATCH 03/26] KVM: arm64: Factor out stage 2 page table data from struct kvm

2020-05-05 Thread Marc Zyngier
Hi James, On Tue, 05 May 2020 17:03:15 +0100, James Morse wrote: > > Hi Marc, > > On 22/04/2020 13:00, Marc Zyngier wrote: > > From: Christoffer Dall > > > > As we are about to reuse our stage 2 page table manipulation code for > > shadow stage 2 page tables in the context of nested

Re: [PATCH 03/26] KVM: arm64: Factor out stage 2 page table data from struct kvm

2020-05-05 Thread Marc Zyngier
Hi Andrew, On Tue, 05 May 2020 16:26:48 +0100, Andrew Scull wrote: > > Having a go at reviewing. Might turn out to be more useful as a learning > exercise for me rather than useful feedback but we've got to start > somewhere.. Thanks for making the effort. Asking questions is never a pointless

Re: [PATCH 03/26] KVM: arm64: Factor out stage 2 page table data from struct kvm

2020-05-05 Thread James Morse
Hi Marc, On 22/04/2020 13:00, Marc Zyngier wrote: > From: Christoffer Dall > > As we are about to reuse our stage 2 page table manipulation code for > shadow stage 2 page tables in the context of nested virtualization, we > are going to manage multiple stage 2 page tables for a single VM. > >

Re: [PATCH V3 04/16] arm64/cpufeature: Introduce ID_PFR2 CPU register

2020-05-05 Thread Mark Rutland
On Tue, May 05, 2020 at 01:12:39PM +0100, Will Deacon wrote: > On Tue, May 05, 2020 at 12:50:54PM +0100, Mark Rutland wrote: > > On Tue, May 05, 2020 at 12:27:19PM +0100, Will Deacon wrote: > > > On Tue, May 05, 2020 at 12:16:07PM +0100, Mark Rutland wrote: > > > > On Tue, May 05, 2020 at

Re: [PATCH V3 04/16] arm64/cpufeature: Introduce ID_PFR2 CPU register

2020-05-05 Thread Will Deacon
On Tue, May 05, 2020 at 12:50:54PM +0100, Mark Rutland wrote: > On Tue, May 05, 2020 at 12:27:19PM +0100, Will Deacon wrote: > > On Tue, May 05, 2020 at 12:16:07PM +0100, Mark Rutland wrote: > > > On Tue, May 05, 2020 at 12:12:41PM +0100, Will Deacon wrote: > > > > On Sat, May 02, 2020 at

Re: [PATCH V3 04/16] arm64/cpufeature: Introduce ID_PFR2 CPU register

2020-05-05 Thread Mark Rutland
On Tue, May 05, 2020 at 12:27:19PM +0100, Will Deacon wrote: > On Tue, May 05, 2020 at 12:16:07PM +0100, Mark Rutland wrote: > > On Tue, May 05, 2020 at 12:12:41PM +0100, Will Deacon wrote: > > > On Sat, May 02, 2020 at 07:03:53PM +0530, Anshuman Khandual wrote: > > > > This adds basic building

Re: [PATCH V3 04/16] arm64/cpufeature: Introduce ID_PFR2 CPU register

2020-05-05 Thread Will Deacon
On Tue, May 05, 2020 at 12:16:07PM +0100, Mark Rutland wrote: > On Tue, May 05, 2020 at 12:12:41PM +0100, Will Deacon wrote: > > On Sat, May 02, 2020 at 07:03:53PM +0530, Anshuman Khandual wrote: > > > This adds basic building blocks required for ID_PFR2 CPU register which > > > provides

Re: [PATCH V3 04/16] arm64/cpufeature: Introduce ID_PFR2 CPU register

2020-05-05 Thread Mark Rutland
On Tue, May 05, 2020 at 12:16:07PM +0100, Mark Rutland wrote: > On Tue, May 05, 2020 at 12:12:41PM +0100, Will Deacon wrote: > > On Sat, May 02, 2020 at 07:03:53PM +0530, Anshuman Khandual wrote: > > > This adds basic building blocks required for ID_PFR2 CPU register which > > > provides

Re: [PATCH V3 04/16] arm64/cpufeature: Introduce ID_PFR2 CPU register

2020-05-05 Thread Mark Rutland
On Tue, May 05, 2020 at 12:12:41PM +0100, Will Deacon wrote: > On Sat, May 02, 2020 at 07:03:53PM +0530, Anshuman Khandual wrote: > > This adds basic building blocks required for ID_PFR2 CPU register which > > provides information about the AArch32 programmers model which must be > > interpreted

Re: [PATCH V3 04/16] arm64/cpufeature: Introduce ID_PFR2 CPU register

2020-05-05 Thread Will Deacon
On Sat, May 02, 2020 at 07:03:53PM +0530, Anshuman Khandual wrote: > This adds basic building blocks required for ID_PFR2 CPU register which > provides information about the AArch32 programmers model which must be > interpreted along with ID_PFR0 and ID_PFR1 CPU registers. This is added > per ARM

Re: [PATCH v4 2/7] KVM: arm64: clean up redundant 'kvm_run' parameters

2020-05-05 Thread Marc Zyngier
Hi Tianjia, On 2020-04-27 05:35, Tianjia Zhang wrote: In the current kvm version, 'kvm_run' has been included in the 'kvm_vcpu' structure. For historical reasons, many kvm-related function parameters retain the 'kvm_run' and 'kvm_vcpu' parameters at the same time. This patch does a unified

Re: [PATCH v4 0/7] clean up redundant 'kvm_run' parameters

2020-05-05 Thread Tianjia Zhang
Paolo Bonzini, any opinion on this? Thanks and best, Tianjia On 2020/4/27 12:35, Tianjia Zhang wrote: In the current kvm version, 'kvm_run' has been included in the 'kvm_vcpu' structure. For historical reasons, many kvm-related function parameters retain the 'kvm_run' and 'kvm_vcpu' parameters

Re: [PATCH V3 06/16] arm64/cpufeature: Introduce ID_MMFR5 CPU register

2020-05-05 Thread Anshuman Khandual
On 05/05/2020 02:03 AM, Will Deacon wrote: > On Sat, May 02, 2020 at 07:03:55PM +0530, Anshuman Khandual wrote: >> This adds basic building blocks required for ID_MMFR5 CPU register which >> provides information about the implemented memory model and memory >> management support in AArch32