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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham 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 67E86C433F5 for ; Tue, 4 Sep 2018 15:26:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1858C206BA for ; Tue, 4 Sep 2018 15:26:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1858C206BA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727726AbeIDTvr (ORCPT ); Tue, 4 Sep 2018 15:51:47 -0400 Received: from mga07.intel.com ([134.134.136.100]:34050 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726304AbeIDTvr (ORCPT ); Tue, 4 Sep 2018 15:51:47 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2018 08:26:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,329,1531810800"; d="scan'208";a="260604208" Received: from schoebin-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.35.203]) by fmsmga006.fm.intel.com with ESMTP; 04 Sep 2018 08:26:06 -0700 Date: Tue, 4 Sep 2018 18:26:05 +0300 From: Jarkko Sakkinen To: "Huang, Kai" Cc: "Christopherson, Sean J" , "platform-driver-x86@vger.kernel.org" , "x86@kernel.org" , "nhorman@redhat.com" , "linux-kernel@vger.kernel.org" , "tglx@linutronix.de" , "suresh.b.siddha@intel.com" , "Ayoun, Serge" , "hpa@zytor.com" , "npmccallum@redhat.com" , "mingo@redhat.com" , "linux-sgx@vger.kernel.org" , "Hansen, Dave" Subject: Re: [PATCH v13 10/13] x86/sgx: Add sgx_einit() for initializing enclaves Message-ID: <20180904152605.GA8344@linux.intel.com> References: <20180827185507.17087-1-jarkko.sakkinen@linux.intel.com> <20180827185507.17087-11-jarkko.sakkinen@linux.intel.com> <1535406078.3416.9.camel@intel.com> <20180828070129.GA5301@linux.intel.com> <105F7BF4D0229846AF094488D65A09893541037C@PGSMSX112.gar.corp.intel.com> <20180831121645.GA18075@linux.intel.com> <20180831181509.GB21555@linux.intel.com> <20180903191926.GC13497@linux.intel.com> <105F7BF4D0229846AF094488D65A09893541970F@PGSMSX112.gar.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <105F7BF4D0229846AF094488D65A09893541970F@PGSMSX112.gar.corp.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 03, 2018 at 11:45:14PM +0000, Huang, Kai wrote: > But INVALID_TOKEN is not only returned when MSRs are mismatched, so do > you plan to check to rule out other cases that cause INVALID_TOKEN > before retrying EINIT, or unconditionally retry EINIT? And we should > only retry once? In the case of this error we will do wrmsrs and retry einit once. This is how I understood it at least. Q: Do we have to care about VMM sleep anyway? I mean if VMM always traps EINIT it can write the MSRs with guest values if it has been sleeping. If the answer is no, then retrying once should be a complete solution and we don't need pm_cnt. /Jarkko From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 4 Sep 2018 18:26:05 +0300 From: Jarkko Sakkinen To: "Huang, Kai" CC: "Christopherson, Sean J" , "platform-driver-x86@vger.kernel.org" , "x86@kernel.org" , "nhorman@redhat.com" , "linux-kernel@vger.kernel.org" , "tglx@linutronix.de" , "suresh.b.siddha@intel.com" , "Ayoun, Serge" , "hpa@zytor.com" , "npmccallum@redhat.com" , "mingo@redhat.com" , "linux-sgx@vger.kernel.org" , "Hansen, Dave" Subject: Re: [PATCH v13 10/13] x86/sgx: Add sgx_einit() for initializing enclaves Message-ID: <20180904152605.GA8344@linux.intel.com> References: <20180827185507.17087-1-jarkko.sakkinen@linux.intel.com> <20180827185507.17087-11-jarkko.sakkinen@linux.intel.com> <1535406078.3416.9.camel@intel.com> <20180828070129.GA5301@linux.intel.com> <105F7BF4D0229846AF094488D65A09893541037C@PGSMSX112.gar.corp.intel.com> <20180831121645.GA18075@linux.intel.com> <20180831181509.GB21555@linux.intel.com> <20180903191926.GC13497@linux.intel.com> <105F7BF4D0229846AF094488D65A09893541970F@PGSMSX112.gar.corp.intel.com> Content-Type: text/plain; charset="us-ascii" In-Reply-To: <105F7BF4D0229846AF094488D65A09893541970F@PGSMSX112.gar.corp.intel.com> Sender: Return-Path: platform-driver-x86-owner@vger.kernel.org MIME-Version: 1.0 List-ID: On Mon, Sep 03, 2018 at 11:45:14PM +0000, Huang, Kai wrote: > But INVALID_TOKEN is not only returned when MSRs are mismatched, so do > you plan to check to rule out other cases that cause INVALID_TOKEN > before retrying EINIT, or unconditionally retry EINIT? And we should > only retry once? In the case of this error we will do wrmsrs and retry einit once. This is how I understood it at least. Q: Do we have to care about VMM sleep anyway? I mean if VMM always traps EINIT it can write the MSRs with guest values if it has been sleeping. If the answer is no, then retrying once should be a complete solution and we don't need pm_cnt. /Jarkko