From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CA60C433FE for ; Wed, 23 Feb 2022 12:25:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240420AbiBWMZ0 (ORCPT ); Wed, 23 Feb 2022 07:25:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231725AbiBWMZY (ORCPT ); Wed, 23 Feb 2022 07:25:24 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFE7F9E57A; Wed, 23 Feb 2022 04:24:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645619097; x=1677155097; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=zk0Q5i+bK10PCCeKqTaU8DiX28bSdfCtroqlbdMjIsw=; b=VzF59Pdw9GCOhByXXwRYpHoq2zlGY7fUAzbJJ9uDYQslGDcd5ZfVkTLa LK336AgK54bZjV4VedRmwWTjfAi8WfD1FBh336AdGAIk4UyH+1I1Bbxnj O5WzNC5pTSvTeQao3oUbtlqQInWlA81OoTPocUWCyRKPl1/L/uolRl9t9 HJVBJYMvLzWwh6Lbr2oTPpn9gajLplY63YspJwQBa+TWx6MJnCtgxQ0kP zU+USK9A6zmP9FEdb+3ibx/7CTo09bQJFatKu4VZa0fqT2WP1va7b5RWW nO5HqVdAp1haNrQr7AGJ6NcRC3Phray8me+EuLc9Jl2ItlZHWiUshdBYU w==; X-IronPort-AV: E=McAfee;i="6200,9189,10266"; a="251686667" X-IronPort-AV: E=Sophos;i="5.88,390,1635231600"; d="scan'208";a="251686667" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2022 04:24:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,390,1635231600"; d="scan'208";a="781813629" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 23 Feb 2022 04:24:51 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id 1BB0B143; Wed, 23 Feb 2022 14:25:08 +0200 (EET) Date: Wed, 23 Feb 2022 15:25:08 +0300 From: "Kirill A. Shutemov" To: Borislav Petkov Cc: Brijesh Singh , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-coco@lists.linux.dev, Thomas Gleixner , Ingo Molnar , Joerg Roedel , Tom Lendacky , "H. Peter Anvin" , Paolo Bonzini , Sean Christopherson , Andy Lutomirski , Dave Hansen , Peter Gonda , Peter Zijlstra , David Rientjes , Michael Roth , Andi Kleen Subject: Re: [PATCH] x86/mm/cpa: Generalize __set_memory_enc_pgtable() Message-ID: <20220223122508.3nvvz4b7fj2fsr2a@black.fi.intel.com> References: <20220222185740.26228-1-kirill.shutemov@linux.intel.com> <20220223043528.2093214-1-brijesh.singh@amd.com> <20220223115539.pqk7624xku2qwhlu@black.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 23, 2022 at 01:13:03PM +0100, Borislav Petkov wrote: > On Wed, Feb 23, 2022 at 02:55:39PM +0300, Kirill A. Shutemov wrote: > > This operation can fail for TDX. We need to be able to return error code > > here: > > /* Notify hypervisor that we have successfully set/clr encryption attribute. */ > > if (!ret) > > ret = x86_platform.guest.enc_status_change_finish(addr, numpages, enc); > > bool to state failure/success or you need to return a specific value? So far it is only success or failure. I used int and -EIO as failure. bool is enough, but I don't see a reason not to use int. -- Kirill A. Shutemov