[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <76e918cf-44ef-4e9b-9e56-84256b637398@intel.com>
Date: Thu, 21 Mar 2024 12:09:57 +1300
From: "Huang, Kai" <kai.huang@...el.com>
To: Isaku Yamahata <isaku.yamahata@...el.com>
CC: <kvm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<isaku.yamahata@...il.com>, Paolo Bonzini <pbonzini@...hat.com>,
<erdemaktas@...gle.com>, Sean Christopherson <seanjc@...gle.com>, Sagi Shahar
<sagis@...gle.com>, <chen.bo@...el.com>, <hang.yuan@...el.com>,
<tina.zhang@...el.com>, Binbin Wu <binbin.wu@...ux.intel.com>, Yuan Yao
<yuan.yao@...el.com>, <isaku.yamahata@...ux.intel.com>
Subject: Re: [PATCH v19 030/130] KVM: TDX: Add helper functions to print TDX
SEAMCALL error
> 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? */
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..
>
> void pr_tdx_sept_error(u64 op, u64 error_code, const union tdx_sept_entry *entry,
> const union tdx_sept_level_state *level_state)
> {
> #define MSG \
> "SEAMCALL (0x%016llx) failed: 0x%016llx entry 0x%016llx level_state 0x%016llx\n"
> pr_err_ratelimited(MSG, op, error_code, entry->raw, level_state->raw);
> }
A higher-level wrapper to print SEPT error is fine to me, but do it in a
separate patch.
Powered by blists - more mailing lists