From: James Hogan <james.hogan@imgtec.com>
To: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>,
Pekka Enberg <penberg@kernel.org>
Cc: David Daney <ddaney.cavm@gmail.com>, <kvm@vger.kernel.org>,
<linux-mips@linux-mips.org>
Subject: Re: [PATCH v2 08/12] kvm tools: Provide per arch macro to specify type for KVM_CREATE_VM
Date: Tue, 20 May 2014 12:24:58 +0100 [thread overview]
Message-ID: <537B3B8A.5000600@imgtec.com> (raw)
In-Reply-To: <1400518411-9759-9-git-send-email-andreas.herrmann@caviumnetworks.com>
On 19/05/14 17:53, Andreas Herrmann wrote:
> This is is usually 0 for most archs. On mips we have two types.
> TE (type 0) and MIPS-VZ (type 1). Default to 1 on mips.
Minor thing I didn't spot with v1 (sorry).
I think this patch should probably be moved before patch 6 with the mips
part squashed into patch 6, otherwise AFAICT the mips support in patch
6/7 is broken out of the box until this patch fixes it.
Cheers
James
>
> Signed-off-by: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
> ---
> tools/kvm/arm/include/arm-common/kvm-arch.h | 2 ++
> tools/kvm/kvm.c | 2 +-
> tools/kvm/mips/include/kvm/kvm-arch.h | 5 +++++
> tools/kvm/powerpc/include/kvm/kvm-arch.h | 2 ++
> tools/kvm/x86/include/kvm/kvm-arch.h | 2 ++
> 5 files changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/tools/kvm/arm/include/arm-common/kvm-arch.h b/tools/kvm/arm/include/arm-common/kvm-arch.h
> index b6c4bf8..a552163 100644
> --- a/tools/kvm/arm/include/arm-common/kvm-arch.h
> +++ b/tools/kvm/arm/include/arm-common/kvm-arch.h
> @@ -32,6 +32,8 @@
>
> #define KVM_IRQ_OFFSET GIC_SPI_IRQ_BASE
>
> +#define KVM_VM_TYPE 0
> +
> #define VIRTIO_DEFAULT_TRANS(kvm) \
> ((kvm)->cfg.arch.virtio_trans_pci ? VIRTIO_PCI : VIRTIO_MMIO)
>
> diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c
> index 6046434..e1b9f6c 100644
> --- a/tools/kvm/kvm.c
> +++ b/tools/kvm/kvm.c
> @@ -284,7 +284,7 @@ int kvm__init(struct kvm *kvm)
> goto err_sys_fd;
> }
>
> - kvm->vm_fd = ioctl(kvm->sys_fd, KVM_CREATE_VM, 0);
> + kvm->vm_fd = ioctl(kvm->sys_fd, KVM_CREATE_VM, KVM_VM_TYPE);
> if (kvm->vm_fd < 0) {
> pr_err("KVM_CREATE_VM ioctl");
> ret = kvm->vm_fd;
> diff --git a/tools/kvm/mips/include/kvm/kvm-arch.h b/tools/kvm/mips/include/kvm/kvm-arch.h
> index 4a8407b..7eadbf4 100644
> --- a/tools/kvm/mips/include/kvm/kvm-arch.h
> +++ b/tools/kvm/mips/include/kvm/kvm-arch.h
> @@ -17,6 +17,11 @@
>
> #define KVM_IRQ_OFFSET 1
>
> +/*
> + * MIPS-VZ (trap and emulate is 0)
> + */
> +#define KVM_VM_TYPE 1
> +
> #define VIRTIO_DEFAULT_TRANS(kvm) VIRTIO_PCI
>
> #include <stdbool.h>
> diff --git a/tools/kvm/powerpc/include/kvm/kvm-arch.h b/tools/kvm/powerpc/include/kvm/kvm-arch.h
> index f8627a2..fdd518f 100644
> --- a/tools/kvm/powerpc/include/kvm/kvm-arch.h
> +++ b/tools/kvm/powerpc/include/kvm/kvm-arch.h
> @@ -44,6 +44,8 @@
>
> #define KVM_IRQ_OFFSET 16
>
> +#define KVM_VM_TYPE 0
> +
> #define VIRTIO_DEFAULT_TRANS(kvm) VIRTIO_PCI
>
> struct spapr_phb;
> diff --git a/tools/kvm/x86/include/kvm/kvm-arch.h b/tools/kvm/x86/include/kvm/kvm-arch.h
> index a9f23b8..673bdf1 100644
> --- a/tools/kvm/x86/include/kvm/kvm-arch.h
> +++ b/tools/kvm/x86/include/kvm/kvm-arch.h
> @@ -27,6 +27,8 @@
>
> #define KVM_IRQ_OFFSET 5
>
> +#define KVM_VM_TYPE 0
> +
> #define VIRTIO_DEFAULT_TRANS(kvm) VIRTIO_PCI
>
> struct kvm_arch {
>
WARNING: multiple messages have this Message-ID (diff)
From: James Hogan <james.hogan@imgtec.com>
To: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>,
Pekka Enberg <penberg@kernel.org>
Cc: David Daney <ddaney.cavm@gmail.com>,
kvm@vger.kernel.org, linux-mips@linux-mips.org
Subject: Re: [PATCH v2 08/12] kvm tools: Provide per arch macro to specify type for KVM_CREATE_VM
Date: Tue, 20 May 2014 12:24:58 +0100 [thread overview]
Message-ID: <537B3B8A.5000600@imgtec.com> (raw)
Message-ID: <20140520112458.enqvVB0MHbbGmWAPXfMaU6L-w3eEMbh9vo2lflIzuck@z> (raw)
In-Reply-To: <1400518411-9759-9-git-send-email-andreas.herrmann@caviumnetworks.com>
On 19/05/14 17:53, Andreas Herrmann wrote:
> This is is usually 0 for most archs. On mips we have two types.
> TE (type 0) and MIPS-VZ (type 1). Default to 1 on mips.
Minor thing I didn't spot with v1 (sorry).
I think this patch should probably be moved before patch 6 with the mips
part squashed into patch 6, otherwise AFAICT the mips support in patch
6/7 is broken out of the box until this patch fixes it.
Cheers
James
>
> Signed-off-by: Andreas Herrmann <andreas.herrmann@caviumnetworks.com>
> ---
> tools/kvm/arm/include/arm-common/kvm-arch.h | 2 ++
> tools/kvm/kvm.c | 2 +-
> tools/kvm/mips/include/kvm/kvm-arch.h | 5 +++++
> tools/kvm/powerpc/include/kvm/kvm-arch.h | 2 ++
> tools/kvm/x86/include/kvm/kvm-arch.h | 2 ++
> 5 files changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/tools/kvm/arm/include/arm-common/kvm-arch.h b/tools/kvm/arm/include/arm-common/kvm-arch.h
> index b6c4bf8..a552163 100644
> --- a/tools/kvm/arm/include/arm-common/kvm-arch.h
> +++ b/tools/kvm/arm/include/arm-common/kvm-arch.h
> @@ -32,6 +32,8 @@
>
> #define KVM_IRQ_OFFSET GIC_SPI_IRQ_BASE
>
> +#define KVM_VM_TYPE 0
> +
> #define VIRTIO_DEFAULT_TRANS(kvm) \
> ((kvm)->cfg.arch.virtio_trans_pci ? VIRTIO_PCI : VIRTIO_MMIO)
>
> diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c
> index 6046434..e1b9f6c 100644
> --- a/tools/kvm/kvm.c
> +++ b/tools/kvm/kvm.c
> @@ -284,7 +284,7 @@ int kvm__init(struct kvm *kvm)
> goto err_sys_fd;
> }
>
> - kvm->vm_fd = ioctl(kvm->sys_fd, KVM_CREATE_VM, 0);
> + kvm->vm_fd = ioctl(kvm->sys_fd, KVM_CREATE_VM, KVM_VM_TYPE);
> if (kvm->vm_fd < 0) {
> pr_err("KVM_CREATE_VM ioctl");
> ret = kvm->vm_fd;
> diff --git a/tools/kvm/mips/include/kvm/kvm-arch.h b/tools/kvm/mips/include/kvm/kvm-arch.h
> index 4a8407b..7eadbf4 100644
> --- a/tools/kvm/mips/include/kvm/kvm-arch.h
> +++ b/tools/kvm/mips/include/kvm/kvm-arch.h
> @@ -17,6 +17,11 @@
>
> #define KVM_IRQ_OFFSET 1
>
> +/*
> + * MIPS-VZ (trap and emulate is 0)
> + */
> +#define KVM_VM_TYPE 1
> +
> #define VIRTIO_DEFAULT_TRANS(kvm) VIRTIO_PCI
>
> #include <stdbool.h>
> diff --git a/tools/kvm/powerpc/include/kvm/kvm-arch.h b/tools/kvm/powerpc/include/kvm/kvm-arch.h
> index f8627a2..fdd518f 100644
> --- a/tools/kvm/powerpc/include/kvm/kvm-arch.h
> +++ b/tools/kvm/powerpc/include/kvm/kvm-arch.h
> @@ -44,6 +44,8 @@
>
> #define KVM_IRQ_OFFSET 16
>
> +#define KVM_VM_TYPE 0
> +
> #define VIRTIO_DEFAULT_TRANS(kvm) VIRTIO_PCI
>
> struct spapr_phb;
> diff --git a/tools/kvm/x86/include/kvm/kvm-arch.h b/tools/kvm/x86/include/kvm/kvm-arch.h
> index a9f23b8..673bdf1 100644
> --- a/tools/kvm/x86/include/kvm/kvm-arch.h
> +++ b/tools/kvm/x86/include/kvm/kvm-arch.h
> @@ -27,6 +27,8 @@
>
> #define KVM_IRQ_OFFSET 5
>
> +#define KVM_VM_TYPE 0
> +
> #define VIRTIO_DEFAULT_TRANS(kvm) VIRTIO_PCI
>
> struct kvm_arch {
>
next prev parent reply other threads:[~2014-05-20 11:29 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-19 16:53 [PATCH v2 00/12] kvm tools: Misc patches (mips support) Andreas Herrmann
2014-05-19 16:53 ` Andreas Herrmann
2014-05-19 16:53 ` [PATCH v2 01/12] kvm tools: Print message on failure of KVM_CREATE_VM Andreas Herrmann
2014-05-19 16:53 ` Andreas Herrmann
2014-05-19 16:53 ` [PATCH v2 02/12] kvm tools: Fix print format warnings Andreas Herrmann
2014-05-19 16:53 ` Andreas Herrmann
2014-05-19 16:53 ` [PATCH v2 03/12] kvm tools: Move definition of TERM_MAX_DEVS to header Andreas Herrmann
2014-05-19 16:53 ` Andreas Herrmann
2014-05-19 16:53 ` [PATCH v2 04/12] kvm tools: Allow to load ELF binary Andreas Herrmann
2014-05-19 16:53 ` Andreas Herrmann
2014-05-19 16:53 ` [PATCH v2 05/12] kvm tools: Introduce weak (default) load_bzimage function Andreas Herrmann
2014-05-19 16:53 ` Andreas Herrmann
2014-05-19 16:53 ` [PATCH v2 06/12] kvm tools, mips: Add MIPS support Andreas Herrmann
2014-05-19 16:53 ` Andreas Herrmann
2014-05-19 16:53 ` [PATCH v2 07/12] kvm tools, mips: Enable build of mips support Andreas Herrmann
2014-05-19 16:53 ` Andreas Herrmann
2014-05-19 16:53 ` [PATCH v2 08/12] kvm tools: Provide per arch macro to specify type for KVM_CREATE_VM Andreas Herrmann
2014-05-19 16:53 ` Andreas Herrmann
2014-05-20 11:24 ` James Hogan [this message]
2014-05-20 11:24 ` James Hogan
2014-05-20 14:55 ` Andreas Herrmann
2014-05-20 14:55 ` Andreas Herrmann
2014-05-19 16:53 ` [PATCH v2 09/12] kvm tools: Handle virtio/pci I/O space as little endian Andreas Herrmann
2014-05-19 16:53 ` Andreas Herrmann
2014-05-19 16:53 ` [PATCH v2 10/12] kvm tools, mips: Add support for loading elf binaries Andreas Herrmann
2014-05-19 16:53 ` Andreas Herrmann
2014-05-19 16:53 ` [PATCH v2 11/12] kvm tools: Modify term_putc to write more than one char Andreas Herrmann
2014-05-19 16:53 ` Andreas Herrmann
2014-05-19 16:53 ` [PATCH v2 12/12] kvm tools: Return number of bytes written by term_putc Andreas Herrmann
2014-05-19 16:53 ` Andreas Herrmann
2014-05-20 11:20 ` [PATCH v2 00/12] kvm tools: Misc patches (mips support) James Hogan
2014-05-20 11:20 ` James Hogan
2014-05-20 17:52 ` Pekka Enberg
2014-05-20 21:25 ` James Hogan
2014-05-20 21:25 ` James Hogan
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=537B3B8A.5000600@imgtec.com \
--to=james.hogan@imgtec.com \
--cc=andreas.herrmann@caviumnetworks.com \
--cc=ddaney.cavm@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=penberg@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.