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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 71F56C433B4 for ; Wed, 14 Apr 2021 01:31:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 534C66113D for ; Wed, 14 Apr 2021 01:31:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245545AbhDNBbU (ORCPT ); Tue, 13 Apr 2021 21:31:20 -0400 Received: from mga17.intel.com ([192.55.52.151]:25608 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349025AbhDNBbR (ORCPT ); Tue, 13 Apr 2021 21:31:17 -0400 IronPort-SDR: KfTmpWTo813seAk5BX0NCRjAScevYysb0ADP3H+00ej5Ep0/sNccJfRNEwnPFSumQEBjGv1MxR zy5bVDrDQpCQ== X-IronPort-AV: E=McAfee;i="6200,9189,9953"; a="174645034" X-IronPort-AV: E=Sophos;i="5.82,221,1613462400"; d="scan'208";a="174645034" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2021 18:30:54 -0700 IronPort-SDR: zUw6MIcPvnRBnKZ1NgtyFMUfkSAQlDAsSS2ORPG2GuA42Q0yoBXuT7zduOB0HjdKFDTAxYaT1X KckYs5lrbZxQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,221,1613462400"; d="scan'208";a="600564828" Received: from linux.intel.com ([10.54.29.200]) by orsmga005.jf.intel.com with ESMTP; 13 Apr 2021 18:30:54 -0700 Received: from [10.209.6.241] (kliang2-MOBL.ccr.corp.intel.com [10.209.6.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 0E5D35808CA; Tue, 13 Apr 2021 18:30:52 -0700 (PDT) Subject: Re: [PATCH V3 2/2] perf/x86: Reset the dirty counter to prevent the leak for an RDPMC task To: Andy Lutomirski Cc: Peter Zijlstra , Ingo Molnar , LKML , Arnaldo Carvalho de Melo , Andi Kleen , Mark Rutland , Stephane Eranian , Namhyung Kim References: <1618340250-29027-1-git-send-email-kan.liang@linux.intel.com> <1618340250-29027-2-git-send-email-kan.liang@linux.intel.com> From: "Liang, Kan" Message-ID: Date: Tue, 13 Apr 2021 21:30:51 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/13/2021 8:34 PM, Andy Lutomirski wrote: > On Tue, Apr 13, 2021 at 12:05 PM wrote: >> >> From: Kan Liang >> >> The counter value of a perf task may leak to another RDPMC task. >> For example, a perf stat task as below is running on CPU 0. >> >> perf stat -e 'branches,cycles' -- taskset -c 0 ./workload > > I assume this doesn't fix the leak if the sensitive counter is systemwide? > Right. > Could Intel please add proper security and ideally virtualization for > this? Ideally RDPMC permission would be a bitmask for all RDPMC-able > counters, not just a single on/off switch. > Yes, we are working on it. For now, I think this patch is what we can do so far. Thanks, Kan