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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230614162908.GS2244082@ls.amr.corp.intel.com>
Date:   Wed, 14 Jun 2023 09:29:08 -0700
From:   Isaku Yamahata <isaku.yamahata@...il.com>
To:     "Wang, Wei W" <wei.w.wang@...el.com>
Cc:     Isaku Yamahata <isaku.yamahata@...il.com>,
        "Yamahata, Isaku" <isaku.yamahata@...el.com>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Paolo Bonzini <pbonzini@...hat.com>,
        "Aktas, Erdem" <erdemaktas@...gle.com>,
        "Christopherson,, Sean" <seanjc@...gle.com>,
        "Shahar, Sagi" <sagis@...gle.com>,
        David Matlack <dmatlack@...gle.com>,
        "Huang, Kai" <kai.huang@...el.com>,
        Zhi Wang <zhi.wang.linux@...il.com>,
        "Chen, Bo2" <chen.bo@...el.com>,
        Sean Christopherson <sean.j.christopherson@...el.com>
Subject: Re: [PATCH v14 011/113] KVM: TDX: Add C wrapper functions for
 SEAMCALLs to the TDX module

On Wed, Jun 14, 2023 at 11:45:49AM +0000,
"Wang, Wei W" <wei.w.wang@...el.com> wrote:

> On Friday, June 9, 2023 4:11 AM, Isaku Yamahata wrote:
> > How about this comment?
> > 
> > 	if (unlikely(ret == TDX_SEAMCALL_UD)) {
> 
> Where is the TDX_SEAMCALL_UD error code documented in the spec?
> I failed to find it.

This is not a part of the spec, but a convention of __seamcall().
Please refer to
https://lore.kernel.org/all/ec640452a4385d61bec97f8b761ed1ff38898504.1685887183.git.kai.huang@intel.com/


> > In the case of reboot or kexec,
> > 		 * kvm shutdown notifier, kvm_shutdown(), makes VMX off
> > (VMXOFF)
> > 		 * while TDs can be still running to invoke SEAMCALL.  It
> > 		 * results in superfluous errors or warnings.
> > 		 * If rebooting, return 0 to suppress superfluous messages.
> > 		 * If not rebooting, panic by kvm_spurious_fault().
> > 		 */
> > 		kvm_spurious_fault();
> 
> I would put it this way:
> SEAMCALLs fail with TDX_SEAMCALL_UD returned when VMX is off.
> This can happen when host gets rebooted or live updated. In this case,
> the instruction execution is actually ignored as KVM is shut down, so
> the error code is suppressed. Other than this, the error is unexpected
> and the execution can't continue as the TDX features reply on VMX to
> be on.

Thanks for it. I made minor fix to it.

	if (unlikely(ret == TDX_SEAMCALL_UD)) {
		/*
		 * SEAMCALLs fail with TDX_SEAMCALL_UD returned when VMX is off.
		 * This can happen when the host gets rebooted or live
		 * updated. In this case, the instruction execution is ignored
		 * as KVM is shut down, so the error code is suppressed. Other
		 * than this, the error is unexpected and the execution can't
		 * continue as the TDX features reply on VMX to be on.
		 */
		kvm_spurious_fault();
		return 0;
	}

-- 
Isaku Yamahata <isaku.yamahata@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ