Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2553894rdg; Mon, 14 Aug 2023 06:22:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGw39HIoursuqn9cb8IAeJ3nmR0EEP7ILnG/fxrigdnF50lRkDAngr1eTHk0Ggtpjr+fjr2 X-Received: by 2002:a17:907:7743:b0:997:e7d9:50f7 with SMTP id kx3-20020a170907774300b00997e7d950f7mr8115940ejc.66.1692019327782; Mon, 14 Aug 2023 06:22:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692019327; cv=none; d=google.com; s=arc-20160816; b=IjcHIfxeLDqiSlwjPaWteko7XfvaTPNHGebpsRTL1dBS1kpeYUxOUeXrkmBYoOJZHD Qg6PXXz/ZMoIOL8F5P0jtKrJsbz3f1QlC1i3toWzltyFeW2qTj3LBLspUkmxPy/G+G4b 0gd6cTgQQW2nXGUzVLW2Od8IPGpeQ73dBtLCzW8kQ+x5JcSkfRTJitR4RxLms+dN++rl jTGM/75+bkn1pZAj5UNvxU7Sfs9ZtDTc1bfPB1V0Gygro51mcAZHVPGcl0rQJbPA8ymL vK+BbQ/RM45BmoJcsPRJPAe5mQaTM51lOlYri9OD5Nm9V4nR214HM+ZHrUAlLVZvtqwg Ndkg== 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=CwtUPOcQ0JSmPG9joS7Jsy94l0Wu6FGllPhroZRoesw=; fh=tgDgutw9IwCs/Kgf8KwcWvqbsh9VgTizdEbpis0y7RA=; b=XObaPKzjJwNwW1D/eIhprt64TBUyfwNxW+A7Wp08zaNX7VLjG3OociZJcwjT8ppzU6 BejGRBQq2lybgJ0FiWV6rZFnNBcIJyaH9LEW1YxEndBmAJeKy9O2rrcx1svQAtgvnlL/ zMrZHS3LwZ1uIn16hF85lewVc7wcE0fF7QTOu9YX4zv0gCXgDxGkaiaf7Ga407LvWuRP Ee7MG+TjBMUpYAOntwuKEZmmWGyeqyqTlIe1hlwfwA3XXZRf3/XhuYGgTsVVw0TXkov6 b66Q/w+MHnWjWFnCel/Hlnjlc6GmyQjiryHmPWEKx+mZ1OpZnpyByMywNY+WX6SkNeU6 eeEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=qz0rQNpK; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f15-20020a170906390f00b0099bc0530efesi7554441eje.453.2023.08.14.06.21.42; Mon, 14 Aug 2023 06:22:07 -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=@infradead.org header.s=desiato.20200630 header.b=qz0rQNpK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234428AbjHNLWV (ORCPT + 99 others); Mon, 14 Aug 2023 07:22:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234542AbjHNLWK (ORCPT ); Mon, 14 Aug 2023 07:22:10 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA7BFFA for ; Mon, 14 Aug 2023 04:22:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=CwtUPOcQ0JSmPG9joS7Jsy94l0Wu6FGllPhroZRoesw=; b=qz0rQNpK8fMbkHdREE5ywA9Z44 MRZBhwNhNjgiOSISK5PlBdd/8RL2TWqH5NheUcedNazezmmK6/vyyYC3oXcA+/rpLEDwZ+t1cty8v zVv9CjI6LMn0m2DiLwBcBoLhUQbRNvGIEPqIiS7y0lArWgxwpxy7kyZ7qaNMz4l25anUv/0vxt58k 61V9cxRr6FDgVzTpmXSoJJS0lMRY7h85ar5H9D9F8xfHViZ9l+7wYjSdf+Vj7ffEM6nxUn0/jNxFY qxWINC1yUtfX8xp+OuKWZzQQMFboa5zwQaHm0hKp6ZATJrR2CPcafi5UWZ2cy1sF6720zQAsLy3KX d5t4qY+g==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qVVdo-00AYBH-2f; Mon, 14 Aug 2023 11:21:45 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 3ABA630020B; Mon, 14 Aug 2023 13:21:44 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 280B420167A97; Mon, 14 Aug 2023 13:21:44 +0200 (CEST) Date: Mon, 14 Aug 2023 13:21:44 +0200 From: Peter Zijlstra To: Dan Williams Cc: linux-coco@lists.linux.dev, Borislav Petkov , Tom Lendacky , Dionna Glaze , Brijesh Singh , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 5/5] virt: sevguest: Add TSM_REPORTS support for SNP_{GET, GET_EXT}_REPORT Message-ID: <20230814112144.GF776869@hirez.programming.kicks-ass.net> References: <169199898909.1782217.10899362240465838600.stgit@dwillia2-xfh.jf.intel.com> <169199901829.1782217.16990408177897780160.stgit@dwillia2-xfh.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <169199901829.1782217.16990408177897780160.stgit@dwillia2-xfh.jf.intel.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Mon, Aug 14, 2023 at 12:43:38AM -0700, Dan Williams wrote: > +static u8 *sev_report_new(struct device *dev, const struct tsm_desc *desc, > + size_t *outblob_len) > +{ > + > + u8 *buf __free(kvfree) = kvzalloc(size, GFP_KERNEL); > + > + > + *outblob_len = size; > + no_free_ptr(buf); > + return buf; This seems broken, no_free_ptr(x) is basically xchg(X, NULL) (except no atomics). So the above would end up being: return NULL; What you want to write is somehting like: return no_free_ptr(buf); or, a convenient shorthand: return_ptr(buf);