From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerone Young Subject: [PATCH 06 of 27] imported patch move_kvm_set_init_tss Date: Wed, 31 Oct 2007 12:05:11 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org # HG changeset patch # User Jerone Young # Date 1193849564 18000 # Node ID a809d39bd74d33d221dd98cc6afa02d9a35889a4 # Parent 4d8d1bd969dc9a1f2ad3b983d7e63172bee64fd4 imported patch move_kvm_set_init_tss diff --git a/libkvm/libkvm-x86.c b/libkvm/libkvm-x86.c --- a/libkvm/libkvm-x86.c +++ b/libkvm/libkvm-x86.c @@ -3,6 +3,7 @@ #include #include #include +#include int kvm_alloc_kernel_memory(kvm_context_t kvm, unsigned long memory, void **vm_mem) @@ -201,3 +202,25 @@ int kvm_set_tss_addr(kvm_context_t kvm, return -ENOSYS; } +static int kvm_init_tss(kvm_context_t kvm) +{ +#ifdef KVM_CAP_SET_TSS_ADDR + int r; + + r = ioctl(kvm->fd, KVM_CHECK_EXTENSION, KVM_CAP_SET_TSS_ADDR); + if (r > 0) { + /* + * this address is 3 pages before the bios, and the bios should present + * as unavaible memory + */ + r = kvm_set_tss_addr(kvm, 0xfffbd000); + if (r < 0) { + printf("kvm_init_tss: unable to set tss addr\n"); + return r; + } + + } +#endif + return 0; +} + diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c --- a/libkvm/libkvm.c +++ b/libkvm/libkvm.c @@ -328,28 +328,6 @@ int kvm_create_vm(kvm_context_t kvm) return 0; } - -static int kvm_init_tss(kvm_context_t kvm) -{ -#ifdef KVM_CAP_SET_TSS_ADDR - int r; - - r = ioctl(kvm->fd, KVM_CHECK_EXTENSION, KVM_CAP_SET_TSS_ADDR); - if (r > 0) { - /* - * this address is 3 pages before the bios, and the bios should present - * as unavaible memory - */ - r = kvm_set_tss_addr(kvm, 0xfffbd000); - if (r < 0) { - printf("kvm_init_tss: unable to set tss addr\n"); - return r; - } - - } -#endif - return 0; -} static int kvm_create_default_phys_mem(kvm_context_t kvm, unsigned long phys_mem_bytes, ------------------------------------------------------------------------- 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/