Re: [PATCH 0/3] KVM: arm64: Normalize cache configuration

2022-12-13 Thread Oliver Upton
Hi Akihiko, On Sun, Dec 11, 2022 at 02:16:57PM +0900, Akihiko Odaki wrote: > Before this change, the cache configuration of the physical CPU was > exposed to vcpus. This is problematic because the cache configuration a > vcpu sees varies when it migrates between vcpus with different cache >

Re: [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86

2022-12-13 Thread Sean Christopherson
+David On Tue, Dec 13, 2022, Sean Christopherson wrote: > Rename UNAME_M to ARCH_DIR and explicitly set it directly for x86. At > this point, the name of the arch directory really doesn't have anything > to do with `uname -m`, and UNAME_M is unnecessarily confusing given that > its purpose is

Re: [PATCH 1/1] KVM: arm64: PMU: Fix PMCR_EL0 reset value

2022-12-13 Thread Ricardo Koller
On Fri, Dec 09, 2022 at 05:58:31PM +, Oliver Upton wrote: > On Fri, Dec 09, 2022 at 04:44:46PM +, James Clark wrote: > > ARMV8_PMU_PMCR_N_MASK is an unshifted value which results in the wrong > > reset value for PMCR_EL0, so shift it to fix it. > > That's just mean. *_MASK tends to be a

Re: [kvm-unit-tests PATCH 3/3] arm: pmu: Add tests for 64-bit overflows

2022-12-13 Thread Ricardo Koller
On Tue, Dec 13, 2022 at 05:03:40PM +, Alexandru Elisei wrote: > Hi, > > Checked that all places where ALL_SET/PRE_OVERFLOW were used are now taking > into account the fact that counters are programmed to be 64bit. > > In the case of 64bit counters, the printf format specifier is %ld, which >

Re: [kvm-unit-tests PATCH 1/3] arm: pmu: Fix overflow checks for PMUv3p5 long counters

2022-12-13 Thread Ricardo Koller
On Tue, Dec 13, 2022 at 04:43:38PM +, Alexandru Elisei wrote: > Hi, > > On Tue, Dec 13, 2022 at 08:21:24AM -0800, Ricardo Koller wrote: > > On Tue, Dec 13, 2022 at 12:36:14PM +, Alexandru Elisei wrote: > > > Hi, > > > > > > Some more comments below. > > > > > > On Fri, Dec 02, 2022 at

Re: [kvm-unit-tests PATCH 3/3] arm: pmu: Add tests for 64-bit overflows

2022-12-13 Thread Alexandru Elisei
Hi, Checked that all places where ALL_SET/PRE_OVERFLOW were used are now taking into account the fact that counters are programmed to be 64bit. In the case of 64bit counters, the printf format specifier is %ld, which means that ALL_SET_64 and PRE_OVERFLOW_64 are now displayed as negative

Re: [kvm-unit-tests PATCH 1/3] arm: pmu: Fix overflow checks for PMUv3p5 long counters

2022-12-13 Thread Alexandru Elisei
Hi, On Tue, Dec 13, 2022 at 08:21:24AM -0800, Ricardo Koller wrote: > On Tue, Dec 13, 2022 at 12:36:14PM +, Alexandru Elisei wrote: > > Hi, > > > > Some more comments below. > > > > On Fri, Dec 02, 2022 at 04:55:25AM +, Ricardo Koller wrote: > > > PMUv3p5 uses 64-bit counters

Re: [kvm-unit-tests PATCH 1/3] arm: pmu: Fix overflow checks for PMUv3p5 long counters

2022-12-13 Thread Ricardo Koller
On Tue, Dec 13, 2022 at 12:36:14PM +, Alexandru Elisei wrote: > Hi, > > Some more comments below. > > On Fri, Dec 02, 2022 at 04:55:25AM +, Ricardo Koller wrote: > > PMUv3p5 uses 64-bit counters irrespective of whether the PMU is configured > > for overflowing at 32 or 64-bits. The

Re: [kvm-unit-tests PATCH 1/3] arm: pmu: Fix overflow checks for PMUv3p5 long counters

2022-12-13 Thread Alexandru Elisei
Hi, Some more comments below. On Fri, Dec 02, 2022 at 04:55:25AM +, Ricardo Koller wrote: > PMUv3p5 uses 64-bit counters irrespective of whether the PMU is configured > for overflowing at 32 or 64-bits. The consequence is that tests that check > the counter values after overflowing should

Re: [PATCH 01/14] KVM: selftests: Define literal to asm constraint in aarch64 as unsigned long

2022-12-13 Thread Philippe Mathieu-Daudé
On 13/12/22 01:16, Sean Christopherson wrote: Define a literal '0' asm input constraint to aarch64/page_fault_test's guest_cas() as an unsigned long to make clang happy. tools/testing/selftests/kvm/aarch64/page_fault_test.c:120:16: error: value size does not match register size

Re: [PATCH 07/14] KVM: selftests: Use proper function prototypes in probing code

2022-12-13 Thread Philippe Mathieu-Daudé
On 13/12/22 01:16, Sean Christopherson wrote: Make the main() functions in the probing code proper prototypes so that compiling the probing code with more strict flags won't generate false negatives. :1:5: error: function declaration isn’t a prototype [-Werror=strict-prototypes]

Re: [PATCH 05/14] KVM: selftests: Fix a typo in x86-64's kvm_get_cpu_address_width()

2022-12-13 Thread Philippe Mathieu-Daudé
On 13/12/22 01:16, Sean Christopherson wrote: Fix a == vs. = typo in kvm_get_cpu_address_width() that results in @pa_bits being left unset if the CPU doesn't support enumerating its MAX_PHY_ADDR. Flagged by clang's unusued-value warning. lib/x86_64/processor.c:1034:51: warning: expression

Re: [PATCH 03/14] KVM: selftests: Fix divide-by-zero bug in memslot_perf_test

2022-12-13 Thread Philippe Mathieu-Daudé
On 13/12/22 01:16, Sean Christopherson wrote: Check that the number of pages per slot is non-zero in get_max_slots() prior to computing the remaining number of pages. clang generates code that uses an actual DIV for calculating the remaining, which causes a #DE if the total number of pages is