Skip to content

Commit b5fa1f9

Browse files
author
Marc Zyngier
committed
KVM: arm64: Make __vcpu_sys_reg() a pure rvalue operand
Now that we don't have any use of __vcpu_sys_reg() as a lvalue, remove the in-place update, and directly return the sanitised value. Reviewed-by: Miguel Luis <[email protected]> Reviewed-by: Oliver Upton <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
1 parent b61fae4 commit b5fa1f9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

arch/arm64/include/asm/kvm_host.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,13 +1130,13 @@ u64 kvm_vcpu_apply_reg_masks(const struct kvm_vcpu *, enum vcpu_sysreg, u64);
11301130
} while (0)
11311131

11321132
#define __vcpu_sys_reg(v,r) \
1133-
(*({ \
1133+
({ \
11341134
const struct kvm_cpu_context *ctxt = &(v)->arch.ctxt; \
1135-
u64 *__r = __ctxt_sys_reg(ctxt, (r)); \
1135+
u64 __v = ctxt_sys_reg(ctxt, (r)); \
11361136
if (vcpu_has_nv((v)) && (r) >= __SANITISED_REG_START__) \
1137-
*__r = kvm_vcpu_apply_reg_masks((v), (r), *__r);\
1138-
__r; \
1139-
}))
1137+
__v = kvm_vcpu_apply_reg_masks((v), (r), __v); \
1138+
__v; \
1139+
})
11401140

11411141
u64 vcpu_read_sys_reg(const struct kvm_vcpu *vcpu, int reg);
11421142
void vcpu_write_sys_reg(struct kvm_vcpu *vcpu, u64 val, int reg);

0 commit comments

Comments
 (0)