Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-05-10 Thread Kunwu Chan
Thanks for reply. On 2024/4/26 00:25, Sean Christopherson wrote: On Wed, Apr 24, 2024, Oliver Upton wrote: Hey, On Wed, Apr 24, 2024 at 07:51:44AM -0700, Sean Christopherson wrote: On Wed, Apr 24, 2024, Andrew Jones wrote: On Tue, Apr 23, 2024 at 12:15:47PM -0700, Sean Christopherson wrote:

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-25 Thread Sean Christopherson
On Wed, Apr 24, 2024, Oliver Upton wrote: > Hey, > > On Wed, Apr 24, 2024 at 07:51:44AM -0700, Sean Christopherson wrote: > > On Wed, Apr 24, 2024, Andrew Jones wrote: > > > On Tue, Apr 23, 2024 at 12:15:47PM -0700, Sean Christopherson wrote: > > > ... > > > > I almost wonder if we should just

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-24 Thread Oliver Upton
Hey, On Wed, Apr 24, 2024 at 07:51:44AM -0700, Sean Christopherson wrote: > On Wed, Apr 24, 2024, Andrew Jones wrote: > > On Tue, Apr 23, 2024 at 12:15:47PM -0700, Sean Christopherson wrote: > > ... > > > I almost wonder if we should just pick a prefix that's less obviously > > > connected > > >

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-24 Thread Sean Christopherson
On Wed, Apr 24, 2024, Andrew Jones wrote: > On Tue, Apr 23, 2024 at 12:15:47PM -0700, Sean Christopherson wrote: > ... > > I almost wonder if we should just pick a prefix that's less obviously > > connected > > to KVM and/or selftests, but unique and short. > > > > How about kvmsft_ ? It's based

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-24 Thread Sean Christopherson
On Wed, Apr 24, 2024, Dan Carpenter wrote: > On Tue, Apr 23, 2024 at 12:15:47PM -0700, Sean Christopherson wrote: > > On Tue, Apr 23, 2024, Andrew Jones wrote: > > > On Tue, Apr 23, 2024 at 07:56:01AM -0700, Sean Christopherson wrote: > > > > +others > > > > > > > > On Tue, Apr 23, 2024, Markus

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-24 Thread Andrew Jones
On Tue, Apr 23, 2024 at 12:15:47PM -0700, Sean Christopherson wrote: ... > I almost wonder if we should just pick a prefix that's less obviously > connected > to KVM and/or selftests, but unique and short. > How about kvmsft_ ? It's based on the ksft_ prefix of kselftest.h. Maybe it's too close

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-23 Thread Dan Carpenter
On Tue, Apr 23, 2024 at 12:15:47PM -0700, Sean Christopherson wrote: > On Tue, Apr 23, 2024, Andrew Jones wrote: > > On Tue, Apr 23, 2024 at 07:56:01AM -0700, Sean Christopherson wrote: > > > +others > > > > > > On Tue, Apr 23, 2024, Markus Elfring wrote: > > > > … > > > > > This patch will add

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-23 Thread Kunwu Chan
Thanks all for the reply. On 2024/4/24 03:15, Sean Christopherson wrote: On Tue, Apr 23, 2024, Andrew Jones wrote: On Tue, Apr 23, 2024 at 07:56:01AM -0700, Sean Christopherson wrote: +others On Tue, Apr 23, 2024, Markus Elfring wrote: … This patch will add the malloc failure checking …

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-23 Thread Sean Christopherson
On Tue, Apr 23, 2024, Andrew Jones wrote: > On Tue, Apr 23, 2024 at 07:56:01AM -0700, Sean Christopherson wrote: > > +others > > > > On Tue, Apr 23, 2024, Markus Elfring wrote: > > > … > > > > This patch will add the malloc failure checking > > > … > > > > > > * Please use a corresponding

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-23 Thread Andrew Jones
On Tue, Apr 23, 2024 at 07:56:01AM -0700, Sean Christopherson wrote: > +others > > On Tue, Apr 23, 2024, Markus Elfring wrote: > > … > > > This patch will add the malloc failure checking > > … > > > > * Please use a corresponding imperative wording for the change description. > > > > * Would

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-23 Thread Sean Christopherson
+others On Tue, Apr 23, 2024, Markus Elfring wrote: > … > > This patch will add the malloc failure checking > … > > * Please use a corresponding imperative wording for the change description. > > * Would you like to add the tag “Fixes” accordingly? Nah, don't bother with Fixes. OOM will cause

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-23 Thread Markus Elfring
… > This patch will add the malloc failure checking … * Please use a corresponding imperative wording for the change description. * Would you like to add the tag “Fixes” accordingly? … > +++ b/tools/testing/selftests/kvm/x86_64/vmx_set_nested_state_test.c > @@ -91,6 +91,7 @@ void

Re: [PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-23 Thread Muhammad Usama Anjum
On 4/23/24 12:39 PM, Kunwu Chan wrote: > There is a 'malloc' call in test_vmx_nested_state function, which can > be unsuccessful. This patch will add the malloc failure checking > to avoid possible null dereference and give more information > about test fail reasons. LGTM Reviewed-by: Muhammad

[PATCH] KVM: selftests: Add 'malloc' failure check in test_vmx_nested_state

2024-04-23 Thread Kunwu Chan
There is a 'malloc' call in test_vmx_nested_state function, which can be unsuccessful. This patch will add the malloc failure checking to avoid possible null dereference and give more information about test fail reasons. Signed-off-by: Kunwu Chan ---