From: Carlo Marcelo Arenas Belon <carenas-kLeDWSohozoJb6fo7hG9ng@public.gmane.org>
To: Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH 11 of 17] Move msrs functions to libkvm-x86.c
Date: Wed, 7 Nov 2007 23:57:00 -0600 [thread overview]
Message-ID: <20071108055700.GA1937@tapir> (raw)
In-Reply-To: <cbe4ad07343fc1ef904f.1194367732@thinkpad>
On Tue, Nov 06, 2007 at 10:48:52AM -0600, Jerone Young wrote:
> Move msrs functions to libkvm-x86.c
>
> This patch moves functions:
> kvm_msr_list
> move kvm_get_msrs
> move kvm_set_msrs
the problem is that with this the definitions were moved as well from libkvm.h
to kvm-x86.h which is private and not meant to be exported outside of libkvm
but those 3 functions are used by qemu-kvm.c as shown by :
/var/tmp/portage/app-emulation/kvm-51/work/kvm-51/qemu/qemu-kvm.c: In function
`load_regs':
/var/tmp/portage/app-emulation/kvm-51/work/kvm-51/qemu/qemu-kvm.c:319:
warning: implicit declaration of function `kvm_set_msrs'
/var/tmp/portage/app-emulation/kvm-51/work/kvm-51/qemu/qemu-kvm.c: In function
`save_regs':
/var/tmp/portage/app-emulation/kvm-51/work/kvm-51/qemu/qemu-kvm.c:457:
warning: implicit declaration of function `kvm_get_msrs'
/var/tmp/portage/app-emulation/kvm-51/work/kvm-51/qemu/qemu-kvm.c: In function
`kvm_qemu_create_context':
/var/tmp/portage/app-emulation/kvm-51/work/kvm-51/qemu/qemu-kvm.c:1020:
warning: implicit declaration of function `kvm_get_msr_list'
/var/tmp/portage/app-emulation/kvm-51/work/kvm-51/qemu/qemu-kvm.c:1020:
warning: assignment makes pointer from integer without a cast
the following patch moves them to a new public arch specific header for libkvm
named libkvm-x86.h and that needs to be installed in userspace as well but is
not completely independent and would had been as well ifdef inside libkvm.h
for simplicity.
Jerone or anyone else that is working in the architectural work care to
comment?
Carlo
PS. tested in amd64
--
diff --git a/libkvm/Makefile b/libkvm/Makefile
index 65efb3a..bbeb564 100644
--- a/libkvm/Makefile
+++ b/libkvm/Makefile
@@ -26,6 +26,7 @@ libkvm.a: libkvm.o $(libkvm-$(ARCH)-objs)
install:
install -D libkvm.h $(DESTDIR)/$(PREFIX)/include/libkvm.h
+ install -D libkvm-x86.h $(DESTDIR)/$(PREFIX)/include/libkvm-x86.h
install -D $(KERNELDIR)/include/linux/kvm.h \
$(DESTDIR)/$(PREFIX)/include/linux/kvm.h
install -D $(KERNELDIR)/include/linux/kvm_para.h \
diff --git a/libkvm/kvm-x86.h b/libkvm/kvm-x86.h
index b531a3b..1e1c718 100644
--- a/libkvm/kvm-x86.h
+++ b/libkvm/kvm-x86.h
@@ -19,8 +19,7 @@
#define KVM_X86_H
#include "kvm-common.h"
-
-#include "kvm-common.h"
+#include "libkvm-x86.h"
#define PAGE_SIZE 4096ul
#define PAGE_MASK (~(PAGE_SIZE - 1))
@@ -42,8 +41,4 @@ int kvm_run_abi10(kvm_context_t kvm, int vcpu);
void kvm_show_code(kvm_context_t kvm, int vcpu);
-struct kvm_msr_list *kvm_get_msr_list(kvm_context_t);
-int kvm_get_msrs(kvm_context_t, int vcpu, struct kvm_msr_entry *msrs, int n);
-int kvm_set_msrs(kvm_context_t, int vcpu, struct kvm_msr_entry *msrs, int n);
-
#endif
diff --git a/libkvm/libkvm-x86.h b/libkvm/libkvm-x86.h
new file mode 100644
index 0000000..6531d1f
--- /dev/null
+++ b/libkvm/libkvm-x86.h
@@ -0,0 +1,12 @@
+/** \file libkvm-x86.h
+ * libkvm for x86 API
+ */
+
+#ifndef LIBKVM_X86_H
+#define LIBKVM_X86_H
+
+struct kvm_msr_list *kvm_get_msr_list(kvm_context_t kvm);
+int kvm_get_msrs(kvm_context_t kvm, int vcpu, struct kvm_msr_entry *msrs, int n);
+int kvm_set_msrs(kvm_context_t kvm, int vcpu, struct kvm_msr_entry *msrs, int n);
+
+#endif
diff --git a/libkvm/libkvm.h b/libkvm/libkvm.h
index b00d658..173566f 100644
--- a/libkvm/libkvm.h
+++ b/libkvm/libkvm.h
@@ -19,6 +19,10 @@ struct kvm_context;
typedef struct kvm_context *kvm_context_t;
+#if defined(__x86_64__) || defined(__i386__)
+#include <libkvm-x86.h>
+#endif
+
/*!
* \brief KVM callbacks structure
*
-------------------------------------------------------------------------
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/
next prev parent reply other threads:[~2007-11-08 5:57 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-06 16:48 [PATCH 00 of 17] [v4] libkvm refactor Jerone Young
2007-11-06 16:48 ` [PATCH 01 of 17] Move kvm_context to kvm-common.h & add CFLAGS to config-* filese Jerone Young
2007-11-06 16:48 ` [PATCH 02 of 17] Make static slot & kvm_memory region funcions public Jerone Young
2007-11-06 16:48 ` [PATCH 03 of 17] Move fuction kvm_alloc_kernel_memory to libkvm-x86.c Jerone Young
2007-11-06 16:48 ` [PATCH 04 of 17] Move kvm_alloc_userspace_memory " Jerone Young
2007-11-06 16:48 ` [PATCH 05 of 17] Modify out arch specific code from kvm_create function Jerone Young
2007-11-06 16:48 ` [PATCH 06 of 17] Move kvm_create_kernel_phys_mem to libkvm-x86.c Jerone Young
2007-11-06 16:48 ` [PATCH 07 of 17] Move kvm_create_memory_alias & kvm_destroy_memory_alias " Jerone Young
2007-11-07 13:52 ` Avi Kivity
2007-11-06 16:48 ` [PATCH 08 of 17] Move kvm_get & kmv_set_lapci functions " Jerone Young
2007-11-06 16:48 ` [PATCH 09 of 17] Make functions in libkvm.c nonstatic Jerone Young
2007-11-06 16:48 ` [PATCH 10 of 17] Move abi 10 functions to libkvm-x86.c Jerone Young
2007-11-06 16:48 ` [PATCH 11 of 17] Move msrs " Jerone Young
2007-11-08 5:57 ` Carlo Marcelo Arenas Belon [this message]
2007-11-08 5:54 ` Avi Kivity
[not found] ` <4732A4AE.30100-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-08 6:34 ` [PATCH] make msrs functions public for x86 Carlo Marcelo Arenas Belon
2007-11-08 8:30 ` Avi Kivity
2007-11-08 17:10 ` Jerone Young
2007-11-08 18:59 ` [PATCH 11 of 17] Move msrs functions to libkvm-x86.c Hollis Blanchard
2007-11-11 10:01 ` Avi Kivity
2007-11-06 16:48 ` [PATCH 12 of 17] Move print_seg & Move kvm_show_regs " Jerone Young
2007-11-06 16:48 ` [PATCH 13 of 17] Declare kvm_abi as a global variable in kvm-common.h Jerone Young
2007-11-06 16:48 ` [PATCH 14 of 17] Move kvm_get_apic to libkvm-x86.c Jerone Young
2007-11-06 16:48 ` [PATCH 15 of 17] Move cr8 functions " Jerone Young
2007-11-06 16:48 ` [PATCH 16 of 17] Move kvm_setup_cpuid " Jerone Young
2007-11-06 16:48 ` [PATCH 17 of 17] Remove unsued inclusion of linux/kvm_parah.h in userspace libkvm.h Jerone Young
2007-11-07 13:52 ` [PATCH 00 of 17] [v4] libkvm refactor Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071108055700.GA1937@tapir \
--to=carenas-kledwsohozojb6fo7hg9ng@public.gmane.org \
--cc=jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox