* [PATCH] kvm tools: arm: remove register accessor macros now that they are in uapi
@ 2014-08-29 13:00 Will Deacon
2014-09-05 10:22 ` Will Deacon
0 siblings, 1 reply; 2+ messages in thread
From: Will Deacon @ 2014-08-29 13:00 UTC (permalink / raw)
To: penberg; +Cc: penberg, kvm, Will Deacon
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>
---
Pekka -- please take this as a fix, since merging the 3.16 sources has
caused some breakage for ARM. Cheers!
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, ®) < 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.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] kvm tools: arm: remove register accessor macros now that they are in uapi
2014-08-29 13:00 [PATCH] kvm tools: arm: remove register accessor macros now that they are in uapi Will Deacon
@ 2014-09-05 10:22 ` Will Deacon
0 siblings, 0 replies; 2+ messages in thread
From: Will Deacon @ 2014-09-05 10:22 UTC (permalink / raw)
To: penberg@kernel.org; +Cc: penberg@iki.fi, kvm@vger.kernel.org
On Fri, Aug 29, 2014 at 02:00:24PM +0100, Will Deacon wrote:
> 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>
> ---
>
> Pekka -- please take this as a fix, since merging the 3.16 sources has
> caused some breakage for ARM. Cheers!
Ping? It would be great to get the build failure fixed on master.
Cheers,
Will
> 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, ®) < 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.1.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-05 10:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-29 13:00 [PATCH] kvm tools: arm: remove register accessor macros now that they are in uapi Will Deacon
2014-09-05 10:22 ` Will Deacon
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.