Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp373363imn; Wed, 3 Aug 2022 07:31:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR6Zka4ohK3BtE0Sj1FSvsx/rGmgHtwAdi8dRX1hz0C99wTJTES1NrxeEH3zpEUcUDzvZby5 X-Received: by 2002:a63:e906:0:b0:41b:eba0:8b6d with SMTP id i6-20020a63e906000000b0041beba08b6dmr14400704pgh.501.1659537110599; Wed, 03 Aug 2022 07:31:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659537110; cv=none; d=google.com; s=arc-20160816; b=fvFWhnUKsvJTEq/SPfCcheihZ5ndMM96+AOjg1YxMO6zXvSmHJOfozHvLYxy0jt2oX gc8J4nU6WgcXSTTsm99dy4fTL+CioQ9Bwx+lReL5gdhs0vBTPv7KklLgnC2vAoIUccSH GKzpLoEJrJTY2djS/RtjgcrJK/sw/j3SWgHx8vnD8PLQx5NPPZf05bTHIqLttgwDMCFg u+WZD7oMzXj47dxbB4G/xfqkB6+RfxOASYxKfhPaelvnSyt/8GiA8lQ5hnc9rFpBK5te Gms7t2lm8sG0cx4Zq9kXWMTdghVcJiu15QaqDeehd8SZ94j/dBdZBAAT+YsaBHedyABb /Y4w== 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=BRUf+2IZfGifY7DQ1c9ozHf4L+H4ou+hlOzYsPu9drM=; b=gyLl4jMOUzTraH458lnleauoynS0ucDDKEA4nP+DBU7atPStp/lpZTonzyvOTWzzsN ZpRZvMrGjIFGCRi/P+5ou2EVdRI9fYLuvDj+ACbdcsnj0LWqXr/J5qIgVzcMyEXW0vun N5U7o2AkWmgosFb3dQ4ATzBR7Hm1YUS2UZrbz5n4agbaLJfItNIC/1jR0wOpsLfLPo1j GjBT6bnRICfrEuS56TuFrgEFbwVAeHwBS2b8jIyXID0qSbVkVdIph7fJ0u/pgg6HirNW jojBeCP/mPErj6mewf3NTfdlYd6Lu+n9vC/eluD+wfBK9PlTzue4E0CP6k4m5V/jRQxa +sOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G8i9bXoi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e66-20020a636945000000b0041cb0d39714si946208pgc.360.2022.08.03.07.31.24; Wed, 03 Aug 2022 07:31:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G8i9bXoi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238422AbiHCNrz (ORCPT + 99 others); Wed, 3 Aug 2022 09:47:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238208AbiHCNr3 (ORCPT ); Wed, 3 Aug 2022 09:47:29 -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 8F36A3336F for ; Wed, 3 Aug 2022 06:46:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659534395; 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=BRUf+2IZfGifY7DQ1c9ozHf4L+H4ou+hlOzYsPu9drM=; b=G8i9bXoiG3G3wOKyHfsjHxODNHUeO3UDOdavL1kcKe2rN4M6mBa3b+w/wSEOk05G8vm4w2 PHrkrNfm4xsSlXPM/Nnxiy86hiIFlvwZec7UwRq2sVHUMQCFMpn5OhnoE0d5qcJdrmZiJH gPVdM1DC+S4/W5DsGq/m9rsYntf7Kbg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-167-LKQpGoK1OzeUsdBTR77SjA-1; Wed, 03 Aug 2022 09:46:31 -0400 X-MC-Unique: LKQpGoK1OzeUsdBTR77SjA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 38BA21824600; Wed, 3 Aug 2022 13:46:29 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.195.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E99640C1288; Wed, 3 Aug 2022 13:46:26 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, Paolo Bonzini , Sean Christopherson Cc: Wanpeng Li , Jim Mattson , Michael Kelley , Siddharth Chandrasekaran , Yuan Yao , Maxim Levitsky , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v9 25/40] KVM: selftests: Move HYPERV_LINUX_OS_ID definition to a common header Date: Wed, 3 Aug 2022 15:46:25 +0200 Message-Id: <20220803134625.399408-1-vkuznets@redhat.com> In-Reply-To: <20220803134110.397885-1-vkuznets@redhat.com> References: <20220803134110.397885-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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. Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov --- tools/testing/selftests/kvm/include/x86_64/hyperv.h | 3 +++ tools/testing/selftests/kvm/x86_64/hyperv_features.c | 6 ++---- 2 files changed, 5 insertions(+), 4 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 79ab0152d281..1144bd1ea626 100644 --- a/tools/testing/selftests/kvm/x86_64/hyperv_features.c +++ b/tools/testing/selftests/kvm/x86_64/hyperv_features.c @@ -13,8 +13,6 @@ #include "processor.h" #include "hyperv.h" -#define LINUX_OS_ID ((u64)0x8100 << 48) - static inline uint8_t hypercall(u64 control, vm_vaddr_t input_address, vm_vaddr_t output_address, uint64_t *hv_status) { @@ -70,7 +68,7 @@ static void guest_hcall(vm_vaddr_t pgs_gpa, struct hcall_data *hcall) GUEST_ASSERT(hcall->control); - 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); if (!(hcall->control & HV_HYPERCALL_FAST_BIT)) { @@ -168,7 +166,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