Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4704723imw; Tue, 19 Jul 2022 11:35:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vmRzlNW/MIJpZ0VNvZrA6UXkOlruHZeRkO0wBgh62N3hgFeu/4v9D/wCWR/m1o7sSkZO0z X-Received: by 2002:a17:907:2d25:b0:72b:83c2:ab90 with SMTP id gs37-20020a1709072d2500b0072b83c2ab90mr31657869ejc.373.1658255712436; Tue, 19 Jul 2022 11:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658255712; cv=none; d=google.com; s=arc-20160816; b=WGX/8UU63D3xEKUchXLBw9NUY5tvGMGDk8yv8YzzzrMzYnVPEnPEtBu3xzA6TUeBTg dF/1Aec6F2lZf8TcaFWDkMzFpyA4eefHtauEo+BXz4+/IZeLbCG+hRytKsSTFENa39tD /WH+w8TIFVhIR+1WFO/wIIHNKFMaUGZ1u19Gqv8neRhU5PWnq6zp9inx3RL3Tx1Z2YXS m/EYGdrzUK6xTBOgtgmVigz2MqLCF5Xh8TQdkI4pp9+YZyte/R2Rly/Jgvlh18lvXvnT fParY9/DomuDiP8/mQZUSM89SAqhqTeaOxH3PKfK9WErIcIGrYKBJg9gp+9nZGzoRTVh uucw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=nAx859QqZti3ht5PNQp6lqNGfxZK431e1ecbFg4E0sg=; b=AYdtQuMB8HAmM+58GZe01XQemATovZSQO6QasbKlQL2pW2hAbhHymXANqB5H3DY9FA fNiyUAzA0tqyUYEbdLa1e7joYeGgvxyaXOsq36ZlQH5JXSxc3p7+wGbSfdWu8HreCUwT rRfdaZIWq/NTvtXE7poMxYzDqLuJt1JLzSrtu6LXciqnPgEj9KzfmjwGJA1l4SA21w7Y nOnKNJAIiQpsFpFpUE9lOkmVShPquXAbsPB2TXkbb0DZ14TJJAjKRll4s2leF1vZsj1g Y0ONIchcS6CHD1ipfUujuk1S4LhuAgBABa+ly2SXl0ncOscvgywVLirLvzQQNkyKNnvu emAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Wez1ecgT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb20-20020a170907961400b007123c7ecf90si666169ejc.476.2022.07.19.11.34.44; Tue, 19 Jul 2022 11:35:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Wez1ecgT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238701AbiGSRx2 (ORCPT + 99 others); Tue, 19 Jul 2022 13:53:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229944AbiGSRx1 (ORCPT ); Tue, 19 Jul 2022 13:53:27 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C06E558CB; Tue, 19 Jul 2022 10:53:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658253206; x=1689789206; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=2QpaWwyMGOI/87FV5yJoVCYewK4j2LMWRbyQ9ggcnqY=; b=Wez1ecgTptQXbFkRTSfxqrszlftCGgkQQLGJSY7WBIrw/s6zTa0hdZzs 8ZGLQG6P68RzIFDewNR0XAQRbbhxYA+tcsiUqc3bCFJCPRZqUZugUkV5g FXNr2tLFcHX81qLC6LwJh4n+0Vg6XX/FUYrAElnLzdGQU3Z7kfTNFvQBN a7rnatjLp+d4P/x9d9ThJWabYCbc3c+ZNXg/obeY+uLx7PtJHdJjgdjA0 0gATnyIx/vajxGcTebktMqng3HsvpY2HnQ+tCzuzleft7b12Lhne0q4bw WxDdMcF8Q4Rhh0SSoOvRfcox4n0yOrci6oZSigLR9EikPIHHzkoXCouFk Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10413"; a="372859099" X-IronPort-AV: E=Sophos;i="5.92,284,1650956400"; d="scan'208";a="372859099" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2022 10:53:26 -0700 X-IronPort-AV: E=Sophos;i="5.92,284,1650956400"; d="scan'208";a="687198943" Received: from twliston-mobl1.amr.corp.intel.com (HELO [10.212.132.190]) ([10.212.132.190]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2022 10:53:25 -0700 Message-ID: <93960610-d7ff-8c7f-16ae-61191e6ed377@intel.com> Date: Tue, 19 Jul 2022 10:53:24 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] x86/sgx: Allow enclaves to use Asynchrounous Exit Notification Content-Language: en-US To: Haitao Huang , linux-kernel@vger.kernel.org, Dave Hansen Cc: Jarkko Sakkinen , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , linux-sgx@vger.kernel.org, Sean Christopherson , "Huang, Kai" References: <20220705183648.3739111-1-dave.hansen@linux.intel.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/14/22 06:19, Haitao Huang wrote: > > I think you need add this change in arch/x86/kernel/cpu/sgx/ioctl.c, > inside sgx_encl_create function: > > -    encl->attributes_mask = SGX_ATTR_DEBUG | SGX_ATTR_MODE64BIT | > SGX_ATTR_KSS; > +    encl->attributes_mask = SGX_ATTR_DEBUG | SGX_ATTR_MODE64BIT | > SGX_ATTR_KSS | SGX_ATTR_ASYNC_EXIT_NOTIFY; > > Otherwise, EINIT ioctl fails with this new attribute set in enclave secs. Makes sense. I'll add it there. I also just realized we need to update arch/x86/kvm/cpuid.c as well. It keeps a complete list of guest-available SGX attributes.