Re: [PATCH 1/2] KVM: SVM: fix svn_pin_memory()'s use of get_user_pages_fast()

2020-06-29 Thread John Hubbard
On 2020-05-26 00:33, Vitaly Kuznetsov wrote: ... I bit unrelated to this patch, but callers of sev_pin_memory() treat NULL differently: sev_launch_secret()/svm_register_enc_region() return -ENOMEM sev_dbg_crypt() returns -EFAULT Should we switch to ERR_PTR() to preserve the error? /*

Re: [PATCH 1/2] KVM: SVM: fix svn_pin_memory()'s use of get_user_pages_fast()

2020-05-26 Thread Vitaly Kuznetsov
John Hubbard writes: > There are two problems in svn_pin_memory(): > > 1) The return value of get_user_pages_fast() is stored in an > unsigned long, although the declared return value is of type int. > This will not cause any symptoms, but it is misleading. > Fix this by changing the type of npin

[PATCH 1/2] KVM: SVM: fix svn_pin_memory()'s use of get_user_pages_fast()

2020-05-25 Thread John Hubbard
There are two problems in svn_pin_memory(): 1) The return value of get_user_pages_fast() is stored in an unsigned long, although the declared return value is of type int. This will not cause any symptoms, but it is misleading. Fix this by changing the type of npinned to "int". 2) The number of pa