]> xenbits.xensource.com Git - people/pauldu/linux.git/commitdiff
KVM: x86: rename push to emulate_push for consistency
authorJulian Stecklina <julian.stecklina@cyberus-technology.de>
Mon, 9 Oct 2023 09:20:54 +0000 (11:20 +0200)
committerSean Christopherson <seanjc@google.com>
Thu, 8 Feb 2024 00:10:01 +0000 (16:10 -0800)
push and emulate_pop are counterparts. Rename push to emulate_push and
harmonize its function signature with emulate_pop. This should remove
a bit of cognitive load when reading this code.

Signed-off-by: Julian Stecklina <julian.stecklina@cyberus-technology.de>
Link: https://lore.kernel.org/r/20231009092054.556935-2-julian.stecklina@cyberus-technology.de
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/emulate.c

index 711b3250ebaa973d370138afc9ae9ef81b81412b..eafb48f0b745c5c3e29a062f7ada81eb1aeee151 100644 (file)
@@ -1820,22 +1820,22 @@ static int writeback(struct x86_emulate_ctxt *ctxt, struct operand *op)
        return X86EMUL_CONTINUE;
 }
 
-static int push(struct x86_emulate_ctxt *ctxt, void *data, int bytes)
+static int emulate_push(struct x86_emulate_ctxt *ctxt, const void *data, int len)
 {
        struct segmented_address addr;
 
-       rsp_increment(ctxt, -bytes);
+       rsp_increment(ctxt, -len);
        addr.ea = reg_read(ctxt, VCPU_REGS_RSP) & stack_mask(ctxt);
        addr.seg = VCPU_SREG_SS;
 
-       return segmented_write(ctxt, addr, data, bytes);
+       return segmented_write(ctxt, addr, data, len);
 }
 
 static int em_push(struct x86_emulate_ctxt *ctxt)
 {
        /* Disable writeback. */
        ctxt->dst.type = OP_NONE;
-       return push(ctxt, &ctxt->src.val, ctxt->op_bytes);
+       return emulate_push(ctxt, &ctxt->src.val, ctxt->op_bytes);
 }
 
 static int emulate_pop(struct x86_emulate_ctxt *ctxt,
@@ -1921,7 +1921,7 @@ static int em_enter(struct x86_emulate_ctxt *ctxt)
                return X86EMUL_UNHANDLEABLE;
 
        rbp = reg_read(ctxt, VCPU_REGS_RBP);
-       rc = push(ctxt, &rbp, stack_size(ctxt));
+       rc = emulate_push(ctxt, &rbp, stack_size(ctxt));
        if (rc != X86EMUL_CONTINUE)
                return rc;
        assign_masked(reg_rmw(ctxt, VCPU_REGS_RBP), reg_read(ctxt, VCPU_REGS_RSP),