[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230628130256.GB2438817@hirez.programming.kicks-ass.net>
Date: Wed, 28 Jun 2023 15:02:56 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Kai Huang <kai.huang@...el.com>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
linux-mm@...ck.org, x86@...nel.org, dave.hansen@...el.com,
kirill.shutemov@...ux.intel.com, tony.luck@...el.com,
tglx@...utronix.de, bp@...en8.de, mingo@...hat.com, hpa@...or.com,
seanjc@...gle.com, pbonzini@...hat.com, david@...hat.com,
dan.j.williams@...el.com, rafael.j.wysocki@...el.com,
ashok.raj@...el.com, reinette.chatre@...el.com,
len.brown@...el.com, ak@...ux.intel.com, isaku.yamahata@...el.com,
ying.huang@...el.com, chao.gao@...el.com,
sathyanarayanan.kuppuswamy@...ux.intel.com, nik.borisov@...e.com,
bagasdotme@...il.com, sagis@...gle.com, imammedo@...hat.com
Subject: Re: [PATCH v12 06/22] x86/virt/tdx: Handle SEAMCALL running out of
entropy error
On Tue, Jun 27, 2023 at 02:12:36AM +1200, Kai Huang wrote:
> cpu = get_cpu();
> - sret = __seamcall(fn, rcx, rdx, r8, r9, out);
> +
> + /*
> + * Certain SEAMCALL leaf functions may return error due to
> + * running out of entropy, in which case the SEAMCALL should
> + * be retried. Handle this in SEAMCALL common function.
> + *
> + * Mimic rdrand_long() retry behavior.
Yeah, except that doesn't have preemption disabled.. you do.
> + */
> + do {
> + sret = __seamcall(fn, rcx, rdx, r8, r9, out);
> + } while (sret == TDX_RND_NO_ENTROPY && --retry);
> +
> put_cpu();
Powered by blists - more mailing lists