Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp902077pxb; Fri, 22 Jan 2021 02:01:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+JfT0812eHS/kKcMOAcPcVZwo1MvJ+UKOtqd950mQlX0h35rPkpMiH3IOydV0FLylukav X-Received: by 2002:aa7:d919:: with SMTP id a25mr2589871edr.243.1611309685103; Fri, 22 Jan 2021 02:01:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611309685; cv=none; d=google.com; s=arc-20160816; b=GtKEBfzRQ5WzDkDBHDbVtM7MpwF7FFYpSigMsGs1npa832ee/kW3CGHytq8L6TDVdz F8mKEy5Fdd2MUleMcpgoXM1YPU0y1GToOfIi8XO+Mt0DTki5lP9LJ8iwXPbYTbXfDxyl YZBZ57hDJS0rIIkvkZ185pTLgdm1ZtKsuN57LXyoJIKIpDvFtmIHNdpT/AhqL2Vy7auO 572wmMJv7+sFfOCfNZpk30oWK4FezULEJFRt/4+Vcyey17edLZjT/Em49rRiiXp/aXYt z9lg27vVBbT5NoBmM/kS66ah3xX4CXe8J10o9oWnlPR4S5QbkAzn2MD5AaN6P912AEMJ KAiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=LOIQHL9x2mAeYTMhoeeG2U9wpg3O8N1h/6OElLbRyUs=; b=rJR/ZJf9ce+eneBrm5OTP/EgptJ2mtwI5Ij57HuDCnMKkTRFLl39A57PdzFVzDq+YZ M+jXUDKxNTIWKrVnEyRYgEIkMVDnC7aXMGHGHfIrbr3fqEizOvL3imLu09AAXjArsdJN TxOc9RbuUtQ232gYrd1t/X9JC+XzGfiEyw/c44t2j6ZvSKWPpNP/vnkgV4cHkC7z0otS +g8W85g1MLGyLj8aXm1klErM+HmgZbEHaHq5MLGY7BXS0ddmQZNe5idOcKjeAgsm3Nx1 /4W3Z6j3kmu4dUH02ZSVzjdtEACEIrFDOAPswI5fvhyATgpstMLCjAy8KKGLP0I9nOAv U4zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=cDW7vsNY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bv20si2885124ejb.152.2021.01.22.02.01.01; Fri, 22 Jan 2021 02:01:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=cDW7vsNY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727729AbhAVJ71 (ORCPT + 99 others); Fri, 22 Jan 2021 04:59:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727375AbhAVJ5W (ORCPT ); Fri, 22 Jan 2021 04:57:22 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8828DC061788; Fri, 22 Jan 2021 01:56:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=LOIQHL9x2mAeYTMhoeeG2U9wpg3O8N1h/6OElLbRyUs=; b=cDW7vsNYC6CaxNQm8EZ6I6PCqh PVHJZ5S7oX7zfBuRkRmkBqR2UrAGlFmmx8Xf9/Z75eVE2UguP7ZRKKWGyfkIy6sHjqviJocax8e3g +1L9fqITPfJOPAhFQGAyrjAsSF0Uvbg9RbWYsX5Q0H9m5uWv8V4ADJ7FgZNxBiM1dId9cPYc0f1/T a+uiDrZoSeO0I60c3XuHL0i7de1jE9lBZJdscw2Lcet0erlx5cqwW6tFaY6wgm18hwEGgR14ifzFI pZ8RJ+gFwKxWpBD58djPLTdjm5yP3rw9x0AEu5lrh76vb7I0gm9IFFmSwc7Ox48ux+deykcHtT14B kLqWu/3g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2tAx-0008Sb-1V; Fri, 22 Jan 2021 09:56:19 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id C12ED3003E1; Fri, 22 Jan 2021 10:56:12 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8D8BD200D6EE4; Fri, 22 Jan 2021 10:56:12 +0100 (CET) Date: Fri, 22 Jan 2021 10:56:12 +0100 From: Peter Zijlstra To: Sean Christopherson Cc: Andi Kleen , "Xu, Like" , Kan Liang , Paolo Bonzini , eranian@google.com, kvm@vger.kernel.org, Ingo Molnar , Thomas Gleixner , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , wei.w.wang@intel.com, luwei.kang@intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 00/17] KVM: x86/pmu: Add support to enable Guest PEBS via DS Message-ID: References: <20210104131542.495413-1-like.xu@linux.intel.com> <20210115182700.byczztx3vjhsq3p3@two.firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 15, 2021 at 10:51:38AM -0800, Sean Christopherson wrote: > On Fri, Jan 15, 2021, Andi Kleen wrote: > > > I'm asking about ucode/hardare. Is the "guest pebs buffer write -> PEBS PMI" > > > guaranteed to be atomic? > > > > Of course not. > > So there's still a window where the guest could observe the bad counter index, > correct? Guest could do a hypercall to fix up the DS area before it tries to read it I suppose. Or the HV could expose the index mapping and have the guest fix up it. Adding a little virt crud on top shouldn't be too hard.