Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp906347rwd; Wed, 7 Jun 2023 08:22:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4iXzyDdxgM0Cq4lJ+9lNyFsIMBiZTWu+9o4/qVBs+me652cKTvncqYZ8ICrh6SMdWFihOV X-Received: by 2002:a17:90a:f296:b0:259:3d01:c151 with SMTP id fs22-20020a17090af29600b002593d01c151mr1806839pjb.21.1686151370929; Wed, 07 Jun 2023 08:22:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686151370; cv=none; d=google.com; s=arc-20160816; b=Xitinywee9RfYaLYRv7OXViJ4vIj0eg/iH/CflvIJuj/zyCKcpg+Q4RlQox11NIgxS 32CjUl/ORR6NK2Ux5VSsTqQ9h1UdQsetguECT2JwCZ9E8DyX6Zh0QCSvGVo/yB3gAxNT XGugP7/KoCixTGtQkzWg2oeZ6cuJaSbkRqVBLlajUrfVxKRc6j5fAEY1JouTddSUHUzQ 9+ThLu3n9qgeUGFr0JjvmzT0iFtCtIDknPu2ZC0Ofu3YNPpfRHDV5lTDGlA4N6WPUMHH GNjvvxFHio0mI1lPESGaCXw5SYKy4KHGMXxaTDSeRM6wSo9blF61yc7XhHTq3eRWLgPd oK+A== 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=4/xucj685Se4gBbsQEPrRz3ldHSMxMdFZo78dqEYtjo=; b=mvd0kQqLu2xO4rIgdi1SMs4l98ivV/4+wRkp9Mg3tcPSKBmFhDK+RoP7AI/n1kRf9t BhVgNuj2LQg/2kzI0I6/lU1PWxFj/JVVE+ep5oVbght+YcPM2UTW7ES1mDiw6oELMhQQ 6FtAxLoZFTC8VKRt6fOP4kdnc9EPq7Je9ybgeFZE6f3ijuiM8n8jMPYet0VKaaU1H3UJ JLVPmrlulfEMkqSjLrezQhM2MT8JXc4hjye4gO8j8EGqHlme7mAX+fsxRX56weVOT83G qkhFJz7u7d6SVwxg81io/hxE91Q8qfsgIVmJb63EdU8kZRRbU9CRLKQn/b4cfHnOpDfs TzIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MUffKpnw; 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 r16-20020a638f50000000b00530b135eae9si9194389pgn.119.2023.06.07.08.22.36; Wed, 07 Jun 2023 08:22:50 -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=MUffKpnw; 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 S241237AbjFGPJS (ORCPT + 99 others); Wed, 7 Jun 2023 11:09:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241203AbjFGPJQ (ORCPT ); Wed, 7 Jun 2023 11:09:16 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7EC910CE; Wed, 7 Jun 2023 08:09:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686150556; x=1717686556; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=dkmBvMVEaR9WNW+FaDgHJkj5zFLkk93xq/0IXE9EB+g=; b=MUffKpnwGQiDtCmRZi0aPpyVYMgc24omjp7rpIKBn9Ga4PJD6wlp1dt6 bxhe1l5EzWZR25HziAp19BbbsnPykFfhI5JySryuHebDCkYgO+NF2c/VK 5QPiExBBAkC+PpxeXg/fcbdJ4tKXyehkUqLbcm/4upnMHJbhzlZqur5rJ 59/NUFEA64EchBlM1HszA/2g77RCYR8207MA9Ht9VIFjERdYryiqFPeCt Lz0OobH6ZVVWuIBTY3OFAl4LZ7ZCCRjE560DFWNZT/qTq88t1U4koMayZ np4L8GdS6kG5uKa+BrFWnATqEarfxyndIz78RPkHQKFjehCxBWbMTpU5K w==; X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="337376317" X-IronPort-AV: E=Sophos;i="6.00,224,1681196400"; d="scan'208";a="337376317" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2023 08:08:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="687032427" X-IronPort-AV: E=Sophos;i="6.00,224,1681196400"; d="scan'208";a="687032427" Received: from vsmyers-mobl2.amr.corp.intel.com (HELO [10.212.146.233]) ([10.212.146.233]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2023 08:08:48 -0700 Message-ID: <1e58e3df-ae9a-607c-cfc3-4f3d033ed531@intel.com> Date: Wed, 7 Jun 2023 08:08:48 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v11 06/20] x86/virt/tdx: Handle SEAMCALL running out of entropy error Content-Language: en-US To: Kai Huang , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: linux-mm@kvack.org, kirill.shutemov@linux.intel.com, tony.luck@intel.com, peterz@infradead.org, tglx@linutronix.de, seanjc@google.com, pbonzini@redhat.com, david@redhat.com, dan.j.williams@intel.com, rafael.j.wysocki@intel.com, ying.huang@intel.com, reinette.chatre@intel.com, len.brown@intel.com, ak@linux.intel.com, isaku.yamahata@intel.com, chao.gao@intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, bagasdotme@gmail.com, sagis@google.com, imammedo@redhat.com References: <9b3582c9f3a81ae68b32d9997fcd20baecb63b9b.1685887183.git.kai.huang@intel.com> From: Dave Hansen In-Reply-To: <9b3582c9f3a81ae68b32d9997fcd20baecb63b9b.1685887183.git.kai.huang@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.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_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 6/4/23 07:27, Kai Huang wrote: > Certain SEAMCALL leaf functions may return error due to running out of > entropy, in which case the SEAMCALL should be retried as suggested by > the TDX spec. > > Handle this case in SEAMCALL common function. Mimic the existing > rdrand_long() to retry RDRAND_RETRY_LOOPS times. ... because who are we kidding? When the TDX module says it doesn't have enough entropy it means rdrand. Reviewed-by: Dave Hansen