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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 599BBC433DF for ; Fri, 19 Jun 2020 13:29:14 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 32F0D207FC for ; Fri, 19 Jun 2020 13:29:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 32F0D207FC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jmH4p-0000vK-Sd; Fri, 19 Jun 2020 13:29:03 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jmH4o-0000vF-Nl for xen-devel@lists.xenproject.org; Fri, 19 Jun 2020 13:29:02 +0000 X-Inumbo-ID: d6205d3c-b230-11ea-b7bb-bc764e2007e4 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d6205d3c-b230-11ea-b7bb-bc764e2007e4; Fri, 19 Jun 2020 13:29:01 +0000 (UTC) Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: pLU/hlGo7Oq7gTSVlXPjoEOWkvHOyHO5R+EV8dws81gr5+18S3Od+/LcaTrmn816kWm3qcD/2R mylw4vFh7kSsLe31EpNVNGACoIi0cfh/mMqhgkyHfOziidCFI70uPYUFfaqBrW9pju84R4BXNP LoVBInbpEhBTsub7dkVF+pAntjxYU6Z412x5N5TYHK+fXDiiDo4koFeK9ij9jFqjT/2JJy8h9Y nxhtw/d0pr62sS3UYbZKaIGvD97eDDXa1q+lZYAHm7VSLdKFim/tNsw+cdBuab0fsWnllqjChK ljc= X-SBRS: 2.7 X-MesageID: 20817032 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.75,255,1589256000"; d="scan'208";a="20817032" Subject: Re: [PATCH for-4.14] x86/msr: Disallow access to Processor Trace MSRs To: Jan Beulich References: <20200619115823.22243-1-andrew.cooper3@citrix.com> <32440578-e346-85cc-abad-1aa5694f0ab2@suse.com> From: Andrew Cooper Message-ID: <855c1668-3f91-c084-70d5-76f3e171f074@citrix.com> Date: Fri, 19 Jun 2020 14:28:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <32440578-e346-85cc-abad-1aa5694f0ab2@suse.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Language: en-GB X-ClientProxiedBy: AMSPEX02CAS01.citrite.net (10.69.22.112) To AMSPEX02CL02.citrite.net (10.69.22.126) X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?Q?Micha=c5=82_Leszczy=c5=84ski?= , Xen-devel , Paul Durrant , Wei Liu , =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On 19/06/2020 13:48, Jan Beulich wrote: > On 19.06.2020 13:58, Andrew Cooper wrote: >> --- a/xen/arch/x86/msr.c >> +++ b/xen/arch/x86/msr.c >> @@ -168,6 +168,12 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val) >> case MSR_TSX_FORCE_ABORT: >> case MSR_TSX_CTRL: >> case MSR_MCU_OPT_CTRL: >> + case MSR_RTIT_OUTPUT_BASE: >> + case MSR_RTIT_OUTPUT_MASK: >> + case MSR_RTIT_CTL: >> + case MSR_RTIT_STATUS: >> + case MSR_RTIT_CR3_MATCH: >> + case MSR_RTIT_ADDR_A(0) ... MSR_RTIT_ADDR_B(3): > The respective CPUID field is 3 bits wide, so wouldn't it be better > to cover the full possible range (0...6 afaict)? Last time I tried, you objected to me covering MSR ranges which weren't defined. If you want to extend the range like that, it ought to be MSR_RTIT_OUTPUT_BASE ... MSR_RTIT_ADDR_B(7) to cover the entire area which seems to be exclusively for PT. ~Andrew