Skip to content

Commit 64435aa

Browse files
blitzsean-jc
authored andcommitted
KVM: x86: rename push to emulate_push for consistency
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent 6fd1e39 commit 64435aa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

arch/x86/kvm/emulate.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,22 +1820,22 @@ static int writeback(struct x86_emulate_ctxt *ctxt, struct operand *op)
18201820
return X86EMUL_CONTINUE;
18211821
}
18221822

1823-
static int push(struct x86_emulate_ctxt *ctxt, void *data, int bytes)
1823+
static int emulate_push(struct x86_emulate_ctxt *ctxt, const void *data, int len)
18241824
{
18251825
struct segmented_address addr;
18261826

1827-
rsp_increment(ctxt, -bytes);
1827+
rsp_increment(ctxt, -len);
18281828
addr.ea = reg_read(ctxt, VCPU_REGS_RSP) & stack_mask(ctxt);
18291829
addr.seg = VCPU_SREG_SS;
18301830

1831-
return segmented_write(ctxt, addr, data, bytes);
1831+
return segmented_write(ctxt, addr, data, len);
18321832
}
18331833

18341834
static int em_push(struct x86_emulate_ctxt *ctxt)
18351835
{
18361836
/* Disable writeback. */
18371837
ctxt->dst.type = OP_NONE;
1838-
return push(ctxt, &ctxt->src.val, ctxt->op_bytes);
1838+
return emulate_push(ctxt, &ctxt->src.val, ctxt->op_bytes);
18391839
}
18401840

18411841
static int emulate_pop(struct x86_emulate_ctxt *ctxt,
@@ -1921,7 +1921,7 @@ static int em_enter(struct x86_emulate_ctxt *ctxt)
19211921
return X86EMUL_UNHANDLEABLE;
19221922

19231923
rbp = reg_read(ctxt, VCPU_REGS_RBP);
1924-
rc = push(ctxt, &rbp, stack_size(ctxt));
1924+
rc = emulate_push(ctxt, &rbp, stack_size(ctxt));
19251925
if (rc != X86EMUL_CONTINUE)
19261926
return rc;
19271927
assign_masked(reg_rmw(ctxt, VCPU_REGS_RBP), reg_read(ctxt, VCPU_REGS_RSP),

0 commit comments

Comments
 (0)