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 BF912C433FE for ; Thu, 3 Mar 2022 21:44:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236633AbiCCVpN (ORCPT ); Thu, 3 Mar 2022 16:45:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231592AbiCCVpL (ORCPT ); Thu, 3 Mar 2022 16:45:11 -0500 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E074ED96E; Thu, 3 Mar 2022 13:44:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646343864; x=1677879864; h=message-id:date:mime-version:to:cc:references:from: subject:in-reply-to:content-transfer-encoding; bh=keicInxUEAKxeWmCP5NXaijHvEQLxflKToeZQsAFpxQ=; b=Q6GyVJuocg+KkPFz6557jyaAUhLTl4PnIvyJ+3p2Dzb25cdU3rj1tDTP BdWkHn+aB/olxWgVOVB8O8i74bVEHRtieWXyBAaRHCWTuUgrVP3Mo39uV purF0hRBNSk2La0MXs+MqZBYqGKnpjMmZ9TpoEzznmytalSBBIZp5t8qI sNtDUbquu2BLfT1LY3himT9XCFwDYqQyKm9ZQySJDnezZ+V37vQd3nFlm D1cxZlE6zm7nMqoV4c+6L9D3Ng9w0jt8SBWxizf8roHqcqDpQW70nJ1Zx eaIxik9AEBviI7q+n9yCImZiU6ZOInDKcNUzLQoqeCO8Zty37zn/c5Cpn g==; X-IronPort-AV: E=McAfee;i="6200,9189,10275"; a="252646611" X-IronPort-AV: E=Sophos;i="5.90,153,1643702400"; d="scan'208";a="252646611" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2022 13:44:23 -0800 X-IronPort-AV: E=Sophos;i="5.90,153,1643702400"; d="scan'208";a="642280146" Received: from eabada-mobl2.amr.corp.intel.com (HELO [10.209.6.252]) ([10.209.6.252]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2022 13:44:23 -0800 Message-ID: Date: Thu, 3 Mar 2022 13:44:14 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: Reinette Chatre , Haitao Huang , Jarkko Sakkinen Cc: "Dhanraj, Vijay" , "dave.hansen@linux.intel.com" , "tglx@linutronix.de" , "bp@alien8.de" , "Lutomirski, Andy" , "mingo@redhat.com" , "linux-sgx@vger.kernel.org" , "x86@kernel.org" , "Christopherson,, Sean" , "Huang, Kai" , "Zhang, Cathy" , "Xing, Cedric" , "Huang, Haitao" , "Shanahan, Mark" , "hpa@zytor.com" , "linux-kernel@vger.kernel.org" References: <4ce06608b5351f65f4e6bc6fc87c88a71215a2e7.1644274683.git.reinette.chatre@intel.com> <2d2d3471-78ce-9faa-daf6-138078f5ffaa@intel.com> <6f65287a-f69c-971e-be2c-929e327e7ff9@intel.com> <19155cab-ecff-a8a6-f724-98c4535642ef@intel.com> From: Dave Hansen Subject: Re: [PATCH V2 16/32] x86/sgx: Support restricting of enclave page permissions In-Reply-To: <19155cab-ecff-a8a6-f724-98c4535642ef@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/3/22 13:23, Reinette Chatre wrote: > Unfortunately MAP_POPULATE is not supported by SGX VMAs because of their > VM_IO and VM_PFNMAP flags. When VMAs with such flags obtain this capability > then I believe that SGX would benefit. Some Intel folks asked for this quite a while ago. I think it's entirely doable: add a new vm_ops->populate() function that will allow ignoring VM_IO|VM_PFNMAP if present. Or, if nobody wants to waste all of the vm_ops space, just add an arch_vma_populate() or something which can call over into SGX. I'll happily review the patches if anyone can put such a beast together.