Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3565910pxp; Tue, 8 Mar 2022 17:36:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJw61JHbM68lSuf0Dkf7E8/xILxTok/CqPYySO1LZBZOSVHJTLTUJipHrbgUeME5gc2/xww5 X-Received: by 2002:a63:7218:0:b0:37f:fc63:b995 with SMTP id n24-20020a637218000000b0037ffc63b995mr15493669pgc.48.1646789813007; Tue, 08 Mar 2022 17:36:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646789813; cv=none; d=google.com; s=arc-20160816; b=PgBPQOJuXMWy9sxxzjLKR0Qlyf9XtdBd0KdKCoA6rc3wFcZkyRGCRJ1n8inTZmGWlX Eb6oUyviF7S9jp5vsWOlSIVTl4vYb9dkWDLbvooGz7k3rZ+tozghY8UglrmJRPjVHGDm xg6TLGRgA5aBjTuTmmJ4fuuR75ppbaVV7RSgvOWYYmyh8DRxeWnfLpvjF2zga0/1mmfe dcjUB63Rqpiw1ApBCi8zCXOWDq2BiLZkrgYml+w6d8QdbJlWxDTy0nhbpT8HlwQBkPLS wlGjzwopuIc6cMqT61dKuApUzLM1fm44M9ao5bGEk+4dXd+ETqSepH45sMR9DUBvTB8U DiPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=kIifr3b2QdzGraVEgIab2CtnyH2GC+4PtqflIyd61Ic=; b=UCD+bXkn3HKvuHesy7beuzEKcUgazjX1PNPZzjq+OT3CbWDE4vJqpbVoO5Pd+IHjY1 EdJXyIzaVJ97j7Fjqj/5N9ggbp2OBUSRGsi17WSLNhys5p11HquGAV47mmw/gnIuftJu DyEJcqCr+p+djqTd7xIrmL5FSX5Ae/4MsU/4+JvZy8FkwRn2U0/0Qd1Ap1strcpK/61R DiQaBBVvB/uuO/3Mgx4NsRUj0mLQ+uWmcLUbfd4FgyweS0ED17sFoUxpE6PezQMUEfOJ 6GqM1AWLR85ZozdCvGwElvxzLcuu5KV0XStA1eL68ipL3t2BYw3ehap6RzWnh10k3wRv Eo0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=TNeI8aoA; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id r10-20020a056a00216a00b004e10370daffsi485501pff.24.2022.03.08.17.36.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 17:36:52 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=TNeI8aoA; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6F11116E7E4; Tue, 8 Mar 2022 16:22:38 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239312AbiCHQPq (ORCPT + 99 others); Tue, 8 Mar 2022 11:15:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231548AbiCHQPo (ORCPT ); Tue, 8 Mar 2022 11:15:44 -0500 Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0B7550B3A for ; Tue, 8 Mar 2022 08:14:47 -0800 (PST) Received: by mail-oi1-x229.google.com with SMTP id 12so19336383oix.12 for ; Tue, 08 Mar 2022 08:14:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kIifr3b2QdzGraVEgIab2CtnyH2GC+4PtqflIyd61Ic=; b=TNeI8aoAYP5NSnk1pt0TitmjMycf+hJOQWlu8NMS1/pYV3TYZ0CKN4QqDlYmaLG1S3 wxf89ao5y6FNlcaMNJRSWAT8BoVZa+rNIUsBXImTbXNXVMZxu177cU18Q/VXBjiZ5IMj l9o/LXQ9TsHn5mij0AmnDbwqptPURfuVAsZD3C0SwFOD4qbZ4GmZP2SDlGtRHWEq1NAz +ao3jAK6lhVjB2I6wpsXxXJmpsHeBVauKJ3JJLwksGSHXYgf+bY142Uwpx85n+HRvHt6 yKD61xLQBT7shDSiMgs311Hy/6Ax4CR6iTVUx4camFRQOEPAsMFgHWYMOmSHt+UbAJgy jK1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kIifr3b2QdzGraVEgIab2CtnyH2GC+4PtqflIyd61Ic=; b=53FreUF6o4Oj53uCTZwoXZ5McertDL0QRce38/89RxhfbquaSdvB6XTge9qwOMyNkH ruLtj3PDI8knEzAK2oSRtyQhehm97bpEJoBaXf1fA2FP6nCke8EsqNQQzL3Jg1jhLyWK TtRnyRUYY4FYyvS+sIyejKQcKBuC5aAW/Eus/V7ScieyTgjP/pae16uKAaDLndoo/Di3 iFIp3OZkZyNuMioC0ynsSD+OC+93ZZPEWpQ9owgUkXtC1qyAZ9Xy31ZKWHZHJ48CA24t q0FLu7z1GNaGqAjMtA4PT8sq1ciqsJgMoLNKM+HhmajwN5J+Q/yVnhtAWprb/cgHc1K6 3XhA== X-Gm-Message-State: AOAM530m5Vqnxm0j0qitVz5uhKFZMVadL6BZdm1aAbbuSlbSH5DVnbRt QyjMoCffHmehbynSx4mwdpEMAJo5XmCYaolkaD/guQ== X-Received: by 2002:a05:6808:1446:b0:2d5:281f:9cda with SMTP id x6-20020a056808144600b002d5281f9cdamr3108662oiv.13.1646756086855; Tue, 08 Mar 2022 08:14:46 -0800 (PST) MIME-Version: 1.0 References: <20220302111334.12689-1-likexu@tencent.com> <20220302111334.12689-13-likexu@tencent.com> <273a7631-188b-a7a9-a551-4e577dcdd8d1@gmail.com> <158bcefb-4087-c2a3-cfcf-e33ab53af649@gmail.com> In-Reply-To: <158bcefb-4087-c2a3-cfcf-e33ab53af649@gmail.com> From: Jim Mattson Date: Tue, 8 Mar 2022 08:14:36 -0800 Message-ID: Subject: Re: [PATCH v2 12/12] KVM: x86/pmu: Clear reserved bit PERF_CTL2[43] for AMD erratum 1292 To: Like Xu Cc: Paolo Bonzini , kvm@vger.kernel.org, Sean Christopherson , Wanpeng Li , Vitaly Kuznetsov , Joerg Roedel , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 On Tue, Mar 8, 2022 at 3:25 AM Like Xu wrote: > > On 5/3/2022 3:06 am, Jim Mattson wrote: > > We should continue to synthesize a #GP for an attempt to set "must be > > zero" bits or for rule violations, like "address must be canonical." > > Actually, I do stand in the same position as you. > > > However, we have absolutely no business making up our own hardware > > specification. This is a bug, and it should be fixed, like any other > > bug. > Current virtual hardware interfaces do not strictly comply with vendor > specifications > and may not be the same in the first step of enablement, or some of them may have > to be compromised later out of various complexity. > > The behavior of AMD's "synthesize a #GP" to "reserved without qualification" bits > is clearly a legacy tech decision (not sure if it was intentional). We may need > a larger > independent patch set to apply this one-time surgery, including of course this > pmu issue. > > What do you think ? The PMU issue needs to be fixed ASAP, since a Linux guest will set the "host-only" bit on a CPU that doesn't support it, and Linux expects the bit to be ignored and the remainder of the PerfEvtSeln to be written. Currently, KVM synthesizes #GP and the PerfEvtSeln is not written. I don't believe it is necessary to fix all related issues at one time. Incremental fixes should be fine.