Message ID | 20171106113105.qvw5wq7qts3ak5c2@pd.tnic (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 11/06/2017 05:31 AM, Borislav Petkov wrote: ... >> - ret = sev_dbg_decrypt_user(kvm, >> - __sme_page_pa(src_p[0]) + s_off, >> - dst_vaddr, >> - __sme_page_pa(dst_p[0]) + d_off, >> - len, &argp->error); >> + if (dec) >> + ret = sev_dbg_decrypt_user(kvm, >> + __sme_page_pa(src_p[0]) + s_off, >> + dst_vaddr, >> + __sme_page_pa(dst_p[0]) + d_off, >> + len, &argp->error); >> + else >> + ret = __sev_dbg_encrypt_user(kvm, >> + __sme_page_pa(src_p[0]) + s_off, >> + vaddr, >> + __sme_page_pa(dst_p[0]) + d_off, >> + dst_vaddr, >> + len, &argp->error); > > sev_dbg_decrypt_user but __sev_dbg_encrypt_user, with the "__" ?? > yes they both should be "__", I will overlooked it and will fix in next rev.
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index a60454afb4d2..68d398e72c4c 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -6261,16 +6261,6 @@ static int sev_dbg_crypt(struct kvm *kvm, struct kvm_sev_cmd *argp, bool dec) return ret; } -static int sev_dbg_decrypt(struct kvm *kvm, struct kvm_sev_cmd *argp) -{ - return sev_dbg_crypt(kvm, argp, true); -} - -static int sev_dbg_encrypt(struct kvm *kvm, struct kvm_sev_cmd *argp) -{ - return sev_dbg_crypt(kvm, argp, false); -} - static int svm_mem_enc_op(struct kvm *kvm, void __user *argp) { struct kvm_sev_cmd sev_cmd; @@ -6304,10 +6294,10 @@ static int svm_mem_enc_op(struct kvm *kvm, void __user *argp) r = sev_guest_status(kvm, &sev_cmd); break; case KVM_SEV_DBG_DECRYPT: - r = sev_dbg_decrypt(kvm, &sev_cmd); + r = sev_dbg_crypt(kvm, argp, true); break; case KVM_SEV_DBG_ENCRYPT: - r = sev_dbg_encrypt(kvm, &sev_cmd); + r = sev_dbg_crypt(kvm, argp, false); break; default: r = -EINVAL;