Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7214016ybi; Wed, 5 Jun 2019 13:16:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwhGO/K316AxmmGquO6XUr6S+V0ufSjRDuBygv+LQfHpcNDqB65QOGn+pdkqUdGdsz7EvkW X-Received: by 2002:a63:1925:: with SMTP id z37mr706955pgl.251.1559765793837; Wed, 05 Jun 2019 13:16:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559765793; cv=none; d=google.com; s=arc-20160816; b=F+xM6Xa0noG4cRfhXPFzpj1MPDHhxzCpjaxh0cxkdsldkY0KXz9WvQ0uHJQ2BRulno cru1g+URnYy/BPw7LNbYHbgdI5RnuqNDiJGlOSqU3kF1iyHoy4l5gr9EGzo7ztYR/w/7 9Z4vEgp7j/8mGrKLhJOQnMTQcfCINCZiZeVBb8ancAhLLG2+QKBSjGqkWF5KN+HJgrxk VX6w/SEHR45nX+hBbFQ/msw9QG1I1ljmc6uxqZIacuZZsOe5erzmCSaIZyAh9YDx3Tnl mzRSeyGCP01pwHsNWZAiq1HVWPVb9Hcfv2TEsFRiJZfK23BO0fpIripP9JOSBs9mHQSF /zIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=znk5vD5rMbn5z4a3+WKbn3kzpOM9HaH0Z0fJiM8Yq8Y=; b=e8qjrEXOG+Piv4bJTIocwtOv4i9O7pMtI3s74EuBIt9TNeHE/7nd5464RdoB7H9TgV HrE0poWnVwU4uG8aL7l52zqDEKNs7+AQEzl1wKvvkFDe/D+jW5C7QJ83RdCNoWO4HBtt O/MVq5XdMPlXZP2aCgHzSp89TnMyKM/Eep/2fLHilIkFwQK0a1TrEL3rZcEFypKnGV9h l+2ZWx6ho7uALOwoYdulFuOW8I61o04PviL1qP3gZlEsCykplnOiyToKsMikTyV5CMY2 R6Z6LHprghYLyxw0cj/5mZcLYlmMIyUL45nq0YJoNK/IDK5wqkVljATRes/OCzHPwGHa tUvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=cmnRJyjY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i2si27740255pgl.282.2019.06.05.13.16.16; Wed, 05 Jun 2019 13:16:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=cmnRJyjY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726554AbfFEUOH (ORCPT + 99 others); Wed, 5 Jun 2019 16:14:07 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:33154 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726502AbfFEUOH (ORCPT ); Wed, 5 Jun 2019 16:14:07 -0400 Received: by mail-pf1-f193.google.com with SMTP id x15so5661pfq.0 for ; Wed, 05 Jun 2019 13:14:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=znk5vD5rMbn5z4a3+WKbn3kzpOM9HaH0Z0fJiM8Yq8Y=; b=cmnRJyjY3QFQ+BQOSejlOb1DI3VR7qg0TxLdoYYyAOnIePiy2kqrOVzKDPJKqyKt9q 6q6cFyKC3bXadxZhDLpIDnTiAj8qBNzlGCp37zCdo1f6DCz1Pm3E2QJGiuEr6GohiQn+ Vr98wk6xFFOxQ30tZJaRSGuwppW7Qtx7FFdY0fNjUohl14NwFJNhUVubaWb2DCq6mNWh k/b5SlOspVX9Czxbn2EeK2gY+egCxGLPlimc5AjRPkJ5g5YN2ALuFTsFJgULIkd8aurI DcuI0FhRG8rGZm95wu9C/ee/tWCwSl6UO3MZ8pJFxkXgv9nFwH56xau/aFS4XvtaKP9V Qx1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=znk5vD5rMbn5z4a3+WKbn3kzpOM9HaH0Z0fJiM8Yq8Y=; b=NIosKlx8kPCJoIrnR8sQh2JEvjVbUjt44DoUvcXAXKko9hafOlGC+2L9TZNyegcEyl P4r1aG/Wc1x0LQ1jLO1ZgBuHali5YeHDxZNW+M/xRIPAp3d/wh1VD+vuZCW/wNtdyM27 yi8roslHhfiK3XPsMGebfL+ZLG8ql5jqTnWfvAM+WjlliF0wC7zt5m3MszQqBTOsouhM l53psnIckMX6cbycP0gNk2JczHo5Qys4l4JK8DqtGM8ky/3Az54sYzLFkcMX766G4o8p /RHDQtOp1QJwj+HU5KpSaYzO+ERKQ/VCH/CSg3xVx8/AwritPTtvB20ccgyExNJroNif mnuw== X-Gm-Message-State: APjAAAUwy9fdwbcDRomnJd2oVwmyvVPzWtMyAfTiZ3XecfrsQizP9djN iRWm/3Ax+g5m7wcsI3quklwdeg== X-Received: by 2002:a17:90a:8409:: with SMTP id j9mr47854496pjn.2.1559765646373; Wed, 05 Jun 2019 13:14:06 -0700 (PDT) Received: from ?IPv6:2601:646:c200:1ef2:31dd:a2eb:ca:4a50? ([2601:646:c200:1ef2:31dd:a2eb:ca:4a50]) by smtp.gmail.com with ESMTPSA id c6sm42250854pfm.163.2019.06.05.13.14.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jun 2019 13:14:05 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [RFC PATCH 2/9] x86/sgx: Do not naturally align MAP_FIXED address From: Andy Lutomirski X-Mailer: iPhone Mail (16F203) In-Reply-To: <20190605151653.GK11331@linux.intel.com> Date: Wed, 5 Jun 2019 13:14:04 -0700 Cc: "Xing, Cedric" , Andy Lutomirski , "Christopherson, Sean J" , Stephen Smalley , James Morris , "Serge E . Hallyn" , LSM List , Paul Moore , Eric Paris , "selinux@vger.kernel.org" , Jethro Beekman , "Hansen, Dave" , Thomas Gleixner , Linus Torvalds , LKML , X86 ML , "linux-sgx@vger.kernel.org" , Andrew Morton , "nhorman@redhat.com" , "npmccallum@redhat.com" , "Ayoun, Serge" , "Katz-zamir, Shay" , "Huang, Haitao" , Andy Shevchenko , "Svahn, Kai" , Borislav Petkov , Josh Triplett , "Huang, Kai" , David Rientjes , "Roberts, William C" , "Tricca, Philip B" Content-Transfer-Encoding: quoted-printable Message-Id: <5A85C1D7-A159-437E-B42A-3F4254E07305@amacapital.net> References: <20190531233159.30992-1-sean.j.christopherson@intel.com> <20190531233159.30992-3-sean.j.christopherson@intel.com> <20190604114951.GC30594@linux.intel.com> <960B34DE67B9E140824F1DCDEC400C0F654EDBDE@ORSMSX116.amr.corp.intel.com> <20190605151653.GK11331@linux.intel.com> To: Jarkko Sakkinen Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jun 5, 2019, at 8:17 AM, Jarkko Sakkinen wrote: >=20 >> On Tue, Jun 04, 2019 at 10:10:22PM +0000, Xing, Cedric wrote: >> A bit off topic here. This mmap()/mprotect() discussion reminds me a >> question (guess for Jarkko): Now that vma->vm_file->private_data keeps >> a pointer to the enclave, why do we store it again in vma->vm_private? >> It isn't a big deal but non-NULL vm_private does prevent mprotect() >> from merging adjacent VMAs.=20 >=20 > Same semantics as with a regular mmap i.e. you can close the file and > still use the mapping. >=20 >=20 The file should be properly refcounted =E2=80=94 vm_file should not go away w= hile it=E2=80=99s mapped.=