Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1749199pxm; Fri, 4 Mar 2022 02:44:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJydjr6IcmpDx31yy9pBefZ3oQeWcWR6zOY56K2dm5EQzui8A4RvpH8VhFxdkHY3bzCZsrVB X-Received: by 2002:a62:8883:0:b0:4f1:922:1a26 with SMTP id l125-20020a628883000000b004f109221a26mr42018276pfd.63.1646390665005; Fri, 04 Mar 2022 02:44:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646390664; cv=none; d=google.com; s=arc-20160816; b=Vhrq3Q37SXpT/JLYuUzca4+Xd+xXQc+3ySoW+AAuWeQO5SYRV+d8PjfoIERDgO2fxS JL2joq+NS5dVeUy4241OUG3Sgtp1OnZ24kjEGkieB6qmHxwxlvfNYaCMNijXx16dFa4z iA/fAByO6W5jJnoWmQLUv8aFQ9KD8sfFzTDvm43MkoQADRYdD1szL/9DHQmrwdYg59R4 f2pdur8ZM32P8jTuQlPfwUNeQuoYPyi0+5VD+3YX7be0KQGG7Kmvl8PlllAPaULuFJYo Na8twV0Q+3wlPJ+HGvTfQhEmkP2JXfVdt8RxJnsePvlMUDovdsBwRZPcKkS15/eWR7k6 NZyg== 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:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=A3zTMSnPi5gjTclYF4ZCHsLNf5s8tkT6USYdrOVwtPo=; b=GHN4gvxptdsq0uJfA6tg8qGWi0vVl39hZeCBFFthx0I/mXUzyNTE2u3VGXPXi7pOLu LSNFBcxJqNSJemyKK77sn0pJY/ywhZcxLQOtkFE7OzRb41pIGKhmlAoxlw+XdThCPpwA MPL0C0OvmmcVACMp6yQTmz2NR3DuqL9SF0g9WRDAcX+8c9T5obd0TtfMOSLoy5B6xqyq YUjeD3330UqMOupyMJ1c+4WGaoNjkZGjNwjA73OyqnP9Qqkg/PvoSsbEDFiCXsv2YBu+ wJSSp8kAw5AdAI0d4LwRHyCaJljN87G++Exx81tVPCEoia2EryzzscdDkSTCyCzgd+VN aHHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Q6GyVJuo; 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 lr2-20020a17090b4b8200b001bf24f533acsi2167692pjb.3.2022.03.04.02.44.08; Fri, 04 Mar 2022 02:44:24 -0800 (PST) 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=Q6GyVJuo; 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 S236629AbiCCVpM (ORCPT + 99 others); Thu, 3 Mar 2022 16:45:12 -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 X-Spam-Status: No, score=-4.8 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,T_SCC_BODY_TEXT_LINE 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 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.