[PATCH V5 (RESEND) 0/4] arm64/cpufeature: Introduce ID_PFR2, ID_DFR1, ID_MMFR5 and other changes

2020-07-02 Thread Anshuman Khandual
These are remaining patches from V4 series which had some pending reviews from Suzuki (https://patchwork.kernel.org/cover/11557333/). Also dropped [PATCH 15/17] as that will need some more investigation and rework. This series applies on 5.8-rc3. Cc: Catalin Marinas Cc: Will Deacon Cc: Mark

Re: [kvm-unit-tests PATCH v2 7/8] arm64: microbench: Add time limit for each individual test

2020-07-02 Thread Jingyi Wang
Hi Eric, On 7/2/2020 9:23 PM, Auger Eric wrote: Hi Jingyi, On 7/2/20 5:01 AM, Jingyi Wang wrote: Besides using separate running times parameter, we add time limit for loop_test to make sure each test should be done in a certain time(5 sec here). Signed-off-by: Jingyi Wang ---

Re: [kvm-unit-tests PATCH v2 3/8] arm64: microbench: gic: Add gicv4.1 support for ipi latency test.

2020-07-02 Thread Jingyi Wang
On 7/2/2020 9:42 PM, Auger Eric wrote: Hi Marc, On 7/2/20 3:08 PM, Marc Zyngier wrote: Hi Eric, On 2020-07-02 13:57, Auger Eric wrote: Hi Jingyi, On 7/2/20 5:01 AM, Jingyi Wang wrote: If gicv4.1(sgi hardware injection) supported, we test ipi injection via hw/sw way separately.

[PATCH v3 12/21] KVM: x86/mmu: Skip filling the gfn cache for guaranteed direct MMU topups

2020-07-02 Thread Sean Christopherson
Don't bother filling the gfn array cache when the caller is a fully direct MMU, i.e. won't need a gfn array for shadow pages. Reviewed-by: Ben Gardon Signed-off-by: Sean Christopherson --- arch/x86/kvm/mmu/mmu.c | 18 ++ arch/x86/kvm/mmu/paging_tmpl.h | 4 ++-- 2 files

[PATCH v3 19/21] KVM: MIPS: Drop @max param from mmu_topup_memory_cache()

2020-07-02 Thread Sean Christopherson
Replace the @max param in mmu_topup_memory_cache() and instead use ARRAY_SIZE() to terminate the loop to fill the cache. This removes a BUG_ON() and sets the stage for moving MIPS to the common memory cache implementation. No functional change intended. Signed-off-by: Sean Christopherson ---

[PATCH v3 18/21] KVM: arm64: Use common KVM implementation of MMU memory caches

2020-07-02 Thread Sean Christopherson
Move to the common MMU memory cache implementation now that the common code and arm64's existing code are semantically compatible. No functional change intended. Cc: Marc Zyngier Suggested-by: Christoffer Dall Signed-off-by: Sean Christopherson --- arch/arm64/include/asm/Kbuild | 1 -

[PATCH v3 01/21] KVM: x86/mmu: Track the associated kmem_cache in the MMU caches

2020-07-02 Thread Sean Christopherson
Track the kmem_cache used for non-page KVM MMU memory caches instead of passing in the associated kmem_cache when filling the cache. This will allow consolidating code and other cleanups. No functional change intended. Reviewed-by: Ben Gardon Signed-off-by: Sean Christopherson ---

[PATCH v3 06/21] KVM: x86/mmu: Move fast_page_fault() call above mmu_topup_memory_caches()

2020-07-02 Thread Sean Christopherson
Avoid refilling the memory caches and potentially slow reclaim/swap when handling a fast page fault, which does not need to allocate any new objects. Reviewed-by: Ben Gardon Signed-off-by: Sean Christopherson --- arch/x86/kvm/mmu/mmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3

[PATCH v3 04/21] KVM: x86/mmu: Remove superfluous gotos from mmu_topup_memory_caches()

2020-07-02 Thread Sean Christopherson
Return errors directly from mmu_topup_memory_caches() instead of branching to a label that does the same. No functional change intended. Reviewed-by: Ben Gardon Signed-off-by: Sean Christopherson --- arch/x86/kvm/mmu/mmu.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff

[PATCH v3 05/21] KVM: x86/mmu: Try to avoid crashing KVM if a MMU memory cache is empty

2020-07-02 Thread Sean Christopherson
Attempt to allocate a new object instead of crashing KVM (and likely the kernel) if a memory cache is unexpectedly empty. Use GFP_ATOMIC for the allocation as the caches are used while holding mmu_lock. The immediate BUG_ON() makes the code unnecessarily explosive and led to confusing minimums

[PATCH v3 14/21] KVM: Move x86's version of struct kvm_mmu_memory_cache to common code

2020-07-02 Thread Sean Christopherson
Move x86's 'struct kvm_mmu_memory_cache' to common code in anticipation of moving the entire x86 implementation code to common KVM and reusing it for arm64 and MIPS. Add a new architecture specific asm/kvm_types.h to control the existence and parameters of the struct. The new header is needed to

[PATCH v3 20/21] KVM: MIPS: Account pages used for GPA page tables

2020-07-02 Thread Sean Christopherson
Use GFP_KERNEL_ACCOUNT instead of GFP_KERNEL when allocating pages for the the GPA page tables. The primary motivation for accounting the allocations is to align with the common KVM memory cache helpers in preparation for moving to the common implementation in a future patch. The actual

[PATCH v3 07/21] KVM: x86/mmu: Topup memory caches after walking GVA->GPA

2020-07-02 Thread Sean Christopherson
Topup memory caches after walking the GVA->GPA translation during a shadow page fault, there is no need to ensure the caches are full when walking the GVA. As of commit f5a1e9f89504f ("KVM: MMU: remove call to kvm_mmu_pte_write from walk_addr"), the FNAME(walk_addr) flow no longer add rmaps via

[PATCH v3 13/21] KVM: x86/mmu: Prepend "kvm_" to memory cache helpers that will be global

2020-07-02 Thread Sean Christopherson
Rename the memory helpers that will soon be moved to common code and be made globaly available via linux/kvm_host.h. "mmu" alone is not a sufficient namespace for globally available KVM symbols. Opportunistically add "nr_" in mmu_memory_cache_free_objects() to make it clear the function returns

[PATCH v3 08/21] KVM: x86/mmu: Clean up the gorilla math in mmu_topup_memory_caches()

2020-07-02 Thread Sean Christopherson
Clean up the minimums in mmu_topup_memory_caches() to document the driving mechanisms behind the minimums. Now that encountering an empty cache is unlikely to trigger BUG_ON(), it is less dangerous to be more precise when defining the minimums. For rmaps, the logic is 1 parent PTE per level,

[PATCH v3 11/21] KVM: x86/mmu: Zero allocate shadow pages (outside of mmu_lock)

2020-07-02 Thread Sean Christopherson
Set __GFP_ZERO for the shadow page memory cache and drop the explicit clear_page() from kvm_mmu_get_page(). This moves the cost of zeroing a page to the allocation time of the physical page, i.e. when topping up the memory caches, and thus avoids having to zero out an entire page while holding

[PATCH v3 03/21] KVM: x86/mmu: Use consistent "mc" name for kvm_mmu_memory_cache locals

2020-07-02 Thread Sean Christopherson
Use "mc" for local variables to shorten line lengths and provide consistent names, which will be especially helpful when some of the helpers are moved to common KVM code in future patches. No functional change intended. Reviewed-by: Ben Gardon Signed-off-by: Sean Christopherson ---

[PATCH v3 21/21] KVM: MIPS: Use common KVM implementation of MMU memory caches

2020-07-02 Thread Sean Christopherson
Move to the common MMU memory cache implementation now that the common code and MIPS's existing code are semantically compatible. No functional change intended. Suggested-by: Christoffer Dall Signed-off-by: Sean Christopherson --- arch/mips/include/asm/Kbuild | 1 -

[PATCH v3 00/21] KVM: Cleanup and unify kvm_mmu_memory_cache usage

2020-07-02 Thread Sean Christopherson
The only interesting delta from v2 is that patch 18 is updated to handle a conflict with arm64's p4d rework. Resolution was straightforward (famous last words). This series resurrects Christoffer Dall's series[1] to provide a common MMU memory cache implementation that can be shared by x86,

[PATCH v3 17/21] KVM: arm64: Use common code's approach for __GFP_ZERO with memory caches

2020-07-02 Thread Sean Christopherson
Add a "gfp_zero" member to arm64's 'struct kvm_mmu_memory_cache' to make the struct and its usage compatible with the common 'struct kvm_mmu_memory_cache' in linux/kvm_host.h. This will minimize code churn when arm64 moves to the common implementation in a future patch, at the cost of temporarily

[PATCH v3 10/21] KVM: x86/mmu: Make __GFP_ZERO a property of the memory cache

2020-07-02 Thread Sean Christopherson
Add a gfp_zero flag to 'struct kvm_mmu_memory_cache' and use it to control __GFP_ZERO instead of hardcoding a call to kmem_cache_zalloc(). A future patch needs such a flag for the __get_free_page() path, as gfn arrays do not need/want the allocator to zero the memory. Convert the kmem_cache paths

[PATCH v3 09/21] KVM: x86/mmu: Separate the memory caches for shadow pages and gfn arrays

2020-07-02 Thread Sean Christopherson
Use separate caches for allocating shadow pages versus gfn arrays. This sets the stage for specifying __GFP_ZERO when allocating shadow pages without incurring extra cost for gfn arrays. No functional change intended. Reviewed-by: Ben Gardon Signed-off-by: Sean Christopherson ---

[PATCH v3 02/21] KVM: x86/mmu: Consolidate "page" variant of memory cache helpers

2020-07-02 Thread Sean Christopherson
Drop the "page" variants of the topup/free memory cache helpers, using the existence of an associated kmem_cache to select the correct alloc or free routine. No functional change intended. Reviewed-by: Ben Gardon Signed-off-by: Sean Christopherson --- arch/x86/kvm/mmu/mmu.c | 37

[PATCH v3 15/21] KVM: Move x86's MMU memory cache helpers to common KVM code

2020-07-02 Thread Sean Christopherson
Move x86's memory cache helpers to common KVM code so that they can be reused by arm64 and MIPS in future patches. Suggested-by: Christoffer Dall Reviewed-by: Ben Gardon Signed-off-by: Sean Christopherson --- arch/x86/kvm/mmu/mmu.c | 53 --

[PATCH v3 16/21] KVM: arm64: Drop @max param from mmu_topup_memory_cache()

2020-07-02 Thread Sean Christopherson
Replace the @max param in mmu_topup_memory_cache() and instead use ARRAY_SIZE() to terminate the loop to fill the cache. This removes a BUG_ON() and sets the stage for moving arm64 to the common memory cache implementation. No functional change intended. Tested-by: Marc Zyngier Signed-off-by:

Re: [kvm-unit-tests PATCH v2 3/8] arm64: microbench: gic: Add gicv4.1 support for ipi latency test.

2020-07-02 Thread Andrew Jones
On Thu, Jul 02, 2020 at 02:57:56PM +0200, Auger Eric wrote: > Hi Jingyi, > > On 7/2/20 5:01 AM, Jingyi Wang wrote: > > If gicv4.1(sgi hardware injection) supported, we test ipi injection > > via hw/sw way separately. > > > > Signed-off-by: Jingyi Wang > > --- > > arm/micro-bench.c| 45

Re: [PATCH V5 0/4] arm64/cpufeature: Introduce ID_PFR2, ID_DFR1, ID_MMFR5 and other changes

2020-07-02 Thread Catalin Marinas
On Wed, May 27, 2020 at 08:33:35AM +0530, Anshuman Khandual wrote: > These are remaining patches from V4 series which had some pending reviews > from Suzuki (https://patchwork.kernel.org/cover/11557333/). Also dropped > [PATCH 15/17] as that will need some more investigation and rework. > > This

Re: [PATCH] kvmtool: arm64: Report missing support for 32bit guests

2020-07-02 Thread Marc Zyngier
On 2020-07-02 16:37, Suzuki K Poulose wrote: Hi Marc On 07/01/2020 04:42 PM, Marc Zyngier wrote: On 2020-07-01 15:20, Suzuki K Poulose wrote: When the host doesn't support 32bit guests, the kvmtool fails without a proper message on what is wrong. i.e,  $ lkvm run -c 1 Image --aarch32   #

Re: [PATCH] kvmtool: arm64: Report missing support for 32bit guests

2020-07-02 Thread Suzuki K Poulose
Hi Marc On 07/01/2020 04:42 PM, Marc Zyngier wrote: On 2020-07-01 15:20, Suzuki K Poulose wrote: When the host doesn't support 32bit guests, the kvmtool fails without a proper message on what is wrong. i.e,  $ lkvm run -c 1 Image --aarch32   # lkvm run -k Image -m 256 -c 1 --name guest-105618

Re: [PATCH v2 3/3] arm64: Add workaround for Arm Cortex-A77 erratum 1508412

2020-07-02 Thread Will Deacon
On Thu, Jul 02, 2020 at 08:56:05AM -0600, Rob Herring wrote: > On Thu, Jul 2, 2020 at 5:42 AM Will Deacon wrote: > > > > On Wed, Jul 01, 2020 at 03:53:08PM -0600, Rob Herring wrote: > > > On Cortex-A77 r0p0 and r1p0, a sequence of a non-cacheable or device load > > > and a store exclusive or

Re: [PATCH v2 3/3] arm64: Add workaround for Arm Cortex-A77 erratum 1508412

2020-07-02 Thread Rob Herring
On Thu, Jul 2, 2020 at 5:42 AM Will Deacon wrote: > > On Wed, Jul 01, 2020 at 03:53:08PM -0600, Rob Herring wrote: > > On Cortex-A77 r0p0 and r1p0, a sequence of a non-cacheable or device load > > and a store exclusive or PAR_EL1 read can cause a deadlock. > > > > The workaround requires a DMB SY

Re: [PATCH v2 1/3] KVM: arm64: Print warning when cpu erratum can cause guests to deadlock

2020-07-02 Thread Will Deacon
On Thu, Jul 02, 2020 at 08:04:43AM -0600, Rob Herring wrote: > On Thu, Jul 2, 2020 at 5:45 AM Will Deacon wrote: > > > > On Wed, Jul 01, 2020 at 03:53:06PM -0600, Rob Herring wrote: > > > If guests don't have certain CPU erratum work-arounds implemented, then > > > there is a possibility a guest

Re: [PATCH v2 1/3] KVM: arm64: Print warning when cpu erratum can cause guests to deadlock

2020-07-02 Thread Rob Herring
On Thu, Jul 2, 2020 at 5:45 AM Will Deacon wrote: > > On Wed, Jul 01, 2020 at 03:53:06PM -0600, Rob Herring wrote: > > If guests don't have certain CPU erratum work-arounds implemented, then > > there is a possibility a guest can deadlock the system. IOW, only trusted > > guests should be used on

[PATCH v2 1/8] KVM: arm64: Set DBM bit for writable PTEs

2020-07-02 Thread Keqian Zhu
DBM bit is used by MMU to differentiate a genuinely non-writable page from a page that is only temporarily non-writable in order to mark dirty. Signed-off-by: Keqian Zhu Signed-off-by: Peng Liang --- arch/arm64/include/asm/kvm_mmu.h | 4 1 file changed, 4 insertions(+) diff --git

[PATCH v2 4/8] KVM: arm64: Save stage2 PTE dirty status if it is covered

2020-07-02 Thread Keqian Zhu
kvm_set_pte is called to replace a target PTE with a desired one. We always do this without changing the desired one, but if dirty status set by hardware is covered, let caller know it. There are two types of operations will change PTE and may cover dirty status set by hardware. 1. Stage2 PTE

[PATCH v2 0/8] KVM: arm64: Support HW dirty log based on DBM

2020-07-02 Thread Keqian Zhu
This patch series add support for dirty log based on HW DBM. It works well under some migration test cases, including VM with 4K pages or 2M THP. I checked the SHA256 hash digest of all memory and they keep same for source VM and destination VM, which means no dirty pages is missed under hardware

[PATCH v2 3/8] KVM: arm64: Modify stage2 young mechanism to support hw DBM

2020-07-02 Thread Keqian Zhu
Marking PTs young (set AF bit) should be atomic to avoid cover dirty status set by hardware. Signed-off-by: Keqian Zhu Signed-off-by: Peng Liang --- arch/arm64/include/asm/kvm_mmu.h | 31 ++- arch/arm64/kvm/mmu.c | 15 --- 2 files changed, 30

[PATCH v2 2/8] KVM: arm64: Scan PTEs to sync dirty log

2020-07-02 Thread Keqian Zhu
For hardware management of dirty state, dirty state is stored in PTEs. We have to scan all PTEs to sync dirty log to memslot dirty bitmap. Signed-off-by: Keqian Zhu Signed-off-by: Peng Liang --- arch/arm64/include/asm/kvm_host.h | 1 + arch/arm64/include/asm/kvm_mmu.h | 13 +++

[PATCH v2 6/8] KVM: arm64: Add KVM_CAP_ARM_HW_DIRTY_LOG capability

2020-07-02 Thread Keqian Zhu
For that using arm64 DBM to log dirty pages has the side effect of long time dirty log sync, we should give userspace opportunity to enable or disable this feature, to realize some policy. This feature is disabled by default. Signed-off-by: Keqian Zhu Signed-off-by: Peng Liang ---

[PATCH v2 5/8] KVM: arm64: Steply write protect page table by mask bit

2020-07-02 Thread Keqian Zhu
During dirty log clear, page table entries are write protected according to a mask. In the past we write protect all entries corresponding to the mask from ffs to fls. Though there may be zero bits between this range, we are holding the kvm mmu lock so we won't write protect entries that we don't

[PATCH v2 8/8] KVM: Omit dirty log sync in log clear if initially all set

2020-07-02 Thread Keqian Zhu
Synchronizing dirty log during log clear is useful only when the dirty bitmap of userspace contains dirty bits that memslot dirty bitmap does not contain, because we can sync new dirty bits to memslot dirty bitmap, then we can clear them by the way and avoid reporting them to userspace later.

[PATCH v2 7/8] KVM: arm64: Sync dirty log parallel

2020-07-02 Thread Keqian Zhu
Give userspace another selection to solve high-cost dirty log sync, which called multi-core offload. Usersapce can enable this policy through KVM_CAP_ARM_HW_DIRTY_LOG. Signed-off-by: Keqian Zhu Signed-off-by: Peng Liang --- arch/arm64/include/asm/kvm_host.h | 3 ++ arch/arm64/kvm/arm.c

Re: [kvm-unit-tests PATCH v2 3/8] arm64: microbench: gic: Add gicv4.1 support for ipi latency test.

2020-07-02 Thread Auger Eric
Hi Marc, On 7/2/20 3:08 PM, Marc Zyngier wrote: > Hi Eric, > > On 2020-07-02 13:57, Auger Eric wrote: >> Hi Jingyi, >> >> On 7/2/20 5:01 AM, Jingyi Wang wrote: >>> If gicv4.1(sgi hardware injection) supported, we test ipi injection >>> via hw/sw way separately. >>> >>> Signed-off-by: Jingyi Wang

Re: [kvm-unit-tests PATCH v2 8/8] arm64: microbench: Add vtimer latency test

2020-07-02 Thread Auger Eric
Hi Jingyi, On 7/2/20 5:01 AM, Jingyi Wang wrote: > Trigger PPIs by setting up a 10msec timer and test the latency. so for each iteration the accumulated valued is 10 ms + latency, right? and what is printed at the end does include the accumulated periods. Wouldn't it make sense to have a

Re: [kvm-unit-tests PATCH v2 7/8] arm64: microbench: Add time limit for each individual test

2020-07-02 Thread Auger Eric
Hi Jingyi, On 7/2/20 5:01 AM, Jingyi Wang wrote: > Besides using separate running times parameter, we add time limit > for loop_test to make sure each test should be done in a certain > time(5 sec here). > > Signed-off-by: Jingyi Wang > --- > arm/micro-bench.c | 17 +++-- > 1 file

Re: [kvm-unit-tests PATCH v2 6/8] arm64: microbench: Allow each test to specify its running times

2020-07-02 Thread Auger Eric
Hi Jingyi, On 7/2/20 7:29 AM, Andrew Jones wrote: > On Thu, Jul 02, 2020 at 11:01:30AM +0800, Jingyi Wang wrote: >> For some test in micro-bench can be time consuming, we add a >> micro-bench test parameter to allow each individual test to specify >> its running times. >> >> Signed-off-by: Jingyi

Re: [kvm-unit-tests PATCH v2 5/8] arm64: microbench: its: Add LPI latency test

2020-07-02 Thread Auger Eric
Hi Jingyi, On 7/2/20 5:01 AM, Jingyi Wang wrote: > Triggers LPIs through the INT command and test the latency. > Mostly inherited form commit 0ef02cd6cbaa(arm/arm64: ITS: INT > functional tests). > > Signed-off-by: Jingyi Wang > --- > arm/micro-bench.c | 44

Re: [kvm-unit-tests PATCH v2 3/8] arm64: microbench: gic: Add gicv4.1 support for ipi latency test.

2020-07-02 Thread Marc Zyngier
Hi Eric, On 2020-07-02 13:57, Auger Eric wrote: Hi Jingyi, On 7/2/20 5:01 AM, Jingyi Wang wrote: If gicv4.1(sgi hardware injection) supported, we test ipi injection via hw/sw way separately. Signed-off-by: Jingyi Wang --- arm/micro-bench.c| 45

Re: [kvm-unit-tests PATCH v2 3/8] arm64: microbench: gic: Add gicv4.1 support for ipi latency test.

2020-07-02 Thread Marc Zyngier
Hi Eric, On 2020-07-02 13:36, Auger Eric wrote: Hi Marc, On 7/2/20 10:22 AM, Marc Zyngier wrote: On 2020-07-02 04:01, Jingyi Wang wrote: If gicv4.1(sgi hardware injection) supported, we test ipi injection via hw/sw way separately. nit: active-less SGIs are not strictly a feature of GICv4.1

Re: [kvm-unit-tests PATCH v2 4/8] arm64: its: Handle its command queue wrapping

2020-07-02 Thread Auger Eric
Hi Jingyi, On 7/2/20 5:01 AM, Jingyi Wang wrote: > Because micro-bench may send a large number of ITS commands, we > should handle ITS command queue wrapping as kernel instead of just > failing the test. > > Signed-off-by: Jingyi Wang Reviewed-by: Eric Auger Thanks Eric > --- >

Re: [kvm-unit-tests PATCH v2 3/8] arm64: microbench: gic: Add gicv4.1 support for ipi latency test.

2020-07-02 Thread Auger Eric
Hi Jingyi, On 7/2/20 5:01 AM, Jingyi Wang wrote: > If gicv4.1(sgi hardware injection) supported, we test ipi injection > via hw/sw way separately. > > Signed-off-by: Jingyi Wang > --- > arm/micro-bench.c| 45 +++- > lib/arm/asm/gic-v3.h | 3 +++ >

Re: [kvm-unit-tests PATCH v2 3/8] arm64: microbench: gic: Add gicv4.1 support for ipi latency test.

2020-07-02 Thread Auger Eric
Hi Marc, On 7/2/20 10:22 AM, Marc Zyngier wrote: > On 2020-07-02 04:01, Jingyi Wang wrote: >> If gicv4.1(sgi hardware injection) supported, we test ipi injection >> via hw/sw way separately. > > nit: active-less SGIs are not strictly a feature of GICv4.1 (you could > imagine a GIC emulation

Re: [kvm-unit-tests PATCH v2 1/8] arm64: microbench: get correct ipi received num

2020-07-02 Thread Auger Eric
Hi Jingyi, On 7/2/20 5:01 AM, Jingyi Wang wrote: > If ipi_exec() fails because of timeout, we shouldn't increase > the number of ipi received. > > Signed-off-by: Jingyi Wang Reviewed-by: Eric Auger Thanks Eric > --- > arm/micro-bench.c | 4 +++- > 1 file changed, 3 insertions(+), 1

Re: [kvm-unit-tests PATCH v2 2/8] arm64: microbench: Use the funcions for ipi test as the general functions for gic(ipi/lpi/timer) test

2020-07-02 Thread Auger Eric
Hi, On 7/2/20 5:01 AM, Jingyi Wang wrote: > The following patches will use that. > > Signed-off-by: Jingyi Wang > --- > arm/micro-bench.c | 39 ++- > 1 file changed, 22 insertions(+), 17 deletions(-) > With commit message suggested by Drew, Reviewed-by:

Re: [PATCH v2 1/3] KVM: arm64: Print warning when cpu erratum can cause guests to deadlock

2020-07-02 Thread Will Deacon
On Wed, Jul 01, 2020 at 03:53:06PM -0600, Rob Herring wrote: > If guests don't have certain CPU erratum work-arounds implemented, then > there is a possibility a guest can deadlock the system. IOW, only trusted > guests should be used on systems with the erratum. > > This is the case for

Re: [PATCH v2 3/3] arm64: Add workaround for Arm Cortex-A77 erratum 1508412

2020-07-02 Thread Will Deacon
On Wed, Jul 01, 2020 at 03:53:08PM -0600, Rob Herring wrote: > On Cortex-A77 r0p0 and r1p0, a sequence of a non-cacheable or device load > and a store exclusive or PAR_EL1 read can cause a deadlock. > > The workaround requires a DMB SY before and after a PAR_EL1 register read > and the disabling

Re: [PATCH 03/12] KVM: arm64: Report hardware dirty status of stage2 PTE if coverred

2020-07-02 Thread zhukeqian
Hi Steven, On 2020/7/1 19:28, Steven Price wrote: > Hi, > > On 16/06/2020 10:35, Keqian Zhu wrote: >> kvm_set_pte is called to replace a target PTE with a desired one. >> We always do this without changing the desired one, but if dirty >> status set by hardware is coverred, let caller know it.

Re: [kvm-unit-tests PATCH v2 3/8] arm64: microbench: gic: Add gicv4.1 support for ipi latency test.

2020-07-02 Thread Jingyi Wang
On 7/2/2020 5:17 PM, Marc Zyngier wrote: On 2020-07-02 10:02, Jingyi Wang wrote: Hi Marc, On 7/2/2020 4:22 PM, Marc Zyngier wrote: On 2020-07-02 04:01, Jingyi Wang wrote: If gicv4.1(sgi hardware injection) supported, we test ipi injection via hw/sw way separately. nit: active-less SGIs are

Re: [kvm-unit-tests PATCH v2 3/8] arm64: microbench: gic: Add gicv4.1 support for ipi latency test.

2020-07-02 Thread Marc Zyngier
On 2020-07-02 10:02, Jingyi Wang wrote: Hi Marc, On 7/2/2020 4:22 PM, Marc Zyngier wrote: On 2020-07-02 04:01, Jingyi Wang wrote: If gicv4.1(sgi hardware injection) supported, we test ipi injection via hw/sw way separately. nit: active-less SGIs are not strictly a feature of GICv4.1 (you

Re: [PATCH kvm-unit-tests] arm/arm64: timer: Extract irqs at setup time

2020-07-02 Thread Auger Eric
Hi Drew, On 7/2/20 10:12 AM, Andrew Jones wrote: > The timer can be useful for other tests besides the timer test. > Extract the DT parsing of the irqs out of the timer test into > setup and provide them along with some defines in a new timer.h > file. > > Signed-off-by: Andrew Jones

Re: [kvm-unit-tests PATCH v2 3/8] arm64: microbench: gic: Add gicv4.1 support for ipi latency test.

2020-07-02 Thread Jingyi Wang
Hi Marc, On 7/2/2020 4:22 PM, Marc Zyngier wrote: On 2020-07-02 04:01, Jingyi Wang wrote: If gicv4.1(sgi hardware injection) supported, we test ipi injection via hw/sw way separately. nit: active-less SGIs are not strictly a feature of GICv4.1 (you could imagine a GIC emulation offering the

Re: [kvm-unit-tests PATCH v2 8/8] arm64: microbench: Add vtimer latency test

2020-07-02 Thread Jingyi Wang
Hi Drew, On 7/2/2020 1:44 PM, Andrew Jones wrote: On Thu, Jul 02, 2020 at 11:01:32AM +0800, Jingyi Wang wrote: Trigger PPIs by setting up a 10msec timer and test the latency. Signed-off-by: Jingyi Wang --- arm/micro-bench.c | 56 ++- 1 file

Re: [kvm-unit-tests PATCH v2 7/8] arm64: microbench: Add time limit for each individual test

2020-07-02 Thread Jingyi Wang
On 7/2/2020 1:48 PM, Andrew Jones wrote: On Thu, Jul 02, 2020 at 11:01:31AM +0800, Jingyi Wang wrote: Besides using separate running times parameter, we add time limit for loop_test to make sure each test should be done in a certain time(5 sec here). Signed-off-by: Jingyi Wang ---

Re: [kvm-unit-tests PATCH v2 6/8] arm64: microbench: Allow each test to specify its running times

2020-07-02 Thread Jingyi Wang
On 7/2/2020 1:29 PM, Andrew Jones wrote: On Thu, Jul 02, 2020 at 11:01:30AM +0800, Jingyi Wang wrote: For some test in micro-bench can be time consuming, we add a micro-bench test parameter to allow each individual test to specify its running times. Signed-off-by: Jingyi Wang ---

Re: [kvm-unit-tests PATCH v2 3/8] arm64: microbench: gic: Add gicv4.1 support for ipi latency test.

2020-07-02 Thread Marc Zyngier
On 2020-07-02 04:01, Jingyi Wang wrote: If gicv4.1(sgi hardware injection) supported, we test ipi injection via hw/sw way separately. nit: active-less SGIs are not strictly a feature of GICv4.1 (you could imagine a GIC emulation offering the same thing). Furthermore, GICv4.1 isn't as such

Re: [kvm-unit-tests PATCH v2 2/8] arm64: microbench: Use the funcions for ipi test as the general functions for gic(ipi/lpi/timer) test

2020-07-02 Thread Jingyi Wang
Hi Drew, On 7/2/2020 1:25 PM, Andrew Jones wrote: Hi Jingyi, This patch has quite a long summary. How about instead of arm64: microbench: Use the funcions for ipi test as the general functions for gic(ipi/lpi/timer) test we use arm64: microbench: Generalize ipi test names and then in

[PATCH kvm-unit-tests] arm/arm64: timer: Extract irqs at setup time

2020-07-02 Thread Andrew Jones
The timer can be useful for other tests besides the timer test. Extract the DT parsing of the irqs out of the timer test into setup and provide them along with some defines in a new timer.h file. Signed-off-by: Andrew Jones --- arm/timer.c | 26 --