Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5516505rwb; Wed, 21 Sep 2022 08:48:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5rB8mxkI9tNJnVtetVS/BtcBtL8EYOSuDYaJPZ0BhsNe7GBq547aj+oy2Vi8g82ewOxoWR X-Received: by 2002:a17:902:b08b:b0:178:48b6:f5a8 with SMTP id p11-20020a170902b08b00b0017848b6f5a8mr5324845plr.3.1663775331635; Wed, 21 Sep 2022 08:48:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663775331; cv=none; d=google.com; s=arc-20160816; b=IUDGJmsJOMHHYjBdj0N2MiiHyc4nEqLx8cAyr9hs7Xd4nZRqtEwJpmDKR989/CBsvN QjEbR6P29ooC7gtV2knIg8W4cAd/7zbiAOiaB9hktQI3m/gq7kKgaxMKtURMexiKkMXv BIDzDSeVSWF8zbu24nxTjKqfKkpHBLqoeD/Ks46CUzE8vgNRXcpC3na+7nU2ru7pT74n VuD8olwCZOrhLA5SvpddZzCydBO/lcMEbenwFs0qDkYcuehAcgCLMVeVWs34soEwsgdR NhDmj5XjfgZF8M+s9y66xgzIkvICbryS7Xo4JNQ5CSxNd77y7koXfcYCx5HmDAMMeRiQ uDCQ== 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=QDv8uQ3PRqvmvrBqcggp1My2nsb1JvOz8pqCzGPKw6Q=; b=cZacwrMzpKbiHzef2INPWKY3w14yyJZhsuEtOG+VD5OCARtjkDbhupiaJglIzZxslL gMBjWHcIzpnMqrR/HXfQlw4woh0Yy+4IuHiKhKayGFSepW41qCrKyF0cgnDta4o+1zcC RtrS084YU41Fwc1fz3jpI0yiO3yS3WKolCQJ2cXMC5cYt7jNsXojwCHJb6BKJ4qz7gpR aD7+y63drb6l6aC1Ge7Ow4csLvJxhJMO1p5d03gYeJ4D5exiiOvHwb3+S8c6QQYRIFjD dIxQrypxBoDC8U3kJPtwzL0Pvw5fSnI8t7P+9Qjbp6Su0/aLCQg2ChtsL6/3GK8iTiSg 7NHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HtGRlh0H; 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 j4-20020a63ec04000000b0042b77c2ce6bsi3221118pgh.130.2022.09.21.08.48.40; Wed, 21 Sep 2022 08:48:51 -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=HtGRlh0H; 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 S231356AbiIUP2S (ORCPT + 99 others); Wed, 21 Sep 2022 11:28:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231278AbiIUP11 (ORCPT ); Wed, 21 Sep 2022 11:27:27 -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 ESMTPS id DBA3598D36 for ; Wed, 21 Sep 2022 08:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663773949; 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=QDv8uQ3PRqvmvrBqcggp1My2nsb1JvOz8pqCzGPKw6Q=; b=HtGRlh0HmIGrOrLHmCXBgQF59Za+W9DBaT9IeuKFnFmrqHoLwi+L5jz35L9VsDfd9N8qKg UHongRBazNW2WACK+EdIV5U/rznHYOC6+jfkH13+Jx5laF/2gvkjj5dhloWOFRWjFfl0Eb XFt/gn6EQW3GlKkvk9b7si9W5osp1ko= 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-493-FzDKHFQ2MQK4OGZkyLdzyQ-1; Wed, 21 Sep 2022 11:25:44 -0400 X-MC-Unique: FzDKHFQ2MQK4OGZkyLdzyQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 727B885A583; Wed, 21 Sep 2022 15:25:43 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.194.159]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6FA9A2166B26; Wed, 21 Sep 2022 15:25:41 +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 v10 24/39] KVM: selftests: Move HYPERV_LINUX_OS_ID definition to a common header Date: Wed, 21 Sep 2022 17:24:21 +0200 Message-Id: <20220921152436.3673454-25-vkuznets@redhat.com> In-Reply-To: <20220921152436.3673454-1-vkuznets@redhat.com> References: <20220921152436.3673454-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Spam-Status: No, score=-2.8 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.37.3