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=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 E274AC433E6 for ; Mon, 31 Aug 2020 15:12:51 +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 AF354207EA for ; Mon, 31 Aug 2020 15:12:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="RG+uxOTC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF354207EA Authentication-Results: mail.kernel.org; dmarc=fail (p=reject 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 1kClTn-0003zE-9v; Mon, 31 Aug 2020 15:12:19 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kClTm-0003z9-M0 for xen-devel@lists.xenproject.org; Mon, 31 Aug 2020 15:12:18 +0000 X-Inumbo-ID: f1f199ec-e964-4b4e-821e-79dce944dc0a Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id f1f199ec-e964-4b4e-821e-79dce944dc0a; Mon, 31 Aug 2020 15:12:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1598886738; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=i2p3koI2qcbJfRP6ve5L4Rtzx0noyKtM5FKQkJryCHI=; b=RG+uxOTCJuelWpRh1LlJ8RV4vj2zgks3TEaA+Wmaq+xl0fntuTbEG7BT gGwmrBwmThbgv75WWMN4iMZqw+33yF1+odbJm82fWldXn/Ue4TWXhRD09 dKW4bbSq4o5PBVJz47ytV7jFuNwVcqGalYaYRcPEGM9eMwc+O9RtSnlHT E=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: +XQJ0gWoC4jgkY6Jw4479eLYuyfK9r0MUn3os83TzOJCRUcOfik3of28nY98GaW7Eb3glvDHYK vxFzrLCIfCMwAxIJ9YCZpDH04J3sxAlqt5cgmresoxOql9xLUPLYr4KfPybQbHB786rU9D1rrF N6JsNq9/w0LJ4b4mD+q1yxugqQBfcmZpRZboSip/nA5qm4feF/da2bV9MoKmkKq9O5ThEA1Lve NmVcS7HgrHO2ahmGfI4zoB41z5TWVcuA62xkzjXx7uiLoGzs2IMLko61ZPpl5olj/dUV2xMmVQ J9M= X-SBRS: 2.7 X-MesageID: 25991742 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.76,376,1592884800"; d="scan'208";a="25991742" Date: Mon, 31 Aug 2020 17:12:04 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Jan Beulich CC: , Jun Nakajima , Kevin Tian , Andrew Cooper , Wei Liu Subject: Re: [PATCH v2 5/8] x86/pv: allow reading FEATURE_CONTROL MSR Message-ID: <20200831151204.GF753@Air-de-Roger> References: <20200820150835.27440-1-roger.pau@citrix.com> <20200820150835.27440-6-roger.pau@citrix.com> <3e260ee3-674b-82d2-d983-f17d3d91c230@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3e260ee3-674b-82d2-d983-f17d3d91c230@suse.com> X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To FTLPEX02CL06.citrite.net (10.13.108.179) 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: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On Thu, Aug 27, 2020 at 05:53:16PM +0200, Jan Beulich wrote: > On 20.08.2020 17:08, Roger Pau Monne wrote: > > @@ -181,6 +182,18 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val) > > /* Not offered to guests. */ > > goto gp_fault; > > > > + case MSR_IA32_FEATURE_CONTROL: > > + if ( !(cp->x86_vendor & X86_VENDOR_INTEL) ) > > + goto gp_fault; > > Can we really do it this way round, rather than raising #GP when > we know the MSR isn't there (AMD / Hygon)? I realized code e.g. > ... > > > + *val = IA32_FEATURE_CONTROL_LOCK; > > + if ( vmce_has_lmce(v) ) > > + *val |= IA32_FEATURE_CONTROL_LMCE_ON; > > + if ( nestedhvm_enabled(d) ) > > + *val |= IA32_FEATURE_CONTROL_ENABLE_VMXON_OUTSIDE_SMX; > > + break; > > + > > + > > case MSR_IA32_PLATFORM_ID: > > if ( !(cp->x86_vendor & X86_VENDOR_INTEL) || > > !(boot_cpu_data.x86_vendor & X86_VENDOR_INTEL) ) > > ... in context right here does it the same way, but I still > wonder whether we wouldn't better switch existing instances, too. Hm, no idea really. Right now it seems better to check for != Intel rather than AMD | Hygon | Centaur | Shanghai, as that's a MSR specific to Intel. Do those MSRs exist in Centaur / Shanghai? Thanks, Roger.