Re: Current kernel fails to compile with KVM on PowerPC

2011-12-11 Thread Jörg Sommer
Alexander Graf hat am Tue 22. Nov, 22:29 (+0100) geschrieben:
 On 22.11.2011, at 21:04, Jörg Sommer wrote:
  Jörg Sommer hat am Mon 07. Nov, 20:48 (+0100) geschrieben:
  I'm trying to build the kernel with the git commit-id
  31555213f03bca37d2c02e10946296052f4ecfcd, but it fails
  
   CHK include/linux/version.h
   HOSTCC  scripts/mod/modpost.o
   CHK include/generated/utsrelease.h
   UPD include/generated/utsrelease.h
   HOSTLD  scripts/mod/modpost
   GEN include/generated/bounds.h
   CC  arch/powerpc/kernel/asm-offsets.s
  In file included from arch/powerpc/kernel/asm-offsets.c:59:0:
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h: In function 
  ‘compute_tlbie_rb’:
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:393:10: error: 
  ‘HPTE_V_SECONDARY’ undeclared (first use in this function)
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:393:10: note: 
  each undeclared identifier is reported only once for each function it 
  appears in
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:396:12: error: 
  ‘HPTE_V_1TB_SEG’ undeclared (first use in this function)
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:401:10: error: 
  ‘HPTE_V_LARGE’ undeclared (first use in this function)
  /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:415:2: 
  warning: right shift count = width of type [enabled by default]
  make[3]: *** [arch/powerpc/kernel/asm-offsets.s] Fehler 1
  make[2]: *** [prepare0] Fehler 2
  make[1]: *** [deb-pkg] Fehler 2
  make: *** [deb-pkg] Fehler 2
  
  I'm still having this problem. I can' build
  6fe4c6d466e95d31164f14b1ac4aefb51f0f4f82. Are there any patches to
  make the kernel builds and do not oops [1] on PowerPC?
 
 The failures above should be fixed by now.

I've pulled git://git.kernel.org/pub/scm/virt/kvm/kvm.git
(a41d08d13f903da5c633fc58ee074156f05ab3ce), but this tree doesn't contain
a suitable commit. Where can I find it?

Bye, Jörg.
-- 
 Ich kenn mich mit OpenBSD kaum aus, was sind denn da so die
 Vorteile gegenueber Linux und iptables?
Der Fuchsschwanzeffekt ist größer. :-
Message-ID: slrnb11064.54g.hsch...@humbert.ddns.org


signature.asc
Description: Digital signature http://en.wikipedia.org/wiki/OpenPGP


Re: [PATCH V2 04/23] kvm tools: Get correct 64-bit types on PPC64 and link appropriately

2011-12-11 Thread Matt Evans
On 09/12/11 19:29, Pekka Enberg wrote:
 On Fri, Dec 9, 2011 at 10:24 AM, Sasha Levin levinsasha...@gmail.com wrote:
 If you also got kernel patches that add __SANE_USERSPACE_TYPES__ to the
 headers, and KVM_CAP_NR_VCPUS to KVM PPC, we can carry them in the KVM
 tools tree as well.
 
 Yup, all we need is ACKs from PPC maintainers.

Cool, I've pinged them re. __SANE_USERSPACE_TYPES__, and that would be useful to
carry in your tree.  But, IMHO, the patch I sent to Alex ([PATCH] KVM: PPC: Add
KVM_CAP_NR_VCPUS and KVM_CAP_MAX_VCPUS) should go in via his tree.  The
KVM/PPC-HV kernel folk will get it quicker in their trees (pulled from Alex) and
it's not a build problem, only a limit of SMP CPU numbers.  That is, if you're
building a kernel for PPC KVM today you'll probably use something more similar
to Alex's tree than mainline/kvm tools tree.


Cheers,


Matt
--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 17/23] kvm tools: Add ability to map guest RAM from hugetlbfs

2011-12-11 Thread Matt Evans
On 09/12/11 18:39, Sasha Levin wrote:
 On Fri, 2011-12-09 at 17:55 +1100, Matt Evans wrote:
 Add a --hugetlbfs commandline option to give a path to hugetlbfs-map guest
 memory (down in kvm__arch_init()).  For x86, guest memory is a normal
 ANON mmap() if this option is not provided, otherwise a hugetlbfs mmap.

 Signed-off-by: Matt Evans m...@ozlabs.org
 ---
  tools/kvm/builtin-run.c  |4 ++-
  tools/kvm/include/kvm/kvm.h  |4 +-
  tools/kvm/include/kvm/util.h |4 +++
  tools/kvm/kvm.c  |4 +-
  tools/kvm/util.c |   45 
 ++
  tools/kvm/x86/kvm.c  |   20 +++--
  6 files changed, 73 insertions(+), 8 deletions(-)

 diff --git a/tools/kvm/builtin-run.c b/tools/kvm/builtin-run.c
 index 7969901..0acfe81 100644
 --- a/tools/kvm/builtin-run.c
 +++ b/tools/kvm/builtin-run.c
 @@ -82,6 +82,7 @@ static const char *guest_mac;
  static const char *host_mac;
  static const char *script;
  static const char *guest_name;
 +static const char *hugetlbfs_path;
  static struct virtio_net_params *net_params;
  static bool single_step;
  static bool readonly_image[MAX_DISK_IMAGES];
 @@ -422,6 +423,7 @@ static const struct option options[] = {
  OPT_CALLBACK('\0', tty, NULL, tty id,
   Remap guest TTY into a pty on the host,
   tty_parser),
 +OPT_STRING('\0', hugetlbfs, hugetlbfs_path, path, Hugetlbfs 
 path),
  
  OPT_GROUP(Kernel options:),
  OPT_STRING('k', kernel, kernel_filename, kernel,
 @@ -807,7 +809,7 @@ int kvm_cmd_run(int argc, const char **argv, const char 
 *prefix)
  guest_name = default_name;
  }
  
 -kvm = kvm__init(dev, ram_size, guest_name);
 +kvm = kvm__init(dev, hugetlbfs_path, ram_size, guest_name);
  
  kvm-single_step = single_step;
  
 diff --git a/tools/kvm/include/kvm/kvm.h b/tools/kvm/include/kvm/kvm.h
 index 5fe6e75..7159952 100644
 --- a/tools/kvm/include/kvm/kvm.h
 +++ b/tools/kvm/include/kvm/kvm.h
 @@ -30,7 +30,7 @@ struct kvm_ext {
  void kvm__set_dir(const char *fmt, ...);
  const char *kvm__get_dir(void);
  
 -struct kvm *kvm__init(const char *kvm_dev, u64 ram_size, const char *name);
 +struct kvm *kvm__init(const char *kvm_dev, const char *hugetlbfs_path, u64 
 ram_size, const char *name);
  int kvm__recommended_cpus(struct kvm *kvm);
  int kvm__max_cpus(struct kvm *kvm);
  void kvm__init_ram(struct kvm *kvm);
 @@ -54,7 +54,7 @@ int kvm__enumerate_instances(int (*callback)(const char 
 *name, int pid));
  void kvm__remove_socket(const char *name);
  
  void kvm__arch_set_cmdline(char *cmdline, bool video);
 -void kvm__arch_init(struct kvm *kvm, const char *kvm_dev, u64 ram_size, 
 const char *name);
 +void kvm__arch_init(struct kvm *kvm, const char *kvm_dev, const char 
 *hugetlbfs_path, u64 ram_size, const char *name);
  void kvm__arch_setup_firmware(struct kvm *kvm);
  bool kvm__arch_cpu_supports_vm(void);
  void kvm__arch_periodic_poll(struct kvm *kvm);
 diff --git a/tools/kvm/include/kvm/util.h b/tools/kvm/include/kvm/util.h
 index dc2e0b9..1f6fbbd 100644
 --- a/tools/kvm/include/kvm/util.h
 +++ b/tools/kvm/include/kvm/util.h
 @@ -20,6 +20,7 @@
  #include limits.h
  #include sys/param.h
  #include sys/types.h
 +#include linux/types.h
  
  #ifdef __GNUC__
  #define NORETURN __attribute__((__noreturn__))
 @@ -75,4 +76,7 @@ static inline void msleep(unsigned int msecs)
  {
  usleep(MSECS_TO_USECS(msecs));
  }
 +
 +void *mmap_hugetlbfs(const char *htlbfs_path, u64 size);
 +
  #endif /* KVM__UTIL_H */
 diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c
 index c54f886..35ca2c5 100644
 --- a/tools/kvm/kvm.c
 +++ b/tools/kvm/kvm.c
 @@ -306,7 +306,7 @@ int kvm__max_cpus(struct kvm *kvm)
  return ret;
  }
  
 -struct kvm *kvm__init(const char *kvm_dev, u64 ram_size, const char *name)
 +struct kvm *kvm__init(const char *kvm_dev, const char *hugetlbfs_path, u64 
 ram_size, const char *name)
  {
  struct kvm *kvm;
  int ret;
 @@ -339,7 +339,7 @@ struct kvm *kvm__init(const char *kvm_dev, u64 ram_size, 
 const char *name)
  if (kvm__check_extensions(kvm))
  die(A required KVM extention is not supported by OS);
  
 -kvm__arch_init(kvm, kvm_dev, ram_size, name);
 +kvm__arch_init(kvm, kvm_dev, hugetlbfs_path, ram_size, name);
  
  kvm-name = name;
  
 diff --git a/tools/kvm/util.c b/tools/kvm/util.c
 index 4efbce9..90b6a3b 100644
 --- a/tools/kvm/util.c
 +++ b/tools/kvm/util.c
 @@ -4,6 +4,11 @@
  
  #include kvm/util.h
  
 +#include linux/magic.h/* For HUGETLBFS_MAGIC */
 +#include sys/mman.h
 +#include sys/stat.h
 +#include sys/statfs.h
 +
  static void report(const char *prefix, const char *err, va_list params)
  {
  char msg[1024];
 @@ -99,3 +104,43 @@ size_t strlcat(char *dest, const char *src, size_t count)
  
  return res;
  }
 +
 +void *mmap_hugetlbfs(const char *htlbfs_path, u64 size)
 +{
 +char mpath[PATH_MAX];
 +int fd;
 +int r;
 +struct statfs sfs;
 +

Re: [PATCH V2 04/23] kvm tools: Get correct 64-bit types on PPC64 and link appropriately

2011-12-11 Thread Pekka Enberg
On Mon, 2011-12-12 at 12:03 +1100, Matt Evans wrote:
 On 09/12/11 19:29, Pekka Enberg wrote:
  On Fri, Dec 9, 2011 at 10:24 AM, Sasha Levin levinsasha...@gmail.com 
  wrote:
  If you also got kernel patches that add __SANE_USERSPACE_TYPES__ to the
  headers, and KVM_CAP_NR_VCPUS to KVM PPC, we can carry them in the KVM
  tools tree as well.
  
  Yup, all we need is ACKs from PPC maintainers.
 
 Cool, I've pinged them re. __SANE_USERSPACE_TYPES__, and that would be useful 
 to
 carry in your tree.  But, IMHO, the patch I sent to Alex ([PATCH] KVM: PPC: 
 Add
 KVM_CAP_NR_VCPUS and KVM_CAP_MAX_VCPUS) should go in via his tree.  The
 KVM/PPC-HV kernel folk will get it quicker in their trees (pulled from Alex) 
 and
 it's not a build problem, only a limit of SMP CPU numbers.  That is, if 
 you're
 building a kernel for PPC KVM today you'll probably use something more similar
 to Alex's tree than mainline/kvm tools tree.

Definitely. The __SANE_USERSPACE_TYPES__ patch should probably go to
powerpc git tree in addition to our tree.

Pekka

--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 17/23] kvm tools: Add ability to map guest RAM from hugetlbfs

2011-12-11 Thread Pekka Enberg
On Mon, Dec 12, 2011 at 7:17 AM, Matt Evans m...@ozlabs.org wrote:
 Well, I'm manually mapping from hugetlbfs as currently* PPC KVM requires
 hugepages to back guest RAM and MADV_HUGEPAGE is just a hint, no?  I also 
 wanted
 things to work on kernels without transparent hugepages enabled.  I think it's
 safer to do things explicitly, as if the user requests hugepages it's more
 transparent (I'm thinking benchmarking, etc.) to be definitely using 
 hugepages.

OK, makes sense. You should probably mention that in the changelog.
--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Current kernel fails to compile with KVM on PowerPC

2011-12-11 Thread Alexander Graf

On 11.12.2011, at 16:16, Jörg Sommer wrote:

 Alexander Graf hat am Tue 22. Nov, 22:29 (+0100) geschrieben:
 On 22.11.2011, at 21:04, Jörg Sommer wrote:
 Jörg Sommer hat am Mon 07. Nov, 20:48 (+0100) geschrieben:
 I'm trying to build the kernel with the git commit-id
 31555213f03bca37d2c02e10946296052f4ecfcd, but it fails
 
 CHK include/linux/version.h
 HOSTCC  scripts/mod/modpost.o
 CHK include/generated/utsrelease.h
 UPD include/generated/utsrelease.h
 HOSTLD  scripts/mod/modpost
 GEN include/generated/bounds.h
 CC  arch/powerpc/kernel/asm-offsets.s
 In file included from arch/powerpc/kernel/asm-offsets.c:59:0:
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h: In function 
 ‘compute_tlbie_rb’:
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:393:10: error: 
 ‘HPTE_V_SECONDARY’ undeclared (first use in this function)
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:393:10: note: 
 each undeclared identifier is reported only once for each function it 
 appears in
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:396:12: error: 
 ‘HPTE_V_1TB_SEG’ undeclared (first use in this function)
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:401:10: error: 
 ‘HPTE_V_LARGE’ undeclared (first use in this function)
 /home/joerg/git/linux/arch/powerpc/include/asm/kvm_book3s.h:415:2: 
 warning: right shift count = width of type [enabled by default]
 make[3]: *** [arch/powerpc/kernel/asm-offsets.s] Fehler 1
 make[2]: *** [prepare0] Fehler 2
 make[1]: *** [deb-pkg] Fehler 2
 make: *** [deb-pkg] Fehler 2
 
 I'm still having this problem. I can' build
 6fe4c6d466e95d31164f14b1ac4aefb51f0f4f82. Are there any patches to
 make the kernel builds and do not oops [1] on PowerPC?
 
 The failures above should be fixed by now.
 
 I've pulled git://git.kernel.org/pub/scm/virt/kvm/kvm.git
 (a41d08d13f903da5c633fc58ee074156f05ab3ce), but this tree doesn't contain
 a suitable commit. Where can I find it?

Please try:

  git://github.com/agraf/linux-2.6.git kvm-ppc-next

That's my WIP tree. I still have a few more patches I want to collect before 
shoving everything through automated testing and pushing it on to Avi.


Alex

--
To unsubscribe from this list: send the line unsubscribe kvm-ppc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html