On Mon, Dec 12, 2022, Nick Desaulniers wrote:
> > diff --git a/tools/testing/selftests/kvm/Makefile
> > b/tools/testing/selftests/kvm/Makefile
> > index 2487db21b177..9cff99a1cb2e 100644
> > --- a/tools/testing/selftests/kvm/Makefile
> > +++ b/tools/testing/selftests/kvm/Makefile
> > @@ -196,6 +19
On Mon, Dec 12, 2022, Paolo Bonzini wrote:
> On 12/12/22 18:39, Sean Christopherson wrote:
> > My preference would be to leave .smm in x86's page role
>
> What about defining a byte of arch_role and a macro to build it?
I think David already carved out a big chunk for arch role bits, my objection
On Mon, Dec 12, 2022 at 4:17 PM Sean Christopherson wrote:
>
> Disable gnu-variable-sized-type-not-at-end so that tests and libraries
> can create overlays of variable sized arrays at the end of structs when
> using a fixed number of entries, e.g. to get/set a single MSR.
>
> It's possible to fudg
On Mon, Dec 12, 2022 at 11:50:29PM +0100, Paolo Bonzini wrote:
> On 12/12/22 18:39, Sean Christopherson wrote:
> > > The notion of address spaces is already existing architecture-neutral
> > > concept in KVM (e.g. see uses of KVM_ADDRESS_SPACE_NUM in
> > > virt/kvm/kvm_main.c), although SMM is the
On Mon, Dec 12, 2022 at 06:17:36PM +, Oliver Upton wrote:
> On Mon, Dec 12, 2022 at 05:39:38PM +, Sean Christopherson wrote:
> > On Fri, Dec 09, 2022, David Matlack wrote:
> > > On Fri, Dec 9, 2022 at 9:25 AM Oliver Upton
> > > wrote:
> > My preference would be to leave .smm in x86's page
On Mon, Dec 12, 2022 at 3:11 PM Paolo Bonzini wrote:
>
> On 12/8/22 20:38, David Matlack wrote:
> > +/*
> > + * kvm_mmu_page_role tracks the properties of a shadow page (where shadow
> > page
> > + * also includes TDP pages) to determine whether or not a page can be used
> > in
> > + * the given
On Mon, Dec 12, 2022, David Matlack wrote:
> On Mon, Dec 12, 2022 at 11:32 AM Ben Gardon wrote:
> >
> > On Thu, Dec 8, 2022 at 11:39 AM David Matlack wrote:
> > >
> > > Abstract away kvm_mmu_max_mapping_level(), which is an x86-specific
> > > function for computing the max level that a given GFN
Use $(wildcard ...) to find the test targets (.sh files) and test source
files (.c and .S) instead of manually adding files/targets for every
architecture, which is a maintenance burden and error prone, e.g. RISC-V
supports RSEQ but doesn't build the test for reasons unknown.
To deal with common t
Enable the RSEQ test for RISC-V, which according to HAVE_RSEQ is supported
by the kernel and thus should be tested. The RSEQ test was added shortly
before RISC-V selftests support landed, i.e. was likely overlooked during
merging.
Note, the RSEQ test currently doesn't compile with clang due to an
Use $(wildcard ...) to find the library source files instead of manually
defining the inputs, which is a maintenance burden and error prone.
Signed-off-by: Sean Christopherson
---
tools/testing/selftests/kvm/Makefile | 45
1 file changed, 5 insertions(+), 40 deletion
Disable gnu-variable-sized-type-not-at-end so that tests and libraries
can create overlays of variable sized arrays at the end of structs when
using a fixed number of entries, e.g. to get/set a single MSR.
It's possible to fudge around the warning, e.g. by defining a custom
struct that hardcodes t
Include lib.mk before consuming $(CC) and document that lib.mk overwrites
$(CC) unless make was invoked with -e or $(CC) was specified after make
(which apparently makes the environment override the Makefile?!?!).
Including lib.mk after using it for probing, e.g. for -no-pie, can lead
to weirdness.
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 purely to identify the arch specific directory.
Signed-off-by: Sean
Explicitly disable the compiler's builtin memcmp(), memcpy(), and
memset(). Because only lib/string_override.c is built with -ffreestanding,
the compiler reserves the right to do what it wants and can try to link the
non-freestanding code to its own crud.
/usr/bin/x86_64-linux-gnu-ld: /lib/x86_
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 result unused
[-Wunused-value]
*pa_b
Use pattern matching to exclude everything except .c, .h, .S, and .sh
files from Git. Manually adding every test target has an absurd
maintenance cost, is comically error prone, and leads to bikeshedding
over whether or not the targets should be listed in alphabetical order.
Deliberately do not i
Probe -no-pie with the actual set of CFLAGS used to compile the tests,
clang whines about -no-pie being unused if the tests are compiled with
-static.
clang: warning: argument unused during compilation: '-no-pie'
[-Wunused-command-line-argument]
Signed-off-by: Sean Christopherson
---
tools/
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]
Signed-off-by: Sean Christopherson
---
tools/testing/selft
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 less than the number of slots.
traps: memslot_p
Delete an unused struct definition in x86_64/vmx_tsc_adjust_test.c.
Signed-off-by: Sean Christopherson
---
tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c | 5 -
1 file changed, 5 deletions(-)
diff --git a/tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c
b/tools/testing/se
Fix a variety of KVM selftests issues exposed by clang, and rework the
Makefile and .gitignore to reduce the maintenance burden of selftests.
For the Makefile, programmatically generate the list of targets by
looking for .c files, and opt-out via a dummy macro in the source
instead of forcing arch
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 specified by the constraint
and modifier [-Werror,-Wasm
On 12/13/22 00:26, Sean Christopherson wrote:
I would strongly be in favor of discarding the shadow paging residue if
x86 folks are willing to part ways with it 😄
Yes, absolutely. Something like to_shadow_page->to_mmu_data, sp->md,
spt->hpt, spte->spte, sptep->hptep.
"host" will be confusing i
On Mon, Dec 12, 2022, Paolo Bonzini wrote:
> On 12/9/22 20:07, Oliver Upton wrote:
> > > - Naming. This series does not change the names of any existing code.
> > > So all the KVM/x86 Shadow MMU-style terminology like
> > > "shadow_page"/"sp"/"spte" persists. Should we keep that style in
On 12/8/22 20:38, David Matlack wrote:
Invert the meaning of sp->tdp_mmu_page and rename it accordingly. This
allows the TDP MMU code to not care about this field, which will be used
in a subsequent commit to move the TDP MMU to common code.
No functional change intended.
Let's use a bit of th
On 12/8/22 20:38, David Matlack wrote:
+/*
+ * kvm_mmu_page_role tracks the properties of a shadow page (where shadow page
+ * also includes TDP pages) to determine whether or not a page can be used in
+ * the given MMU context.
+ */
+union kvm_mmu_page_role {
+ u32 word;
+ struct {
+
On 12/9/22 20:07, Oliver Upton wrote:
- Naming. This series does not change the names of any existing code.
So all the KVM/x86 Shadow MMU-style terminology like
"shadow_page"/"sp"/"spte" persists. Should we keep that style in
common code or move toward something less shadow-paging-s
On 12/12/22 18:39, Sean Christopherson wrote:
The notion of address spaces is already existing architecture-neutral
concept in KVM (e.g. see uses of KVM_ADDRESS_SPACE_NUM in
virt/kvm/kvm_main.c), although SMM is the only use-case I'm aware of.
Yes, SMM is currently the only use-case.
It's pos
On Mon, Dec 12, 2022 at 2:32 PM Paolo Bonzini wrote:
>
> On 12/8/22 20:38, David Matlack wrote:
> > This commit increases the size of struct kvm_mmu_page by 64 bytes on
> > x86_64 (184 bytes -> 248 bytes). The size of this struct can be reduced
> > in future commits by moving TDP MMU root fields i
On Mon, Dec 12, 2022 at 2:03 PM Ben Gardon wrote:
>
> On Thu, Dec 8, 2022 at 11:40 AM David Matlack wrote:
> >
> > Move kvm_arch_flush_remote_tlbs_memslot() to common code and drop
> > "arch_" from the name. kvm_arch_flush_remote_tlbs_memslot() is just a
> > range-based TLB invalidation where the
On 12/8/22 20:38, David Matlack wrote:
This commit increases the size of struct kvm_mmu_page by 64 bytes on
x86_64 (184 bytes -> 248 bytes). The size of this struct can be reduced
in future commits by moving TDP MMU root fields into a separate struct
and by dynamically allocating fields only used
On Mon, Dec 12, 2022 at 10:24:31AM -0800, Ben Gardon wrote:
> On Thu, Dec 8, 2022 at 11:39 AM David Matlack wrote:
> >
> > Move struct kvm_page_fault to common code. This will be used in a future
> > commit to move the TDP MMU to common code.
> >
> > No functional change intended.
> >
> > Signed-o
On 12/8/22 20:38, David Matlack wrote:
+
+ /* Derived from mmu and global state. */
+ const bool is_tdp;
I think this could stay in the architecture-independent part.
Paolo
___
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://li
On Thu, Dec 8, 2022 at 11:40 AM David Matlack wrote:
>
> Move kvm_arch_flush_remote_tlbs_memslot() to common code and drop
> "arch_" from the name. kvm_arch_flush_remote_tlbs_memslot() is just a
> range-based TLB invalidation where the range is defined by the memslot.
> Now that kvm_flush_remote_t
On Mon, Dec 12, 2022 at 11:32 AM Ben Gardon wrote:
>
> On Thu, Dec 8, 2022 at 11:39 AM David Matlack wrote:
> >
> > Abstract away kvm_mmu_max_mapping_level(), which is an x86-specific
> > function for computing the max level that a given GFN can be mapped in
> > KVM's page tables. This will be us
On Fri, Dec 09, 2022 at 05:47:14PM +, Alexandru Elisei wrote:
> Hi,
>
> 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
On Thu, Dec 8, 2022 at 11:39 AM David Matlack wrote:
>
> Abstract away kvm_mmu_max_mapping_level(), which is an x86-specific
> function for computing the max level that a given GFN can be mapped in
> KVM's page tables. This will be used in a future commit to enable moving
> the TDP MMU to common c
On Thu, Dec 8, 2022 at 11:39 AM David Matlack wrote:
>
> Move struct kvm_gfn_range to kvm_types.h so that it's definition can be
> accessed in a future commit by arch/x86/include/asm/kvm/tdp_pgtable.h
> without needing to include the mega-header kvm_host.h.
>
> No functional change intended.
>
> S
On Thu, Dec 8, 2022 at 11:39 AM David Matlack wrote:
>
> Move struct kvm_page_fault to common code. This will be used in a future
> commit to move the TDP MMU to common code.
>
> No functional change intended.
>
> Signed-off-by: David Matlack
> ---
> arch/x86/include/asm/kvm/mmu_types.h | 20 +++
On Mon, Dec 12, 2022 at 05:39:38PM +, Sean Christopherson wrote:
> On Fri, Dec 09, 2022, David Matlack wrote:
> > On Fri, Dec 9, 2022 at 9:25 AM Oliver Upton wrote:
> > >
> > > On Fri, Dec 09, 2022 at 10:37:47AM +0800, Yang, Weijiang wrote:
> > > > > diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/
On Thu, Dec 8, 2022 at 11:39 AM David Matlack wrote:
>
> Move struct kvm_mmu_page to common code and all x86-specific fields into
> kvm_mmu_page_arch.
>
> This commit increases the size of struct kvm_mmu_page by 64 bytes on
> x86_64 (184 bytes -> 248 bytes). The size of this struct can be reduced
On Thu, Dec 8, 2022 at 11:39 AM David Matlack wrote:
>
> Move struct kvm_mmu_page_role into common code, and move all
> x86-specific fields into a separate sub-struct within the role,
> kvm_mmu_page_role_arch.
>
> Signed-off-by: David Matlack
> ---
> MAINTAINERS | 4 +-
On Fri, Dec 09, 2022, David Matlack wrote:
> On Fri, Dec 9, 2022 at 9:25 AM Oliver Upton wrote:
> >
> > On Fri, Dec 09, 2022 at 10:37:47AM +0800, Yang, Weijiang wrote:
> > > > diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
> > > > index 4d188f056933..f375b719f565 100644
> > > > --- a
Hi,
On Mon, Dec 12, 2022 at 09:05:02AM +, Marc Zyngier wrote:
> Alex,
>
> On Sun, 11 Dec 2022 11:40:39 +,
> Alexandru Elisei wrote:
> >
> > A simple "hey, you're wrong here, the PMU extensions do not follow the
> > principles of the ID scheme for fields in ID registers" would have
> > s
On 12/9/22 22:03, Sean Christopherson wrote:
From: Sean Christopherson
Date: Fri, 9 Dec 2022 12:55:44 -0800
Subject: [PATCH] KVM: selftests: Use magic value to signal ucall_alloc()
failure
Use a magic value to signal a ucall_alloc() failure instead of simply
doing GUEST_ASSERT(). GUEST_ASSERT
On 12/9/22 02:52, Oliver Upton wrote:
The combination of the pool-based ucall implementation + page_fault_test
resulted in some 'fun' bugs. As has always been the case, KVM selftests
is a house of cards.
Small series to fix up the issues on kvm/queue. Patches 1-2 can probably
be squashed into Pa
On 12/9/22 02:53, Oliver Upton wrote:
@@ -268,17 +305,17 @@ struct kvm_vm *vm_create(enum vm_guest_mode mode)
#ifdef __aarch64__
if (vm->pa_bits != 40)
vm->type = KVM_VM_TYPE_ARM_IPA_SIZE(vm->pa_bits);
+
+ /* selftests use TTBR0 only, meaning there is a single
On Fri, 9 Dec 2022 16:44:45 +, James Clark wrote:
> We noticed qemu failing to run because of an assert on our CI. I don't see
> the issue anymore with
> this fix.
>
> Applies to kvmarm/next (753d734f3f34)
>
> Thanks
>
> [...]
Applied to fixes, thanks!
[1/1] KVM: arm64: PMU: Fix PMCR_EL0
Alex,
On Sun, 11 Dec 2022 11:40:39 +,
Alexandru Elisei wrote:
>
> A simple "hey, you're wrong here, the PMU extensions do not follow the
> principles of the ID scheme for fields in ID registers" would have
> sufficed.
This is what I did, and saved you the hassle of looking it up.
> Guess y
49 matches
Mail list logo