All of lore.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Anup Patel <anup.patel@linaro.org>, penberg@kernel.org
Cc: "kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"patches@apm.com" <patches@apm.com>,
	Marc Zyngier <Marc.Zyngier@arm.com>,
	"penberg@kernel.org" <penberg@kernel.org>,
	"christoffer.dall@linaro.org" <christoffer.dall@linaro.org>,
	"pranavkumar@linaro.org" <pranavkumar@linaro.org>
Subject: Re: [PATCH 2/5] kvmtool: ARM64: Fix compile error for aarch64
Date: Thu, 7 Aug 2014 10:12:12 +0100	[thread overview]
Message-ID: <20140807091212.GF13703@arm.com> (raw)
In-Reply-To: <CALrVBksRRCz3_QFccN22S2eyxLrrv+m4c7SgEr52iQFO_FYQ=Q@mail.gmail.com>

On Thu, Aug 07, 2014 at 09:50:52AM +0100, Anup Patel wrote:
> On 6 August 2014 18:20, Will Deacon <will.deacon@arm.com> wrote:
> > On Tue, Aug 05, 2014 at 09:49:56AM +0100, Anup Patel wrote:
> >> The __ARM64_SYS_REG() macro is already defined in uapi/asm/kvm.h
> >> of Linux-3.16-rcX hence remove it from arm/aarch64/kvm-cpu.c
> >
> > I've been carrying a similar patch in my kvmtool/arm branch, but upstream
> > kvmtool is still based on 3.13, so this isn't needed at the moment.
> >
> > Do you have a need for Pekka to merge in the latest kernel sources?
> >
> > Will
> 
> Yes, we should syncup KVMTOOL with latest kernel sources.
> 
> I want to be able to shutdown VM when using KVMTOOL. To do
> this we need to use PSCI-v0.2 from Guest kernel.

Ok. Pekka, could you merge in 3.16 to the kvmtool master branch please?
You'll need my patch below to resolve some ARM build fallout.

Cheers,

Will

--->8

>From e780359998667e3eb08d9d002398618a06a861b9 Mon Sep 17 00:00:00 2001
From: Will Deacon <will.deacon@arm.com>
Date: Tue, 13 May 2014 12:06:06 +0100
Subject: [PATCH] kvm tools: arm: remove register accessor macros now that they
 are in uapi

The kernel now exposes register accessor macros in the uapi/ headers
for arm and arm64, so use those instead (and avoid the compile failure
from the duplicate definitions).

Signed-off-by: Will Deacon <will.deacon@arm.com>
---
 tools/kvm/arm/aarch32/kvm-cpu.c | 15 +--------------
 tools/kvm/arm/aarch64/kvm-cpu.c | 15 ---------------
 2 files changed, 1 insertion(+), 29 deletions(-)

diff --git a/tools/kvm/arm/aarch32/kvm-cpu.c b/tools/kvm/arm/aarch32/kvm-cpu.c
index 464b473dc936..95fb1da5ba3d 100644
--- a/tools/kvm/arm/aarch32/kvm-cpu.c
+++ b/tools/kvm/arm/aarch32/kvm-cpu.c
@@ -7,25 +7,12 @@
 #define ARM_CORE_REG(x)	(KVM_REG_ARM | KVM_REG_SIZE_U32 | KVM_REG_ARM_CORE | \
 			 KVM_REG_ARM_CORE_REG(x))
 
-#define ARM_CP15_REG_SHIFT_MASK(x,n)		\
-	(((x) << KVM_REG_ARM_ ## n ## _SHIFT) & KVM_REG_ARM_ ## n ## _MASK)
-
-#define __ARM_CP15_REG(op1,crn,crm,op2)			\
-	(KVM_REG_ARM | KVM_REG_SIZE_U32		|	\
-	 (15 << KVM_REG_ARM_COPROC_SHIFT)	|	\
-	 ARM_CP15_REG_SHIFT_MASK(op1, OPC1)	|	\
-	 ARM_CP15_REG_SHIFT_MASK(crn, 32_CRN)	|	\
-	 ARM_CP15_REG_SHIFT_MASK(crm, CRM)	|	\
-	 ARM_CP15_REG_SHIFT_MASK(op2, 32_OPC2))
-
-#define ARM_CP15_REG(...)	__ARM_CP15_REG(__VA_ARGS__)
-
 unsigned long kvm_cpu__get_vcpu_mpidr(struct kvm_cpu *vcpu)
 {
 	struct kvm_one_reg reg;
 	u32 mpidr;
 
-	reg.id = ARM_CP15_REG(ARM_CPU_ID, ARM_CPU_ID_MPIDR);
+	reg.id = ARM_CP15_REG32(ARM_CPU_ID, ARM_CPU_ID_MPIDR);
 	reg.addr = (u64)(unsigned long)&mpidr;
 	if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, &reg) < 0)
 		die("KVM_GET_ONE_REG failed (get_mpidr vcpu%ld", vcpu->cpu_id);
diff --git a/tools/kvm/arm/aarch64/kvm-cpu.c b/tools/kvm/arm/aarch64/kvm-cpu.c
index 71a2a3a7789d..1b293748efd6 100644
--- a/tools/kvm/arm/aarch64/kvm-cpu.c
+++ b/tools/kvm/arm/aarch64/kvm-cpu.c
@@ -15,21 +15,6 @@
 #define ARM64_CORE_REG(x)	(KVM_REG_ARM64 | KVM_REG_SIZE_U64 | \
 				 KVM_REG_ARM_CORE | KVM_REG_ARM_CORE_REG(x))
 
-#define ARM64_SYS_REG_SHIFT_MASK(x,n)				\
-	(((x) << KVM_REG_ARM64_SYSREG_ ## n ## _SHIFT) &	\
-	 KVM_REG_ARM64_SYSREG_ ## n ## _MASK)
-
-#define __ARM64_SYS_REG(op0,op1,crn,crm,op2)			\
-	(KVM_REG_ARM64 | KVM_REG_SIZE_U64		|	\
-	 KVM_REG_ARM64_SYSREG				|	\
-	 ARM64_SYS_REG_SHIFT_MASK(op0, OP0)		|	\
-	 ARM64_SYS_REG_SHIFT_MASK(op1, OP1)		|	\
-	 ARM64_SYS_REG_SHIFT_MASK(crn, CRN)		|	\
-	 ARM64_SYS_REG_SHIFT_MASK(crm, CRM)		|	\
-	 ARM64_SYS_REG_SHIFT_MASK(op2, OP2))
-
-#define ARM64_SYS_REG(...)	__ARM64_SYS_REG(__VA_ARGS__)
-
 unsigned long kvm_cpu__get_vcpu_mpidr(struct kvm_cpu *vcpu)
 {
 	struct kvm_one_reg reg;
-- 
2.0.1


  reply	other threads:[~2014-08-07  9:12 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-05  8:49 [PATCH 0/5] kvmtool: ARM/ARM64: Misc updates Anup Patel
2014-08-05  8:49 ` [PATCH 1/5] kvmtool: ARM: Use KVM_ARM_PREFERRED_TARGET vm ioctl to determine target cpu Anup Patel
2014-08-06 12:48   ` Will Deacon
2014-08-07  8:44     ` Anup Patel
2014-08-07  8:52       ` Peter Maydell
2014-08-05  8:49 ` [PATCH 2/5] kvmtool: ARM64: Fix compile error for aarch64 Anup Patel
2014-08-06 12:50   ` Will Deacon
2014-08-07  8:50     ` Anup Patel
2014-08-07  9:12       ` Will Deacon [this message]
2014-08-28  9:56         ` Pekka Enberg
2014-08-28 10:03           ` Will Deacon
2014-08-05  8:49 ` [PATCH 3/5] kvmtool: ARM64: Add target type potenza " Anup Patel
2014-08-06 12:52   ` Will Deacon
2014-08-07  8:56     ` Anup Patel
2014-08-07  9:01       ` Will Deacon
2014-08-05  8:49 ` [PATCH 4/5] kvmtool: Handle exit reason KVM_EXIT_SYSTEM_EVENT Anup Patel
2014-08-06 12:53   ` Will Deacon
2014-08-07  8:57     ` Anup Patel
2014-08-05  8:49 ` [PATCH 5/5] kvmtool: ARM/ARM64: Provide PSCI-0.2 guest when in-kernel KVM supports it Anup Patel
2014-08-06 12:56   ` Will Deacon
2014-08-07  9:00     ` Anup Patel
2014-08-07  9:09       ` Will Deacon
2014-08-05  8:53 ` [PATCH 0/5] kvmtool: ARM/ARM64: Misc updates Anup Patel

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=20140807091212.GF13703@arm.com \
    --to=will.deacon@arm.com \
    --cc=Marc.Zyngier@arm.com \
    --cc=anup.patel@linaro.org \
    --cc=christoffer.dall@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=patches@apm.com \
    --cc=penberg@kernel.org \
    --cc=pranavkumar@linaro.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.