Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4562113ybp; Mon, 7 Oct 2019 10:14:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzPSglxoaP8Nnkh/iOyn81Em32sUoVWpew1Qy0X6ShhtxteUU1xqwFaF4Bb5mFateAw19l6 X-Received: by 2002:aa7:c343:: with SMTP id j3mr30401247edr.187.1570468450154; Mon, 07 Oct 2019 10:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570468450; cv=none; d=google.com; s=arc-20160816; b=zflfTV9dh7mkxI4KOP2OUTJangoEP1jk9hJDcEc20iioLNAA6Tyz9bSBZSjqZXJ7Fd A5ABZ24Nd/yMcuvuD6WupDFhhOpWoD/vS0a+FczyqbsGoi84iSV/SiXRc0jdaMcEEPOl jJZhUYdx4D9IdpBfaVch26GpPY9j1FOmrWQj/3VF0I+Wn5KvB5UlIBfoF8uvKRWs7KGD gTfvP50o0s9gZFAWsILewVAHCm+cpmIwLYENWsROlbT2L6neWFL032UuImU9xVs56fe3 RfIag1XRH1F7sf1smDrjYu584uGp0mVYtrO0+TZbWfnYVyRdh/45Q5ZDHJuLU3m7R4dH PXrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:openpgp:from:references:cc:to:subject; bh=bLYqevL9PdywyJeqkvnwbJNWCTwp+vmfpCLSwv3bSmE=; b=txwIydZ1FrqrVeqmMmcLB/azuKIaJmWU53cAF4+F8qySu2136E1CN2kisX1Q1OC02P ox0rdrNAgMmnHV0IlRhN4bUlyXKNRHL3sg0WqmKuo5ZgoIEXyPwA2kA+jhwARKmmttyJ 3oDFjHQMBWg/xYGyI1S5qYv4mAHJ6rysh+zkQ/NcIeZ6uaHED5VE6NNzdG+j2qn1ZG4H 7BA6wmu2Pt3EAoi37eoVpfaADqp4VWDsRZB3jYRKDeZCvm9d6EBsQ9YwAlfiUiDwC76C gY8ARBLpeeDmKP34AF30LZorLG8ZQq8prwxkQ39lhazbbh3ThSWe5DEIfFVYnfF/BOKt Jfcg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c9si8742471eda.229.2019.10.07.10.13.46; Mon, 07 Oct 2019 10:14:10 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729071AbfJGRLZ (ORCPT + 99 others); Mon, 7 Oct 2019 13:11:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56096 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727801AbfJGRLY (ORCPT ); Mon, 7 Oct 2019 13:11:24 -0400 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 57D382A09D7 for ; Mon, 7 Oct 2019 17:11:24 +0000 (UTC) Received: by mail-wr1-f69.google.com with SMTP id k2so7830175wrn.7 for ; Mon, 07 Oct 2019 10:11:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=bLYqevL9PdywyJeqkvnwbJNWCTwp+vmfpCLSwv3bSmE=; b=oQlHPAKGYJ7PeBB9bzRjx5rJsQb2BgM0NILHCxn6k1yVboMwUpBorrQ5a9eLDSbunX z1U9l1YvMNdDFqP9HtErVrj7o3aOiWuKow26YBi7VHOJV9Eyk6FGtl87OxBlB3bNI1iN yClS+G7TAyC1LV6TUIuru428IG7zFWOkEDZ8Ow+bl2L/0WAvHb2Ysq2KJ3rCtuayV7Ty VScEHBD7gpfC4hM5SLD2fhcVAqCx6m/Q7sR2xwV1z7XjTrh7XMKf75ZdyLKLCra93lYr IeiUTEW0Ma6a9dgEBfd1HADts99jmZQU9MDLo8AYPGhZy41eDS8gH1BE3XImGrXDb3Jt mcAA== X-Gm-Message-State: APjAAAVyZ//+Ko98e5trnB7Aoz5e98statzDUYwfKdxuaSART3DAAflz OA+c0GBO6SNEVos4cZdHWUMhRt08rS6qdgnm6f4nqqPYjRsh54Rc1mPWCrxjsDee8OH+Fyo2ZCx lixhP5dkJARn9/5tc2CsmHpsk X-Received: by 2002:a1c:dfc4:: with SMTP id w187mr212752wmg.107.1570468282980; Mon, 07 Oct 2019 10:11:22 -0700 (PDT) X-Received: by 2002:a1c:dfc4:: with SMTP id w187mr212734wmg.107.1570468282725; Mon, 07 Oct 2019 10:11:22 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:9dd9:ce92:89b5:d1f2? ([2001:b07:6468:f312:9dd9:ce92:89b5:d1f2]) by smtp.gmail.com with ESMTPSA id n17sm13127190wrp.37.2019.10.07.10.11.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Oct 2019 10:11:22 -0700 (PDT) Subject: Re: [PATCH 10/16] x86/cpu: Detect VMX features on Intel, Centaur and Zhaoxin CPUs To: Sean Christopherson , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, Peter Zijlstra , Arnaldo Carvalho de Melo , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Tony Luck , Tony W Wang-oc Cc: "H. Peter Anvin" , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-edac@vger.kernel.org, Borislav Petkov , Jarkko Sakkinen References: <20191004215615.5479-1-sean.j.christopherson@intel.com> <20191004215615.5479-11-sean.j.christopherson@intel.com> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: Date: Mon, 7 Oct 2019 19:11:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191004215615.5479-11-sean.j.christopherson@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/10/19 23:56, Sean Christopherson wrote: > + /* > + * The high bits contain the allowed-1 settings, i.e. features that can > + * be turned on. The low bits contain the allowed-0 settings, i.e. > + * features that can be turned off. Ignore the allowed-0 settings, > + * if a feature can be turned on then it's supported. > + */ > + rdmsr(MSR_IA32_VMX_PINBASED_CTLS, ign, supported); For QEMU, we're defining a feature as supported if a feature can be turned both on and off. Since msr_low and msr_high can be defined respectively as must-be-one and can-be-one, the features become "msr_high & ~msr_low". Also, shouldn't this use the "true" feature availability MSRs if available? Paolo