From: Scott Wood <scottwood@freescale.com>
To: Liu Yu <yu.liu@freescale.com>
Cc: agraf@suse.de, kvm-ppc@vger.kernel.org, kvm@vger.kernel.org,
linuxppc-dev@ozlabs.org, B07421@freescale.com
Subject: Re: [PATCH v4 1/3] KVM: PPC: epapr: Factor out the epapr init
Date: Thu, 16 Feb 2012 17:13:23 +0000 [thread overview]
Message-ID: <4F3D3933.3020501@freescale.com> (raw)
In-Reply-To: <1329384365-4028-1-git-send-email-yu.liu@freescale.com>
On 02/16/2012 03:26 AM, Liu Yu wrote:
> from the kvm guest paravirt init code.
>
> Signed-off-by: Liu Yu <yu.liu@freescale.com>
> ---
> v4:
> 1. code cleanup
> 2. move kvm_hypercall_start() to epapr_hypercall_start()
>
> arch/powerpc/Kconfig | 4 ++
> arch/powerpc/include/asm/epapr_hcalls.h | 2 +
> arch/powerpc/kernel/Makefile | 1 +
> arch/powerpc/kernel/epapr.S | 25 ++++++++++++++++
> arch/powerpc/kernel/epapr_para.c | 49 +++++++++++++++++++++++++++++++
> arch/powerpc/kernel/kvm.c | 28 ++----------------
> arch/powerpc/kernel/kvm_emul.S | 10 ------
> arch/powerpc/kvm/Kconfig | 1 +
> 8 files changed, 85 insertions(+), 35 deletions(-)
> create mode 100644 arch/powerpc/kernel/epapr.S
> create mode 100644 arch/powerpc/kernel/epapr_para.c
The comment about spelling out "paravirt" wasnn't meant to be restricted
to the kconfig symbol. There are lots of words that begin with "para",
and ePAPR isn't just about virtualization.
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 1919634..1262b43 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -202,6 +202,10 @@ config EPAPR_BOOT
> Used to allow a board to specify it wants an ePAPR compliant wrapper.
> default n
>
> +config EPAPR_PARAVIRT
> + bool
> + default n
Why isn't this user-selectable? It's useful on its own.
> diff --git a/arch/powerpc/kernel/epapr.S b/arch/powerpc/kernel/epapr.S
> new file mode 100644
> index 0000000..697b390
> --- /dev/null
> +++ b/arch/powerpc/kernel/epapr.S
epapr-hcall.S
> +bool epapr_para_enabled = false;
> +
> +static int __init epapr_para_init(void)
> +{
> + struct device_node *hyper_node;
> + const u32 *insts;
> + int len, i;
> +
> + hyper_node = of_find_node_by_path("/hypervisor");
> + if (!hyper_node)
> + return -ENODEV;
> +
> + insts = of_get_property(hyper_node, "hcall-instructions", &len);
> + if (!(len % 4) && (len >= (4 * 4))) {
> + for (i = 0; i < (len / 4); i++)
> + epapr_hypercall_start[i] = insts[i];
> + flush_icache_range((ulong)epapr_hypercall_start,
> + (ulong)epapr_hypercall_start + len);
> +
> + epapr_para_enabled = true;
> + }
Use patch_instruction(), fix the if test, and remove unnecessary
parentheses. Print an error if the if test fails, but return silently
if the property is absent.
Please make asm/epapr_hcalls.h and asm/fsl_hcalls.h work with this as well.
-Scott
WARNING: multiple messages have this Message-ID (diff)
From: Scott Wood <scottwood@freescale.com>
To: Liu Yu <yu.liu@freescale.com>
Cc: linuxppc-dev@ozlabs.org, B07421@freescale.com, agraf@suse.de,
kvm-ppc@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH v4 1/3] KVM: PPC: epapr: Factor out the epapr init
Date: Thu, 16 Feb 2012 11:13:23 -0600 [thread overview]
Message-ID: <4F3D3933.3020501@freescale.com> (raw)
In-Reply-To: <1329384365-4028-1-git-send-email-yu.liu@freescale.com>
On 02/16/2012 03:26 AM, Liu Yu wrote:
> from the kvm guest paravirt init code.
>
> Signed-off-by: Liu Yu <yu.liu@freescale.com>
> ---
> v4:
> 1. code cleanup
> 2. move kvm_hypercall_start() to epapr_hypercall_start()
>
> arch/powerpc/Kconfig | 4 ++
> arch/powerpc/include/asm/epapr_hcalls.h | 2 +
> arch/powerpc/kernel/Makefile | 1 +
> arch/powerpc/kernel/epapr.S | 25 ++++++++++++++++
> arch/powerpc/kernel/epapr_para.c | 49 +++++++++++++++++++++++++++++++
> arch/powerpc/kernel/kvm.c | 28 ++----------------
> arch/powerpc/kernel/kvm_emul.S | 10 ------
> arch/powerpc/kvm/Kconfig | 1 +
> 8 files changed, 85 insertions(+), 35 deletions(-)
> create mode 100644 arch/powerpc/kernel/epapr.S
> create mode 100644 arch/powerpc/kernel/epapr_para.c
The comment about spelling out "paravirt" wasnn't meant to be restricted
to the kconfig symbol. There are lots of words that begin with "para",
and ePAPR isn't just about virtualization.
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 1919634..1262b43 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -202,6 +202,10 @@ config EPAPR_BOOT
> Used to allow a board to specify it wants an ePAPR compliant wrapper.
> default n
>
> +config EPAPR_PARAVIRT
> + bool
> + default n
Why isn't this user-selectable? It's useful on its own.
> diff --git a/arch/powerpc/kernel/epapr.S b/arch/powerpc/kernel/epapr.S
> new file mode 100644
> index 0000000..697b390
> --- /dev/null
> +++ b/arch/powerpc/kernel/epapr.S
epapr-hcall.S
> +bool epapr_para_enabled = false;
> +
> +static int __init epapr_para_init(void)
> +{
> + struct device_node *hyper_node;
> + const u32 *insts;
> + int len, i;
> +
> + hyper_node = of_find_node_by_path("/hypervisor");
> + if (!hyper_node)
> + return -ENODEV;
> +
> + insts = of_get_property(hyper_node, "hcall-instructions", &len);
> + if (!(len % 4) && (len >= (4 * 4))) {
> + for (i = 0; i < (len / 4); i++)
> + epapr_hypercall_start[i] = insts[i];
> + flush_icache_range((ulong)epapr_hypercall_start,
> + (ulong)epapr_hypercall_start + len);
> +
> + epapr_para_enabled = true;
> + }
Use patch_instruction(), fix the if test, and remove unnecessary
parentheses. Print an error if the if test fails, but return silently
if the property is absent.
Please make asm/epapr_hcalls.h and asm/fsl_hcalls.h work with this as well.
-Scott
WARNING: multiple messages have this Message-ID (diff)
From: Scott Wood <scottwood@freescale.com>
To: Liu Yu <yu.liu@freescale.com>
Cc: <agraf@suse.de>, <kvm-ppc@vger.kernel.org>, <kvm@vger.kernel.org>,
<linuxppc-dev@ozlabs.org>, <B07421@freescale.com>
Subject: Re: [PATCH v4 1/3] KVM: PPC: epapr: Factor out the epapr init
Date: Thu, 16 Feb 2012 11:13:23 -0600 [thread overview]
Message-ID: <4F3D3933.3020501@freescale.com> (raw)
In-Reply-To: <1329384365-4028-1-git-send-email-yu.liu@freescale.com>
On 02/16/2012 03:26 AM, Liu Yu wrote:
> from the kvm guest paravirt init code.
>
> Signed-off-by: Liu Yu <yu.liu@freescale.com>
> ---
> v4:
> 1. code cleanup
> 2. move kvm_hypercall_start() to epapr_hypercall_start()
>
> arch/powerpc/Kconfig | 4 ++
> arch/powerpc/include/asm/epapr_hcalls.h | 2 +
> arch/powerpc/kernel/Makefile | 1 +
> arch/powerpc/kernel/epapr.S | 25 ++++++++++++++++
> arch/powerpc/kernel/epapr_para.c | 49 +++++++++++++++++++++++++++++++
> arch/powerpc/kernel/kvm.c | 28 ++----------------
> arch/powerpc/kernel/kvm_emul.S | 10 ------
> arch/powerpc/kvm/Kconfig | 1 +
> 8 files changed, 85 insertions(+), 35 deletions(-)
> create mode 100644 arch/powerpc/kernel/epapr.S
> create mode 100644 arch/powerpc/kernel/epapr_para.c
The comment about spelling out "paravirt" wasnn't meant to be restricted
to the kconfig symbol. There are lots of words that begin with "para",
and ePAPR isn't just about virtualization.
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 1919634..1262b43 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -202,6 +202,10 @@ config EPAPR_BOOT
> Used to allow a board to specify it wants an ePAPR compliant wrapper.
> default n
>
> +config EPAPR_PARAVIRT
> + bool
> + default n
Why isn't this user-selectable? It's useful on its own.
> diff --git a/arch/powerpc/kernel/epapr.S b/arch/powerpc/kernel/epapr.S
> new file mode 100644
> index 0000000..697b390
> --- /dev/null
> +++ b/arch/powerpc/kernel/epapr.S
epapr-hcall.S
> +bool epapr_para_enabled = false;
> +
> +static int __init epapr_para_init(void)
> +{
> + struct device_node *hyper_node;
> + const u32 *insts;
> + int len, i;
> +
> + hyper_node = of_find_node_by_path("/hypervisor");
> + if (!hyper_node)
> + return -ENODEV;
> +
> + insts = of_get_property(hyper_node, "hcall-instructions", &len);
> + if (!(len % 4) && (len >= (4 * 4))) {
> + for (i = 0; i < (len / 4); i++)
> + epapr_hypercall_start[i] = insts[i];
> + flush_icache_range((ulong)epapr_hypercall_start,
> + (ulong)epapr_hypercall_start + len);
> +
> + epapr_para_enabled = true;
> + }
Use patch_instruction(), fix the if test, and remove unnecessary
parentheses. Print an error if the if test fails, but return silently
if the property is absent.
Please make asm/epapr_hcalls.h and asm/fsl_hcalls.h work with this as well.
-Scott
next prev parent reply other threads:[~2012-02-16 17:13 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-16 9:26 [PATCH v4 1/3] KVM: PPC: epapr: Factor out the epapr init Liu Yu
2012-02-16 9:26 ` Liu Yu
2012-02-16 9:26 ` Liu Yu
2012-02-16 9:26 ` [PATCH v4 2/3] KVM: PPC: epapr: Add idle hcall support for host Liu Yu
2012-02-16 9:26 ` Liu Yu
2012-02-16 9:26 ` Liu Yu
2012-02-16 9:26 ` [PATCH v4 3/3] KVM: PPC: epapr: install ev_idle hcall for e500 guest Liu Yu
2012-02-16 9:26 ` Liu Yu
2012-02-16 9:26 ` Liu Yu
2012-02-16 10:24 ` Alexander Graf
2012-02-16 10:24 ` Alexander Graf
2012-02-16 10:24 ` Alexander Graf
2012-02-16 16:58 ` Scott Wood
2012-02-16 16:58 ` Scott Wood
2012-02-16 16:58 ` Scott Wood
2012-02-16 17:18 ` Alexander Graf
2012-02-16 17:18 ` Alexander Graf
2012-02-16 17:18 ` Alexander Graf
2012-02-16 17:28 ` Scott Wood
2012-02-16 17:28 ` Scott Wood
2012-02-16 17:28 ` Scott Wood
2012-02-16 17:30 ` Alexander Graf
2012-02-16 17:30 ` Alexander Graf
2012-02-16 17:30 ` Alexander Graf
2012-02-16 17:36 ` Scott Wood
2012-02-16 17:36 ` Scott Wood
2012-02-16 17:36 ` Scott Wood
2012-02-16 17:39 ` Alexander Graf
2012-02-16 17:39 ` Alexander Graf
2012-02-16 17:39 ` Alexander Graf
2012-02-16 17:14 ` Scott Wood
2012-02-16 17:14 ` Scott Wood
2012-02-16 17:14 ` Scott Wood
2012-02-16 10:20 ` [PATCH v4 2/3] KVM: PPC: epapr: Add idle hcall support for host Alexander Graf
2012-02-16 10:20 ` Alexander Graf
2012-02-16 10:20 ` Alexander Graf
2012-02-17 2:13 ` Liu Yu-B13201
2012-02-17 2:13 ` Liu Yu-B13201
2012-02-17 2:20 ` Alexander Graf
2012-02-17 2:20 ` Alexander Graf
2012-02-17 2:20 ` Alexander Graf
2012-02-16 10:17 ` [PATCH v4 1/3] KVM: PPC: epapr: Factor out the epapr init Alexander Graf
2012-02-16 10:17 ` Alexander Graf
2012-02-16 10:17 ` Alexander Graf
2012-02-16 17:13 ` Scott Wood [this message]
2012-02-16 17:13 ` Scott Wood
2012-02-16 17:13 ` Scott Wood
2012-02-17 10:03 ` Liu Yu-B13201
2012-02-17 10:03 ` Liu Yu-B13201
2012-02-17 10:03 ` Liu Yu-B13201
2012-02-17 18:58 ` Scott Wood
2012-02-17 18:58 ` Scott Wood
2012-02-17 18:58 ` Scott Wood
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=4F3D3933.3020501@freescale.com \
--to=scottwood@freescale.com \
--cc=B07421@freescale.com \
--cc=agraf@suse.de \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=yu.liu@freescale.com \
/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.