Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1188481ybl; Wed, 29 Jan 2020 17:11:27 -0800 (PST) X-Google-Smtp-Source: APXvYqxvBQfhTLqemfwKBBDFX7lpqGwJDsWR8Fs5eE5DTVE2qzWIM+Qloz6FkiHGaqQsMAsowOP+ X-Received: by 2002:a05:6830:9a:: with SMTP id a26mr1634410oto.273.1580346687572; Wed, 29 Jan 2020 17:11:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580346687; cv=none; d=google.com; s=arc-20160816; b=MT4MWqUzkV9eYruBouRlwiSXrkt0dTHXKJMXO+mzrGBiQ6pdos5/+EKTT3WIGoHQ3r vE7eKwmLHmr2hk2AdJu1UyuHLOFR+UX9H1NbzCCdEqGIDDn5pp3gGfDeNCa0wH/I7w/w QJL9sHCLyDkXVr68gHVV2QH6Bn4xt6kt0DxWUSIcrxAE1iPw7MMZrqft1q0+d7hslidB Gawvj75XSy1TIPb//v2ycHLs3evqQ9kURujcb/xfj27bGF3BW9JD2ygugCUloXUkCVC2 LHzn5YAlM5B1m0a2EiXVSbNuTOpwSF6oxvvRUmAEfjHRS81Em2hR3257ijcz2bYqaud0 1Ybw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=UIJpdZf8sX5VGl+nHmaWeHVqzqy84GuWYzpeHSNvIXI=; b=SobHU87ecVMVuz0asBC4hQx4lfCPVIhT7U1KncKDuVkHyCpW5tgTjG9Zy/ZMpmzdEW vOQzqSxylPvKuCf5E9LskGLtZc6gv5HxehJcUDCXJqqODkEXH3mbN31Fo0L0NHCj9m06 2R6a5wrPMVSu6juja49ZZlUL9IB7P2/RUmzBgzIV8AZ4kS6R78Q8XjZY090PiDAsMrdJ 94M6bknh/QIivp2wuQMuDCJ6X1A2PRbja0Np6rl74HoUmcsfB8bsxdDLZk9KLCV+ytz4 NGM6+pTPcfb/yman+XKkuYWNI/3/lX/ZkrzxJfpnCGuO2y4H6D1gxXNmyvKu2TGrJ5Oe Edjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=hU3t0iZG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o20si2080125otl.60.2020.01.29.17.11.12; Wed, 29 Jan 2020 17:11:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=hU3t0iZG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727258AbgA3BKJ (ORCPT + 99 others); Wed, 29 Jan 2020 20:10:09 -0500 Received: from mail-il1-f195.google.com ([209.85.166.195]:34640 "EHLO mail-il1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727152AbgA3BKI (ORCPT ); Wed, 29 Jan 2020 20:10:08 -0500 Received: by mail-il1-f195.google.com with SMTP id l4so1657201ilj.1 for ; Wed, 29 Jan 2020 17:10:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UIJpdZf8sX5VGl+nHmaWeHVqzqy84GuWYzpeHSNvIXI=; b=hU3t0iZGT8HwRfOP4zVuOtz3kV3jIt0WgWHzgIDdGnlNgCp2nYKcn+PWAwp0+7+h83 k6hawullwibiw+XqN8pcm0jM9t2ArylW9tcCDveOXk1XlqbZNNWlEbjmFQ5HZTnSe7Oj paRNmprpKbjxC7/90mZKVcKjuottHjnImoHu/Jjn88XL4aWriRPZ7Ia98oMNt2Q9mpow dxm2faq1/WbfnRi/a1JWHBBFg8RHhuLIZpNs2M7fXpjCciWplsUDV4jftN7WKi3VGreR XVruQn4izyIRR/eFIBzf2aldBBRjtZSLOIeDs2rD/9PDkgN1EyMgmGUq1RbcAgz9stut uF8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UIJpdZf8sX5VGl+nHmaWeHVqzqy84GuWYzpeHSNvIXI=; b=TdmjlzX5TaP/AlbAN8x3wTcFO68z1RMZ2ebfxvXZowlpRpxEV3V1xMVFk4BtETWDjU lSOYOdgQsyZIZJhnFXUjnyaVC++P8cvYp1fHTVCnIWJawSnhvlBYk8mFHN1gHdg08l9K qD8DfCpFs8HAygDk6vum3hjMM4wWfqkRLFLcAYu6WjF0WzYu0jtzdKRGvMZZahZ23scs toALvnS5/+MitEIzEob81MIziGUefxBI8efofjhvdSh5c7+DqMmmIs7abOK6HI5ADm5G nYhwzs+GUDGuxVUvlsU2gVGaNRkipn81VjDgbHyp7nwitG0RU25gQLjZiYqB15nMG8PU 1DTA== X-Gm-Message-State: APjAAAVHetwjGGKfNWBEF1Kq9H0A3QdwguYnzBqhUSRhVjQs3J/fezhn 47EDvbGS1++3j+RAXPJvgYs1+K4YOgH77QukpJihbMhQ X-Received: by 2002:a92:8c9c:: with SMTP id s28mr1981527ill.248.1580346607859; Wed, 29 Jan 2020 17:10:07 -0800 (PST) MIME-Version: 1.0 References: <20200127212256.194310-1-ehankland@google.com> <2a394c6d-c453-6559-bf33-f654af7922bd@redhat.com> In-Reply-To: <2a394c6d-c453-6559-bf33-f654af7922bd@redhat.com> From: Eric Hankland Date: Wed, 29 Jan 2020 17:09:56 -0800 Message-ID: Subject: Re: [PATCH] KVM: x86: Fix perfctr WRMSR for running counters To: Paolo Bonzini Cc: Jim Mattson , Peter Shier , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry - I forgot to switch to plain text mode on my first reply. > I think this best written as it was before commit 2924b52117: > > if (!msr_info->host_initiated) > data = (s64)(s32)data; > pmc->counter += data - pmc_read_counter(pmc); Sounds good to me. > Do you have a testcase? I added a testcase to kvm-unit-tests/x86/pmu.c that fails without this patch and passes with it. Should I send out that patch now?