Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1127275rwi; Thu, 13 Oct 2022 09:22:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5uMnOk1wdfkoruq3oeiq5fQhDhw/hWszYcBvvNz58aUddmreg8Tl4E2wbPxdxWvk5MHv+o X-Received: by 2002:a17:90b:1e4c:b0:20d:8cf0:1a46 with SMTP id pi12-20020a17090b1e4c00b0020d8cf01a46mr656384pjb.164.1665678138937; Thu, 13 Oct 2022 09:22:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665678138; cv=none; d=google.com; s=arc-20160816; b=x5rkjtV4+k3adHmJMCyi7w0qC6eJ3Ql5EQlXkXD2eE8euHDYBFtga4JxWNzyTf8E2k VsBXxkPyz+9oGXeJFi/mOBtIae5jy7vRQ95vC7laY2ES94af/k+QOaFW88TGHqwsDTH+ 6gZRU5XEShLpFA1Uo3qncBzqiNvUFKoDDzIIZ4xPCByG2uFLn3Bd9wT8jIeLiLsylpep Hc51Q8UONOlJEhrPWxO+inFSE89qUwfZ8SvEcYjJpwgn8ZnzM+6eYyJSB2dAIE17xQ0J JQrPhP5IXtGG7qXZso2QzSRPXR7aqrAmMUdjgvwiK62EtEZ0aE8CRdL1SNe7qVBDqv4J DGsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=a+oiXu31xDKr0EHzuX8XBFCyIAi3YCeRXLjNSYeRdhM=; b=L6Y61UJe35JZPlV8PSwUXdF8rDhOYdS+Xe5sJPKBl+Uy4H6QCGIG4ozoxfmDfZWFV8 DkY4POct5V0ksEALqzD9/lFOFNkd3dcelOyG+gXIO8ohd0uUl0M9myY/T6CN8qW+iXp/ Wq7lU23yeY+nURstGo7rtT2mPqglt9BdCw4M+yDDtLpVBPhaQwdAdMKDFSZRwDXQYT84 K4OaacdnO80AXxAvV+fJUm9pXa9Kh4FPo+6Xv5hIDSH2yyI8Ab9jtG3PnXmwnO7QiVlC g8mCqa3Fybs97nbMG8VUtk8zZhr9zwdxTVe+DZsTgUGwC9Qwg8LNkEHRAkalhCRaOG4f du8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Y3baiJRV; 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 z12-20020a634c0c000000b0043a1129e476si22619477pga.340.2022.10.13.09.22.01; Thu, 13 Oct 2022 09:22:18 -0700 (PDT) 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=Y3baiJRV; 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 S229933AbiJMQE0 (ORCPT + 99 others); Thu, 13 Oct 2022 12:04:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229689AbiJMQEW (ORCPT ); Thu, 13 Oct 2022 12:04:22 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 412D11119DD; Thu, 13 Oct 2022 09:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665677061; x=1697213061; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=a+oiXu31xDKr0EHzuX8XBFCyIAi3YCeRXLjNSYeRdhM=; b=Y3baiJRV5BmcSqxklWhQxU8FqYkTUyQLffcOe2b0etJVhxvy3+JT2qRi JT5eSK1HzZgmE6y3XPKQBIXkv5wVaW+JHIZY1OLIZEhYUryVUKYfY+in3 Jr5rPhHnad9t3SvO9cF8iDN3eUKcLRENf9KR+jqcw/IajSlb7i91xJlTy TDzYye7T19Tls/pclcbD5KkicfNHCTWUBwGM5pkT/5XLyyLdJ6R5ZrsTr MalwdMIbjy3EHhKk8UFJ/MFvOFDZ8pBcZvaI1S/pnbfQEh3vBmXgbT+Tn QGKKDflBKuAfxh3zJkVtodH2n/1pGVqY2ycJkjqSNei7bHehlvVLKxMBh w==; X-IronPort-AV: E=McAfee;i="6500,9779,10499"; a="305112177" X-IronPort-AV: E=Sophos;i="5.95,182,1661842800"; d="scan'208";a="305112177" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2022 09:03:16 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10499"; a="872386514" X-IronPort-AV: E=Sophos;i="5.95,182,1661842800"; d="scan'208";a="872386514" Received: from shahidmo-mobl1.amr.corp.intel.com (HELO [10.251.5.146]) ([10.251.5.146]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Oct 2022 09:03:15 -0700 Message-ID: <26cfc85cf1beebc600428e24f12f49c961540071.camel@linux.intel.com> Subject: Re: [PATCH] x86/sgx: Replace kmap/kunmap_atomic calls From: Kristen Carlson Accardi To: Jarkko Sakkinen , Dave Hansen Cc: Ira Weiny , linux-kernel@vger.kernel.org, linux-sgx@vger.kernel.org, Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" Date: Thu, 13 Oct 2022 09:03:01 -0700 In-Reply-To: References: <20220929160647.362798-1-kristen@linux.intel.com> <711f8036-787a-571e-1c0d-1a258175ebb2@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-1.module_f36+15386+a24ad1a3) MIME-Version: 1.0 X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE 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 Wed, 2022-10-12 at 18:50 +0300, Jarkko Sakkinen wrote: > On Wed, Oct 12, 2022 at 05:50:19PM +0300, Jarkko Sakkinen wrote: > > On Wed, Oct 12, 2022 at 07:13:26AM -0700, Dave Hansen wrote: > > > On 10/12/22 00:15, Jarkko Sakkinen wrote: > > > > There's no data to show that this change would be useful to do. > > >=20 > > > Jarkko, I think the overall transition to kmap_local_page() is a > > > good > > > one.=C2=A0 It is a superior API and having it around will pave the wa= y > > > for > > > new features.=C2=A0 I don't think we should demand 'data' for each an= d > > > every > > > one of these. > > >=20 > > > Please take a look around the tree and see how other maintainers > > > are > > > handling these patches.=C2=A0 They're not limited to SGX. > >=20 > > Sure, I'll take a look for comparison. >=20 > Yeah, I think it is pretty solid idea. >=20 > Looking at the decription: >=20 > "It is not necessary to disable page faults or preemption when > using kmap calls, so replace kmap_atomic() and kunmap_atomic() > calls with more the more appropriate kmap_local_page() and > kunmap_local() calls." >=20 > We did not pick kmap_atomic() because it disables preeemption, > i.e. it was not a "design choice". I'd rather phrase this as > along the lines: >=20 > "Migrate to the newer kmap_local_page() interface from kmap_atomic() > in order to move away from per-CPU maps to pre-task_struct maps. > This in effect removes the need to disable preemption in the > local CPU while kmap is active, and thus vastly reduces overall > system latency." >=20 > Can be improved or written completely otherwise. I just wrote it > in the way that I had understood the whole deal in the first place. >=20 > BR, Jarkko Thanks for looking into this Jarkko - I will update the commit log for the next version. Kristen