From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23CFC3ED3CF for ; Wed, 20 May 2026 15:27:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779290848; cv=none; b=HIXbSGuBpqCRjeCwQ2IZcN1I4iBL4Zd15gpmexDZ7WebO3ScrQlofR5iwrfQbGj0asN5B61ilYeTyjrnr3YsdQaP88P3jN3uhfRyjmNnZoCxP1fDN/qph1RicLmNK4Z+Oq5fQJZAYUuKMOpNA8pxQ4zS6X42zAh4/uchPuEc3aI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779290848; c=relaxed/simple; bh=tweE/B5iRx4WqCmZC5jUJFMzY9zDXaqivSkzvGtJbn0=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Xx/A5c+rwUB/1C+NfZywtHgt39AXaxGOtmk9j24tSbwLdYsqfemu8grnWqE+6IwV00zVnEv4LPlL6NjXwO8NpX+JQn+ifftjKpBy+52kbcb8WxOJflK7oDeega/vFbUnra7fFheTtVK4cf/cRUo935LH0epRteXdRK0fYNA2gic= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=jl75T6B6; arc=none smtp.client-ip=209.85.216.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="jl75T6B6" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-365fd467cf6so4281344a91.0 for ; Wed, 20 May 2026 08:27:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1779290845; x=1779895645; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=KhkgzLIvh7n8FBkLDCvvyoRLLy05jqAaJJsIAGt7tN0=; b=jl75T6B6IX1JoAbAqro0d025vtLPgZ14owh3pQapzTDfGVO2G3FwRjt4BM2yDF2yVG SKFSQY/UDRvxrHvCvnIlfdkeuE16jX548emLlFaqCZytPiRw0cU2vS3jU3xAMdQ0BvMR rGNV7Q5wfOUNsu6PZgWfzIJxQPKhe3cbYnHpQ0z8dHOaQlIiLYH9YS6cb+2pygvZ1TyU dN/EE1UYFf4QPlj85M75tCtIj8g9okNKSYPAsFNuo0VQrzwR3b4bYPZiqKATWFJCgyb5 PvYNFFyszPF/lQmWEVYhb5yWQjpbE7KqhtyNqXtMALHW5Qy7hdBvvrsl7dtdEJWuscw7 sX0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779290845; x=1779895645; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KhkgzLIvh7n8FBkLDCvvyoRLLy05jqAaJJsIAGt7tN0=; b=V8Nwai0AbjfslQ4bvJVV84ysSbLVkaU/z3HGf6tDvNGUVGQxVuvPP063rklEZZVkRl GJy4FwMm7Fub4g2QWh5Ijy17h+EeGptF9dlwt+ObfPoIu04RaYVYIH0IYzxBpXNQWOkD HPQk1XyqZ5hCMjeOZ6sS9a1W2Yqtpdga16RfXMSmnvOQ1jPM/PJupCXX/iDqe0GAOZv5 eYCwkxpUVIKPg1E7Gc2IgHjoGbUyctXUrxGYK22kUbYNSs2dQu+FQpb2YrkXqE5h2IZm odOa/sAODlOQAg77iUdLJJsCTa7bi/XFDB9QWpbMMu8smV+jutW+7uwx4c8lamFfu93b ETCw== X-Gm-Message-State: AOJu0YyWxlspBaDGwwbB8T0Od6aPHftBKBQRk0dy+7nz31OIac6xswah 4rNy6Y/avWfNDrIntV0WUmfKv2BdZsXFxJxr2meFMnoDwRW651Kz8TrGjwqi7q2SYSlxKdySdbb 6UC4Fjw== X-Received: from pgct24.prod.google.com ([2002:a05:6a02:5298:b0:c82:73de:68e2]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:2e04:b0:368:ed26:15b2 with SMTP id 98e67ed59e1d1-369519fe820mr25179766a91.8.1779290845382; Wed, 20 May 2026 08:27:25 -0700 (PDT) Date: Wed, 20 May 2026 08:27:24 -0700 In-Reply-To: <20260520151710.231788-4-imbrenda@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260520151710.231788-1-imbrenda@linux.ibm.com> <20260520151710.231788-4-imbrenda@linux.ibm.com> Message-ID: Subject: Re: [PATCH v1 3/4] KVM: selftests: Fix pre_fault_memory_test to run on s390 From: Sean Christopherson To: Claudio Imbrenda Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-s390@vger.kernel.org, borntraeger@de.ibm.com, frankja@linux.ibm.com, david@kernel.org, seiden@linux.ibm.com, nrb@linux.ibm.com, schlameuss@linux.ibm.com, gra@linux.ibm.com, pbonzini@redhat.com, yan.y.zhao@intel.com, isaku.yamahata@intel.com Content-Type: text/plain; charset="us-ascii" On Wed, May 20, 2026, Claudio Imbrenda wrote: > Add a missing #include which is needed and otherwise > not included on s390. > > Fence the assertion vcpu->run->exit_reason == KVM_EXIT_IO so that it > is only checked on x86. On s390 the UCALL will return with a different > code. > > Signed-off-by: Claudio Imbrenda > --- > tools/testing/selftests/kvm/pre_fault_memory_test.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/tools/testing/selftests/kvm/pre_fault_memory_test.c b/tools/testing/selftests/kvm/pre_fault_memory_test.c > index fcb57fd034e6..42794892e902 100644 > --- a/tools/testing/selftests/kvm/pre_fault_memory_test.c > +++ b/tools/testing/selftests/kvm/pre_fault_memory_test.c > @@ -11,6 +11,7 @@ > #include > #include > #include > +#include > > /* Arbitrarily chosen values */ > #define TEST_SIZE (SZ_2M + PAGE_SIZE) > @@ -167,7 +168,6 @@ static void __test_pre_fault_memory(unsigned long vm_type, bool private) > .type = vm_type, > }; > struct kvm_vcpu *vcpu; > - struct kvm_run *run; > struct kvm_vm *vm; > struct ucall uc; > > @@ -193,10 +193,11 @@ static void __test_pre_fault_memory(unsigned long vm_type, bool private) > vcpu_args_set(vcpu, 1, gva); > vcpu_run(vcpu); > > - run = vcpu->run; > - TEST_ASSERT(run->exit_reason == KVM_EXIT_IO, > +#ifdef __x86_64__ I'd say just delete this assertion entirely. It's an extra layer of paranoia to guard against stale ucall data, but x86's ucall_arch_get_ucall() already has sufficient guards. > + TEST_ASSERT(vcpu->run->exit_reason == KVM_EXIT_IO, > "Wanted KVM_EXIT_IO, got exit reason: %u (%s)", > run->exit_reason, exit_reason_str(run->exit_reason)); > +#endif > > switch (get_ucall(vcpu, &uc)) { > case UCALL_ABORT: > -- > 2.54.0 >