Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp583539imd; Sat, 3 Nov 2018 06:23:27 -0700 (PDT) X-Google-Smtp-Source: AJdET5cfdiZUW9yZxmGC48Cce7U9P77Rb1be+O/Un7l4UzVm/qtElRGHgKNT4Is58LXuLjq+aDyl X-Received: by 2002:a17:902:380c:: with SMTP id l12-v6mr15456750plc.37.1541251407523; Sat, 03 Nov 2018 06:23:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541251407; cv=none; d=google.com; s=arc-20160816; b=h5vqI5U9nWqtqgJiLIRnuN4jcJhNOX62UDs5R1YnOEjNsUJebqWb9ELComf+CGL0xn ynMnvsfj3bPrjA1I4xp/jyJ7xKowT2m7GEEnVS7TpvJpzLqyeAtaLmnJn497B6yTRhQA n4XC6Vr30IGc8IUKjAADH0kZBlQKeV82sIJDWaIVxts7FnQXiha0Fe0LCDy4dg5UKZde ORGItPEFon4C4k0bTnbY7y/yAWz5b3LhP7jV2D3jJzzL2DozcdYTtFMa85a03svievca /Avri4F6ZnBKoRD11MFHFbrJiwi+zFqPwty58TXJYaW8RrbayBB0drWKzdr+iZAr0GYt i6PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JzSMpRov2s5eQW704mg4yHFih2u2ihs5fs+BX5Ru0dE=; b=dW0WIoVnbmLMSAv6cZ2RmHrrUqZeRqw9X0vhBTaHqyaVpzhbil0MapxxI7bdMmVWC/ UIq0YFf5IrWh80C7ZJ0ZaIpF4WW8UONZEe6aP1V+CE3jdeJxSTB39mtp0P+EoFNC0OBG beFLgATi9wvjfp680SqmILyh1aW3ArbiQ0zXtF9sDK+E+aJKzXa3OKf0l4eo3+uUURhW HZlN1fmzQc/37MjFi49+YsTu0o2WCs70eOvY2FGSmDB2f95rW62ilgptPnAwiphPny0c rkve6P/q+t5W2bE1daxIv92IBqFuMAonSjjUtrFyneDYARPbF5qlPxCMLgs8XX4eiqpz O2gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Jxi/Qk2v"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z66-v6si2865420pfb.104.2018.11.03.06.23.10; Sat, 03 Nov 2018 06:23:27 -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=@gmail.com header.s=20161025 header.b="Jxi/Qk2v"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728593AbeKCWeH (ORCPT + 99 others); Sat, 3 Nov 2018 18:34:07 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:32914 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727658AbeKCWeH (ORCPT ); Sat, 3 Nov 2018 18:34:07 -0400 Received: by mail-qk1-f194.google.com with SMTP id o89so7606022qko.0; Sat, 03 Nov 2018 06:22:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JzSMpRov2s5eQW704mg4yHFih2u2ihs5fs+BX5Ru0dE=; b=Jxi/Qk2vy3iBWqxV0m6A+4uiPQNnUPmH0EY2cPkzYsG+AbQ5upjSkwBssnjg7+2QeD 043ZTLFfbkMlgR4wNkia5dmCH0wignz5IzM8VOYE/VYKPw5ozinfo+cKWwcwzHjzkrCN gVDOKmeklZNTRVD/tQGw+nSnJPXPGvyDgIHKKFpbX97x5cydwxPDyRMiHdUNN8XPdggM DAsU25zrNnxVURQcxE1mLnW0nyvkZKvibyCg8h4D9Vzko30JdyAB3UTNypxcPyWjZ4qz Lk/hVW73iGozLQ/uOjF1+VaitFjgdmaKP3x+Y+uaRKtb/k4bsI9pYmrIqS1g3VHE+79j aPew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JzSMpRov2s5eQW704mg4yHFih2u2ihs5fs+BX5Ru0dE=; b=Q1s17Ek05mAqjAF3/pXko64DyT8asElOk4f3GehKBuHb6jZgPXQkIeNbWRP2mjMWYW 9pqKJrNM5BpEoOMHbMcywd5q9leIIoa7Fn76YheM1UCxNiM3Ih0lw6Oy1Gf3L1DPhgyt U/HTkl3GQ51ZJRki9flsS8i+xZIFYWAEbnSgE2DfOJjjdgLtVH8VJWSU0q3btWk2/ZuS upNHcqKiLzybh70rYi0q96+10nXjtY5DmSwYp5s8N0eJxP99NXQ8zgJgvitl4Wl8AAVp RzzR6+KRlPRxZa9EyJwg/tBhWQNOSRDdu+c09Q1Kgdl7+QfmQ8MEOsG+D43AkDPta+H8 bYrg== X-Gm-Message-State: AGRZ1gJWmJ+UZW51a9R6qHtVmxN6B5kLXqIjAixJ6EkQo7TLqqsa153J jZzAAdPHQuzfm5u5q+jfU0Mv8lyKeUXzXAA3ivk= X-Received: by 2002:a0c:d268:: with SMTP id o37mr14686970qvh.136.1541251366132; Sat, 03 Nov 2018 06:22:46 -0700 (PDT) MIME-Version: 1.0 References: <20181102231320.29164-1-jarkko.sakkinen@linux.intel.com> <20181102231320.29164-17-jarkko.sakkinen@linux.intel.com> In-Reply-To: <20181102231320.29164-17-jarkko.sakkinen@linux.intel.com> From: Andy Shevchenko Date: Sat, 3 Nov 2018 15:22:34 +0200 Message-ID: Subject: Re: [PATCH v15 16/23] x86/sgx: Enumerate and track EPC sections To: Jarkko Sakkinen Cc: "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Platform Driver , linux-sgx@vger.kernel.org, Dave Hansen , sean.j.christopherson@intel.com, nhorman@redhat.com, npmccallum@redhat.com, serge.ayoun@intel.com, shay.katz-zamir@intel.com, haitao.huang@intel.com, mark.shanahan@intel.com, Andy Shevchenko , suresh.b.siddha@intel.com, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Reinette Chatre , "Rafael J. Wysocki" , "Kirill A. Shutemov" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 3, 2018 at 1:17 AM Jarkko Sakkinen wrote: > > From: Sean Christopherson > > Enumerate Enclave Page Cache (EPC) sections via CPUID and add the data > structures necessary to track EPC pages so that they can be allocated, > freed and managed. As a system may have multiple EPC sections, invoke > CPUID on SGX sub-leafs until an invalid leaf is encountered. > > On NUMA systems, a node can have at most one bank. A bank can be at > most part of two nodes. SGX supports both nodes with a single memory > controller and also sub-cluster nodes with severals memory controllers > on a single die. > > For simplicity, support a maximum of eight EPC sections. Current > client hardware supports only a single section, while upcoming server > hardware will support at most eight sections. Bounding the number of > sections also allows the section ID to be embedded along with a page's > offset in a single unsigned long, enabling easy retrieval of both the > VA and PA for a given page. > + iounmap(section->va); > + section->va = ioremap_cache(addr, size); > + if (!section->va) > + return -ENOMEM; I forgot if it's a place in code on which we discussed ioremap() vs. memremap() call. And I forgot why the conclusion is to leave ioremap(). Sorry, if I'm mistaken. -- With Best Regards, Andy Shevchenko