Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp89798rwb; Thu, 6 Oct 2022 15:03:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7UHInO1uW8MwE7pxT4MlC1/F71iQ51+XNsmxXcOPdImgphszFKniYH0YFr1j/9DZ43sTww X-Received: by 2002:aa7:cb18:0:b0:452:9071:aff with SMTP id s24-20020aa7cb18000000b0045290710affmr1783061edt.194.1665093803908; Thu, 06 Oct 2022 15:03:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665093803; cv=none; d=google.com; s=arc-20160816; b=Y2O/MCSddhDnWK4hwB4+Wzuxqetb+X8XNpaCgwVaznXcAeyQmAuBxH0V91+E8ZDbvK Dbdi6M6NmUIey46r/N8XQJmogeqsr9px3Gmxk9lod1BWpO07+MIpIquoaA7iic/uLqon fwoadS8VXWvF5O0VYemzY/sB1m6I194+KeLSjudOZnqwAQhep7DCCpTKynd0+l9X5Lzh XGyVo6kkI39ZDGH+PXR1HV+0gjF90AEWb9GWDXMTDu1iMROe/HDvRr5qysbzq5UNa3Qx C9wHUC+F9MnsriCwIsTIo+R0h7fBYe+gvlrFdGvuVFftko3Oc84keoi44/kk55OBWlbe m3oQ== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=hINcX/jbM0RnWIifljmCylzRSBF8AqNMxy3m9LLFbRE=; b=Z/eba9XO4nmcpUDCHSm1tpzp0LiXujmanS2qfqcUNgXe2O2haHOZS1u12o0dd5Folm 8HhEGVNsa4aTCmXPtHb4c4jloDlU8WBdq0MxTNhs36OYM2h0zxc7GcYzadRtZHfB+Bcc D2GFuMmvLgoUPD08Wj7L6yzR9OXfPmaguBHe/kAzoMrJsfH3koWCSCeVPl1koDkHNk96 oFy29GtoPvJbW0wjcRozKUjcIlrekUw6i+mNSP6asyO4UVjtV8p3PLuJptmMrE9be8ud VUbDxdh2pQ3+kfnMqdayLFlBb6Nu20z2vHvl1B2flvbMgPp/+mZIjJODEdyF0O4oGz0d aDqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NXodHHby; 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 c30-20020a50d65e000000b00452dfa2bb27si417007edj.134.2022.10.06.15.02.51; Thu, 06 Oct 2022 15:03:23 -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=NXodHHby; 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 S232156AbiJFUqA (ORCPT + 99 others); Thu, 6 Oct 2022 16:46:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229540AbiJFUp6 (ORCPT ); Thu, 6 Oct 2022 16:45:58 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2190BE2D7; Thu, 6 Oct 2022 13:45:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665089157; x=1696625157; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=OwJ1ROhRXZmye0Wodpt5I0o6ytjW0KtspOAjyDYbTpc=; b=NXodHHbywNd7aDXfMNLCEtHsyk5uQ3CUBS7beOTGOYGqhwctv0c/bFMi eTxV+vLwpCJx/dDE19EcA3WMundae/RNtLxLZLmktlf6dTy0yt46RzIgK I2jqjWe1wxJKb3ARrVtH7bqkWmFA2QVhMm8r1ybj2h4A6+NQ+xYbzr9S1 iqQRDB0KdjvNOPK+GLpIP5xvu1NhantgVCjZf8yiS2qyChta/4toggijZ V9o8sUcQzfLdIWSgmSkRf53O25TAESxFtoIcR1IqbS7Qr63eusrn8xyCt 4P4zIxSfK5PkuIm/vgOwXagUV+kyOq3m1IsNDHy8X3gLDJQRB/9twSe39 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10492"; a="329999364" X-IronPort-AV: E=Sophos;i="5.95,164,1661842800"; d="scan'208";a="329999364" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2022 13:45:57 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10492"; a="655769471" X-IronPort-AV: E=Sophos;i="5.95,164,1661842800"; d="scan'208";a="655769471" Received: from jlcone-mobl1.amr.corp.intel.com (HELO [10.212.128.129]) ([10.212.128.129]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2022 13:45:57 -0700 Message-ID: Date: Thu, 6 Oct 2022 13:45:56 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] x86/sgx: Replace kmap/kunmap_atomic calls Content-Language: en-US To: "Fabio M. De Francesco" , linux-kernel@vger.kernel.org, linux-sgx@vger.kernel.org, Jarkko Sakkinen , Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Kristen Carlson Accardi Cc: ira.weiny@intel.com References: <20220929160647.362798-1-kristen@linux.intel.com> <3694452.kQq0lBPeGt@mypc> From: Dave Hansen In-Reply-To: <3694452.kQq0lBPeGt@mypc> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.5 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_HI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 10/6/22 13:37, Fabio M. De Francesco wrote: > kmap() were not suited in those cases because it might sleep. If the intents > of the author are simply map a page while in atomic, so to avoid sleeping in > atomic bugs, your conversions looks good. > > For the reasons above, can you please say something more about why this code > needed a kmap_atomic() instead of calling kmap()? This question is backwards. kmap_atomic() is the default that folks use. You use kmap_atomic() *always* unless you _need_ to sleep or one of the other kmap()-only things. Folks don't and shouldn't have to explain why this was using kmap_atomic().