Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp245651pxb; Wed, 3 Feb 2021 04:41:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnQbpmmeOfocX/gVlgHYSmy7gKvTNRos0wWVwL3WRuVhgbYT4Y1TIIJ47yLqZnr/MpSZvU X-Received: by 2002:aa7:cac6:: with SMTP id l6mr2782149edt.357.1612356083698; Wed, 03 Feb 2021 04:41:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612356083; cv=none; d=google.com; s=arc-20160816; b=NIjU0+x6LkepvU3v+v9T4Az5Q39wYl58uk/KrI+a2120oOf6CV25kmYwgQB4DGimYg KeSZw/aw0T7/4As2IoYGYP8C5tCLFBujm3AWAguVhC3iKOSxK2ZLPJPqu6wLk4lytv0B s80AhmHcLy1x2UG8dx9xFslbsRU57jm8JaYi5mA9sdUgtTckwcBU1lGej5xZTjtegxH9 eWq8X087wqswTeEzO1R7ywDlxiuK9qiM2nMpOPiAHI9fMLprNB84VwIaKfYYvMGAbNby XpD7zvKHWwNrw6sV0rmgw8YUj3XMx1A/392p6mUpcEp3n1Vk159Gi4YuTHg3R1FXtnC1 Gqxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=LwGwynhaPA5yH5/Pe4HRMizNLYNBNXTFcNZsVJQBNMo=; b=Cv1m/P8J9b+gSaCqQPihnvOsnu4tGxP5KStm0G2dbAhEdyBPdchE2w1abthn+x1JOv AE3CZAkJDJ1ajOtzzD6DqmJNh2J2/nXtj0O0nVPXVFf+9nBpqVo5TttTGRvqq7225dI0 rTHr8MnlI/6IWytQ0SnhASaDczBpaH2ZQZvfQy8Ve+JP9JcYf5c8T4Tsic7De7q4VPzg bhtPELXXzEezS0x5Y6OrugmPqdi6hKwVMiK41I/L6P+nA0/9+9EZ8Q0XZsHm5MHBKj/g NEK1h7CHEGXwNZAKVARgg2QHTCQtNNCblC0vogNYZvG3NyLVTwLjBs0bOfHnKxhJFZQo bcxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si1310555ejw.77.2021.02.03.04.40.58; Wed, 03 Feb 2021 04:41:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230257AbhBCMit (ORCPT + 99 others); Wed, 3 Feb 2021 07:38:49 -0500 Received: from mga02.intel.com ([134.134.136.20]:31173 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229777AbhBCMis (ORCPT ); Wed, 3 Feb 2021 07:38:48 -0500 IronPort-SDR: ut+pHBYZv39zJn1U+De3v39w9dqp8i0YrmFLpV+Gy+wIlWUwXH/EplTZzHc1kGt/5QkBuQfG/f 6GA2qms1R+Mw== X-IronPort-AV: E=McAfee;i="6000,8403,9883"; a="168141275" X-IronPort-AV: E=Sophos;i="5.79,398,1602572400"; d="scan'208";a="168141275" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2021 04:38:02 -0800 IronPort-SDR: zOvKmxyMEh5/wZg7/SDXUExUwH6TO4jXWQDp31ZzbgxqVMYPCooiT3hV10/VaIHvitEvGZ+NAw hrDu1BWfMV3w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,398,1602572400"; d="scan'208";a="433390944" Received: from unknown (HELO localhost) ([10.239.159.166]) by orsmga001.jf.intel.com with ESMTP; 03 Feb 2021 04:38:00 -0800 Date: Wed, 3 Feb 2021 20:50:16 +0800 From: Yang Weijiang To: Paolo Bonzini Cc: Yang Weijiang , seanjc@google.com, jmattson@google.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, yu.c.zhang@linux.intel.com Subject: Re: [PATCH v15 07/14] KVM: VMX: Emulate reads and writes to CET MSRs Message-ID: <20210203125016.GA6080@local-michael-cet-test> References: <20210203113421.5759-1-weijiang.yang@intel.com> <20210203113421.5759-8-weijiang.yang@intel.com> <6a743d57-8128-b5db-ddc1-9dd4c4c1004e@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6a743d57-8128-b5db-ddc1-9dd4c4c1004e@redhat.com> User-Agent: Mutt/1.11.3 (2019-02-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 03, 2021 at 12:57:41PM +0100, Paolo Bonzini wrote: > On 03/02/21 12:34, Yang Weijiang wrote: > > MSRs that are switched through XSAVES are especially annoying due to the > > possibility of the kernel's FPU being used in IRQ context. Disable IRQs > > and ensure the guest's FPU state is loaded when accessing such MSRs. > > Good catch! This should be in x86.h and named kvm_get/set_xsave_msr because > it's not VMX specific. The commit message should also be there as a > comment. Thanks a lot for reviewing! These words came from Sean! :-D > > In addition, > > > + case MSR_IA32_S_CET: > > + if (!cet_is_control_msr_accessible(vcpu, msr_info)) > > + return 1; > > + msr_info->data = vmcs_readl(GUEST_S_CET); > > + break; > > + case MSR_IA32_U_CET: > > + if (!cet_is_control_msr_accessible(vcpu, msr_info)) > > + return 1; > > + vmx_get_xsave_msr(msr_info); > > + break; > > these two might as well be the same "case" for symmetry with the handling of > WRMSR. > > I've fixed this up locally, since these patches will not be pushed to Linus > until the corresponding bare metal support is there. Got it! > > Paolo