Re: [PATCH v5 01/19] KVM: x86: Allocate new rmap and large page tracking when moving memslot

2020-02-05 Thread Peter Xu
On Tue, Jan 21, 2020 at 02:31:39PM -0800, Sean Christopherson wrote: > Reallocate a rmap array and recalcuate large page compatibility when > moving an existing memslot to correctly handle the alignment properties > of the new memslot. The number of rmap entries required at each level > is

Re: [PATCH v5 01/19] KVM: x86: Allocate new rmap and large page tracking when moving memslot

2020-02-05 Thread Peter Xu
On Wed, Feb 05, 2020 at 06:17:15PM -0800, Sean Christopherson wrote: > On Wed, Feb 05, 2020 at 09:00:31PM -0500, Peter Xu wrote: > > On Wed, Feb 05, 2020 at 03:55:33PM -0800, Sean Christopherson wrote: > > > On Wed, Feb 05, 2020 at 04:49:52PM -0500, Peter Xu wrote: > > > > On Tue, Jan 21, 2020 at

Re: [PATCH v5 04/19] KVM: PPC: Move memslot memory allocation into prepare_memory_region()

2020-02-05 Thread Peter Xu
On Tue, Jan 21, 2020 at 02:31:42PM -0800, Sean Christopherson wrote: > static int kvmppc_core_prepare_memory_region_hv(struct kvm *kvm, > - struct kvm_memory_slot *memslot, > - const struct > kvm_userspace_memory_region

Re: [PATCH v5 01/19] KVM: x86: Allocate new rmap and large page tracking when moving memslot

2020-02-05 Thread Sean Christopherson
On Wed, Feb 05, 2020 at 04:49:52PM -0500, Peter Xu wrote: > On Tue, Jan 21, 2020 at 02:31:39PM -0800, Sean Christopherson wrote: > > Reallocate a rmap array and recalcuate large page compatibility when > > moving an existing memslot to correctly handle the alignment properties > > of the new

Re: [PATCH v5 06/19] KVM: Drop kvm_arch_create_memslot()

2020-02-05 Thread Peter Xu
On Tue, Jan 21, 2020 at 02:31:44PM -0800, Sean Christopherson wrote: > Remove kvm_arch_create_memslot() now that all arch implementations are > effectively nops. Removing kvm_arch_create_memslot() eliminates the > possibility for arch specific code to allocate memory prior to setting > a memslot,

Re: [PATCH v5 03/19] KVM: Don't free new memslot if allocation of said memslot fails

2020-02-05 Thread Peter Xu
On Tue, Jan 21, 2020 at 02:31:41PM -0800, Sean Christopherson wrote: > The two implementations of kvm_arch_create_memslot() in x86 and PPC are > both good citizens and free up all local resources if creation fails. > Return immediately (via a superfluous goto) instead of calling >

Re: [PATCH v5 01/19] KVM: x86: Allocate new rmap and large page tracking when moving memslot

2020-02-05 Thread Sean Christopherson
On Wed, Feb 05, 2020 at 09:00:31PM -0500, Peter Xu wrote: > On Wed, Feb 05, 2020 at 03:55:33PM -0800, Sean Christopherson wrote: > > On Wed, Feb 05, 2020 at 04:49:52PM -0500, Peter Xu wrote: > > > On Tue, Jan 21, 2020 at 02:31:39PM -0800, Sean Christopherson wrote: > > > > Reallocate a rmap array

Re: [PATCH v5 08/19] KVM: Refactor error handling for setting memory region

2020-02-05 Thread Peter Xu
On Tue, Jan 21, 2020 at 02:31:46PM -0800, Sean Christopherson wrote: > Replace a big pile o' gotos with returns to make it more obvious what > error code is being returned, and to prepare for refactoring the > functional, i.e. post-checks, portion of __kvm_set_memory_region(). > > Reviewed-by:

Re: [PATCH v5 02/19] KVM: Reinstall old memslots if arch preparation fails

2020-02-05 Thread Peter Xu
On Tue, Jan 21, 2020 at 02:31:40PM -0800, Sean Christopherson wrote: > Reinstall the old memslots if preparing the new memory region fails > after invalidating a to-be-{re}moved memslot. > > Remove the superfluous 'old_memslots' variable so that it's somewhat > clear that the error handling path

Re: [PATCH v5 01/19] KVM: x86: Allocate new rmap and large page tracking when moving memslot

2020-02-05 Thread Peter Xu
On Wed, Feb 05, 2020 at 03:55:33PM -0800, Sean Christopherson wrote: > On Wed, Feb 05, 2020 at 04:49:52PM -0500, Peter Xu wrote: > > On Tue, Jan 21, 2020 at 02:31:39PM -0800, Sean Christopherson wrote: > > > Reallocate a rmap array and recalcuate large page compatibility when > > > moving an

[PATCH v2 6/6] irqchip/gic-v3-its: Rename VPENDBASER/VPROPBASER accessors

2020-02-05 Thread Zenghui Yu
V{PEND,PROP}BASER registers are actually located in VLPI_base frame of the *redistributor*. Rename their accessors to reflect this fact. No functional changes. Signed-off-by: Zenghui Yu --- arch/arm/include/asm/arch_gicv3.h | 12 ++-- arch/arm64/include/asm/arch_gicv3.h | 8

[PATCH v2 1/6] irqchip/gic-v4.1: Fix programming of GICR_VPROPBASER_4_1_SIZE

2020-02-05 Thread Zenghui Yu
The Size field of GICv4.1 VPROPBASER register indicates number of pages minus one and together Page_Size and Size control the vPEID width. Let's respect this requirement of the architecture. Signed-off-by: Zenghui Yu --- drivers/irqchip/irq-gic-v3-its.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v2 0/6] irqchip/gic-v4.1: Cleanup and fixes for GICv4.1

2020-02-05 Thread Zenghui Yu
Hi, This series contains some cleanups, VPROPBASER field programming fix and level2 vPE table allocation enhancement, collected while looking through the GICv4.1 driver one more time. Hope they will help, thanks! v1 -> v2: - Take into account Marc's comments on patch#3 - Add one more patch to

Re: [PATCH v5 01/19] KVM: x86: Allocate new rmap and large page tracking when moving memslot

2020-02-05 Thread Sean Christopherson
On Wed, Feb 05, 2020 at 09:58:58PM -0500, Peter Xu wrote: > On Wed, Feb 05, 2020 at 06:17:15PM -0800, Sean Christopherson wrote: > > On Wed, Feb 05, 2020 at 09:00:31PM -0500, Peter Xu wrote: > > > On Wed, Feb 05, 2020 at 03:55:33PM -0800, Sean Christopherson wrote: > > > > On Wed, Feb 05, 2020 at

Re: [PATCH 0/5] irqchip/gic-v4.1: Cleanup and fixes for GICv4.1

2020-02-05 Thread Zenghui Yu
Hi Marc, On 2020/2/5 20:46, Marc Zyngier wrote: Hi Zenghui, On 2020-02-04 09:09, Zenghui Yu wrote: Hi, This series contains some cleanups, VPROPBASER field programming fix and level2 vPE table allocation enhancement, collected while looking through the GICv4.1 driver one more time. Hope

[PATCH v2 4/6] irqchip/gic-v4.1: Drop 'tmp' in inherit_vpe_l1_table_from_rd()

2020-02-05 Thread Zenghui Yu
The variable 'tmp' in inherit_vpe_l1_table_from_rd() is actually not needed, drop it. Signed-off-by: Zenghui Yu --- drivers/irqchip/irq-gic-v3-its.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index

[PATCH v2 3/6] irqchip/gic-v4.1: Ensure L2 vPE table is allocated at RD level

2020-02-05 Thread Zenghui Yu
In GICv4, we will ensure that level2 vPE table memory is allocated for the specified vpe_id on all v4 ITS, in its_alloc_vpe_table(). This still works well for the typical GICv4.1 implementation, where the new vPE table is shared between the ITSs and the RDs. To make it explicit, let us introduce

[PATCH v2 2/6] irqchip/gic-v4.1: Set vpe_l1_base for all redistributors

2020-02-05 Thread Zenghui Yu
Currently, we will not set vpe_l1_page for the current RD if we can inherit the vPE configuration table from another RD (or ITS), which results in an inconsistency between RDs within the same CommonLPIAff group. Let's rename it to vpe_l1_base to indicate the base address of the vPE configuration

[PATCH v2 5/6] irqchip/gic-v3-its: Remove superfluous WARN_ON

2020-02-05 Thread Zenghui Yu
"ITS virtual pending table not cleaning" is already complained inside its_clear_vpend_valid(), there's no need to trigger a WARN_ON again. Signed-off-by: Zenghui Yu --- drivers/irqchip/irq-gic-v3-its.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c

Re: [PATCH v2 2/2] target/arm: kvm: Handle DABT with no valid ISS

2020-02-05 Thread Andrew Jones
On Wed, Jan 29, 2020 at 08:24:41PM +, Beata Michalska wrote: > On ARMv7 & ARMv8 some load/store instructions might trigger a data abort > exception with no valid ISS info to be decoded. The lack of decode info > makes it at least tricky to emulate those instruction which is one of the > (many)

Re: [PATCH] KVM: arm/arm64: Fix up includes for trace.h

2020-02-05 Thread Jeremy Cline
On Wed, Feb 05, 2020 at 03:18:05PM +, Marc Zyngier wrote: > On 2020-02-05 13:41, Jeremy Cline wrote: > > Fedora kernel builds on armv7hl began failing recently because > > kvm_arm_exception_type and kvm_arm_exception_class were undeclared in > > trace.h. Add the missing include. > > > >

Re: [PATCH kvmtool] Add emulation for CFI compatible flash memory

2020-02-05 Thread Will Deacon
On Wed, Jan 08, 2020 at 06:32:12PM +, Andre Przywara wrote: > From: Raphael Gault > > The EDK II UEFI firmware implementation requires some storage for the EFI > variables, which is typically some flash storage. > Since this is already supported on the EDK II side, we add a CFI flash >

Re: [PATCH RFC 3/5] irqchip/gic-v4.1: Ensure L2 vPE table is allocated at RD level

2020-02-05 Thread Marc Zyngier
Hi Zenghui, Thanks for this. A few comments below. On 2020-02-04 09:09, Zenghui Yu wrote: In GICv4, we will ensure that level2 vPE table memory is allocated for the specified vpe_id on all v4 ITS, in its_alloc_vpe_table(). This still works well for the typical GICv4.1 implementation, where the

Re: [PATCH 1/5] irqchip/gic-v4.1: Fix programming of GICR_VPROPBASER_4_1_SIZE

2020-02-05 Thread Marc Zyngier
On 2020-02-04 09:09, Zenghui Yu wrote: The Size field of GICv4.1 VPROPBASER register indicates number of pages minus one and together Page_Size and Size control the vPEID width. Let's respect this requirement of the architecture. Signed-off-by: Zenghui Yu --- drivers/irqchip/irq-gic-v3-its.c

Re: [PATCH 0/5] irqchip/gic-v4.1: Cleanup and fixes for GICv4.1

2020-02-05 Thread Marc Zyngier
Hi Zenghui, On 2020-02-04 09:09, Zenghui Yu wrote: Hi, This series contains some cleanups, VPROPBASER field programming fix and level2 vPE table allocation enhancement, collected while looking through the GICv4.1 driver one more time. Hope they will help, thanks! Zenghui Yu (5):

[PATCH] KVM: arm/arm64: Fix up includes for trace.h

2020-02-05 Thread Jeremy Cline
Fedora kernel builds on armv7hl began failing recently because kvm_arm_exception_type and kvm_arm_exception_class were undeclared in trace.h. Add the missing include. Signed-off-by: Jeremy Cline --- I've not dug very deeply into what exactly changed between commit b3a608222336 (the last build

Re: [PATCH] KVM: arm/arm64: Fix up includes for trace.h

2020-02-05 Thread Marc Zyngier
On 2020-02-05 13:41, Jeremy Cline wrote: Fedora kernel builds on armv7hl began failing recently because kvm_arm_exception_type and kvm_arm_exception_class were undeclared in trace.h. Add the missing include. Signed-off-by: Jeremy Cline --- I've not dug very deeply into what exactly changed