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]
Date:   Wed, 28 Jun 2023 11:09:43 +0800
From:   Chao Gao <chao.gao@...el.com>
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>,
        <peterz@...radead.org>, <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>,
        <sathyanarayanan.kuppuswamy@...ux.intel.com>,
        <nik.borisov@...e.com>, <bagasdotme@...il.com>, <sagis@...gle.com>,
        <imammedo@...hat.com>
Subject: Re: [PATCH v12 05/22] x86/virt/tdx: Add SEAMCALL infrastructure

>+/*
>+ * Wrapper of __seamcall() to convert SEAMCALL leaf function error code
>+ * to kernel error code.  @seamcall_ret and @out contain the SEAMCALL
>+ * leaf function return code and the additional output respectively if
>+ * not NULL.
>+ */
>+static int __always_unused seamcall(u64 fn, u64 rcx, u64 rdx, u64 r8, u64 r9,
>+				    u64 *seamcall_ret,
>+				    struct tdx_module_output *out)
>+{
>+	u64 sret;
>+	int cpu;
>+
>+	/* Need a stable CPU id for printing error message */
>+	cpu = get_cpu();
>+	sret = __seamcall(fn, rcx, rdx, r8, r9, out);
>+	put_cpu();
>+
>+	/* Save SEAMCALL return code if the caller wants it */
>+	if (seamcall_ret)
>+		*seamcall_ret = sret;

Hi Kai,

All callers in this series pass NULL for seamcall_ret. I am no sure if
you keep it intentionally.

>+
>+	switch (sret) {
>+	case 0:
>+		/* SEAMCALL was successful */

Nit: if you add

#define TDX_SUCCESS	0

and do

	case TDX_SUCCESS:
		return 0;

then the code becomes self-explanatory. i.e., you can drop the comment.

>+		return 0;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ