Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2069691imn; Mon, 1 Aug 2022 10:01:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR5y02qUrckEO2XtUeIxg4Sg9be/4+F9QbB8vQw0bnYitzRUh4E9jLEQYGMxEAIzyvJRlHtp X-Received: by 2002:a17:902:f549:b0:16d:68cd:f26 with SMTP id h9-20020a170902f54900b0016d68cd0f26mr17721470plf.70.1659373283627; Mon, 01 Aug 2022 10:01:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659373283; cv=none; d=google.com; s=arc-20160816; b=E/e4nsG8pFgOaNYaVTjgRCVbPghBTl58+rNFpVFHo5OYUiwmM4xl0o1j+or7fL9lf4 AG9HBVbqoKbdkwbtL/XxYhF1NYlQOQcCd/DH08ytLcTnDPkZ0tvOTkYV/0/apUFKWBdr GTv0AK1yqvafDgF5UMxIrETFdYw5uB4hHA/mgDnFFT+9CzHi9zmRjd/yRGO55lltG5qM lJHEZt2XcBhaX/9S7UdrqXtPNi03+rAcJ4IirCimAU07yAXy3jfVYD3oq4xJgGQrGrSY FRSy04umaqieLzZRdD5A/iRrx9OtzNEBibjGkSFZf2+eISiHADCUeAXUGLaNsHo4s7Xk 2Ijw== 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=j43Nrs/dnG2tCnILiQLS+P/SyNRLeZRgIWooGASbTvs=; b=XGitBkIddEz4RuDmUHwoRmtg/gIVUj1PeTeMGthvwIZSHG654VAgwZ6PQbHMWDwWqS aWMKJouJBiHCK85aB+mY6FVyXhaDUtTnW8Ghj50GF5HfSLNvaBGlF+iY7ZW3aej6gGOD pTXwg+bKTvLV1549FbD8lXUsmk83qezwX4p5gKuSRZRWKIvl7yUp9C4Ii0JFDIFHg7BW iAyMFa6ZIoE49Bbld7uY2VcneKh4FszcyfVWcZ8mQJUOZZ5+nzCUNVRgbPFk4FpoA3pn awdqwfuCj6M6HoT7yLMPbD0TP8ZlrqcFi+gPCjfH5wnnt2G05o1GiLzoEk43D8/eZAPS YCiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RbUUsyqE; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mg17-20020a17090b371100b001f4fc60c4dcsi3585270pjb.6.2022.08.01.10.01.01; Mon, 01 Aug 2022 10:01: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=@kernel.org header.s=k20201202 header.b=RbUUsyqE; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233180AbiHAQkx (ORCPT + 99 others); Mon, 1 Aug 2022 12:40:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234245AbiHAQkt (ORCPT ); Mon, 1 Aug 2022 12:40:49 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B6E5F3D; Mon, 1 Aug 2022 09:40:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id E304BCE176D; Mon, 1 Aug 2022 16:40:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB6C2C433C1; Mon, 1 Aug 2022 16:40:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659372045; bh=ka1KQO7g3lQa9qYWoLj3EEBCib4PxRY+082o/dfbQnQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RbUUsyqEbREZcwQQd4MNED4pvd9uUOw9s1xkvRGamu+tggUC1xVk0kIMXXDP8eCf2 1LN6zOo0ruIlNH5/cAsC9SSRhtD9DXgAyZLoIusS/0BPCoJ0vGfWWn+X2OxYPaofwN 2aXvRYo1ttZ7E/EwGJDwL1+HoXhr0gozy5v3C6p3H2aFIWN18lm6Z6181zB8tGaEbz aHc4Co+z5UM3pjQy9H9/cocliBrRKAieTWzd9JCJvlAZcwpkZsMI5KA4mU1VbKiS0/ lwoNDnEZgEM85LX6r9albcAiEpaoHMhzTmEt+euWry54yqMuJae//xfrYLkc5E8NeQ Rb8/+18wmPlvg== Date: Mon, 1 Aug 2022 19:40:39 +0300 From: Jarkko Sakkinen To: Dave Hansen Cc: Kristen Carlson Accardi , linux-kernel@vger.kernel.org, Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , linux-sgx@vger.kernel.org Subject: Re: [PATCH] x86/sgx: Improve comments for sgx_encl_lookup/alloc_backing() Message-ID: References: <20220720182120.1160956-1-kristen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Thu, Jul 28, 2022 at 06:47:01AM -0700, Dave Hansen wrote: > On 7/28/22 00:58, Jarkko Sakkinen wrote: > > On Wed, Jul 20, 2022 at 11:21:19AM -0700, Kristen Carlson Accardi wrote: > >> Modify the comments for sgx_encl_lookup_backing() and for > >> sgx_encl_alloc_backing() to indicate that they take a reference > >> which must be dropped with a call to sgx_encl_put_backing(). > >> Make sgx_encl_lookup_backing() static for now, and change the > >> name of sgx_encl_get_backing() to __sgx_encl_get_backing() to > >> make it more clear that sgx_encl_get_backing() is an internal > >> function. > >> > >> Signed-off-by: Kristen Carlson Accardi > > The rename is unnecessary. > > Well, it was done to address some reviewer confusion: > > https://lore.kernel.org/all/YtUs3MKLzFg+rqEV@zn.tnic/ > > I wouldn't call it unnecessary. Heck, I'd argue that the one of the > main reasons that this code leaked memory in the first place was the > naming and lack of comments. Maybe the rename should be its own patch with this tag in the commit: Link: https://lore.kernel.org/all/YtUs3MKLzFg+rqEV@zn.tnic/ BR, Jarkko