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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A62DC433F5 for ; Wed, 25 May 2022 14:12:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240501AbiEYOMj (ORCPT ); Wed, 25 May 2022 10:12:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234758AbiEYOMh (ORCPT ); Wed, 25 May 2022 10:12:37 -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 78632AB0F5 for ; Wed, 25 May 2022 07:12:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653487955; 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=A3L6WGFmdy6pwHnD+6q3GnwdUEW6LAQ5NplSTSpXSVk=; b=TpjYhpHhWm6MfGj3nEHut5qttsUhW5QAs3TPDpqzD3KuaXPksAB8DQacx8q1vGrO5PrI3j u3bydxxnTaRxckecyPiwN6XJTY6YRPLO843+mKZ6IA8IB6Vs+59/h9zOFmfmlJImzUhF7y 5R/i7vljruyPzMYuZYOZMd/UFMbVPkA= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-479-S3JMU0leMleIbqNi_H8DWQ-1; Wed, 25 May 2022 10:12:30 -0400 X-MC-Unique: S3JMU0leMleIbqNi_H8DWQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C864329AA2F8; Wed, 25 May 2022 14:12:29 +0000 (UTC) Received: from starship (unknown [10.40.192.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B411C15E71; Wed, 25 May 2022 14:12:27 +0000 (UTC) Message-ID: <48b495c5610d25596a268c71b627b2e2136ac0bd.camel@redhat.com> Subject: Re: [PATCH RESEND v12 00/17] KVM: x86/pmu: Add basic support to enable guest PEBS via DS From: Maxim Levitsky To: Like Xu , Paolo Bonzini Cc: Sean Christopherson , Wanpeng Li , Joerg Roedel , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Jim Mattson , Vitaly Kuznetsov Date: Wed, 25 May 2022 17:12:26 +0300 In-Reply-To: <289d0c88-36a0-afd4-4d47-f2db3fb63654@gmail.com> References: <20220411101946.20262-1-likexu@tencent.com> <87fsl5u3bg.fsf@redhat.com> <874k1ltw9y.fsf@redhat.com> <0848a2da-c9cf-6973-c774-ff16c3e8a248@redhat.com> <289d0c88-36a0-afd4-4d47-f2db3fb63654@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2022-05-25 at 16:32 +0800, Like Xu wrote: > On 25/5/2022 4:14 pm, Paolo Bonzini wrote: > > On 5/25/22 09:56, Like Xu wrote: > > > Thanks for the clarification. > > > > > > Some kvm x86 selftests have been failing due to this issue even after the last > > > commit. > > > > > > I blame myself for not passing the msr_info->host_initiated to the > > > intel_is_valid_msr(), > > > meanwhile I pondered further whether we should check only the MSR addrs range in > > > the kvm_pmu_is_valid_msr() and apply this kind of sanity check in the > > > pmu_set/get_msr(). > > > > > > Vitaly && Paolo, any preference to move forward ? > > > > I'm not sure what I did wrong to not see the failure, so I'll fix it myself. > > More info, some Skylake hosts fail the tests like x86_64/state_test due to this > issue. > > > But from now on, I'll have a hard rule of no new processor features enabled > > without KVM unit tests or selftests. In fact, it would be nice if you wrote > > some for PEBS. > > Great, my team (or at least me) is committed to contributing more tests on vPMU > features. > > We may update the process document to the > Documentation/virt/kvm/review-checklist.rst. > > > Paolo > > FYI, this patch series also break 'msr' test in kvm-unit tests. (kvm/queue of today, and master of the kvm-unit-tests repo) The test tries to set the MSR_IA32_MISC_ENABLE to 0x400c51889 and gets #GP. Commenting this out, gets rid of #GP, but test still fails with unexpected result if (!msr_info->host_initiated && ((old_val ^ data) & MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL)) return 1; It is very possible that the test is broken, I'll check this later. Best regards, Maxim Levitsky