* [PATCH] arch: arm64: kernel: add '#ifdef CONFIG_COMPAT' for aarch32_break_handler()
@ 2013-06-22 5:54 Chen Gang
2013-06-24 8:47 ` Will Deacon
2013-06-24 9:27 ` [PATCH v2] " Chen Gang
0 siblings, 2 replies; 12+ messages in thread
From: Chen Gang @ 2013-06-22 5:54 UTC (permalink / raw)
To: linux-arm-kernel
If 'COMPAT' not defined, aarch32_break_handler() cannot pass compiling,
so need add '#ifdef' for it just like the header file has done.
The related make:
make ARCH=arm64 randconfig
make ARCH=arm64 menuconfig
make ARCH=arm64 V=1 EXTRA_CFLAGS=-W
The related error:
arch/arm64/kernel/debug-monitors.c:249:5: error: redefinition of ?aarch32_break_handler?
In file included from arch/arm64/kernel/debug-monitors.c:29:0:
/root/linux-next/arch/arm64/include/asm/debug-monitors.h:89:12: note: previous definition of ?aarch32_break_handler? was here
Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
arch/arm64/kernel/debug-monitors.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
index 08018e3..ceedcd7 100644
--- a/arch/arm64/kernel/debug-monitors.c
+++ b/arch/arm64/kernel/debug-monitors.c
@@ -246,6 +246,7 @@ static int brk_handler(unsigned long addr, unsigned int esr,
return 0;
}
+#ifdef CONFIG_COMPAT
int aarch32_break_handler(struct pt_regs *regs)
{
siginfo_t info;
@@ -285,6 +286,7 @@ int aarch32_break_handler(struct pt_regs *regs)
force_sig_info(SIGTRAP, &info, current);
return 0;
}
+#endif
static int __init debug_traps_init(void)
{
--
1.7.7.6
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH] arch: arm64: kernel: add '#ifdef CONFIG_COMPAT' for aarch32_break_handler()
2013-06-22 5:54 [PATCH] arch: arm64: kernel: add '#ifdef CONFIG_COMPAT' for aarch32_break_handler() Chen Gang
@ 2013-06-24 8:47 ` Will Deacon
2013-06-24 9:19 ` Chen Gang
2013-06-24 9:27 ` [PATCH v2] " Chen Gang
1 sibling, 1 reply; 12+ messages in thread
From: Will Deacon @ 2013-06-24 8:47 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Jun 22, 2013 at 06:54:14AM +0100, Chen Gang wrote:
>
> If 'COMPAT' not defined, aarch32_break_handler() cannot pass compiling,
> so need add '#ifdef' for it just like the header file has done.
>
> The related make:
>
> make ARCH=arm64 randconfig
> make ARCH=arm64 menuconfig
> make ARCH=arm64 V=1 EXTRA_CFLAGS=-W
>
> The related error:
>
> arch/arm64/kernel/debug-monitors.c:249:5: error: redefinition of ?aarch32_break_handler?
> In file included from arch/arm64/kernel/debug-monitors.c:29:0:
> /root/linux-next/arch/arm64/include/asm/debug-monitors.h:89:12: note: previous definition of ?aarch32_break_handler? was here
Actually, can we just kill the static definition in debug-monitors.h
instead? I don't see anything in the full-blown aardch32_break_handler that
won't play nicely if !COMPAT.
Will
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] arch: arm64: kernel: add '#ifdef CONFIG_COMPAT' for aarch32_break_handler()
2013-06-24 8:47 ` Will Deacon
@ 2013-06-24 9:19 ` Chen Gang
0 siblings, 0 replies; 12+ messages in thread
From: Chen Gang @ 2013-06-24 9:19 UTC (permalink / raw)
To: linux-arm-kernel
On 06/24/2013 04:47 PM, Will Deacon wrote:
> On Sat, Jun 22, 2013 at 06:54:14AM +0100, Chen Gang wrote:
>> >
>> > If 'COMPAT' not defined, aarch32_break_handler() cannot pass compiling,
>> > so need add '#ifdef' for it just like the header file has done.
>> >
>> > The related make:
>> >
>> > make ARCH=arm64 randconfig
>> > make ARCH=arm64 menuconfig
>> > make ARCH=arm64 V=1 EXTRA_CFLAGS=-W
>> >
>> > The related error:
>> >
>> > arch/arm64/kernel/debug-monitors.c:249:5: error: redefinition of ?aarch32_break_handler?
>> > In file included from arch/arm64/kernel/debug-monitors.c:29:0:
>> > /root/linux-next/arch/arm64/include/asm/debug-monitors.h:89:12: note: previous definition of ?aarch32_break_handler? was here
> Actually, can we just kill the static definition in debug-monitors.h
> instead? I don't see anything in the full-blown aardch32_break_handler that
> won't play nicely if !COMPAT.
It sounds good, I will send patch v2.
Thanks.
--
Chen Gang
Asianux Corporation
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2] arch: arm64: kernel: add '#ifdef CONFIG_COMPAT' for aarch32_break_handler()
2013-06-22 5:54 [PATCH] arch: arm64: kernel: add '#ifdef CONFIG_COMPAT' for aarch32_break_handler() Chen Gang
2013-06-24 8:47 ` Will Deacon
@ 2013-06-24 9:27 ` Chen Gang
2013-06-24 10:14 ` Will Deacon
[not found] ` <51C81A39.5060909@asianux.com>
1 sibling, 2 replies; 12+ messages in thread
From: Chen Gang @ 2013-06-24 9:27 UTC (permalink / raw)
To: linux-arm-kernel
If 'COMPAT' not defined, aarch32_break_handler() cannot pass compiling,
and it can work independent with 'COMPAT', so remove dummy definition.
The related make:
make ARCH=arm64 randconfig
make ARCH=arm64 menuconfig
make ARCH=arm64 V=1 EXTRA_CFLAGS=-W
The related error:
arch/arm64/kernel/debug-monitors.c:249:5: error: redefinition of ?aarch32_break_handler?
In file included from arch/arm64/kernel/debug-monitors.c:29:0:
/root/linux-next/arch/arm64/include/asm/debug-monitors.h:89:12: note: previous definition of ?aarch32_break_handler? was here
Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
arch/arm64/include/asm/debug-monitors.h | 7 -------
1 files changed, 0 insertions(+), 7 deletions(-)
diff --git a/arch/arm64/include/asm/debug-monitors.h b/arch/arm64/include/asm/debug-monitors.h
index ef8235c..a2232d0 100644
--- a/arch/arm64/include/asm/debug-monitors.h
+++ b/arch/arm64/include/asm/debug-monitors.h
@@ -83,14 +83,7 @@ static inline int reinstall_suspended_bps(struct pt_regs *regs)
}
#endif
-#ifdef CONFIG_COMPAT
int aarch32_break_handler(struct pt_regs *regs);
-#else
-static int aarch32_break_handler(struct pt_regs *regs)
-{
- return -EFAULT;
-}
-#endif
#endif /* __ASSEMBLY */
#endif /* __KERNEL__ */
--
1.7.7.6
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2] arch: arm64: kernel: add '#ifdef CONFIG_COMPAT' for aarch32_break_handler()
2013-06-24 9:27 ` [PATCH v2] " Chen Gang
@ 2013-06-24 10:14 ` Will Deacon
2013-06-24 10:16 ` Chen Gang
[not found] ` <51C81A39.5060909@asianux.com>
1 sibling, 1 reply; 12+ messages in thread
From: Will Deacon @ 2013-06-24 10:14 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Jun 24, 2013 at 10:27:49AM +0100, Chen Gang wrote:
>
> If 'COMPAT' not defined, aarch32_break_handler() cannot pass compiling,
> and it can work independent with 'COMPAT', so remove dummy definition.
>
> The related make:
>
> make ARCH=arm64 randconfig
> make ARCH=arm64 menuconfig
> make ARCH=arm64 V=1 EXTRA_CFLAGS=-W
This sequence isn't really very useful, so I wouldn't bother including it in
the commit message. You can trigger this issue just by disabling
CONFIG_COMPAT.
> The related error:
>
> arch/arm64/kernel/debug-monitors.c:249:5: error: redefinition of ?aarch32_break_handler?
> In file included from arch/arm64/kernel/debug-monitors.c:29:0:
> /root/linux-next/arch/arm64/include/asm/debug-monitors.h:89:12: note: previous definition of ?aarch32_break_handler? was here
>
>
>
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
> arch/arm64/include/asm/debug-monitors.h | 7 -------
> 1 files changed, 0 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm64/include/asm/debug-monitors.h b/arch/arm64/include/asm/debug-monitors.h
> index ef8235c..a2232d0 100644
> --- a/arch/arm64/include/asm/debug-monitors.h
> +++ b/arch/arm64/include/asm/debug-monitors.h
> @@ -83,14 +83,7 @@ static inline int reinstall_suspended_bps(struct pt_regs *regs)
> }
> #endif
>
> -#ifdef CONFIG_COMPAT
> int aarch32_break_handler(struct pt_regs *regs);
> -#else
> -static int aarch32_break_handler(struct pt_regs *regs)
> -{
> - return -EFAULT;
> -}
> -#endif
Code looks fine to me:
Acked-by: Will Deacon <will.deacon@arm.com>
Will
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2] arch: arm64: kernel: add '#ifdef CONFIG_COMPAT' for aarch32_break_handler()
2013-06-24 10:14 ` Will Deacon
@ 2013-06-24 10:16 ` Chen Gang
0 siblings, 0 replies; 12+ messages in thread
From: Chen Gang @ 2013-06-24 10:16 UTC (permalink / raw)
To: linux-arm-kernel
On 06/24/2013 06:14 PM, Will Deacon wrote:
> On Mon, Jun 24, 2013 at 10:27:49AM +0100, Chen Gang wrote:
>> >
>> > If 'COMPAT' not defined, aarch32_break_handler() cannot pass compiling,
>> > and it can work independent with 'COMPAT', so remove dummy definition.
>> >
>> > The related make:
>> >
>> > make ARCH=arm64 randconfig
>> > make ARCH=arm64 menuconfig
>> > make ARCH=arm64 V=1 EXTRA_CFLAGS=-W
> This sequence isn't really very useful, so I wouldn't bother including it in
> the commit message. You can trigger this issue just by disabling
> CONFIG_COMPAT.
>
OK, thanks. Next time, I need notice about it.
>> > The related error:
>> >
>> > arch/arm64/kernel/debug-monitors.c:249:5: error: redefinition of ?aarch32_break_handler?
>> > In file included from arch/arm64/kernel/debug-monitors.c:29:0:
>> > /root/linux-next/arch/arm64/include/asm/debug-monitors.h:89:12: note: previous definition of ?aarch32_break_handler? was here
>> >
>> >
>> >
>> > Signed-off-by: Chen Gang <gang.chen@asianux.com>
>> > ---
>> > arch/arm64/include/asm/debug-monitors.h | 7 -------
>> > 1 files changed, 0 insertions(+), 7 deletions(-)
>> >
>> > diff --git a/arch/arm64/include/asm/debug-monitors.h b/arch/arm64/include/asm/debug-monitors.h
>> > index ef8235c..a2232d0 100644
>> > --- a/arch/arm64/include/asm/debug-monitors.h
>> > +++ b/arch/arm64/include/asm/debug-monitors.h
>> > @@ -83,14 +83,7 @@ static inline int reinstall_suspended_bps(struct pt_regs *regs)
>> > }
>> > #endif
>> >
>> > -#ifdef CONFIG_COMPAT
>> > int aarch32_break_handler(struct pt_regs *regs);
>> > -#else
>> > -static int aarch32_break_handler(struct pt_regs *regs)
>> > -{
>> > - return -EFAULT;
>> > -}
>> > -#endif
> Code looks fine to me:
>
> Acked-by: Will Deacon <will.deacon@arm.com>
Thanks.
--
Chen Gang
Asianux Corporation
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Suggestion] arch: arm64: xen: "ln -s" the paravirt.h from arm.
[not found] ` <51C81A39.5060909@asianux.com>
@ 2013-06-24 15:43 ` Stefano Stabellini
2013-06-24 16:50 ` Stefano Stabellini
0 siblings, 1 reply; 12+ messages in thread
From: Stefano Stabellini @ 2013-06-24 15:43 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 24 Jun 2013, Chen Gang wrote:
> Hello Maintainers:
>
> if 'CONFIG_XEN'
>
> CC arch/arm64/xen/../../arm/xen/enlighten.o
> arch/arm64/xen/../../arm/xen/enlighten.c:19:26: fatal error: asm/paravirt.h: No such file or directory
>
> The related .config file for next-20130624 is in attachment.
>
>
> If "ln -s ../../../arm/include/asm/paravirt.h paravirt.h", it can pass
> compiling, but I do not know how to make a patch for it ("ln -s ..."),
> Do we have another more suitable ways for it (or another fixing ways) ?
>
> Welcome any suggestions or completions.
The problem is caused by:
commit 3a885582a366caf868b0782041c44854ff4c3568
Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date: Wed May 29 10:56:34 2013 +0000
xen/arm: account for stolen ticks
that is in my tree for linux-next (even though I have not received any
replies from the ARM maintainers so I don't know when and if it is going
to go upstream).
I think that the best thing to do would be to add a couple of ifdef
CONFIG_PARAVIRT in arch/arm/xen/enlighten.c. I'll add them to my tree.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Suggestion] arch: arm64: xen: "ln -s" the paravirt.h from arm.
2013-06-24 15:43 ` [Suggestion] arch: arm64: xen: "ln -s" the paravirt.h from arm Stefano Stabellini
@ 2013-06-24 16:50 ` Stefano Stabellini
2013-06-25 1:31 ` Chen Gang
2013-06-25 13:25 ` Catalin Marinas
0 siblings, 2 replies; 12+ messages in thread
From: Stefano Stabellini @ 2013-06-24 16:50 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, 24 Jun 2013, Stefano Stabellini wrote:
> On Mon, 24 Jun 2013, Chen Gang wrote:
> > Hello Maintainers:
> >
> > if 'CONFIG_XEN'
> >
> > CC arch/arm64/xen/../../arm/xen/enlighten.o
> > arch/arm64/xen/../../arm/xen/enlighten.c:19:26: fatal error: asm/paravirt.h: No such file or directory
> >
> > The related .config file for next-20130624 is in attachment.
> >
> >
> > If "ln -s ../../../arm/include/asm/paravirt.h paravirt.h", it can pass
> > compiling, but I do not know how to make a patch for it ("ln -s ..."),
> > Do we have another more suitable ways for it (or another fixing ways) ?
> >
> > Welcome any suggestions or completions.
>
> The problem is caused by:
>
> commit 3a885582a366caf868b0782041c44854ff4c3568
> Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Date: Wed May 29 10:56:34 2013 +0000
>
> xen/arm: account for stolen ticks
>
> that is in my tree for linux-next (even though I have not received any
> replies from the ARM maintainers so I don't know when and if it is going
> to go upstream).
>
> I think that the best thing to do would be to add a couple of ifdef
> CONFIG_PARAVIRT in arch/arm/xen/enlighten.c. I'll add them to my tree.
Actually now that we have XEN support under arm64, we can just introduce the
same pv_time_op struct and paravirt header that this patch
http://marc.info/?l=linux-arm-kernel&m=136992435301890&w=2
is introducing under arm.
Any opinions?
---
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 19c1cde..47bd26b 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -207,6 +207,25 @@ config FORCE_MAX_ZONEORDER
default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE)
default "11"
+config PARAVIRT
+ bool "Enable paravirtualization code"
+ ---help---
+ This changes the kernel so it can modify itself when it is run
+ under a hypervisor, potentially improving performance significantly
+ over full virtualization.
+
+config PARAVIRT_TIME_ACCOUNTING
+ bool "Paravirtual steal time accounting"
+ select PARAVIRT
+ default n
+ ---help---
+ Select this option to enable fine granularity task steal time
+ accounting. Time spent executing other tasks in parallel with
+ the current vCPU is discounted from the vCPU power. To account for
+ that, there can be a small performance impact.
+
+ If in doubt, say N here.
+
config XEN_DOM0
def_bool y
depends on XEN
@@ -214,6 +233,7 @@ config XEN_DOM0
config XEN
bool "Xen guest support on ARM64 (EXPERIMENTAL)"
depends on ARM64 && OF
+ select PARAVIRT
help
Say Y if you want to run Linux in a Virtual Machine on Xen on ARM64.
diff --git a/arch/arm64/include/asm/paravirt.h b/arch/arm64/include/asm/paravirt.h
new file mode 100644
index 0000000..54e895b
--- /dev/null
+++ b/arch/arm64/include/asm/paravirt.h
@@ -0,0 +1,19 @@
+#ifndef _ASM_ARM64_PARAVIRT_H
+#define _ASM_ARM64_PARAVIRT_H
+
+struct static_key;
+extern struct static_key paravirt_steal_enabled;
+extern struct static_key paravirt_steal_rq_enabled;
+
+struct pv_time_ops {
+ unsigned long long (*steal_clock)(int cpu);
+};
+extern struct pv_time_ops pv_time_ops;
+
+static inline u64 paravirt_steal_clock(int cpu)
+{
+ return pv_time_ops.steal_clock(cpu);
+}
+
+
+#endif
diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
index 7b4b564..17613ad 100644
--- a/arch/arm64/kernel/Makefile
+++ b/arch/arm64/kernel/Makefile
@@ -18,6 +18,7 @@ arm64-obj-$(CONFIG_SMP) += smp.o smp_spin_table.o smp_psci.o
arm64-obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o
arm64-obj-$(CONFIG_HAVE_HW_BREAKPOINT)+= hw_breakpoint.o
arm64-obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
+arm64-obj-$(CONFIG_PARAVIRT) += paravirt.o
obj-y += $(arm64-obj-y) vdso/
obj-m += $(arm64-obj-m)
diff --git a/arch/arm64/kernel/paravirt.c b/arch/arm64/kernel/paravirt.c
new file mode 100644
index 0000000..53f371e
--- /dev/null
+++ b/arch/arm64/kernel/paravirt.c
@@ -0,0 +1,25 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Copyright (C) 2013 Citrix Systems
+ *
+ * Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
+ */
+
+#include <linux/export.h>
+#include <linux/jump_label.h>
+#include <linux/types.h>
+#include <asm/paravirt.h>
+
+struct static_key paravirt_steal_enabled;
+struct static_key paravirt_steal_rq_enabled;
+
+struct pv_time_ops pv_time_ops;
+EXPORT_SYMBOL_GPL(pv_time_ops);
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [Suggestion] arch: arm64: xen: "ln -s" the paravirt.h from arm.
2013-06-24 16:50 ` Stefano Stabellini
@ 2013-06-25 1:31 ` Chen Gang
2013-06-25 12:32 ` Stefano Stabellini
2013-06-25 13:25 ` Catalin Marinas
1 sibling, 1 reply; 12+ messages in thread
From: Chen Gang @ 2013-06-25 1:31 UTC (permalink / raw)
To: linux-arm-kernel
On 06/25/2013 12:50 AM, Stefano Stabellini wrote:
> On Mon, 24 Jun 2013, Stefano Stabellini wrote:
>> > On Mon, 24 Jun 2013, Chen Gang wrote:
>>> > > Hello Maintainers:
>>> > >
>>> > > if 'CONFIG_XEN'
>>> > >
>>> > > CC arch/arm64/xen/../../arm/xen/enlighten.o
>>> > > arch/arm64/xen/../../arm/xen/enlighten.c:19:26: fatal error: asm/paravirt.h: No such file or directory
>>> > >
>>> > > The related .config file for next-20130624 is in attachment.
>>> > >
>>> > >
>>> > > If "ln -s ../../../arm/include/asm/paravirt.h paravirt.h", it can pass
>>> > > compiling, but I do not know how to make a patch for it ("ln -s ..."),
>>> > > Do we have another more suitable ways for it (or another fixing ways) ?
>>> > >
>>> > > Welcome any suggestions or completions.
>> >
>> > The problem is caused by:
>> >
>> > commit 3a885582a366caf868b0782041c44854ff4c3568
>> > Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>> > Date: Wed May 29 10:56:34 2013 +0000
>> >
>> > xen/arm: account for stolen ticks
>> >
>> > that is in my tree for linux-next (even though I have not received any
>> > replies from the ARM maintainers so I don't know when and if it is going
>> > to go upstream).
>> >
>> > I think that the best thing to do would be to add a couple of ifdef
>> > CONFIG_PARAVIRT in arch/arm/xen/enlighten.c. I'll add them to my tree.
> Actually now that we have XEN support under arm64, we can just introduce the
> same pv_time_op struct and paravirt header that this patch
>
> http://marc.info/?l=linux-arm-kernel&m=136992435301890&w=2
>
> is introducing under arm.
> Any opinions?
>
OK, thanks, and excuse me, I can not open the link above (the reason
maybe it can not be accessed from China).
But at least, the patch below is better than "ln -s" (which I provided).
Thanks.
> ---
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 19c1cde..47bd26b 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -207,6 +207,25 @@ config FORCE_MAX_ZONEORDER
> default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE)
> default "11"
>
> +config PARAVIRT
> + bool "Enable paravirtualization code"
> + ---help---
> + This changes the kernel so it can modify itself when it is run
> + under a hypervisor, potentially improving performance significantly
> + over full virtualization.
> +
> +config PARAVIRT_TIME_ACCOUNTING
> + bool "Paravirtual steal time accounting"
> + select PARAVIRT
> + default n
> + ---help---
> + Select this option to enable fine granularity task steal time
> + accounting. Time spent executing other tasks in parallel with
> + the current vCPU is discounted from the vCPU power. To account for
> + that, there can be a small performance impact.
> +
> + If in doubt, say N here.
> +
> config XEN_DOM0
> def_bool y
> depends on XEN
> @@ -214,6 +233,7 @@ config XEN_DOM0
> config XEN
> bool "Xen guest support on ARM64 (EXPERIMENTAL)"
> depends on ARM64 && OF
> + select PARAVIRT
> help
> Say Y if you want to run Linux in a Virtual Machine on Xen on ARM64.
>
> diff --git a/arch/arm64/include/asm/paravirt.h b/arch/arm64/include/asm/paravirt.h
> new file mode 100644
> index 0000000..54e895b
> --- /dev/null
> +++ b/arch/arm64/include/asm/paravirt.h
> @@ -0,0 +1,19 @@
> +#ifndef _ASM_ARM64_PARAVIRT_H
> +#define _ASM_ARM64_PARAVIRT_H
> +
> +struct static_key;
> +extern struct static_key paravirt_steal_enabled;
> +extern struct static_key paravirt_steal_rq_enabled;
> +
> +struct pv_time_ops {
> + unsigned long long (*steal_clock)(int cpu);
> +};
> +extern struct pv_time_ops pv_time_ops;
> +
> +static inline u64 paravirt_steal_clock(int cpu)
> +{
> + return pv_time_ops.steal_clock(cpu);
> +}
> +
> +
> +#endif
> diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
> index 7b4b564..17613ad 100644
> --- a/arch/arm64/kernel/Makefile
> +++ b/arch/arm64/kernel/Makefile
> @@ -18,6 +18,7 @@ arm64-obj-$(CONFIG_SMP) += smp.o smp_spin_table.o smp_psci.o
> arm64-obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o
> arm64-obj-$(CONFIG_HAVE_HW_BREAKPOINT)+= hw_breakpoint.o
> arm64-obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
> +arm64-obj-$(CONFIG_PARAVIRT) += paravirt.o
>
> obj-y += $(arm64-obj-y) vdso/
> obj-m += $(arm64-obj-m)
> diff --git a/arch/arm64/kernel/paravirt.c b/arch/arm64/kernel/paravirt.c
> new file mode 100644
> index 0000000..53f371e
> --- /dev/null
> +++ b/arch/arm64/kernel/paravirt.c
> @@ -0,0 +1,25 @@
> +/*
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * Copyright (C) 2013 Citrix Systems
> + *
> + * Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> + */
> +
> +#include <linux/export.h>
> +#include <linux/jump_label.h>
> +#include <linux/types.h>
> +#include <asm/paravirt.h>
> +
> +struct static_key paravirt_steal_enabled;
> +struct static_key paravirt_steal_rq_enabled;
> +
> +struct pv_time_ops pv_time_ops;
> +EXPORT_SYMBOL_GPL(pv_time_ops);
>
>
--
Chen Gang
Asianux Corporation
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Suggestion] arch: arm64: xen: "ln -s" the paravirt.h from arm.
2013-06-25 1:31 ` Chen Gang
@ 2013-06-25 12:32 ` Stefano Stabellini
0 siblings, 0 replies; 12+ messages in thread
From: Stefano Stabellini @ 2013-06-25 12:32 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, 25 Jun 2013, Chen Gang wrote:
> On 06/25/2013 12:50 AM, Stefano Stabellini wrote:
> > On Mon, 24 Jun 2013, Stefano Stabellini wrote:
> >> > On Mon, 24 Jun 2013, Chen Gang wrote:
> >>> > > Hello Maintainers:
> >>> > >
> >>> > > if 'CONFIG_XEN'
> >>> > >
> >>> > > CC arch/arm64/xen/../../arm/xen/enlighten.o
> >>> > > arch/arm64/xen/../../arm/xen/enlighten.c:19:26: fatal error: asm/paravirt.h: No such file or directory
> >>> > >
> >>> > > The related .config file for next-20130624 is in attachment.
> >>> > >
> >>> > >
> >>> > > If "ln -s ../../../arm/include/asm/paravirt.h paravirt.h", it can pass
> >>> > > compiling, but I do not know how to make a patch for it ("ln -s ..."),
> >>> > > Do we have another more suitable ways for it (or another fixing ways) ?
> >>> > >
> >>> > > Welcome any suggestions or completions.
> >> >
> >> > The problem is caused by:
> >> >
> >> > commit 3a885582a366caf868b0782041c44854ff4c3568
> >> > Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> >> > Date: Wed May 29 10:56:34 2013 +0000
> >> >
> >> > xen/arm: account for stolen ticks
> >> >
> >> > that is in my tree for linux-next (even though I have not received any
> >> > replies from the ARM maintainers so I don't know when and if it is going
> >> > to go upstream).
> >> >
> >> > I think that the best thing to do would be to add a couple of ifdef
> >> > CONFIG_PARAVIRT in arch/arm/xen/enlighten.c. I'll add them to my tree.
> > Actually now that we have XEN support under arm64, we can just introduce the
> > same pv_time_op struct and paravirt header that this patch
> >
> > http://marc.info/?l=linux-arm-kernel&m=136992435301890&w=2
> >
> > is introducing under arm.
> > Any opinions?
> >
>
> OK, thanks, and excuse me, I can not open the link above (the reason
> maybe it can not be accessed from China).
Strange. If you know how to search for a Message-ID, this one is
1369920902-3546-3-git-send-email-stefano.stabellini at eu.citrix.com
> But at least, the patch below is better than "ln -s" (which I provided).
yeah :)
> > ---
> >
> > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> > index 19c1cde..47bd26b 100644
> > --- a/arch/arm64/Kconfig
> > +++ b/arch/arm64/Kconfig
> > @@ -207,6 +207,25 @@ config FORCE_MAX_ZONEORDER
> > default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE)
> > default "11"
> >
> > +config PARAVIRT
> > + bool "Enable paravirtualization code"
> > + ---help---
> > + This changes the kernel so it can modify itself when it is run
> > + under a hypervisor, potentially improving performance significantly
> > + over full virtualization.
> > +
> > +config PARAVIRT_TIME_ACCOUNTING
> > + bool "Paravirtual steal time accounting"
> > + select PARAVIRT
> > + default n
> > + ---help---
> > + Select this option to enable fine granularity task steal time
> > + accounting. Time spent executing other tasks in parallel with
> > + the current vCPU is discounted from the vCPU power. To account for
> > + that, there can be a small performance impact.
> > +
> > + If in doubt, say N here.
> > +
> > config XEN_DOM0
> > def_bool y
> > depends on XEN
> > @@ -214,6 +233,7 @@ config XEN_DOM0
> > config XEN
> > bool "Xen guest support on ARM64 (EXPERIMENTAL)"
> > depends on ARM64 && OF
> > + select PARAVIRT
> > help
> > Say Y if you want to run Linux in a Virtual Machine on Xen on ARM64.
> >
> > diff --git a/arch/arm64/include/asm/paravirt.h b/arch/arm64/include/asm/paravirt.h
> > new file mode 100644
> > index 0000000..54e895b
> > --- /dev/null
> > +++ b/arch/arm64/include/asm/paravirt.h
> > @@ -0,0 +1,19 @@
> > +#ifndef _ASM_ARM64_PARAVIRT_H
> > +#define _ASM_ARM64_PARAVIRT_H
> > +
> > +struct static_key;
> > +extern struct static_key paravirt_steal_enabled;
> > +extern struct static_key paravirt_steal_rq_enabled;
> > +
> > +struct pv_time_ops {
> > + unsigned long long (*steal_clock)(int cpu);
> > +};
> > +extern struct pv_time_ops pv_time_ops;
> > +
> > +static inline u64 paravirt_steal_clock(int cpu)
> > +{
> > + return pv_time_ops.steal_clock(cpu);
> > +}
> > +
> > +
> > +#endif
> > diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile
> > index 7b4b564..17613ad 100644
> > --- a/arch/arm64/kernel/Makefile
> > +++ b/arch/arm64/kernel/Makefile
> > @@ -18,6 +18,7 @@ arm64-obj-$(CONFIG_SMP) += smp.o smp_spin_table.o smp_psci.o
> > arm64-obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o
> > arm64-obj-$(CONFIG_HAVE_HW_BREAKPOINT)+= hw_breakpoint.o
> > arm64-obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
> > +arm64-obj-$(CONFIG_PARAVIRT) += paravirt.o
> >
> > obj-y += $(arm64-obj-y) vdso/
> > obj-m += $(arm64-obj-m)
> > diff --git a/arch/arm64/kernel/paravirt.c b/arch/arm64/kernel/paravirt.c
> > new file mode 100644
> > index 0000000..53f371e
> > --- /dev/null
> > +++ b/arch/arm64/kernel/paravirt.c
> > @@ -0,0 +1,25 @@
> > +/*
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> > + * GNU General Public License for more details.
> > + *
> > + * Copyright (C) 2013 Citrix Systems
> > + *
> > + * Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > + */
> > +
> > +#include <linux/export.h>
> > +#include <linux/jump_label.h>
> > +#include <linux/types.h>
> > +#include <asm/paravirt.h>
> > +
> > +struct static_key paravirt_steal_enabled;
> > +struct static_key paravirt_steal_rq_enabled;
> > +
> > +struct pv_time_ops pv_time_ops;
> > +EXPORT_SYMBOL_GPL(pv_time_ops);
> >
> >
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Suggestion] arch: arm64: xen: "ln -s" the paravirt.h from arm.
2013-06-24 16:50 ` Stefano Stabellini
2013-06-25 1:31 ` Chen Gang
@ 2013-06-25 13:25 ` Catalin Marinas
2013-06-25 15:54 ` Stefano Stabellini
1 sibling, 1 reply; 12+ messages in thread
From: Catalin Marinas @ 2013-06-25 13:25 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Jun 24, 2013 at 05:50:46PM +0100, Stefano Stabellini wrote:
> On Mon, 24 Jun 2013, Stefano Stabellini wrote:
> > On Mon, 24 Jun 2013, Chen Gang wrote:
> > > Hello Maintainers:
> > >
> > > if 'CONFIG_XEN'
> > >
> > > CC arch/arm64/xen/../../arm/xen/enlighten.o
> > > arch/arm64/xen/../../arm/xen/enlighten.c:19:26: fatal error: asm/paravirt.h: No such file or directory
> > >
> > > The related .config file for next-20130624 is in attachment.
> > >
> > >
> > > If "ln -s ../../../arm/include/asm/paravirt.h paravirt.h", it can pass
> > > compiling, but I do not know how to make a patch for it ("ln -s ..."),
> > > Do we have another more suitable ways for it (or another fixing ways) ?
> > >
> > > Welcome any suggestions or completions.
> >
> > The problem is caused by:
> >
> > commit 3a885582a366caf868b0782041c44854ff4c3568
> > Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > Date: Wed May 29 10:56:34 2013 +0000
> >
> > xen/arm: account for stolen ticks
> >
> > that is in my tree for linux-next (even though I have not received any
> > replies from the ARM maintainers so I don't know when and if it is going
> > to go upstream).
> >
> > I think that the best thing to do would be to add a couple of ifdef
> > CONFIG_PARAVIRT in arch/arm/xen/enlighten.c. I'll add them to my tree.
>
> Actually now that we have XEN support under arm64, we can just introduce the
> same pv_time_op struct and paravirt header that this patch
>
> http://marc.info/?l=linux-arm-kernel&m=136992435301890&w=2
>
> is introducing under arm.
I'm not sure whether I replied to your Xen pull request but the patches
have been merged into my 'upstream' branch on git.kernel.org and they'll
be going in for 3.11-rc1.
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 19c1cde..47bd26b 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -207,6 +207,25 @@ config FORCE_MAX_ZONEORDER
> default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE)
> default "11"
>
> +config PARAVIRT
> + bool "Enable paravirtualization code"
> + ---help---
> + This changes the kernel so it can modify itself when it is run
> + under a hypervisor, potentially improving performance significantly
> + over full virtualization.
> +
> +config PARAVIRT_TIME_ACCOUNTING
> + bool "Paravirtual steal time accounting"
> + select PARAVIRT
> + default n
No need for "default n".
If you want, I can apply this patch on top (or send me another pull
request but don't rebase your original Xen branch which I merged).
--
Catalin
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Suggestion] arch: arm64: xen: "ln -s" the paravirt.h from arm.
2013-06-25 13:25 ` Catalin Marinas
@ 2013-06-25 15:54 ` Stefano Stabellini
0 siblings, 0 replies; 12+ messages in thread
From: Stefano Stabellini @ 2013-06-25 15:54 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, 25 Jun 2013, Catalin Marinas wrote:
> On Mon, Jun 24, 2013 at 05:50:46PM +0100, Stefano Stabellini wrote:
> > On Mon, 24 Jun 2013, Stefano Stabellini wrote:
> > > On Mon, 24 Jun 2013, Chen Gang wrote:
> > > > Hello Maintainers:
> > > >
> > > > if 'CONFIG_XEN'
> > > >
> > > > CC arch/arm64/xen/../../arm/xen/enlighten.o
> > > > arch/arm64/xen/../../arm/xen/enlighten.c:19:26: fatal error: asm/paravirt.h: No such file or directory
> > > >
> > > > The related .config file for next-20130624 is in attachment.
> > > >
> > > >
> > > > If "ln -s ../../../arm/include/asm/paravirt.h paravirt.h", it can pass
> > > > compiling, but I do not know how to make a patch for it ("ln -s ..."),
> > > > Do we have another more suitable ways for it (or another fixing ways) ?
> > > >
> > > > Welcome any suggestions or completions.
> > >
> > > The problem is caused by:
> > >
> > > commit 3a885582a366caf868b0782041c44854ff4c3568
> > > Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > Date: Wed May 29 10:56:34 2013 +0000
> > >
> > > xen/arm: account for stolen ticks
> > >
> > > that is in my tree for linux-next (even though I have not received any
> > > replies from the ARM maintainers so I don't know when and if it is going
> > > to go upstream).
> > >
> > > I think that the best thing to do would be to add a couple of ifdef
> > > CONFIG_PARAVIRT in arch/arm/xen/enlighten.c. I'll add them to my tree.
> >
> > Actually now that we have XEN support under arm64, we can just introduce the
> > same pv_time_op struct and paravirt header that this patch
> >
> > http://marc.info/?l=linux-arm-kernel&m=136992435301890&w=2
> >
> > is introducing under arm.
>
> I'm not sure whether I replied to your Xen pull request but the patches
> have been merged into my 'upstream' branch on git.kernel.org and they'll
> be going in for 3.11-rc1.
Great, thanks!
> > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> > index 19c1cde..47bd26b 100644
> > --- a/arch/arm64/Kconfig
> > +++ b/arch/arm64/Kconfig
> > @@ -207,6 +207,25 @@ config FORCE_MAX_ZONEORDER
> > default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE)
> > default "11"
> >
> > +config PARAVIRT
> > + bool "Enable paravirtualization code"
> > + ---help---
> > + This changes the kernel so it can modify itself when it is run
> > + under a hypervisor, potentially improving performance significantly
> > + over full virtualization.
> > +
> > +config PARAVIRT_TIME_ACCOUNTING
> > + bool "Paravirtual steal time accounting"
> > + select PARAVIRT
> > + default n
>
> No need for "default n".
>
> If you want, I can apply this patch on top (or send me another pull
> request but don't rebase your original Xen branch which I merged).
Thanks, but unfortunately the corresponding arm part of this patch
(linked above) didn't manage to get enough reviews and acks.
I might as well send another iteration of "CONFIG_PARAVIRT and stolen
ticks accounting" with this change in it.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2013-06-25 15:54 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-22 5:54 [PATCH] arch: arm64: kernel: add '#ifdef CONFIG_COMPAT' for aarch32_break_handler() Chen Gang
2013-06-24 8:47 ` Will Deacon
2013-06-24 9:19 ` Chen Gang
2013-06-24 9:27 ` [PATCH v2] " Chen Gang
2013-06-24 10:14 ` Will Deacon
2013-06-24 10:16 ` Chen Gang
[not found] ` <51C81A39.5060909@asianux.com>
2013-06-24 15:43 ` [Suggestion] arch: arm64: xen: "ln -s" the paravirt.h from arm Stefano Stabellini
2013-06-24 16:50 ` Stefano Stabellini
2013-06-25 1:31 ` Chen Gang
2013-06-25 12:32 ` Stefano Stabellini
2013-06-25 13:25 ` Catalin Marinas
2013-06-25 15:54 ` Stefano Stabellini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).