Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp205473imj; Thu, 14 Feb 2019 18:39:42 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibx0H3FIQL2SBov+Wwu2TsVmF/C4NySrnPVF+HVwnHAWXok2PEa6QHarss77xClXNf5T6gy X-Received: by 2002:a62:62c5:: with SMTP id w188mr7515269pfb.160.1550198382232; Thu, 14 Feb 2019 18:39:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550198382; cv=none; d=google.com; s=arc-20160816; b=LmpN16PfTcDCw35gtffiA0T5OM/Q1/uLUCIPWxUtEbNidpxQXSI6qIKQbYSHFI+uek wycKEyjyngDCjo/T34SJ5w8EhMxOtV7NsKNqGZIFNvOfrpm4r8bm7LTCLLofxwRfX/gn KNyS65+Gztxh/pp6ocgqXQ7PpUK9hkRU3sSkYUo8IgoIMZ+kep6tWRwH2rjIDx84NbBb tfH89zroyeK5TIR+BRZoUqhqL6OgbSu4aD8iD/w+KLUA93rCZnYHfGywhzF6F4bGUK/Y nXgaWsMbvP6xB7t99KNGTf1z9TFxtrfQxKWd1UF5+O+w/oeIF9F3QBaFJbK2DCZki81Z TvQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2sFIgG8oi37betAlxuuY4/aUbPB0VpWK2Tr+LePNA4A=; b=LVl4+kx6erqNe7B53mRnb3Z2vYsdPdvAKsm0heZmOzltOSmILNlWbWNDLia36NRQeg XkEbRawx6IUTI2VdINCtutv+hJWJ5Sefk44E1u+QgFtFvvzZ6tqP5/vO05d3UbsQb633 qU7M9+yS/7tPUSZkuJA+Qzj9HP07GdaivWWkBahSf1JTEkwbNusApegr0Low/6MqY2tL XGIDEM8eYMYEWqbL6IYpgGVyxtPw0umQj+nWVeEYh5sbLEOi6w+Pn0sv9T8FoMqh59W6 jhVcKpwuywI6MSzzFm/+D7d68MoUiMSGFr+c/Ld8L0/+uKYG5eSRDo9y/pBLEuNrv2nE hMUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Gr0dQEoq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j3si4082205pgf.402.2019.02.14.18.39.25; Thu, 14 Feb 2019 18:39:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Gr0dQEoq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732218AbfBOCLU (ORCPT + 99 others); Thu, 14 Feb 2019 21:11:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:51358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726362AbfBOCLU (ORCPT ); Thu, 14 Feb 2019 21:11:20 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DA05A206BA; Fri, 15 Feb 2019 02:11:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550196679; bh=fk+BTELCR16rNQEvd7Q18bf6WcfziqbdP/6EenzKSiM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gr0dQEoqMIrHL+kQxK1By9yWH/HRwAp9aLj/lt/l0CB3374k75oIvDRBtFo8vVNul vGzrHGnUzXWybjhhwoxl+w9MmSENn6UyguS5ok5yk30B8Ido28dFrHo/ZeJhu2Lc9V OZdc05PZn683qk31y1nXX2VLgYxkdmfQifKVkWng= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Vitaly Kuznetsov , Paolo Bonzini , Sasha Levin , linux-kselftest@vger.kernel.org Subject: [PATCH AUTOSEL 4.20 76/77] KVM: selftests: check returned evmcs version range Date: Thu, 14 Feb 2019 21:08:54 -0500 Message-Id: <20190215020855.176727-76-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215020855.176727-1-sashal@kernel.org> References: <20190215020855.176727-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vitaly Kuznetsov [ Upstream commit 35b531a1e7fc30ac8c62e5ac1794eb1460da614e ] Check that KVM_CAP_HYPERV_ENLIGHTENED_VMCS returns correct version range. Signed-off-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini Signed-off-by: Sasha Levin --- tools/testing/selftests/kvm/x86_64/evmcs_test.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/kvm/x86_64/evmcs_test.c b/tools/testing/selftests/kvm/x86_64/evmcs_test.c index 92c2cfd1b182..5d89b30ddde2 100644 --- a/tools/testing/selftests/kvm/x86_64/evmcs_test.c +++ b/tools/testing/selftests/kvm/x86_64/evmcs_test.c @@ -103,6 +103,12 @@ int main(int argc, char *argv[]) vcpu_ioctl(vm, VCPU_ID, KVM_ENABLE_CAP, &enable_evmcs_cap); + /* KVM should return supported EVMCS version range */ + TEST_ASSERT(((evmcs_ver >> 8) >= (evmcs_ver & 0xff)) && + (evmcs_ver & 0xff) > 0, + "Incorrect EVMCS version range: %x:%x\n", + evmcs_ver & 0xff, evmcs_ver >> 8); + run = vcpu_state(vm, VCPU_ID); vcpu_regs_get(vm, VCPU_ID, ®s1); -- 2.19.1