Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1108181lqo; Fri, 17 May 2024 10:52:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWLQ1QcevKwKkZgljZD2JmbswDDagkxyTynvVMFpKqlPJIm4Fbs683/tmXgBFKru564LiULv6mJVmp6cA1kZFcBNcihe6hyfyPFsrdVwA== X-Google-Smtp-Source: AGHT+IEryDhoV47jZJMO5l0SSNjwWtwxv+TjqP+V7NFVDRsmLBRi3JkK6dVS6HX1LMYkBfz2FF5e X-Received: by 2002:a50:bb05:0:b0:572:5f28:1f25 with SMTP id 4fb4d7f45d1cf-5734d5c1692mr16194970a12.7.1715968335570; Fri, 17 May 2024 10:52:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715968335; cv=pass; d=google.com; s=arc-20160816; b=EM24CAto6Id+BPd4lgD5zndLFFs/k3D5BHqLf7HYBT2appwrqjpjA/Ez5NSCoBXiAF 0x2kpm6cKJsPif06CezFloP1G+XvyQBc34CGkxlCPLybPJmzUfSBn+dfA3UfA2AZH3j+ XGWPurrALAHJFpr3fazKsRMqOKd7NYuIgFPZo9dJ42Xg0vvMI6H19SMERUgcXbXY/m+g QxAxqvCnmIYZmw9bvT5Aq8tJiyGJM18r0RRJhxtrEs+Yoll+5d6ao7fpHBoGexNNZw3J MYnwMRk+1+Q+xsGC0oOx0qIYqvIQ6bb1DBdNQY+zwTmLyPHbAAIEhOXFnLzV5i0O/oxh hKOA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :reply-to:dkim-signature; bh=AZXlcs6m+xDR6nZIttE3zXhan9k7Tdu7nptno26X7+k=; fh=S53WK7USWGPyke6xSRjJCnjhnWPldp6OoNtQOzANyUY=; b=xnuXZf0o/RhkCkx5xjn5KIRXzVruC4QccyP0FN+q8K4k0o605A9I15DPJ8LGEoKNtZ LZC8z+DQ+zvRwX5PK5j3tS5+uhhCtP5jPd/BGNXVsEWz2S8qAuQaf17nUn+wP5OKGgFe xuVp1WO6nQc+jZMVFo+bXBfghTlK67x3wh6X5bBwESKR1ultr1C4x2/kP6l/W/5sSy6R WsblIhG1ZkRh6KHu4jsXyMjH6bNMDOBRXbqsN8pzVfzSTZSudHZQjwU+ciVSgIVLZpYl 2ZeINdo3U800e/eV6DCCh8tr6OIHPE1nW39Ng31IS3oEa/PCigDL0pHPAhdhxOmpYfJo 9ftA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=yByUNarD; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-182446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182446-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c2d5563si10022091a12.250.2024.05.17.10.52.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 10:52:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=yByUNarD; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-182446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182446-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A0B1C1F26F32 for ; Fri, 17 May 2024 17:43:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4CAA1142E93; Fri, 17 May 2024 17:40:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="yByUNarD" Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (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 1AEFF14290A for ; Fri, 17 May 2024 17:40:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715967610; cv=none; b=Vb1/gANFd6KuVbNFG0JVFiWN+l2AgUaTzSljs67U1CCHP3ENWU4uDCZ67mX6nOlot9+srCKiNrAsRboYh9lhTSPXcCC6PYTAojcr20RfYOEpw+/i1jL8YJ/99mJgJRKYZoaEfX0IW6ikp/69uZDB/2dpzgHfvEBgorCwksaD5Cs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715967610; c=relaxed/simple; bh=TVKVVi0oIpGa13TzRgGYboUCGoW+63IrN5ddQ5TrpyM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=D7Ch6i3fNnId6B5XBJTkwUyK6DRapD/YIcBNirNt+r84fqDGSbYZafIk5zkh1SiV34jl0oY20a18XsaTMybTWEyERQBwpEoXt0Aaq2BNyR0AY4+eYW2hnTY9W57GkeOPBOAS3RM3DN6eTX4b8p0ekTadcLAulUuirlfzHOLZX6Q= 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=yByUNarD; arc=none smtp.client-ip=209.85.216.74 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 Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-2b294c5ebc1so8454066a91.2 for ; Fri, 17 May 2024 10:40:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715967608; x=1716572408; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=AZXlcs6m+xDR6nZIttE3zXhan9k7Tdu7nptno26X7+k=; b=yByUNarDPdNKa8DN44EyTanH/T5pIALgKsakDDUbV7SkpOVEANhizu5ny0TOmrLwkH YGejx602ykp/Wo7HAcG8nb+LgOZ1qyjJEdop3HDVt+aHhGZsuwM2dW2DXAu6PfEbciZ6 d4Z94IAhKXDwdZ0VkAeudLzRmZ+jx9cza+Kw1hRF4gMp16lwhB5XsGE30obI55zXEy/c ojcCB5CZIMeuIIar+OFkxpPU4doe1cM08FQCj/ueN6rMiQQgBa8qWkHlGURO2rAe9iU+ Y8rHKLOpNxQdNue826FHPD9tP/752VnL+t24mE+5zAN/TnYksLaFLtiazSI5n5vJlmjQ cXyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715967608; x=1716572408; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AZXlcs6m+xDR6nZIttE3zXhan9k7Tdu7nptno26X7+k=; b=Gpx3P9gOag27GynTAXGEv4NPrbaz+FS7ewCPx3flga8ffeY/LrsdoalElPS8nezcsa lc/Yi03GQ72rHKB/maf6CxmTEC2dqOceT1UzHD7xhEQ/AN3nyZCF344QqwakIUJrmyFl jp5FVG8MzJw44KqUZvALUNrGZR9plqEWPBVGhBciC+j2dlrQFK2ySQ1e6R6GhFMPdzii QclcboDHhapPUlSQdCi1X7Y1Yk0IMMXoKrj68hPtkLDk5GuiCIxN5ifbGuEbvJsh+D5n 9onr/SU9A7QlfJXRStxpShUi5zn7gAZyjzEBgTaGeSwLLKLN2soitdzAWQHfy2VM58SW iZlA== X-Forwarded-Encrypted: i=1; AJvYcCXUyZaArthgBSrECkeQQSWXC52AMWv/qqEjyXaLoc+462fuT+n4f4jczhjPfHNeogfp2xQufSR4BsZ1/Klzv9SId/hO/G7UC6W7dM9+ X-Gm-Message-State: AOJu0Yyx12qI26qHj5Gm7KH5LGcgsi7wM47ojQZ1sFxOlwGmEPCEoaE6 1G3p1TGX0LARhT83MB6suizvaNZ81Rc6nCB1WbD3Sl5EG/r+n2Qgjz1gDLdkL8UlGPv03jpPFdF fng== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:90a:fd08:b0:2b6:2069:ba20 with SMTP id 98e67ed59e1d1-2b6cd1f0549mr58876a91.8.1715967608522; Fri, 17 May 2024 10:40:08 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 17 May 2024 10:38:50 -0700 In-Reply-To: <20240517173926.965351-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240517173926.965351-1-seanjc@google.com> X-Mailer: git-send-email 2.45.0.215.g3402c0e53f-goog Message-ID: <20240517173926.965351-14-seanjc@google.com> Subject: [PATCH v2 13/49] KVM: selftests: Fix a bad TEST_REQUIRE() in x86's KVM PV test From: Sean Christopherson To: Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Hou Wenlong , Kechen Lu , Oliver Upton , Maxim Levitsky , Binbin Wu , Yang Weijiang , Robert Hoo Content-Type: text/plain; charset="UTF-8" Actually check for KVM support for disabling HLT-exiting instead of effectively checking that KVM_CAP_X86_DISABLE_EXITS is #defined to a non-zero value, and convert the TEST_REQUIRE() to a simple return so that only the sub-test is skipped if HLT-exiting is mandatory. The goof has likely gone unnoticed because all x86 CPUs support disabling HLT-exiting, only systems with the opt-in mitigate_smt_rsb KVM module param disallow HLT-exiting. Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/x86_64/kvm_pv_test.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/kvm/x86_64/kvm_pv_test.c b/tools/testing/selftests/kvm/x86_64/kvm_pv_test.c index 78878b3a2725..2aee93108a54 100644 --- a/tools/testing/selftests/kvm/x86_64/kvm_pv_test.c +++ b/tools/testing/selftests/kvm/x86_64/kvm_pv_test.c @@ -140,10 +140,11 @@ static void test_pv_unhalt(void) struct kvm_cpuid_entry2 *ent; u32 kvm_sig_old; + if (!(kvm_check_cap(KVM_CAP_X86_DISABLE_EXITS) & KVM_X86_DISABLE_EXITS_HLT)) + return; + pr_info("testing KVM_FEATURE_PV_UNHALT\n"); - TEST_REQUIRE(KVM_CAP_X86_DISABLE_EXITS); - /* KVM_PV_UNHALT test */ vm = vm_create_with_one_vcpu(&vcpu, guest_main); vcpu_set_cpuid_feature(vcpu, X86_FEATURE_KVM_PV_UNHALT); -- 2.45.0.215.g3402c0e53f-goog