mirror of
https://github.com/torvalds/linux.git
synced 2026-09-27 02:22:02 +02:00
KVM: x86: Move get_segment_base() to regs.h, as kvm_get_segment_base()
Move get_segment_base() to regs.h, as kvm_get_segment_base(), so that the bulk of the register code can be moved from x86.c to a new regs.c, without simultaneously needing to rename "public" helpers to explicitly scope them to KVM. No functional change intended. Cc: Yosry Ahmed <yosry@kernel.org> Signed-off-by: Sean Christopherson <seanjc@google.com> Reviewed-by: Kai Huang <kai.huang@intel.com> Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com> Message-ID: <20260613000329.732085-3-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
6a8a98aa9c
commit
0217de7343
|
|
@ -420,4 +420,9 @@ static inline bool is_guest_mode(struct kvm_vcpu *vcpu)
|
|||
return vcpu->arch.hflags & HF_GUEST_MASK;
|
||||
}
|
||||
|
||||
static inline unsigned long kvm_get_segment_base(struct kvm_vcpu *vcpu, int seg)
|
||||
{
|
||||
return kvm_x86_call(get_segment_base)(vcpu, seg);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -8492,11 +8492,6 @@ static int emulator_pio_out_emulated(struct x86_emulate_ctxt *ctxt,
|
|||
return emulator_pio_out(emul_to_vcpu(ctxt), size, port, val, count);
|
||||
}
|
||||
|
||||
static unsigned long get_segment_base(struct kvm_vcpu *vcpu, int seg)
|
||||
{
|
||||
return kvm_x86_call(get_segment_base)(vcpu, seg);
|
||||
}
|
||||
|
||||
static void emulator_invlpg(struct x86_emulate_ctxt *ctxt, ulong address)
|
||||
{
|
||||
kvm_mmu_invlpg(emul_to_vcpu(ctxt), address);
|
||||
|
|
@ -8641,7 +8636,7 @@ static void emulator_set_idt(struct x86_emulate_ctxt *ctxt, struct desc_ptr *dt)
|
|||
static unsigned long emulator_get_cached_segment_base(
|
||||
struct x86_emulate_ctxt *ctxt, int seg)
|
||||
{
|
||||
return get_segment_base(emul_to_vcpu(ctxt), seg);
|
||||
return kvm_get_segment_base(emul_to_vcpu(ctxt), seg);
|
||||
}
|
||||
|
||||
static bool emulator_get_segment(struct x86_emulate_ctxt *ctxt, u16 *selector,
|
||||
|
|
@ -13837,7 +13832,7 @@ unsigned long kvm_get_linear_rip(struct kvm_vcpu *vcpu)
|
|||
|
||||
if (is_64_bit_mode(vcpu))
|
||||
return kvm_rip_read(vcpu);
|
||||
return (u32)(get_segment_base(vcpu, VCPU_SREG_CS) +
|
||||
return (u32)(kvm_get_segment_base(vcpu, VCPU_SREG_CS) +
|
||||
kvm_rip_read(vcpu));
|
||||
}
|
||||
EXPORT_SYMBOL_FOR_KVM_INTERNAL(kvm_get_linear_rip);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user