Hi all, Per our privious discussions about source layout, I just worked out these patches to support new CPU archs for KVM. Firslty, we just move all files to its final position in source structure as we discussed before. In the drivers/kvm directory I add an x86 directory to hold x86 specific code, and also add an include dir for managing header files. Then, some structures, such as kvm_vcpu, struct kvm_arch_ops(changed to kvm_ops) are extended with an sub field *arch to accommodate arch-specific data fields wtih different architectures. 1. move_files.patch : Move all files to its final position in the soruce structure. No any code logic changed. 2. kvm_x86_ops-kvm_ops.patch. In order to adapt different architectures, we have to change it to an neutral name. kvm_ops maybe not the best name, but shouldn't introduce different meanings. In the third patch, we add a sub field struct kvm_arch_ops for arch-specific ops. That is, different CPU archs can define its arch-specific ops for its special need. IMO, we should treat x86, IA64, ppc etc as different archtiectures, other than see vmx, svm as different archs. svm and vmx should be two different virtualization approaches for x86 arch from the point view of platforms. 3. re-frame.patch. This patch is the main work to to support differnt architectures. it includes: (1). Split kvm_main.c to kvm_arch.c and new kvm_main.c. kvm_arch.c under x86 directory contains arch-specific code, and new kvm_main.c only holds interfaces with user space, and basic kvm infrastructure. Split some functions to make them arch-independent. (2) Add an include directory to hold head files, and split kvm.h to two parts. One is kvm_arch.h to deposit some arch-specfic structures, such as struct kvm_vcpu_arch, kvm_arch_ops etc, some arch-dependent macros and functions declares. (3) Add arch support for structure kvm_ops, and structure kvm_vcpu. (4) Make file change.
By the way, maybe more changes are needed in furture when real new architecture in. Perhaps, some current arch-independent code today will be thought as arch-specific ones, vice versa. Anyway, we these changes are basically necessary for our re-frame work. Only these changes in, then we can carry out further work. These patches are based on commit 7060e1c92b504ac725e2ffbc91053c1dc684e685(last commit of Oct 8). Due to big changes to code structure, these pathes will be out of date soon. So, we have to make the desicion ASAP, or it is very painful to rebase them. Basically, these patches have no more code logic and functionality changes. And I have tested them on our platforms. Works well on 32bit and 64bit platforms. Todo List: split include/linux/kvm.h & kvm_para.h(Not urgent until real other archs in.). Userspace compile infrastructure change accordingly. Any comments are welcome! Thanks Xiantao ------------------------------------------------------------------------- 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