From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) (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 6B05B466B5E for ; Tue, 28 Jul 2026 14:53:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.69 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785250389; cv=none; b=ZMeaH9ppj25UcTB/YWTB6+ixAjB4wvdNbS4dKURPQTvbaqeXFJUH1z5hAjj54l1c1JZnI5bLU3wi5idxq07B7gjbCGuvWETTPLDjHrCABJd74wjkAbTPyNi4TddX1ME6XplxYQlT/gPGZ/zlmxrLUQU/6e1lyx8q0PMdi54lcc8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785250389; c=relaxed/simple; bh=ev34CkbhmD0iX/IeeRnMWpNNjThPuwY1U6RaAwjxyMY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=PQI4TzeomoXUeUqo/NyCQwTsqXhaOk2/TMhcTxSTH+eu4ULyR+kuHHWlwoZ2ljlBje+nme7i/T7i77Lv7EULxn6yxVgweTXisqQ0f8LvSissD0uB81kyRaBK8rvYoS1/9t2BTv/exP8ZIzcfY3Q32suuHP22GcBUta1e14nEuzw= 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=A/t9lC37; arc=none smtp.client-ip=209.85.216.69 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="A/t9lC37" Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-388b404eaa4so1695447a91.0 for ; Tue, 28 Jul 2026 07:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1785250388; x=1785855188; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=9pWpt9v5UPNGwNX/7tiRZM7v/nH0F92RtXnF3fMPvC4=; b=A/t9lC370Ksuvd3yY3zhLhYr+nBu22eI5Fk6U+AaKR/KyW2gNNXh7do+DRtBCMDtp4 cCuJtH9FX1vzl7yarQZ+12nLjSst5sWesQuLpqvxzHspsQPPdmBmjOcGQnC0K3Mm7Ef+ HbhkloiTnS446XKLAkdnVmMv5U0ThxgK/xi3awn5OSWSzjugRHM8r/8wB7I9FBlH0Xlt Tk7Ry3w4K/nUAFaR6JyeK7uNO8j8nTMZE+SkvAE0F+ztb4A+3GN4lS/yUKNJkGpzLTtS npbhJnhLNl9rju59T9FGAaui+0X6VxPwRjjBmDiTcg4OHBLLal5UTrKbas/iVa7+kAfd DzOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785250388; x=1785855188; h=content-type: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:content-type; bh=9pWpt9v5UPNGwNX/7tiRZM7v/nH0F92RtXnF3fMPvC4=; b=I4pBNtobyWWvtHU5x8R0f9GgihaOoGVPY9MAWO6xisnVHmoRwd/q2xx31R/rdQ2Y2R GS5AJMEDrNZkNqMo9r7vokJqx2R36uRwoXDAHlwzIoqj0OuxGW6L3AAo2VCAOh7iyC5q VlfVkw2W6QLDA8tzgkuYWzADPc//Y0KqUnFCwMhBxhqC/ubKlfNBea/CT67I4j2rMkrp xSM4HpNSxo+ZKegxCfnmYr65jseq6wWXPjVda6FjjssE6z96QD2O47BxEpMliGQu1hlo +bSJqiiGv+UyZbPWHSqBle3Yh/OP1HPVtxRbbEMnZq5n8a5+9qD3yakZcR97i+r81iPg v4OQ== X-Forwarded-Encrypted: i=1; AHgh+Ro1KNnSNMat5cCnjFKz9esCxcOlSTT75kc/4NKuSyjmAMNcMQdBDXWPw+Ti5SFkTAHaqh6wOHah9ZhH0ps=@vger.kernel.org X-Gm-Message-State: AOJu0Yy8EZhr1Z7Ps+nibxef9r8YB6Z0loUkHR/5Eq6zOH/ooiaKh7KK 4KUt5FEGb1pprxAkv0Wb8PJxQZKKwySH7KMtw8/XVDnH3ecae0BBR01+L46wO65M19C+jVqDWq0 EfCkDLg== X-Received: from pjuj12.prod.google.com ([2002:a17:90a:d00c:b0:36b:7f07:6fcd]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:1e4c:b0:38e:9e9e:ec57 with SMTP id 98e67ed59e1d1-38f6a588a24mr1974650a91.43.1785250387458; Tue, 28 Jul 2026 07:53:07 -0700 (PDT) Date: Tue, 28 Jul 2026 07:53:06 -0700 In-Reply-To: <20260727235228.1007324-10-yosry@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260727235228.1007324-1-yosry@kernel.org> <20260727235228.1007324-10-yosry@kernel.org> Message-ID: Subject: Re: [PATCH v4 09/12] KVM: selftests: Add basic stress test for save+restore and #PF handling From: Sean Christopherson To: Yosry Ahmed Cc: Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Mon, Jul 27, 2026, Yosry Ahmed wrote: > diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm > index 88c6c8046ddec..e67b1e9893f68 100644 > --- a/tools/testing/selftests/kvm/Makefile.kvm > +++ b/tools/testing/selftests/kvm/Makefile.kvm > @@ -112,6 +112,7 @@ TEST_GEN_PROGS_x86 += x86/set_sregs_test > TEST_GEN_PROGS_x86 += x86/smaller_maxphyaddr_emulation_test > TEST_GEN_PROGS_x86 += x86/smm_test > TEST_GEN_PROGS_x86 += x86/state_test > +TEST_GEN_PROGS_x86 += x86/save_restore_pf_stress_test Sort alphabetically (I'm guessing you forgot to move this when renaming from stress_xxx to save_xxx). > TEST_GEN_PROGS_x86 += x86/vmx_preemption_timer_test > TEST_GEN_PROGS_x86 += x86/svm_vmcall_test > TEST_GEN_PROGS_x86 += x86/svm_int_ctl_test > diff --git a/tools/testing/selftests/kvm/include/x86/processor.h b/tools/testing/selftests/kvm/include/x86/processor.h > index 06d9ba1c4df33..2889782b0016b 100644 > --- a/tools/testing/selftests/kvm/include/x86/processor.h > +++ b/tools/testing/selftests/kvm/include/x86/processor.h > @@ -614,6 +614,15 @@ static inline void set_cr0(u64 val) > __asm__ __volatile__("mov %0, %%cr0" : : "r" (val) : "memory"); > } > > +static inline u64 get_cr2(void) > +{ > + u64 cr2; > + > + __asm__ __volatile__("mov %%cr2, %[cr2]" > + : /* output */ [cr2]"=r"(cr2)); Drop the "/* output */" comment, if the reader doesn't know how asm constraints work *and* can't deduce that it's an output given the function name and return value, then they probably shouldn't be reading this code. Oh, yeesh, all of these getters have that silly comment. Drop it here, I'll send a patch to remove those bad examples. > + return cr2; > +} > +