Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp226016iof; Mon, 6 Jun 2022 02:04:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyECsZP6Vdv5i6sLZXh4Xf9uuwoLo1kAVRPFyAwTLv6UBOMbrZ5NyWuWBLPzgwhlyTsG06g X-Received: by 2002:a63:d44:0:b0:3fa:e913:6640 with SMTP id 4-20020a630d44000000b003fae9136640mr19931914pgn.551.1654506255015; Mon, 06 Jun 2022 02:04:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654506255; cv=none; d=google.com; s=arc-20160816; b=GKSPe6Jj3PXABeaqZk20WLLfNWoYX3M7q/s1fhI4ZYV/YQ7auYh2jOChhmXT+9KIqW tXNuQ/KwrKsUIsDu2OTokIDT7HCqiI4n0RjgBoJbOWNG1hzm2Nl/IW6rtXFWxn3q6M4E HIgdqI5ysbva3X1MkNEkEGOhIDE4tIDeHHTtI4dWS/XxAHlwjXmAyLqMNP/iAOFA0f2y bvjcFK62KC6oRDtkCznrwGfivMiy6mHWtVKYAKqVqrNNo78bNtEYlcDr2vklHTWD7tDK uKsj0cQNuabFf/uX9yCQUCesN0DyrdJ4PoNeyt5+2nYcLSBxN3OhRvq2OtLy6R7u69qZ XSyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=U1sMy8xaJxhqapgk5p9GIXqaotAkSrql7bAakOStiUU=; b=fTFsCKc1uQx3WguCP/gexCOKjgFiCNxomwBlf/x7aJbc3uN0m/xOSPX8SRujzXgPNF 1ivGpyTi4CeoH4q9qaxoUlf5kLzEFz9VsJqkf4/VjYXk1D+CiimFbBWGFp2Lv/LtiRIS mFdiHxhmlsyobdXmbWYHeAY8/x0uuC+x0MKyfWJi6oDcK/0UT3QHGk0CfDAuXcXjnu+d IEZJTTZtSqNKlFIHfkZi1Ye69FB7DBPSOMlLemiy7heK0lX3i2JBUXTNBsccYCvFP/m0 ovhmsTQP4tcYWW8LhbDl6mifN3wfPjpIwBu2B7W8+QsSvFgiWOUmwJXJKsK9cpSYGKew KZPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EhuyXuB9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c8-20020a6566c8000000b003f25a28a4afsi21318760pgw.241.2022.06.06.02.04.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 02:04:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EhuyXuB9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 65D9EDE33C; Mon, 6 Jun 2022 01:41:54 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232563AbiFFIkN (ORCPT + 99 others); Mon, 6 Jun 2022 04:40:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232070AbiFFIiH (ORCPT ); Mon, 6 Jun 2022 04:38:07 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3AEAE21E01 for ; Mon, 6 Jun 2022 01:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654504681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U1sMy8xaJxhqapgk5p9GIXqaotAkSrql7bAakOStiUU=; b=EhuyXuB9S6MmONXPYQhBu+4fWSe75TlNvFr1gdJaU/D2gvXHCQ3gVwcO7zEfOEyfGlXP71 A+84hQE9a1A45gQjkatuZKsjHd0pwrp/a85Bu3Y6Nnoce7MVaJ/aspBgMDHWZWgd/SYIeS Uv9t1HU/0YD/djTllrg0Ncn9naEngXA= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-215-oHQyy_xaM1a3F5E4XNy49Q-1; Mon, 06 Jun 2022 04:37:57 -0400 X-MC-Unique: oHQyy_xaM1a3F5E4XNy49Q-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5733C1C16B42; Mon, 6 Jun 2022 08:37:57 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.193.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 069FD1121314; Mon, 6 Jun 2022 08:37:54 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, Paolo Bonzini Cc: Sean Christopherson , Wanpeng Li , Jim Mattson , Michael Kelley , Siddharth Chandrasekaran , Yuan Yao , Maxim Levitsky , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 25/38] KVM: selftests: Move HYPERV_LINUX_OS_ID definition to a common header Date: Mon, 6 Jun 2022 10:36:42 +0200 Message-Id: <20220606083655.2014609-26-vkuznets@redhat.com> In-Reply-To: <20220606083655.2014609-1-vkuznets@redhat.com> References: <20220606083655.2014609-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org HYPERV_LINUX_OS_ID needs to be written to HV_X64_MSR_GUEST_OS_ID by each Hyper-V specific selftest. Signed-off-by: Vitaly Kuznetsov --- tools/testing/selftests/kvm/include/x86_64/hyperv.h | 3 +++ tools/testing/selftests/kvm/x86_64/hyperv_features.c | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/kvm/include/x86_64/hyperv.h b/tools/testing/selftests/kvm/include/x86_64/hyperv.h index b66910702c0a..f0a8a93694b2 100644 --- a/tools/testing/selftests/kvm/include/x86_64/hyperv.h +++ b/tools/testing/selftests/kvm/include/x86_64/hyperv.h @@ -185,4 +185,7 @@ /* hypercall options */ #define HV_HYPERCALL_FAST_BIT BIT(16) +/* Proper HV_X64_MSR_GUEST_OS_ID value */ +#define HYPERV_LINUX_OS_ID ((u64)0x8100 << 48) + #endif /* !SELFTEST_KVM_HYPERV_H */ diff --git a/tools/testing/selftests/kvm/x86_64/hyperv_features.c b/tools/testing/selftests/kvm/x86_64/hyperv_features.c index 672915ce73d8..98c020356925 100644 --- a/tools/testing/selftests/kvm/x86_64/hyperv_features.c +++ b/tools/testing/selftests/kvm/x86_64/hyperv_features.c @@ -14,7 +14,6 @@ #include "hyperv.h" #define VCPU_ID 0 -#define LINUX_OS_ID ((u64)0x8100 << 48) extern unsigned char rdmsr_start; extern unsigned char rdmsr_end; @@ -127,7 +126,7 @@ static void guest_hcall(vm_vaddr_t pgs_gpa, struct hcall_data *hcall) int i = 0; u64 res, input, output; - wrmsr(HV_X64_MSR_GUEST_OS_ID, LINUX_OS_ID); + wrmsr(HV_X64_MSR_GUEST_OS_ID, HYPERV_LINUX_OS_ID); wrmsr(HV_X64_MSR_HYPERCALL, pgs_gpa); while (hcall->control) { @@ -230,7 +229,7 @@ static void guest_test_msrs_access(void) */ msr->idx = HV_X64_MSR_GUEST_OS_ID; msr->write = 1; - msr->write_val = LINUX_OS_ID; + msr->write_val = HYPERV_LINUX_OS_ID; msr->available = 1; break; case 3: -- 2.35.3