# HG changeset patch # User Jerone Young <[EMAIL PROTECTED]> # Date 1193849565 18000 # Node ID 374df93e6585eeb4f923265d2591b98c2d8e6bd1 # Parent 1e5d53747cb7e5b3ec8a35e36d7d4c9f35cb7c6b Move cr8 functions to kvmctl-x86.c
This patch moves functions: kvm_set_cr8 kvm_get_cr8 cr8 is an x86 only register. Signed-off-by: Jerone Young <[EMAIL PROTECTED]> diff --git a/libkvm/libkvm-x86.c b/libkvm/libkvm-x86.c --- a/libkvm/libkvm-x86.c +++ b/libkvm/libkvm-x86.c @@ -721,3 +721,19 @@ uint64_t kvm_get_apic_base(kvm_context_t return run->apic_base; } +void kvm_set_cr8(kvm_context_t kvm, int vcpu, uint64_t cr8) +{ + struct kvm_run *run = kvm->run[vcpu]; + + if (kvm_abi == 10) { + ((struct kvm_run_abi10 *)run)->cr8 = cr8; + return; + } + run->cr8 = cr8; +} + +__u64 kvm_get_cr8(kvm_context_t kvm, int vcpu) +{ + return kvm->run[vcpu]->cr8; +} + diff --git a/libkvm/libkvm-x86.h b/libkvm/libkvm-x86.h --- a/libkvm/libkvm-x86.h +++ b/libkvm/libkvm-x86.h @@ -87,5 +87,27 @@ void kvm_show_regs(kvm_context_t kvm, in */ uint64_t kvm_get_apic_base(kvm_context_t kvm, int vcpu); +/*! + * \brief Set up cr8 for next time the vcpu is executed + * + * This is a fast setter for cr8, which will be applied when the + * vcpu next enters guest mode. + * + * \param kvm Pointer to the current kvm_context + * \param vcpu Which virtual CPU should get dumped + * \param cr8 next cr8 value + */ +void kvm_set_cr8(kvm_context_t kvm, int vcpu, uint64_t cr8); + +/*! + * \brief Get cr8 for sync tpr in qemu apic emulation + * + * This is a getter for cr8, which used to sync with the tpr in qemu + * apic emualtion. + * + * \param kvm Pointer to the current kvm_context + * \param vcpu Which virtual CPU should get dumped + */ +__u64 kvm_get_cr8(kvm_context_t kvm, int vcpu); #endif diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c --- a/libkvm/libkvm.c +++ b/libkvm/libkvm.c @@ -759,22 +759,6 @@ int kvm_is_ready_for_interrupt_injection return run->ready_for_interrupt_injection; } -void kvm_set_cr8(kvm_context_t kvm, int vcpu, uint64_t cr8) -{ - struct kvm_run *run = kvm->run[vcpu]; - - if (kvm_abi == 10) { - ((struct kvm_run_abi10 *)run)->cr8 = cr8; - return; - } - run->cr8 = cr8; -} - -__u64 kvm_get_cr8(kvm_context_t kvm, int vcpu) -{ - return kvm->run[vcpu]->cr8; -} - int kvm_run(kvm_context_t kvm, int vcpu) { int r; diff --git a/libkvm/libkvm.h b/libkvm/libkvm.h --- a/libkvm/libkvm.h +++ b/libkvm/libkvm.h @@ -244,29 +244,6 @@ int kvm_is_ready_for_interrupt_injection int kvm_is_ready_for_interrupt_injection(kvm_context_t kvm, int vcpu); /*! - * \brief Set up cr8 for next time the vcpu is executed - * - * This is a fast setter for cr8, which will be applied when the - * vcpu next enters guest mode. - * - * \param kvm Pointer to the current kvm_context - * \param vcpu Which virtual CPU should get dumped - * \param cr8 next cr8 value - */ -void kvm_set_cr8(kvm_context_t kvm, int vcpu, uint64_t cr8); - -/*! - * \brief Get cr8 for sync tpr in qemu apic emulation - * - * This is a getter for cr8, which used to sync with the tpr in qemu - * apic emualtion. - * - * \param kvm Pointer to the current kvm_context - * \param vcpu Which virtual CPU should get dumped - */ -__u64 kvm_get_cr8(kvm_context_t kvm, int vcpu); - -/*! * \brief Read VCPU registers * * This gets the GP registers from the VCPU and outputs them ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel