Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp424395rwb; Tue, 4 Oct 2022 06:04:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7oL5ujsQAXZ1N750Zk/uT1WJRJD1n0WX4SV/ffBqu+uypD6k26XriZfC65NXsrpdS/U8PX X-Received: by 2002:a17:903:244e:b0:178:4f50:1ca0 with SMTP id l14-20020a170903244e00b001784f501ca0mr27143622pls.104.1664888674422; Tue, 04 Oct 2022 06:04:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664888674; cv=none; d=google.com; s=arc-20160816; b=F8RZPXs82XPbKqtIYwvi2UVGzTKef8s1tW/MvzFMRX1wE42L+BaMyuUvE71kekg6AI Jn4sJQfsD8GHxPcfigivx46rrBBFOONaJlYA/uAjEwxTgwCoR4JG9JeVaTPeWPfsuv1T LPfNs5fxLBH4bcbIvMoWDiIhaxFdW/5+qEetb6+XDotioEU8WrJfNQ7vVK1nwLLsnBzQ DQwszhEi2+kWrec+aIjobyz8iz9OQMXKn/fkyFxPglfKtfFX2AXQVbdRuWuT1MOudDPc oPUbrL+30PiKlS0ZZKEr15afi2qUm1ypseg0HObgC0UuH2xEtX1IWtThXG5Lyd6s6Nys FALg== 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=rUCg8qdmT/f9wGvYa9s3dkKIpVFfOtqQkOxHWueTN/k=; b=U25K68mk5oMN/aQQa3hjg1d9NJ+7JKTjdvd9jMXChgW6Me7m5cav88kaFeO9l3q7em i1Zuic4OyDIE0EgqKBp8gzlHNXio9W0tuvlN2o5G3bZQFR4L8MfkFoRqyTprqjYjGTE+ vzVs9kLZVNPGylzjThGEVUczS+UgY13oIbQNIYoGpF5fO0J/7gN7u3Su/hv6DvlHogXH 0aiCWj4bDmoMxwhYdq2pKA6NCzbU3yRD0AnEFtu5MSjl4PQPhtpa/ui+mJIYhAgV5lis HQyecr+je2tRvWFPbKLhpIovDN7oCUokAerw2YPcMUAffd0Kq6PqXG3FLvovge856l+s +sVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FTekov0u; 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 qe15-20020a17090b4f8f00b001fb3503ff97si2576300pjb.8.2022.10.04.06.04.20; Tue, 04 Oct 2022 06:04:34 -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=FTekov0u; 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 S229763AbiJDMvW (ORCPT + 99 others); Tue, 4 Oct 2022 08:51:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230168AbiJDMum (ORCPT ); Tue, 4 Oct 2022 08:50:42 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10CCF61705 for ; Tue, 4 Oct 2022 05:48:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664887638; 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=rUCg8qdmT/f9wGvYa9s3dkKIpVFfOtqQkOxHWueTN/k=; b=FTekov0uqXehC0ViwcIflRPNqlNC2NBdWRmpPCTF92tG+bMEMETpY4+PPGQUhkrUtg74JE WOko+EjKftgLcDFXLgEXJMQfvz28dYa3jEF/+wbmmUNsJ4OMevjfcV7Gz6p5rw1xRv7sJp HQYkkhNVSCEu7J5pwe2qcX/VaQ0NYhk= 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-303-Q2NHBm_7PLyctHYWyl1W1A-1; Tue, 04 Oct 2022 08:41:16 -0400 X-MC-Unique: Q2NHBm_7PLyctHYWyl1W1A-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A5D7D882821; Tue, 4 Oct 2022 12:41:15 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.255]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5CCC717583; Tue, 4 Oct 2022 12:41:13 +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 v11 31/46] KVM: selftests: Move HYPERV_LINUX_OS_ID definition to a common header Date: Tue, 4 Oct 2022 14:39:41 +0200 Message-Id: <20221004123956.188909-32-vkuznets@redhat.com> In-Reply-To: <20221004123956.188909-1-vkuznets@redhat.com> References: <20221004123956.188909-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.5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 05b32e550a80..71bb91602a7f 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) { @@ -71,7 +69,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)) { @@ -169,7 +167,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