From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A261FC433DF for ; Wed, 27 May 2020 15:17:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 797BD2084C for ; Wed, 27 May 2020 15:17:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QW+CYypi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389544AbgE0PRA (ORCPT ); Wed, 27 May 2020 11:17:00 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:46655 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389501AbgE0PQ7 (ORCPT ); Wed, 27 May 2020 11:16:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590592618; 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=VVDQvFJrgkWSz8/ikl8zaz7psPPU6nwXpgVWbhjxY/A=; b=QW+CYypiY6rpNEISyGoTqYN8+viS3sVz1WUgt5ED5jO3sDQgnpQWuysOG66T1rfgAeMGxY 7h2/+er8SSmGGOAKG5PxPXnynmHj6sNyntD8cknsVhtbYQgligtM+r3rspV8PqVq8pm1pn k1bKJ7bxqgXWXKMKFgh10bc2zYRD0MA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-104-R7kKTjP5PX6oBfqiP1ZHrQ-1; Wed, 27 May 2020 11:16:54 -0400 X-MC-Unique: R7kKTjP5PX6oBfqiP1ZHrQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D1F6D107ACCD; Wed, 27 May 2020 15:16:52 +0000 (UTC) Received: from starship (unknown [10.35.206.172]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F26519D82; Wed, 27 May 2020 15:16:48 +0000 (UTC) Message-ID: <6d6d38a6f62e0d6d093713703e9f0e183c7eda13.camel@redhat.com> Subject: Re: [PATCH 1/2] kvm/x86/vmx: enable X86_FEATURE_WAITPKG in KVM capabilities From: Maxim Levitsky To: Sean Christopherson Cc: kvm@vger.kernel.org, Paolo Bonzini , "H. Peter Anvin" , Tao Xu , Jim Mattson , linux-kernel@vger.kernel.org, Joerg Roedel , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Wanpeng Li , Ingo Molnar , Thomas Gleixner , Borislav Petkov , Vitaly Kuznetsov , Jingqi Liu Date: Wed, 27 May 2020 18:16:47 +0300 In-Reply-To: <20200527012039.GC31696@linux.intel.com> References: <20200523161455.3940-1-mlevitsk@redhat.com> <20200523161455.3940-2-mlevitsk@redhat.com> <20200527012039.GC31696@linux.intel.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.2 (3.36.2-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, 2020-05-26 at 18:20 -0700, Sean Christopherson wrote: > On Sat, May 23, 2020 at 07:14:54PM +0300, Maxim Levitsky wrote: > > Even though we might not allow the guest to use > > WAITPKG's new instructions, we should tell KVM > > that the feature is supported by the host CPU. > > > > Note that vmx_waitpkg_supported checks that WAITPKG > > _can_ be set in secondary execution controls as specified > > by VMX capability MSR, rather that we actually enable it for a > > guest. > > These line wraps are quite weird and inconsistent. Known issue for me, I usually don't have line wrapping enabled, and I wrap the lines a bit earlier that 72 character limit. I'll re-formatted the commit message to be on 72 line format and I will try now to pay much more attention to that. > > > Fixes: e69e72faa3a0 KVM: x86: Add support for user wait > > instructions > > Checkpatch doesn't complain, but the preferred Fixes format is > > Fixes: e69e72faa3a07 ("KVM: x86: Add support for user wait > instructions") > > e.g. > > git show -s --pretty='tformat:%h ("%s")' Got it, and added to git aliases :-) > > For the code itself: > > Reviewed-by: Sean Christopherson Thank you! > > > Suggested-by: Paolo Bonzini > > Signed-off-by: Maxim Levitsky > > --- > > arch/x86/kvm/vmx/vmx.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c > > index 55712dd86bafa..fca493d4517c5 100644 > > --- a/arch/x86/kvm/vmx/vmx.c > > +++ b/arch/x86/kvm/vmx/vmx.c > > @@ -7298,6 +7298,9 @@ static __init void vmx_set_cpu_caps(void) > > /* CPUID 0x80000001 */ > > if (!cpu_has_vmx_rdtscp()) > > kvm_cpu_cap_clear(X86_FEATURE_RDTSCP); > > + > > + if (vmx_waitpkg_supported()) > > + kvm_cpu_cap_check_and_set(X86_FEATURE_WAITPKG); > > } > > > > static void vmx_request_immediate_exit(struct kvm_vcpu *vcpu) > > -- > > 2.26.2 > >