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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C750C433EF for ; Thu, 16 Jun 2022 15:27:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377892AbiFPP11 (ORCPT ); Thu, 16 Jun 2022 11:27:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233352AbiFPP1Z (ORCPT ); Thu, 16 Jun 2022 11:27:25 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEA923EF2C; Thu, 16 Jun 2022 08:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655393244; x=1686929244; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=ob9vLmkazjAUFLVrXlg6KrVwndrvcwTzHXxq35Obb0w=; b=NfUD+36MtSQ6mzrzAlFWV0gWSGpo1l0k1sw7QgzZuiGSXqgj4UBGP4A8 lBSeG6x/KJCT2s8aEoAvW7ZX50dyYVTb29sNceRopL3T/+Vz4IlR/Nqpu EUPSDcWm1irQxetZyPeGlcRXJZ3AYoFku+uKKE6hvkIpq8tsnzrWdmZxH CCAy/DNVMOTU5MZQDuXS8E0W79LdbZd3a1topBg95cxiX+2xdMDrx3aok WOb1rEesk/xEgRdtWqYXfYHBPa7VAXlsnHjU/J0JWtSfJzSPX5Y2tOhsp a8cqSeAK2yZB4ugCGMsbRkQzCB7mVWaeguqG8lLrtrqojdENSiquG/g5X g==; X-IronPort-AV: E=McAfee;i="6400,9594,10379"; a="279988460" X-IronPort-AV: E=Sophos;i="5.92,305,1650956400"; d="scan'208";a="279988460" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 08:27:18 -0700 X-IronPort-AV: E=Sophos;i="5.92,305,1650956400"; d="scan'208";a="641590945" Received: from yangweij-mobl.ccr.corp.intel.com (HELO [10.249.174.123]) ([10.249.174.123]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 08:27:14 -0700 Message-ID: Date: Thu, 16 Jun 2022 23:27:08 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH 16/19] KVM: x86: Enable CET virtualization for VMX and advertise CET to userspace Content-Language: en-US To: Peter Zijlstra Cc: "pbonzini@redhat.com" , "seanjc@google.com" , "x86@kernel.org" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Edgecombe, Rick P" , Sean Christopherson References: <20220616084643.19564-1-weijiang.yang@intel.com> <20220616084643.19564-17-weijiang.yang@intel.com> From: "Yang, Weijiang" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/16/2022 6:59 PM, Peter Zijlstra wrote: > On Thu, Jun 16, 2022 at 04:46:40AM -0400, Yang Weijiang wrote: >> Set the feature bits so that CET capabilities can be seen in guest via >> CPUID enumeration. Add CR4.CET bit support in order to allow guest set CET >> master control bit(CR4.CET). >> >> Disable KVM CET feature if unrestricted_guest is unsupported/disabled as >> KVM does not support emulating CET. >> >> Don't expose CET feature if dependent CET bits are cleared in host XSS, >> or if XSAVES isn't supported. Updating the CET features in common x86 is >> a little ugly, but there is no clean solution without risking breakage of >> SVM if SVM hardware ever gains support for CET, e.g. moving everything to >> common x86 would prematurely expose CET on SVM. The alternative is to >> put all the logic in VMX, but that means rereading host_xss in VMX and >> duplicating the XSAVES check across VMX and SVM. > Doesn't Zen3 already have SHSTK ? Hmm, you remind me of reading more specs from AMD... I'll check their HW solution if it's available.