Thread (14 messages) 14 messages, 2 authors, 2023-02-16

Re: [PATCH 03/11] virt/coco/sev-guest: Simplify extended guest request handling

From: Dionna Amalie Glaze <hidden>
Date: 2023-02-16 16:44:13
Also in: lkml

        if (ghcb->save.sw_exit_info_2) {
                /* Number of expected pages are returned in RBX */
                if (exit_code == SVM_VMGEXIT_EXT_GUEST_REQUEST &&
-                   ghcb->save.sw_exit_info_2 == SNP_GUEST_REQ_INVALID_LEN)
+                   ghcb->save.sw_exit_info_2 == SNP_GUEST_REQ_INVALID_LEN) {
                        input->data_npages = ghcb_get_rbx(ghcb);
+                       ret = -ENOSPC;
+               } else {
+                       ret = -EIO;
+               }

                *fw_err = ghcb->save.sw_exit_info_2;
-
-               ret = -EIO;
        }
I think *fw_err still needs to be hoisted out of this if block so that
a 0 fw_err gets written back to user space rather than the 0xff
placeholder. The 0 would more correctly indicate the lack of an error.


-- 
-Dionna Glaze, PhD (she/her)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help