lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1fd0ff586a0f42cf04508e155ae5011859bcb14b.camel@intel.com>
Date: Fri, 22 Mar 2024 04:37:40 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "Yamahata, Isaku" <isaku.yamahata@...el.com>
CC: "Zhang, Tina" <tina.zhang@...el.com>, "isaku.yamahata@...ux.intel.com"
	<isaku.yamahata@...ux.intel.com>, "seanjc@...gle.com" <seanjc@...gle.com>,
	"Yuan, Hang" <hang.yuan@...el.com>, "binbin.wu@...ux.intel.com"
	<binbin.wu@...ux.intel.com>, "Chen, Bo2" <chen.bo@...el.com>,
	"sagis@...gle.com" <sagis@...gle.com>, "isaku.yamahata@...il.com"
	<isaku.yamahata@...il.com>, "Aktas, Erdem" <erdemaktas@...gle.com>,
	"kvm@...r.kernel.org" <kvm@...r.kernel.org>, "pbonzini@...hat.com"
	<pbonzini@...hat.com>, "Yao, Yuan" <yuan.yao@...el.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v19 030/130] KVM: TDX: Add helper functions to print TDX
 SEAMCALL error

On Thu, 2024-03-21 at 16:52 -0700, Isaku Yamahata wrote:
> On Thu, Mar 21, 2024 at 12:09:57PM +1300,
> "Huang, Kai" <kai.huang@...el.com> wrote:
> 
> > > Does it make sense?
> > > 
> > > void pr_tdx_error(u64 op, u64 error_code)
> > > {
> > >          pr_err_ratelimited("SEAMCALL (0x%016llx) failed: 0x%016llx\n",
> > >                             op, error_code);
> > > }
> > 
> > Should we also have a _ret version?
> > 
> > void pr_seamcall_err(u64 op, u64 err)
> > {
> > 	/* A comment to explain why using the _ratelimited() version? */
> 
> Because KVM can hit successive seamcall erorrs e.g. during desutructing TD,
> (it's unintentional sometimes), ratelimited version is preferred as safe guard.
> For example, SEAMCALL on all or some LPs (TDH_MNG_KEY_FREEID) can fail at the
> same time.  And the number of LPs can be hundreds.

I mean you certainly have a reason to use _ratelimited() version.  My point is
you at least explain it in a comment.

> 
> 
> > 	pr_err_ratelimited(...);
> > }
> > 
> > void pr_seamcall_err_ret(u64 op, u64 err, struct tdx_module_args *arg)
> > {
> > 	pr_err_seamcall(op, err);
> > 	
> > 	pr_err_ratelimited(...);
> > }
> > 
> > (Hmm... if you look at the tdx.c in TDX host, there's similar code there,
> > and again, it was a little bit annoying when I did that..)
> > 
> > Again, if we just use seamcall_ret() for ALL SEAMCALLs except VP.ENTER, we
> > can simply have one..
> 
> What about this?
> 
> void pr_seamcall_err_ret(u64 op, u64 err, struct tdx_module_args *arg)
> {
>         pr_err_ratelimited("SEAMCALL (0x%016llx) failed: 0x%016llx\n",
>                            op, error_code);
>         if (arg)	
>         	pr_err_ratelimited(...);
> }
> 

Fine to me.

Or call pr_seamcall_err() instead.  I don't care too much.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ