Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp362959imw; Thu, 14 Jul 2022 02:48:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tVtXTEcVp33QvleMSQfHEnqCfclU/Rai4o/j95vdBHkqPz5DfOg183OnVdWW5JGmygMvVi X-Received: by 2002:a17:907:7355:b0:72b:4a31:ba39 with SMTP id dq21-20020a170907735500b0072b4a31ba39mr7775931ejc.490.1657792096245; Thu, 14 Jul 2022 02:48:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657792096; cv=none; d=google.com; s=arc-20160816; b=oldj8VA7x75yWoG55k0eM4pgbMjbvgHmixo74MabqH5t5TEAvxlYXcMT6yhxKnsD85 3D1p2Xt1mv6QTjBICsPT57zlxHqr5AOQPCSW/Whg/hb+GULgk+9vHY6j9I95kUK7wfMw BUzWZxw0gR3hyCzt5DF2msnVstkllneS8SSBHYyL4mwMNCn4r8cJT3plOu+KPeGjc6Pf sDrngnyjTcaZ91CDTtUlGnoplPuy/B7z8jfSa1GUxTdPSiXOE5YaWF9YF768YdiYyu/c Wp8Ovhr6y52d6jOAOxgC/CouzulL/P7CLswOhlccAnC0m0jmG0CQPtcN0h6h3uJLDtZ+ O+9Q== 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=gWH+2XexEWppQJg+fyNx+r8w4lgVOV7GWr1TZgiIJ3k=; b=h0d5F5m9AQy9cpzHKQsy6jOfdUAVDsAGswFJUpRhCTvy8RTWe+IrcvSQppVNhzMe+K Buw7W9ve71j9YgcABQJNdKer+UkQMBiKXrThNJWvoM89BjdXxEc7DTCBnvWZPyRWfTJW XSGNch6iDgOXT67R/TzfS0POUXmTv7cl8fT/BFn9fC0rxli3guo17AJCFYUPMSEdS4M1 Q8Xt7fI5STvYTlDn78kGujniUYh1nskCwE959oFdHBvZFVJOiov1eYRwsDbzaEDOAA8B AaA9YEYy9d8EYeYWhjCL4SQyF8ZmbtXMOHyNSSCHFQdZ10kTUMqEipJ1t+754GcXcl/K bsOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="KayTF3/5"; 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 n13-20020a05640205cd00b00437dce124fesi1791053edx.519.2022.07.14.02.47.50; Thu, 14 Jul 2022 02:48:16 -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="KayTF3/5"; 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 S237787AbiGNJNs (ORCPT + 99 others); Thu, 14 Jul 2022 05:13:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237710AbiGNJNi (ORCPT ); Thu, 14 Jul 2022 05:13:38 -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 93F56C66 for ; Thu, 14 Jul 2022 02:13:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657790015; 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=gWH+2XexEWppQJg+fyNx+r8w4lgVOV7GWr1TZgiIJ3k=; b=KayTF3/5JpNlYr8j+taKFAHTlEmWLpXEXqEOwyAApL0ZQwUXFZXJeuKUrzjFfS4UHxKWSD eXFWeNAYDyoZTn293B3xd5COVbmuop5KfKerORd82P6iFxwrmAFnz4jfhYUvCkY5qXnTx3 7NLowfo+bmnrb1AoUN6oVZOi5fPGIBY= 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-465-WwBCjANVPHqWAr2-w4uTNA-1; Thu, 14 Jul 2022 05:13:33 -0400 X-MC-Unique: WwBCjANVPHqWAr2-w4uTNA-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 11A46101A58D; Thu, 14 Jul 2022 09:13:33 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.194.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2E98D2166B26; Thu, 14 Jul 2022 09:13:30 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, Paolo Bonzini , Sean Christopherson Cc: Anirudh Rayabharam , Wanpeng Li , Jim Mattson , Maxim Levitsky , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 01/25] KVM: x86: hyper-v: Expose access to debug MSRs in the partition privilege flags Date: Thu, 14 Jul 2022 11:13:03 +0200 Message-Id: <20220714091327.1085353-2-vkuznets@redhat.com> In-Reply-To: <20220714091327.1085353-1-vkuznets@redhat.com> References: <20220714091327.1085353-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.6 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,T_SCC_BODY_TEXT_LINE autolearn=ham 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 For some features, Hyper-V spec defines two separate CPUID bits: one listing whether the feature is supported or not and another one showing whether guest partition was granted access to the feature ("partition privilege mask"). 'Debug MSRs available' is one of such features. Add the missing 'access' bit. Fixes: f97f5a56f597 ("x86/kvm/hyper-v: Add support for synthetic debugger interface") Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov --- arch/x86/kvm/hyperv.c | 1 + include/asm-generic/hyperv-tlfs.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c index e2e95a6fccfd..e08189211d9a 100644 --- a/arch/x86/kvm/hyperv.c +++ b/arch/x86/kvm/hyperv.c @@ -2496,6 +2496,7 @@ int kvm_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid, ent->eax |= HV_MSR_RESET_AVAILABLE; ent->eax |= HV_MSR_REFERENCE_TSC_AVAILABLE; ent->eax |= HV_ACCESS_FREQUENCY_MSRS; + ent->eax |= HV_ACCESS_DEBUG_MSRS; ent->eax |= HV_ACCESS_REENLIGHTENMENT; ent->ebx |= HV_POST_MESSAGES; diff --git a/include/asm-generic/hyperv-tlfs.h b/include/asm-generic/hyperv-tlfs.h index fdce7a4cfc6f..1d99dd296a76 100644 --- a/include/asm-generic/hyperv-tlfs.h +++ b/include/asm-generic/hyperv-tlfs.h @@ -70,6 +70,8 @@ #define HV_MSR_GUEST_IDLE_AVAILABLE BIT(10) /* Partition local APIC and TSC frequency registers available */ #define HV_ACCESS_FREQUENCY_MSRS BIT(11) +/* Debug MSRs available */ +#define HV_ACCESS_DEBUG_MSRS BIT(12) /* AccessReenlightenmentControls privilege */ #define HV_ACCESS_REENLIGHTENMENT BIT(13) /* AccessTscInvariantControls privilege */ -- 2.35.3