Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6532537pxv; Thu, 29 Jul 2021 17:39:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUZ18qgGzSHdlGuqzyo9+jxMN2iLJ5JxR52v/jMLSKTe5KGYyjpRSjo5fB5uI3XiF4KDWj X-Received: by 2002:a92:dad0:: with SMTP id o16mr5562223ilq.65.1627605555296; Thu, 29 Jul 2021 17:39:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627605555; cv=none; d=google.com; s=arc-20160816; b=JGVj2TfDeZ9qZujcmQPVIueiYOmyj0/0+Pzs0UZjqnWbkbmaoxoCfvWeKFEt0RL7Mt PS5naIUiy22WzpxuEStyUWTMyIvfK8skDxfSQbr7nhwhzok6Nfi25ubGKq1A0atuykhw dN+6j2DXGo7suOHS6/R0xmHE+I7J9lFvty/ruI5yec3V14IslB/6WCeltj6cUSmaIG4G TtoT3/A9KjZ1MqLxHR0DfmmlTdlXbmpMMBPA2EGTBEBD6SJH6gH6cXYotaXbn64wjMxn 4/cE0S0IuUWIuKAx6aTmFcaKnb+fIhoKdGPqu68TB6f1ZpZsjHk/OZRwCkQXkMIs0f6p K2FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fZ5bEhFqV0Bf7Gg3puxfD8cw5GkABDhzYc6TIRW9wQA=; b=GG2Y77CUhwCh7si7rXW7YbOTHFyauHKtOFJzUyupG680LIghwASfcxo7qG49mHBpWJ 50FAflesoaYEPuKO9knEn+5QniIumk4oXJSWJ/NBTqDJxaXkea3Z7xthVUa16mFKjshd 3QsWGF/uv3eB3FhFbJMJNt75P4/XL6jgitYj8ZRh/aj6o/RWQr4/HvsZZoZ4yDhYdbcb 3Y5s4d2i8FxbGZuQweHCGilidGpADxmtWDVDVN5l2iVB1kri0n/QytxuoE2LOnxph3XJ mOYjFQqSceFdQs3CgnzRQzblX+T7ojdc4oTtYveh0FiLK/uaEjjj0w4Svy40WF56EUQE 6xBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J8iV6OnG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w5si5504051ilu.14.2021.07.29.17.39.02; Thu, 29 Jul 2021 17:39:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J8iV6OnG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229750AbhG3AiR (ORCPT + 99 others); Thu, 29 Jul 2021 20:38:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:35418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229667AbhG3AiQ (ORCPT ); Thu, 29 Jul 2021 20:38:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 218686023F; Fri, 30 Jul 2021 00:38:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627605493; bh=DfX+ZxhlbuWNGwOZXy813T+ILOgGiQVjjFJs6GFI8mQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=J8iV6OnGNWg7mvwqMnLsh+kFbJAuEXcV7Z1rTyp0HoEsQOusUPpuZ3mVUCcMy2f9g y3ykpNThaPAhysCwLi4FqiP16IMerYtgZ5efkXYii0NiLpfpiLZVoNj+vy+Iw18e6s Y+s6RqFTJLEritohM1PSotIF7CCohDcf6Tcvvwk3NCzqN8BBMtFxPrZWocIIF8pUWd M5w5DSXFpbIz30AAOl2VIQM3W4sf/ts435xablmekuGfC9hPUl/44DjckCMF8h6n+J vIRFfiLW8tlgN94w31gSvYJUNXZ1ieI/m9hDkG1YSN4Jw5rRk2u0p2ivfN4o/OLzo5 //ECdlEPn6V6A== Date: Fri, 30 Jul 2021 03:38:09 +0300 From: Jarkko Sakkinen To: Dave Hansen Cc: Tony Luck , Sean Christopherson , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/7] x86/sgx: Add infrastructure to identify SGX EPC pages Message-ID: <20210730003809.hp3nmqmgyysa45nz@kernel.org> References: <20210719182009.1409895-1-tony.luck@intel.com> <20210728204653.1509010-1-tony.luck@intel.com> <20210728204653.1509010-3-tony.luck@intel.com> <141602a3-ef61-01f0-4a3c-69f8e7012fcd@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <141602a3-ef61-01f0-4a3c-69f8e7012fcd@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 28, 2021 at 03:19:46PM -0700, Dave Hansen wrote: > On 7/28/21 1:46 PM, Tony Luck wrote: > > Export a function sgx_is_epc_page() that simply reports whether an > > address is an EPC page for use elsewhere in the kernel. > > It would be really nice to mention why this needs to be exported to > modules. I assume it's the error injection driver or something that can > be built as a module, but this export was a surprise when I saw it. > > It's probably also worth noting that this is a sloooooooow > implementation compared to the core VM code that does something > analogous: pfn_to_page(). It's fine for error handling, but we should > probably have a comment to this effect so that more liberal use doesn't > creep in anywhere. You could also create an xarray to track physical EPC address ranges, and make the query fast. /Jarkko