From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sean Christopherson Date: Wed, 18 Dec 2019 16:39:59 +0000 Subject: Re: [PATCH v4 19/19] KVM: selftests: Add test for KVM_SET_USER_MEMORY_REGION Message-Id: <20191218163958.GC25201@linux.intel.com> List-Id: References: <20191217204041.10815-1-sean.j.christopherson@intel.com> <20191217204041.10815-20-sean.j.christopherson@intel.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Christian Borntraeger Cc: James Hogan , Paul Mackerras , Janosch Frank , Paolo Bonzini , Marc Zyngier , David Hildenbrand , Cornelia Huck , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , James Morse , Julien Thierry , Suzuki K Poulose , linux-mips@vger.kernel.org, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, Christoffer Dall , Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= On Wed, Dec 18, 2019 at 12:39:43PM +0100, Christian Borntraeger wrote: > > On 17.12.19 21:40, Sean Christopherson wrote: > > Add a KVM selftest to test moving the base gfn of a userspace memory > > region. The test is primarily targeted at x86 to verify its memslot > > metadata is correctly updated, but also provides basic functionality > > coverage on other architectures. > > +static void *vcpu_worker(void *data) > > +{ > > + struct kvm_vm *vm = data; > > + struct kvm_run *run; > > + struct ucall uc; > > + uint64_t cmd; > > + > > + /* > > + * Loop until the guest is done. Re-enter the guest on all MMIO exits, > > + * which will occur if the guest attempts to access a memslot while it > > + * is being moved. > > + */ > > + run = vcpu_state(vm, VCPU_ID); > > + do { > > + vcpu_run(vm, VCPU_ID); > > + } while (run->exit_reason = KVM_EXIT_MMIO); > > + > > + TEST_ASSERT(run->exit_reason = KVM_EXIT_IO, > > + "Unexpected exit reason = %d", run->exit_reason); > > > This will also not work for s390. Maybe just make this test x86 specific for now? Doh, that's obvious in hindsight. I think the basic premise is also broken on arm64 as it returns -EFAULT on is_error_noslot_pfn(pfn). So yeah, x86 only for now :-(