LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 2/4] KVM: PPC: epapr: Add idle hcall support for host
From: Liu Yu @ 2012-02-23  9:22 UTC (permalink / raw)
  To: agraf, kvm-ppc, kvm; +Cc: linuxppc-dev, Liu Yu, B07421
In-Reply-To: <1329988942-19610-1-git-send-email-yu.liu@freescale.com>

And add a new flag definition in kvm_ppc_pvinfo to indicate
whether host support EV_IDLE hcall.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
---
v6: no change

 arch/powerpc/include/asm/Kbuild     |    1 +
 arch/powerpc/include/asm/kvm_para.h |   14 ++++++++++++--
 arch/powerpc/kvm/powerpc.c          |    6 ++++++
 include/linux/kvm.h                 |    2 ++
 4 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild
index 7e313f1..13d6b7b 100644
--- a/arch/powerpc/include/asm/Kbuild
+++ b/arch/powerpc/include/asm/Kbuild
@@ -34,5 +34,6 @@ header-y += termios.h
 header-y += types.h
 header-y += ucontext.h
 header-y += unistd.h
+header-y += epapr_hcalls.h
 
 generic-y += rwsem.h
diff --git a/arch/powerpc/include/asm/kvm_para.h b/arch/powerpc/include/asm/kvm_para.h
index 7b754e7..81a34c9 100644
--- a/arch/powerpc/include/asm/kvm_para.h
+++ b/arch/powerpc/include/asm/kvm_para.h
@@ -75,9 +75,19 @@ struct kvm_vcpu_arch_shared {
 };
 
 #define KVM_SC_MAGIC_R0		0x4b564d21 /* "KVM!" */
-#define HC_VENDOR_KVM		(42 << 16)
+
+#include <asm/epapr_hcalls.h>
+
+/* ePAPR Hypercall Vendor ID */
+#define HC_VENDOR_EPAPR		(EV_EPAPR_VENDOR_ID << 16)
+#define HC_VENDOR_KVM		(EV_KVM_VENDOR_ID << 16)
+
+/* ePAPR Hypercall Token */
+#define HC_EV_IDLE		EV_IDLE
+
+/* ePAPR Hypercall Return Codes */
 #define HC_EV_SUCCESS		0
-#define HC_EV_UNIMPLEMENTED	12
+#define HC_EV_UNIMPLEMENTED	EV_UNIMPLEMENTED
 
 #define KVM_FEATURE_MAGIC_PAGE	1
 
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 0e21d15..7098840 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -81,6 +81,10 @@ int kvmppc_kvm_pv(struct kvm_vcpu *vcpu)
 
 		/* Second return value is in r4 */
 		break;
+	case HC_VENDOR_EPAPR | HC_EV_IDLE:
+		r = HC_EV_SUCCESS;
+		kvm_vcpu_block(vcpu);
+		break;
 	default:
 		r = HC_EV_UNIMPLEMENTED;
 		break;
@@ -746,6 +750,8 @@ static int kvm_vm_ioctl_get_pvinfo(struct kvm_ppc_pvinfo *pvinfo)
 	pvinfo->hcall[2] = inst_sc;
 	pvinfo->hcall[3] = inst_nop;
 
+	pvinfo->flags = KVM_PPC_PVINFO_FLAGS_EV_IDLE;
+
 	return 0;
 }
 
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index acbe429..6b2c70e 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -449,6 +449,8 @@ struct kvm_ppc_pvinfo {
 	__u8  pad[108];
 };
 
+#define KVM_PPC_PVINFO_FLAGS_EV_IDLE   (1<<0)
+
 #define KVMIO 0xAE
 
 /* machine type bits, to be used as argument to KVM_CREATE_VM */
-- 
1.7.0.4

^ permalink raw reply related

* [PATCH v6 1/4] KVM: PPC: epapr: Factor out the epapr init
From: Liu Yu @ 2012-02-23  9:22 UTC (permalink / raw)
  To: agraf, kvm-ppc, kvm; +Cc: linuxppc-dev, Liu Yu, B07421

from the kvm guest paravirt init code.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
---
v6:
1. rename epapr_para to epapr_paravirt
2. remove redundant warnings
3. remove unnecessary init

 arch/powerpc/include/asm/epapr_hcalls.h |    2 +
 arch/powerpc/kernel/Makefile            |    1 +
 arch/powerpc/kernel/epapr_hcalls.S      |   25 ++++++++++++++
 arch/powerpc/kernel/epapr_paravirt.c    |   54 +++++++++++++++++++++++++++++++
 arch/powerpc/kernel/kvm.c               |   28 ++--------------
 arch/powerpc/kernel/kvm_emul.S          |   10 ------
 arch/powerpc/platforms/Kconfig          |    9 +++++
 7 files changed, 94 insertions(+), 35 deletions(-)
 create mode 100644 arch/powerpc/kernel/epapr_hcalls.S
 create mode 100644 arch/powerpc/kernel/epapr_paravirt.c

diff --git a/arch/powerpc/include/asm/epapr_hcalls.h b/arch/powerpc/include/asm/epapr_hcalls.h
index f3b0c2c..2173d4c 100644
--- a/arch/powerpc/include/asm/epapr_hcalls.h
+++ b/arch/powerpc/include/asm/epapr_hcalls.h
@@ -148,6 +148,8 @@
 #define EV_HCALL_CLOBBERS2 EV_HCALL_CLOBBERS3, "r5"
 #define EV_HCALL_CLOBBERS1 EV_HCALL_CLOBBERS2, "r4"
 
+extern bool epapr_paravirt_enabled;
+extern u32 epapr_hypercall_start[];
 
 /*
  * We use "uintptr_t" to define a register because it's guaranteed to be a
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index ee728e4..ba8fa43 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -136,6 +136,7 @@ ifneq ($(CONFIG_XMON)$(CONFIG_KEXEC),)
 obj-y				+= ppc_save_regs.o
 endif
 
+obj-$(CONFIG_EPAPR_PARAVIRT)	+= epapr_paravirt.o epapr_hcalls.o
 obj-$(CONFIG_KVM_GUEST)		+= kvm.o kvm_emul.o
 
 # Disable GCOV in odd or sensitive code
diff --git a/arch/powerpc/kernel/epapr_hcalls.S b/arch/powerpc/kernel/epapr_hcalls.S
new file mode 100644
index 0000000..697b390
--- /dev/null
+++ b/arch/powerpc/kernel/epapr_hcalls.S
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2012 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/threads.h>
+#include <asm/reg.h>
+#include <asm/page.h>
+#include <asm/cputable.h>
+#include <asm/thread_info.h>
+#include <asm/ppc_asm.h>
+#include <asm/asm-offsets.h>
+
+/* Hypercall entry point. Will be patched with device tree instructions. */
+.global epapr_hypercall_start
+epapr_hypercall_start:
+	li	r3, -1
+	nop
+	nop
+	nop
+	blr
diff --git a/arch/powerpc/kernel/epapr_paravirt.c b/arch/powerpc/kernel/epapr_paravirt.c
new file mode 100644
index 0000000..45eb439
--- /dev/null
+++ b/arch/powerpc/kernel/epapr_paravirt.c
@@ -0,0 +1,54 @@
+/*
+ * ePAPR para-virtualization support.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ * Copyright (C) 2012 Freescale Semiconductor, Inc.
+ */
+
+#include <linux/of.h>
+#include <asm/epapr_hcalls.h>
+#include <asm/cacheflush.h>
+#include <asm/code-patching.h>
+
+bool epapr_paravirt_enabled;
+
+static int __init epapr_paravirt_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 (!insts)
+		return 0;
+
+	if (!(len % 4) && len <= (4 * 4)) {
+		for (i = 0; i < (len / 4); i++)
+			patch_instruction(epapr_hypercall_start + i, insts[i]);
+
+		epapr_paravirt_enabled = true;
+	} else {
+		printk(KERN_WARNING
+		       "ePAPR paravirt: hcall-instructions format error\n");
+	}
+
+	return 0;
+}
+
+early_initcall(epapr_paravirt_init);
diff --git a/arch/powerpc/kernel/kvm.c b/arch/powerpc/kernel/kvm.c
index 62bdf23..1c13307 100644
--- a/arch/powerpc/kernel/kvm.c
+++ b/arch/powerpc/kernel/kvm.c
@@ -31,6 +31,7 @@
 #include <asm/cacheflush.h>
 #include <asm/disassemble.h>
 #include <asm/ppc-opcode.h>
+#include <asm/epapr_hcalls.h>
 
 #define KVM_MAGIC_PAGE		(-4096L)
 #define magic_var(x) KVM_MAGIC_PAGE + offsetof(struct kvm_vcpu_arch_shared, x)
@@ -726,7 +727,7 @@ unsigned long kvm_hypercall(unsigned long *in,
 	unsigned long register r11 asm("r11") = nr;
 	unsigned long register r12 asm("r12");
 
-	asm volatile("bl	kvm_hypercall_start"
+	asm volatile("bl	epapr_hypercall_start"
 		     : "=r"(r0), "=r"(r3), "=r"(r4), "=r"(r5), "=r"(r6),
 		       "=r"(r7), "=r"(r8), "=r"(r9), "=r"(r10), "=r"(r11),
 		       "=r"(r12)
@@ -747,29 +748,6 @@ unsigned long kvm_hypercall(unsigned long *in,
 }
 EXPORT_SYMBOL_GPL(kvm_hypercall);
 
-static int kvm_para_setup(void)
-{
-	extern u32 kvm_hypercall_start;
-	struct device_node *hyper_node;
-	u32 *insts;
-	int len, i;
-
-	hyper_node = of_find_node_by_path("/hypervisor");
-	if (!hyper_node)
-		return -1;
-
-	insts = (u32*)of_get_property(hyper_node, "hcall-instructions", &len);
-	if (len % 4)
-		return -1;
-	if (len > (4 * 4))
-		return -1;
-
-	for (i = 0; i < (len / 4); i++)
-		kvm_patch_ins(&(&kvm_hypercall_start)[i], insts[i]);
-
-	return 0;
-}
-
 static __init void kvm_free_tmp(void)
 {
 	unsigned long start, end;
@@ -791,7 +769,7 @@ static int __init kvm_guest_init(void)
 	if (!kvm_para_available())
 		goto free_tmp;
 
-	if (kvm_para_setup())
+	if (!epapr_paravirt_enabled)
 		goto free_tmp;
 
 	if (kvm_para_has_feature(KVM_FEATURE_MAGIC_PAGE))
diff --git a/arch/powerpc/kernel/kvm_emul.S b/arch/powerpc/kernel/kvm_emul.S
index e291cf3..62ceb2a 100644
--- a/arch/powerpc/kernel/kvm_emul.S
+++ b/arch/powerpc/kernel/kvm_emul.S
@@ -24,16 +24,6 @@
 #include <asm/page.h>
 #include <asm/asm-offsets.h>
 
-/* Hypercall entry point. Will be patched with device tree instructions. */
-
-.global kvm_hypercall_start
-kvm_hypercall_start:
-	li	r3, -1
-	nop
-	nop
-	nop
-	blr
-
 #define KVM_MAGIC_PAGE		(-4096)
 
 #ifdef CONFIG_64BIT
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 0cfb46d..845690f 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -26,6 +26,7 @@ source "arch/powerpc/platforms/wsp/Kconfig"
 config KVM_GUEST
 	bool "KVM Guest support"
 	default n
+	select EPAPR_PARAVIRT
 	---help---
 	  This option enables various optimizations for running under the KVM
 	  hypervisor. Overhead for the kernel when not running inside KVM should
@@ -33,6 +34,14 @@ config KVM_GUEST
 
 	  In case of doubt, say Y
 
+config EPAPR_PARAVIRT
+	bool "ePAPR para-virtualization support"
+	default n
+	help
+	  Used to enalbe ePAPR complied para-virtualization support for guest.
+
+	  In case of doubt, say Y
+
 config PPC_NATIVE
 	bool
 	depends on 6xx || PPC64
-- 
1.7.0.4

^ permalink raw reply related

* RE: [PATCH] powerpc/85xx: allow CONFIG_PHYS_64BIT to be selectable
From: Huang Changming-R66093 @ 2012-02-23  6:25 UTC (permalink / raw)
  To: Tabi Timur-B04825, galak@kernel.crashing.org,
	benh@kernel.crashing.org, Wood Scott-B07421, Li Yang-R58472,
	linuxppc-dev@ozlabs.org
In-Reply-To: <1329853995-7533-1-git-send-email-timur@freescale.com>

I have one similar patch to remove the "select PHYS_64BIT".
http://patchwork.ozlabs.org/patch/132351/


Thanks
Jerry Huang


> -----Original Message-----
> From: linuxppc-dev-bounces+r66093=3Dfreescale.com@lists.ozlabs.org
> [mailto:linuxppc-dev-bounces+r66093=3Dfreescale.com@lists.ozlabs.org] On
> Behalf Of Timur Tabi
> Sent: Wednesday, February 22, 2012 3:53 AM
> To: galak@kernel.crashing.org; benh@kernel.crashing.org; Wood Scott-
> B07421; Li Yang-R58472; linuxppc-dev@ozlabs.org
> Subject: [PATCH] powerpc/85xx: allow CONFIG_PHYS_64BIT to be selectable
>=20
> Remove the "select PHYS_64BIT" from the Kconfig entry for the P1022DS, so
> that large physical address support is a selectable option for non-
> CoreNet reference boards.
>=20
> The option is enabled in mpc85xx_[smp_]defconfig so that the default is
> unchanged.  However, now it can be deselected.
>=20
> The P1022DS had this option defined because the default device tree for
> this board uses 36-bit addresses.  This had the side-effect of forcing
> this option on for all boards that use mpc85xx_[smp_]defconfig.  Some
> users may want to disable this feature to create an optimized
> configuration for boards with <=3D 2GB of RAM.
>=20
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
>  arch/powerpc/configs/mpc85xx_defconfig     |    1 +
>  arch/powerpc/configs/mpc85xx_smp_defconfig |    1 +
>  arch/powerpc/platforms/85xx/Kconfig        |    1 -
>  3 files changed, 2 insertions(+), 1 deletions(-)
>=20
> diff --git a/arch/powerpc/configs/mpc85xx_defconfig
> b/arch/powerpc/configs/mpc85xx_defconfig
> index f37a2ab..5fb0c8a 100644
> --- a/arch/powerpc/configs/mpc85xx_defconfig
> +++ b/arch/powerpc/configs/mpc85xx_defconfig
> @@ -1,4 +1,5 @@
>  CONFIG_PPC_85xx=3Dy
> +CONFIG_PHYS_64BIT=3Dy
>  CONFIG_EXPERIMENTAL=3Dy
>  CONFIG_SYSVIPC=3Dy
>  CONFIG_POSIX_MQUEUE=3Dy
> diff --git a/arch/powerpc/configs/mpc85xx_smp_defconfig
> b/arch/powerpc/configs/mpc85xx_smp_defconfig
> index abdcd31..fb51bc9 100644
> --- a/arch/powerpc/configs/mpc85xx_smp_defconfig
> +++ b/arch/powerpc/configs/mpc85xx_smp_defconfig
> @@ -1,4 +1,5 @@
>  CONFIG_PPC_85xx=3Dy
> +CONFIG_PHYS_64BIT=3Dy
>  CONFIG_SMP=3Dy
>  CONFIG_NR_CPUS=3D8
>  CONFIG_EXPERIMENTAL=3Dy
> diff --git a/arch/powerpc/platforms/85xx/Kconfig
> b/arch/powerpc/platforms/85xx/Kconfig
> index d7946be..93d27e2 100644
> --- a/arch/powerpc/platforms/85xx/Kconfig
> +++ b/arch/powerpc/platforms/85xx/Kconfig
> @@ -80,7 +80,6 @@ config P1010_RDB
>  config P1022_DS
>  	bool "Freescale P1022 DS"
>  	select DEFAULT_UIMAGE
> -	select PHYS_64BIT	# The DTS has 36-bit addresses
>  	select SWIOTLB
>  	help
>  	  This option enables support for the Freescale P1022DS reference
> board.
> --
> 1.7.3.4
>=20
>=20
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

^ permalink raw reply

* [git pull] Please pull powerpc.git merge branch
From: Benjamin Herrenschmidt @ 2012-02-23  4:58 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linuxppc-dev list, Andrew Morton, Linux Kernel list

Hi Linus !

Here are a few more powerpc bits for you. A stupid regression I
introduced with my previous commit to "fix" program check exceptions
(brown paper bag for me), fix the cpuidle default, a bug fix for
something that isn't strictly speaking a regression but some
upstream changes causes it to show in lockdep now while it didn't
before, and finally a trivial one for rusty to make his life
easier later on removing the old cpumask cruft.

Cheers,
Ben.

The following changes since commit 27e74da9800289e69ba907777df1e2085231eff7:

  i387: export 'fpu_owner_task' per-cpu variable (2012-02-20 19:34:10 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git merge

for you to fetch changes up to 18b246fa60dd4bfc71c78d669e2ffaa5df454d6a:

  powerpc: Fix various issues with return to userspace (2012-02-22 16:48:53 +1100)

----------------------------------------------------------------
Benjamin Herrenschmidt (2):
      cpuidle: Default y on powerpc pSeries
      powerpc: Fix various issues with return to userspace

Michael Ellerman (1):
      powerpc: Fix program check handling when lockdep is enabled

Rusty Russell (1):
      powerpc: Remove references to cpu_*_map

 arch/powerpc/kernel/entry_32.S       |    2 +-
 arch/powerpc/kernel/entry_64.S       |    6 +++++-
 arch/powerpc/kernel/exceptions-64s.S |    2 +-
 arch/powerpc/kernel/signal.c         |   12 ++++++++----
 arch/powerpc/kernel/signal.h         |    2 +-
 arch/powerpc/platforms/wsp/smp.c     |    2 +-
 drivers/cpuidle/Kconfig              |    2 +-
 7 files changed, 18 insertions(+), 10 deletions(-)

^ permalink raw reply

* Re: powerpc/mpic: Fix allocation of reverse-map for multi-ISU mpics
From: Grant Likely @ 2012-02-23  1:59 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1329962108.20389.19.camel@pasglop>

On Wed, Feb 22, 2012 at 6:55 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> On Wed, 2012-02-22 at 18:39 -0700, Grant Likely wrote:
>>
>> Looks fine to me. =A0This will conflict with the irqdomain tree in linux=
-next,
>> but it will be a trivial fixup. =A0Still, if you prefer I can pick this
>> up into my tree.
>
> Well, I'm also going to carry a slightly modified variant of Kyle's
> mpic series so we'll have to deal with conflicts regardless, I'll
> keep that one.
>
> What I might do tho is pull your tree in powerpc-next at some point,
> when you tell me it's frozen solid, this will potentially make my life
> easier.

It's frozen solid now.  Any changes from this point on will be new
patches on top.

g.

^ permalink raw reply

* Re: powerpc/mpic: Fix allocation of reverse-map for multi-ISU mpics
From: Benjamin Herrenschmidt @ 2012-02-23  1:55 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <20120223013947.GC3212@ponder.secretlab.ca>

On Wed, 2012-02-22 at 18:39 -0700, Grant Likely wrote:
> 
> Looks fine to me.  This will conflict with the irqdomain tree in linux-next,
> but it will be a trivial fixup.  Still, if you prefer I can pick this
> up into my tree.

Well, I'm also going to carry a slightly modified variant of Kyle's
mpic series so we'll have to deal with conflicts regardless, I'll
keep that one.

What I might do tho is pull your tree in powerpc-next at some point,
when you tell me it's frozen solid, this will potentially make my life
easier.

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH] ppc-6xx: fix build failure in flipper-pic.c and hlwd-pic.c
From: Grant Likely @ 2012-02-23  1:41 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: olof, linux-next, linuxppc-dev
In-Reply-To: <1329953703-25806-1-git-send-email-paul.gortmaker@windriver.com>

On Wed, Feb 22, 2012 at 06:35:03PM -0500, Paul Gortmaker wrote:
> The commit bae1d8f19983fbfa25559aa3cb6a81a84aa82a18 (linux-next)
> 
>   "irq_domain/powerpc: Use common irq_domain structure instead of irq_host"
> 
> made this change:
> 
>    -static struct irq_host *flipper_irq_host;
>    +static struct irq_domain *flipper_irq_host;
> 
> and this change:
> 
>    -static struct irq_host *hlwd_irq_host;
>    +static struct irq_domain *hlwd_irq_host;
> 
> The intent was to change the type, and not the name, but then in a
> couple of instances, it looks like the sed to change the irq_domain_ops
> name inadvertently also changed the irq_host name where it was not
> supposed to, causing build failures.
> 
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Merged, thanks.

g.

> 
> ---
> 
> [seen in build tests on the linux-next tree from yesterday.]
> 
> diff --git a/arch/powerpc/platforms/embedded6xx/flipper-pic.c b/arch/powerpc/platforms/embedded6xx/flipper-pic.c
> index 675335a..53d6eee 100644
> --- a/arch/powerpc/platforms/embedded6xx/flipper-pic.c
> +++ b/arch/powerpc/platforms/embedded6xx/flipper-pic.c
> @@ -172,7 +172,7 @@ out:
>  
>  unsigned int flipper_pic_get_irq(void)
>  {
> -	void __iomem *io_base = flipper_irq_domain->host_data;
> +	void __iomem *io_base = flipper_irq_host->host_data;
>  	int irq;
>  	u32 irq_status;
>  
> @@ -182,7 +182,7 @@ unsigned int flipper_pic_get_irq(void)
>  		return NO_IRQ;	/* no more IRQs pending */
>  
>  	irq = __ffs(irq_status);
> -	return irq_linear_revmap(flipper_irq_domain, irq);
> +	return irq_linear_revmap(flipper_irq_host, irq);
>  }
>  
>  /*
> @@ -197,7 +197,7 @@ void __init flipper_pic_probe(void)
>  	np = of_find_compatible_node(NULL, NULL, "nintendo,flipper-pic");
>  	BUG_ON(!np);
>  
> -	flipper_irq_domain = flipper_pic_init(np);
> +	flipper_irq_host = flipper_pic_init(np);
>  	BUG_ON(!flipper_irq_host);
>  
>  	irq_set_default_host(flipper_irq_host);
> diff --git a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c
> index da6ca02..3006b51 100644
> --- a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c
> +++ b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c
> @@ -189,7 +189,7 @@ struct irq_domain *hlwd_pic_init(struct device_node *np)
>  
>  unsigned int hlwd_pic_get_irq(void)
>  {
> -	return __hlwd_pic_get_irq(hlwd_irq_domain);
> +	return __hlwd_pic_get_irq(hlwd_irq_host);
>  }
>  
>  /*
> @@ -213,7 +213,7 @@ void hlwd_pic_probe(void)
>  			irq_set_handler_data(cascade_virq, host);
>  			irq_set_chained_handler(cascade_virq,
>  						hlwd_pic_irq_cascade);
> -			hlwd_irq_domain = host;
> +			hlwd_irq_host = host;
>  			break;
>  		}
>  	}
> @@ -227,7 +227,7 @@ void hlwd_pic_probe(void)
>   */
>  void hlwd_quiesce(void)
>  {
> -	void __iomem *io_base = hlwd_irq_domain->host_data;
> +	void __iomem *io_base = hlwd_irq_host->host_data;
>  
>  	__hlwd_quiesce(io_base);
>  }
> -- 
> 1.7.9.1
> 

^ permalink raw reply

* Re: powerpc/mpic: Fix allocation of reverse-map for multi-ISU mpics
From: Grant Likely @ 2012-02-23  1:39 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1329954613.20389.15.camel@pasglop>

On Thu, Feb 23, 2012 at 10:50:13AM +1100, Benjamin Herrenschmidt wrote:
> When using a multi-ISU MPIC, we can interrupts up to
> isu_size * MPIC_MAX_ISU, not just isu_size, so allocate
> the right size reverse map.
> 
> Without this, the code will constantly fallback to
> a linear search.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Looks fine to me.  This will conflict with the irqdomain tree in linux-next,
but it will be a trivial fixup.  Still, if you prefer I can pick this
up into my tree.

g.

> ---
> 
> diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
> index 4e9ccb1..7fb3ab5 100644
> --- a/arch/powerpc/sysdev/mpic.c
> +++ b/arch/powerpc/sysdev/mpic.c
> @@ -1346,7 +1346,8 @@ struct mpic * __init mpic_alloc(struct device_node *node,
>  	mpic->isu_mask = (1 << mpic->isu_shift) - 1;
>  
>  	mpic->irqhost = irq_alloc_host(mpic->node, IRQ_HOST_MAP_LINEAR,
> -				       isu_size ? isu_size : mpic->num_sources,
> +				       isu_size ? isu_size *  MPIC_MAX_ISU :
> +				       mpic->num_sources,
>  				       &mpic_host_ops,
>  				       flags & MPIC_LARGE_VECTORS ? 2048 : 256);
>  
> 
> 

^ permalink raw reply

* Re: [PATCH] powerpc: remove CONFIG_PPC_ISERIES from the architecture Kconfig files
From: Benjamin Herrenschmidt @ 2012-02-23  0:13 UTC (permalink / raw)
  To: ppc-dev; +Cc: Stephen Rothwell
In-Reply-To: <20120223111012.cf31162aeef3737bc7bc8b19@canb.auug.org.au>

On Thu, 2012-02-23 at 11:10 +1100, Stephen Rothwell wrote:
> After this, we can remove the legacy iSeries code more easily.

This is the LAST CALL for objections ... I intend to put that in
-next early next week so speak up NOW if you disagree.

Cheers,
Ben.

> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  arch/powerpc/Kconfig                   |    2 +-
>  arch/powerpc/Kconfig.debug             |    7 -
>  arch/powerpc/configs/iseries_defconfig |  236 --------------------------------
>  arch/powerpc/platforms/Kconfig         |    3 +-
>  arch/powerpc/platforms/iseries/Kconfig |   38 -----
>  arch/powerpc/platforms/pseries/Kconfig |    2 +-
>  6 files changed, 3 insertions(+), 285 deletions(-)
>  delete mode 100644 arch/powerpc/configs/iseries_defconfig
>  delete mode 100644 arch/powerpc/platforms/iseries/Kconfig
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 1919634..e640107 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -611,7 +611,7 @@ endmenu
>  
>  config ISA_DMA_API
>  	bool
> -	default !PPC_ISERIES || PCI
> +	default PCI
>  
>  menu "Bus options"
>  
> diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
> index 4ccb2a0..72d55db 100644
> --- a/arch/powerpc/Kconfig.debug
> +++ b/arch/powerpc/Kconfig.debug
> @@ -196,13 +196,6 @@ config PPC_EARLY_DEBUG_MAPLE
>  	help
>  	  Select this to enable early debugging for Maple.
>  
> -config PPC_EARLY_DEBUG_ISERIES
> -	bool "iSeries HV Console"
> -	depends on PPC_ISERIES
> -	help
> -	  Select this to enable early debugging for legacy iSeries. You need
> -	  to hit "Ctrl-x Ctrl-x" to see the messages on the console.
> -
>  config PPC_EARLY_DEBUG_PAS_REALMODE
>  	bool "PA Semi real mode"
>  	depends on PPC_PASEMI
> diff --git a/arch/powerpc/configs/iseries_defconfig b/arch/powerpc/configs/iseries_defconfig
> deleted file mode 100644
> index 27c46d6..0000000
> --- a/arch/powerpc/configs/iseries_defconfig
> +++ /dev/null
> @@ -1,236 +0,0 @@
> -CONFIG_PPC64=y
> -CONFIG_SMP=y
> -CONFIG_EXPERIMENTAL=y
> -CONFIG_SYSVIPC=y
> -CONFIG_POSIX_MQUEUE=y
> -CONFIG_AUDIT=y
> -CONFIG_AUDITSYSCALL=y
> -CONFIG_IKCONFIG=y
> -CONFIG_IKCONFIG_PROC=y
> -CONFIG_BLK_DEV_INITRD=y
> -# CONFIG_COMPAT_BRK is not set
> -CONFIG_MODULES=y
> -CONFIG_MODULE_UNLOAD=y
> -CONFIG_MODVERSIONS=y
> -CONFIG_MODULE_SRCVERSION_ALL=y
> -# CONFIG_PPC_PSERIES is not set
> -CONFIG_LPARCFG=y
> -CONFIG_PPC_ISERIES=y
> -CONFIG_VIODASD=y
> -CONFIG_VIOCD=m
> -CONFIG_VIOTAPE=m
> -# CONFIG_PPC_PMAC is not set
> -CONFIG_NO_HZ=y
> -CONFIG_HIGH_RES_TIMERS=y
> -CONFIG_IRQ_ALL_CPUS=y
> -# CONFIG_MIGRATION is not set
> -CONFIG_PACKET=y
> -CONFIG_UNIX=y
> -CONFIG_XFRM_USER=m
> -CONFIG_XFRM_SUB_POLICY=y
> -CONFIG_NET_KEY=m
> -CONFIG_INET=y
> -CONFIG_IP_MULTICAST=y
> -CONFIG_NET_IPIP=y
> -CONFIG_SYN_COOKIES=y
> -CONFIG_INET_AH=m
> -CONFIG_INET_ESP=m
> -CONFIG_INET_IPCOMP=m
> -CONFIG_INET_XFRM_MODE_BEET=m
> -# CONFIG_INET_LRO is not set
> -# CONFIG_IPV6 is not set
> -CONFIG_NETFILTER=y
> -CONFIG_NETFILTER_NETLINK_QUEUE=m
> -CONFIG_NETFILTER_NETLINK_LOG=m
> -CONFIG_NF_CONNTRACK=m
> -CONFIG_NF_CONNTRACK_EVENTS=y
> -# CONFIG_NF_CT_PROTO_SCTP is not set
> -CONFIG_NF_CONNTRACK_FTP=m
> -CONFIG_NF_CONNTRACK_IRC=m
> -CONFIG_NF_CONNTRACK_TFTP=m
> -CONFIG_NF_CT_NETLINK=m
> -CONFIG_NETFILTER_TPROXY=m
> -CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
> -CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
> -CONFIG_NETFILTER_XT_TARGET_DSCP=m
> -CONFIG_NETFILTER_XT_TARGET_MARK=m
> -CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
> -CONFIG_NETFILTER_XT_TARGET_TPROXY=m
> -CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m
> -CONFIG_NETFILTER_XT_MATCH_COMMENT=m
> -CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
> -CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
> -CONFIG_NETFILTER_XT_MATCH_DSCP=m
> -CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
> -CONFIG_NETFILTER_XT_MATCH_LENGTH=m
> -CONFIG_NETFILTER_XT_MATCH_LIMIT=m
> -CONFIG_NETFILTER_XT_MATCH_MAC=m
> -CONFIG_NETFILTER_XT_MATCH_MARK=m
> -CONFIG_NETFILTER_XT_MATCH_OWNER=m
> -CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
> -CONFIG_NETFILTER_XT_MATCH_RATEEST=m
> -CONFIG_NETFILTER_XT_MATCH_REALM=m
> -CONFIG_NETFILTER_XT_MATCH_RECENT=m
> -CONFIG_NETFILTER_XT_MATCH_STRING=m
> -CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
> -CONFIG_NETFILTER_XT_MATCH_TIME=m
> -CONFIG_NF_CONNTRACK_IPV4=m
> -CONFIG_IP_NF_QUEUE=m
> -CONFIG_IP_NF_IPTABLES=m
> -CONFIG_IP_NF_MATCH_ADDRTYPE=m
> -CONFIG_IP_NF_MATCH_ECN=m
> -CONFIG_IP_NF_MATCH_TTL=m
> -CONFIG_IP_NF_FILTER=m
> -CONFIG_IP_NF_TARGET_REJECT=m
> -CONFIG_IP_NF_TARGET_LOG=m
> -CONFIG_IP_NF_TARGET_ULOG=m
> -CONFIG_NF_NAT=m
> -CONFIG_IP_NF_TARGET_MASQUERADE=m
> -CONFIG_IP_NF_TARGET_NETMAP=m
> -CONFIG_IP_NF_TARGET_REDIRECT=m
> -CONFIG_IP_NF_MANGLE=m
> -CONFIG_IP_NF_TARGET_CLUSTERIP=m
> -CONFIG_IP_NF_TARGET_ECN=m
> -CONFIG_IP_NF_TARGET_TTL=m
> -CONFIG_IP_NF_RAW=m
> -CONFIG_IP_NF_ARPTABLES=m
> -CONFIG_IP_NF_ARPFILTER=m
> -CONFIG_IP_NF_ARP_MANGLE=m
> -CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
> -CONFIG_PROC_DEVICETREE=y
> -CONFIG_BLK_DEV_LOOP=y
> -CONFIG_BLK_DEV_NBD=m
> -CONFIG_BLK_DEV_RAM=y
> -CONFIG_BLK_DEV_RAM_SIZE=65536
> -CONFIG_SCSI=y
> -CONFIG_BLK_DEV_SD=y
> -CONFIG_CHR_DEV_ST=y
> -CONFIG_BLK_DEV_SR=y
> -CONFIG_BLK_DEV_SR_VENDOR=y
> -CONFIG_CHR_DEV_SG=y
> -CONFIG_SCSI_MULTI_LUN=y
> -CONFIG_SCSI_CONSTANTS=y
> -CONFIG_SCSI_SPI_ATTRS=y
> -CONFIG_SCSI_FC_ATTRS=y
> -CONFIG_SCSI_SAS_LIBSAS=m
> -CONFIG_SCSI_IBMVSCSI=m
> -CONFIG_MD=y
> -CONFIG_BLK_DEV_MD=y
> -CONFIG_MD_LINEAR=y
> -CONFIG_MD_RAID0=y
> -CONFIG_MD_RAID1=y
> -CONFIG_MD_RAID10=m
> -CONFIG_MD_MULTIPATH=m
> -CONFIG_MD_FAULTY=m
> -CONFIG_BLK_DEV_DM=y
> -CONFIG_DM_CRYPT=m
> -CONFIG_DM_SNAPSHOT=m
> -CONFIG_DM_MIRROR=m
> -CONFIG_DM_ZERO=m
> -CONFIG_NETDEVICES=y
> -CONFIG_DUMMY=m
> -CONFIG_BONDING=m
> -CONFIG_TUN=m
> -CONFIG_NET_ETHERNET=y
> -CONFIG_NET_PCI=y
> -CONFIG_PCNET32=y
> -CONFIG_E100=y
> -CONFIG_ACENIC=m
> -CONFIG_E1000=m
> -CONFIG_ISERIES_VETH=y
> -CONFIG_PPP=m
> -CONFIG_PPP_ASYNC=m
> -CONFIG_PPP_SYNC_TTY=m
> -CONFIG_PPP_DEFLATE=m
> -CONFIG_PPP_BSDCOMP=m
> -CONFIG_PPPOE=m
> -CONFIG_NETCONSOLE=y
> -CONFIG_NETPOLL_TRAP=y
> -# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
> -# CONFIG_INPUT_KEYBOARD is not set
> -# CONFIG_INPUT_MOUSE is not set
> -# CONFIG_SERIO is not set
> -CONFIG_SERIAL_ICOM=m
> -# CONFIG_HW_RANDOM is not set
> -CONFIG_GEN_RTC=y
> -CONFIG_RAW_DRIVER=y
> -# CONFIG_HWMON is not set
> -# CONFIG_HID_SUPPORT is not set
> -# CONFIG_USB_SUPPORT is not set
> -CONFIG_EXT2_FS=y
> -CONFIG_EXT2_FS_XATTR=y
> -CONFIG_EXT2_FS_POSIX_ACL=y
> -CONFIG_EXT2_FS_SECURITY=y
> -CONFIG_EXT2_FS_XIP=y
> -CONFIG_EXT3_FS=y
> -CONFIG_EXT3_FS_POSIX_ACL=y
> -CONFIG_EXT3_FS_SECURITY=y
> -CONFIG_EXT4_FS=y
> -CONFIG_REISERFS_FS=y
> -CONFIG_REISERFS_FS_XATTR=y
> -CONFIG_REISERFS_FS_POSIX_ACL=y
> -CONFIG_REISERFS_FS_SECURITY=y
> -CONFIG_JFS_FS=m
> -CONFIG_JFS_POSIX_ACL=y
> -CONFIG_JFS_SECURITY=y
> -CONFIG_XFS_FS=m
> -CONFIG_XFS_POSIX_ACL=y
> -CONFIG_GFS2_FS=m
> -CONFIG_AUTOFS_FS=m
> -CONFIG_ISO9660_FS=y
> -CONFIG_JOLIET=y
> -CONFIG_ZISOFS=y
> -CONFIG_UDF_FS=m
> -CONFIG_MSDOS_FS=y
> -CONFIG_VFAT_FS=y
> -CONFIG_PROC_KCORE=y
> -CONFIG_TMPFS=y
> -CONFIG_TMPFS_POSIX_ACL=y
> -CONFIG_CRAMFS=y
> -CONFIG_NFS_FS=y
> -CONFIG_NFS_V3=y
> -CONFIG_NFS_V3_ACL=y
> -CONFIG_NFS_V4=y
> -CONFIG_NFSD=m
> -CONFIG_NFSD_V3_ACL=y
> -CONFIG_NFSD_V4=y
> -CONFIG_RPCSEC_GSS_SPKM3=m
> -CONFIG_CIFS=m
> -CONFIG_CIFS_XATTR=y
> -CONFIG_CIFS_POSIX=y
> -CONFIG_NLS_CODEPAGE_437=y
> -CONFIG_NLS_ASCII=y
> -CONFIG_NLS_ISO8859_1=y
> -CONFIG_DLM=m
> -CONFIG_CRC_T10DIF=y
> -CONFIG_MAGIC_SYSRQ=y
> -CONFIG_DEBUG_FS=y
> -CONFIG_DEBUG_KERNEL=y
> -# CONFIG_RCU_CPU_STALL_DETECTOR is not set
> -CONFIG_LATENCYTOP=y
> -CONFIG_SYSCTL_SYSCALL_CHECK=y
> -CONFIG_DEBUG_STACKOVERFLOW=y
> -CONFIG_DEBUG_STACK_USAGE=y
> -CONFIG_CRYPTO_NULL=m
> -CONFIG_CRYPTO_TEST=m
> -CONFIG_CRYPTO_ECB=m
> -CONFIG_CRYPTO_PCBC=m
> -CONFIG_CRYPTO_HMAC=y
> -CONFIG_CRYPTO_MD4=m
> -CONFIG_CRYPTO_MICHAEL_MIC=m
> -CONFIG_CRYPTO_SHA256=m
> -CONFIG_CRYPTO_SHA512=m
> -CONFIG_CRYPTO_TGR192=m
> -CONFIG_CRYPTO_WP512=m
> -CONFIG_CRYPTO_AES=m
> -CONFIG_CRYPTO_ANUBIS=m
> -CONFIG_CRYPTO_ARC4=m
> -CONFIG_CRYPTO_BLOWFISH=m
> -CONFIG_CRYPTO_CAST6=m
> -CONFIG_CRYPTO_KHAZAD=m
> -CONFIG_CRYPTO_SEED=m
> -CONFIG_CRYPTO_SERPENT=m
> -CONFIG_CRYPTO_TEA=m
> -CONFIG_CRYPTO_TWOFISH=m
> -# CONFIG_CRYPTO_ANSI_CPRNG is not set
> -# CONFIG_CRYPTO_HW is not set
> diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
> index 0cfb46d..236ab67 100644
> --- a/arch/powerpc/platforms/Kconfig
> +++ b/arch/powerpc/platforms/Kconfig
> @@ -2,7 +2,6 @@ menu "Platform support"
>  
>  source "arch/powerpc/platforms/powernv/Kconfig"
>  source "arch/powerpc/platforms/pseries/Kconfig"
> -source "arch/powerpc/platforms/iseries/Kconfig"
>  source "arch/powerpc/platforms/chrp/Kconfig"
>  source "arch/powerpc/platforms/512x/Kconfig"
>  source "arch/powerpc/platforms/52xx/Kconfig"
> @@ -138,7 +137,7 @@ config MPIC_BROKEN_REGREAD
>  	  of the register contents in software.
>  
>  config IBMVIO
> -	depends on PPC_PSERIES || PPC_ISERIES
> +	depends on PPC_PSERIES
>  	bool
>  	default y
>  
> diff --git a/arch/powerpc/platforms/iseries/Kconfig b/arch/powerpc/platforms/iseries/Kconfig
> deleted file mode 100644
> index b57cda3..0000000
> --- a/arch/powerpc/platforms/iseries/Kconfig
> +++ /dev/null
> @@ -1,38 +0,0 @@
> -config PPC_ISERIES
> -	bool "IBM Legacy iSeries"
> -	depends on PPC64 && PPC_BOOK3S
> -	select PPC_SMP_MUXED_IPI
> -	select PPC_INDIRECT_PIO
> -	select PPC_INDIRECT_MMIO
> -	select PPC_PCI_CHOICE if EXPERT
> -
> -menu "iSeries device drivers"
> -	depends on PPC_ISERIES
> -
> -config VIODASD
> -	tristate "iSeries Virtual I/O disk support"
> -	depends on BLOCK
> -	select VIOPATH
> -	help
> -	  If you are running on an iSeries system and you want to use
> -	  virtual disks created and managed by OS/400, say Y.
> -
> -config VIOCD
> -	tristate "iSeries Virtual I/O CD support"
> -	depends on BLOCK
> -	select VIOPATH
> -	help
> -	  If you are running Linux on an IBM iSeries system and you want to
> -	  read a CD drive owned by OS/400, say Y here.
> -
> -config VIOTAPE
> -	tristate "iSeries Virtual Tape Support"
> -	select VIOPATH
> -	help
> -	  If you are running Linux on an iSeries system and you want Linux
> -	  to read and/or write a tape drive owned by OS/400, say Y here.
> -
> -endmenu
> -
> -config VIOPATH
> -	bool
> diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig
> index 31f22c1..9c28847 100644
> --- a/arch/powerpc/platforms/pseries/Kconfig
> +++ b/arch/powerpc/platforms/pseries/Kconfig
> @@ -72,7 +72,7 @@ config IO_EVENT_IRQ
>  
>  config LPARCFG
>  	bool "LPAR Configuration Data"
> -	depends on PPC_PSERIES || PPC_ISERIES
> +	depends on PPC_PSERIES
>  	help
>  	Provide system capacity information via human readable
>  	<key word>=<value> pairs through a /proc/ppc64/lparcfg interface.
> -- 
> 1.7.9.1
> 

^ permalink raw reply

* [PATCH] powerpc: remove CONFIG_PPC_ISERIES from the architecture Kconfig files
From: Stephen Rothwell @ 2012-02-23  0:10 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: ppc-dev

[-- Attachment #1: Type: text/plain, Size: 10365 bytes --]

After this, we can remove the legacy iSeries code more easily.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/Kconfig                   |    2 +-
 arch/powerpc/Kconfig.debug             |    7 -
 arch/powerpc/configs/iseries_defconfig |  236 --------------------------------
 arch/powerpc/platforms/Kconfig         |    3 +-
 arch/powerpc/platforms/iseries/Kconfig |   38 -----
 arch/powerpc/platforms/pseries/Kconfig |    2 +-
 6 files changed, 3 insertions(+), 285 deletions(-)
 delete mode 100644 arch/powerpc/configs/iseries_defconfig
 delete mode 100644 arch/powerpc/platforms/iseries/Kconfig

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 1919634..e640107 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -611,7 +611,7 @@ endmenu
 
 config ISA_DMA_API
 	bool
-	default !PPC_ISERIES || PCI
+	default PCI
 
 menu "Bus options"
 
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index 4ccb2a0..72d55db 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -196,13 +196,6 @@ config PPC_EARLY_DEBUG_MAPLE
 	help
 	  Select this to enable early debugging for Maple.
 
-config PPC_EARLY_DEBUG_ISERIES
-	bool "iSeries HV Console"
-	depends on PPC_ISERIES
-	help
-	  Select this to enable early debugging for legacy iSeries. You need
-	  to hit "Ctrl-x Ctrl-x" to see the messages on the console.
-
 config PPC_EARLY_DEBUG_PAS_REALMODE
 	bool "PA Semi real mode"
 	depends on PPC_PASEMI
diff --git a/arch/powerpc/configs/iseries_defconfig b/arch/powerpc/configs/iseries_defconfig
deleted file mode 100644
index 27c46d6..0000000
--- a/arch/powerpc/configs/iseries_defconfig
+++ /dev/null
@@ -1,236 +0,0 @@
-CONFIG_PPC64=y
-CONFIG_SMP=y
-CONFIG_EXPERIMENTAL=y
-CONFIG_SYSVIPC=y
-CONFIG_POSIX_MQUEUE=y
-CONFIG_AUDIT=y
-CONFIG_AUDITSYSCALL=y
-CONFIG_IKCONFIG=y
-CONFIG_IKCONFIG_PROC=y
-CONFIG_BLK_DEV_INITRD=y
-# CONFIG_COMPAT_BRK is not set
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODVERSIONS=y
-CONFIG_MODULE_SRCVERSION_ALL=y
-# CONFIG_PPC_PSERIES is not set
-CONFIG_LPARCFG=y
-CONFIG_PPC_ISERIES=y
-CONFIG_VIODASD=y
-CONFIG_VIOCD=m
-CONFIG_VIOTAPE=m
-# CONFIG_PPC_PMAC is not set
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_IRQ_ALL_CPUS=y
-# CONFIG_MIGRATION is not set
-CONFIG_PACKET=y
-CONFIG_UNIX=y
-CONFIG_XFRM_USER=m
-CONFIG_XFRM_SUB_POLICY=y
-CONFIG_NET_KEY=m
-CONFIG_INET=y
-CONFIG_IP_MULTICAST=y
-CONFIG_NET_IPIP=y
-CONFIG_SYN_COOKIES=y
-CONFIG_INET_AH=m
-CONFIG_INET_ESP=m
-CONFIG_INET_IPCOMP=m
-CONFIG_INET_XFRM_MODE_BEET=m
-# CONFIG_INET_LRO is not set
-# CONFIG_IPV6 is not set
-CONFIG_NETFILTER=y
-CONFIG_NETFILTER_NETLINK_QUEUE=m
-CONFIG_NETFILTER_NETLINK_LOG=m
-CONFIG_NF_CONNTRACK=m
-CONFIG_NF_CONNTRACK_EVENTS=y
-# CONFIG_NF_CT_PROTO_SCTP is not set
-CONFIG_NF_CONNTRACK_FTP=m
-CONFIG_NF_CONNTRACK_IRC=m
-CONFIG_NF_CONNTRACK_TFTP=m
-CONFIG_NF_CT_NETLINK=m
-CONFIG_NETFILTER_TPROXY=m
-CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
-CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
-CONFIG_NETFILTER_XT_TARGET_DSCP=m
-CONFIG_NETFILTER_XT_TARGET_MARK=m
-CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
-CONFIG_NETFILTER_XT_TARGET_TPROXY=m
-CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m
-CONFIG_NETFILTER_XT_MATCH_COMMENT=m
-CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
-CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
-CONFIG_NETFILTER_XT_MATCH_DSCP=m
-CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
-CONFIG_NETFILTER_XT_MATCH_LENGTH=m
-CONFIG_NETFILTER_XT_MATCH_LIMIT=m
-CONFIG_NETFILTER_XT_MATCH_MAC=m
-CONFIG_NETFILTER_XT_MATCH_MARK=m
-CONFIG_NETFILTER_XT_MATCH_OWNER=m
-CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
-CONFIG_NETFILTER_XT_MATCH_RATEEST=m
-CONFIG_NETFILTER_XT_MATCH_REALM=m
-CONFIG_NETFILTER_XT_MATCH_RECENT=m
-CONFIG_NETFILTER_XT_MATCH_STRING=m
-CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
-CONFIG_NETFILTER_XT_MATCH_TIME=m
-CONFIG_NF_CONNTRACK_IPV4=m
-CONFIG_IP_NF_QUEUE=m
-CONFIG_IP_NF_IPTABLES=m
-CONFIG_IP_NF_MATCH_ADDRTYPE=m
-CONFIG_IP_NF_MATCH_ECN=m
-CONFIG_IP_NF_MATCH_TTL=m
-CONFIG_IP_NF_FILTER=m
-CONFIG_IP_NF_TARGET_REJECT=m
-CONFIG_IP_NF_TARGET_LOG=m
-CONFIG_IP_NF_TARGET_ULOG=m
-CONFIG_NF_NAT=m
-CONFIG_IP_NF_TARGET_MASQUERADE=m
-CONFIG_IP_NF_TARGET_NETMAP=m
-CONFIG_IP_NF_TARGET_REDIRECT=m
-CONFIG_IP_NF_MANGLE=m
-CONFIG_IP_NF_TARGET_CLUSTERIP=m
-CONFIG_IP_NF_TARGET_ECN=m
-CONFIG_IP_NF_TARGET_TTL=m
-CONFIG_IP_NF_RAW=m
-CONFIG_IP_NF_ARPTABLES=m
-CONFIG_IP_NF_ARPFILTER=m
-CONFIG_IP_NF_ARP_MANGLE=m
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-CONFIG_PROC_DEVICETREE=y
-CONFIG_BLK_DEV_LOOP=y
-CONFIG_BLK_DEV_NBD=m
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_SIZE=65536
-CONFIG_SCSI=y
-CONFIG_BLK_DEV_SD=y
-CONFIG_CHR_DEV_ST=y
-CONFIG_BLK_DEV_SR=y
-CONFIG_BLK_DEV_SR_VENDOR=y
-CONFIG_CHR_DEV_SG=y
-CONFIG_SCSI_MULTI_LUN=y
-CONFIG_SCSI_CONSTANTS=y
-CONFIG_SCSI_SPI_ATTRS=y
-CONFIG_SCSI_FC_ATTRS=y
-CONFIG_SCSI_SAS_LIBSAS=m
-CONFIG_SCSI_IBMVSCSI=m
-CONFIG_MD=y
-CONFIG_BLK_DEV_MD=y
-CONFIG_MD_LINEAR=y
-CONFIG_MD_RAID0=y
-CONFIG_MD_RAID1=y
-CONFIG_MD_RAID10=m
-CONFIG_MD_MULTIPATH=m
-CONFIG_MD_FAULTY=m
-CONFIG_BLK_DEV_DM=y
-CONFIG_DM_CRYPT=m
-CONFIG_DM_SNAPSHOT=m
-CONFIG_DM_MIRROR=m
-CONFIG_DM_ZERO=m
-CONFIG_NETDEVICES=y
-CONFIG_DUMMY=m
-CONFIG_BONDING=m
-CONFIG_TUN=m
-CONFIG_NET_ETHERNET=y
-CONFIG_NET_PCI=y
-CONFIG_PCNET32=y
-CONFIG_E100=y
-CONFIG_ACENIC=m
-CONFIG_E1000=m
-CONFIG_ISERIES_VETH=y
-CONFIG_PPP=m
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_SYNC_TTY=m
-CONFIG_PPP_DEFLATE=m
-CONFIG_PPP_BSDCOMP=m
-CONFIG_PPPOE=m
-CONFIG_NETCONSOLE=y
-CONFIG_NETPOLL_TRAP=y
-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
-# CONFIG_INPUT_KEYBOARD is not set
-# CONFIG_INPUT_MOUSE is not set
-# CONFIG_SERIO is not set
-CONFIG_SERIAL_ICOM=m
-# CONFIG_HW_RANDOM is not set
-CONFIG_GEN_RTC=y
-CONFIG_RAW_DRIVER=y
-# CONFIG_HWMON is not set
-# CONFIG_HID_SUPPORT is not set
-# CONFIG_USB_SUPPORT is not set
-CONFIG_EXT2_FS=y
-CONFIG_EXT2_FS_XATTR=y
-CONFIG_EXT2_FS_POSIX_ACL=y
-CONFIG_EXT2_FS_SECURITY=y
-CONFIG_EXT2_FS_XIP=y
-CONFIG_EXT3_FS=y
-CONFIG_EXT3_FS_POSIX_ACL=y
-CONFIG_EXT3_FS_SECURITY=y
-CONFIG_EXT4_FS=y
-CONFIG_REISERFS_FS=y
-CONFIG_REISERFS_FS_XATTR=y
-CONFIG_REISERFS_FS_POSIX_ACL=y
-CONFIG_REISERFS_FS_SECURITY=y
-CONFIG_JFS_FS=m
-CONFIG_JFS_POSIX_ACL=y
-CONFIG_JFS_SECURITY=y
-CONFIG_XFS_FS=m
-CONFIG_XFS_POSIX_ACL=y
-CONFIG_GFS2_FS=m
-CONFIG_AUTOFS_FS=m
-CONFIG_ISO9660_FS=y
-CONFIG_JOLIET=y
-CONFIG_ZISOFS=y
-CONFIG_UDF_FS=m
-CONFIG_MSDOS_FS=y
-CONFIG_VFAT_FS=y
-CONFIG_PROC_KCORE=y
-CONFIG_TMPFS=y
-CONFIG_TMPFS_POSIX_ACL=y
-CONFIG_CRAMFS=y
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-CONFIG_NFS_V3_ACL=y
-CONFIG_NFS_V4=y
-CONFIG_NFSD=m
-CONFIG_NFSD_V3_ACL=y
-CONFIG_NFSD_V4=y
-CONFIG_RPCSEC_GSS_SPKM3=m
-CONFIG_CIFS=m
-CONFIG_CIFS_XATTR=y
-CONFIG_CIFS_POSIX=y
-CONFIG_NLS_CODEPAGE_437=y
-CONFIG_NLS_ASCII=y
-CONFIG_NLS_ISO8859_1=y
-CONFIG_DLM=m
-CONFIG_CRC_T10DIF=y
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_DEBUG_FS=y
-CONFIG_DEBUG_KERNEL=y
-# CONFIG_RCU_CPU_STALL_DETECTOR is not set
-CONFIG_LATENCYTOP=y
-CONFIG_SYSCTL_SYSCALL_CHECK=y
-CONFIG_DEBUG_STACKOVERFLOW=y
-CONFIG_DEBUG_STACK_USAGE=y
-CONFIG_CRYPTO_NULL=m
-CONFIG_CRYPTO_TEST=m
-CONFIG_CRYPTO_ECB=m
-CONFIG_CRYPTO_PCBC=m
-CONFIG_CRYPTO_HMAC=y
-CONFIG_CRYPTO_MD4=m
-CONFIG_CRYPTO_MICHAEL_MIC=m
-CONFIG_CRYPTO_SHA256=m
-CONFIG_CRYPTO_SHA512=m
-CONFIG_CRYPTO_TGR192=m
-CONFIG_CRYPTO_WP512=m
-CONFIG_CRYPTO_AES=m
-CONFIG_CRYPTO_ANUBIS=m
-CONFIG_CRYPTO_ARC4=m
-CONFIG_CRYPTO_BLOWFISH=m
-CONFIG_CRYPTO_CAST6=m
-CONFIG_CRYPTO_KHAZAD=m
-CONFIG_CRYPTO_SEED=m
-CONFIG_CRYPTO_SERPENT=m
-CONFIG_CRYPTO_TEA=m
-CONFIG_CRYPTO_TWOFISH=m
-# CONFIG_CRYPTO_ANSI_CPRNG is not set
-# CONFIG_CRYPTO_HW is not set
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 0cfb46d..236ab67 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -2,7 +2,6 @@ menu "Platform support"
 
 source "arch/powerpc/platforms/powernv/Kconfig"
 source "arch/powerpc/platforms/pseries/Kconfig"
-source "arch/powerpc/platforms/iseries/Kconfig"
 source "arch/powerpc/platforms/chrp/Kconfig"
 source "arch/powerpc/platforms/512x/Kconfig"
 source "arch/powerpc/platforms/52xx/Kconfig"
@@ -138,7 +137,7 @@ config MPIC_BROKEN_REGREAD
 	  of the register contents in software.
 
 config IBMVIO
-	depends on PPC_PSERIES || PPC_ISERIES
+	depends on PPC_PSERIES
 	bool
 	default y
 
diff --git a/arch/powerpc/platforms/iseries/Kconfig b/arch/powerpc/platforms/iseries/Kconfig
deleted file mode 100644
index b57cda3..0000000
--- a/arch/powerpc/platforms/iseries/Kconfig
+++ /dev/null
@@ -1,38 +0,0 @@
-config PPC_ISERIES
-	bool "IBM Legacy iSeries"
-	depends on PPC64 && PPC_BOOK3S
-	select PPC_SMP_MUXED_IPI
-	select PPC_INDIRECT_PIO
-	select PPC_INDIRECT_MMIO
-	select PPC_PCI_CHOICE if EXPERT
-
-menu "iSeries device drivers"
-	depends on PPC_ISERIES
-
-config VIODASD
-	tristate "iSeries Virtual I/O disk support"
-	depends on BLOCK
-	select VIOPATH
-	help
-	  If you are running on an iSeries system and you want to use
-	  virtual disks created and managed by OS/400, say Y.
-
-config VIOCD
-	tristate "iSeries Virtual I/O CD support"
-	depends on BLOCK
-	select VIOPATH
-	help
-	  If you are running Linux on an IBM iSeries system and you want to
-	  read a CD drive owned by OS/400, say Y here.
-
-config VIOTAPE
-	tristate "iSeries Virtual Tape Support"
-	select VIOPATH
-	help
-	  If you are running Linux on an iSeries system and you want Linux
-	  to read and/or write a tape drive owned by OS/400, say Y here.
-
-endmenu
-
-config VIOPATH
-	bool
diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig
index 31f22c1..9c28847 100644
--- a/arch/powerpc/platforms/pseries/Kconfig
+++ b/arch/powerpc/platforms/pseries/Kconfig
@@ -72,7 +72,7 @@ config IO_EVENT_IRQ
 
 config LPARCFG
 	bool "LPAR Configuration Data"
-	depends on PPC_PSERIES || PPC_ISERIES
+	depends on PPC_PSERIES
 	help
 	Provide system capacity information via human readable
 	<key word>=<value> pairs through a /proc/ppc64/lparcfg interface.
-- 
1.7.9.1

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply related

* powerpc/mpic: Fix allocation of reverse-map for multi-ISU mpics
From: Benjamin Herrenschmidt @ 2012-02-22 23:50 UTC (permalink / raw)
  To: linuxppc-dev

When using a multi-ISU MPIC, we can interrupts up to
isu_size * MPIC_MAX_ISU, not just isu_size, so allocate
the right size reverse map.

Without this, the code will constantly fallback to
a linear search.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 4e9ccb1..7fb3ab5 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1346,7 +1346,8 @@ struct mpic * __init mpic_alloc(struct device_node *node,
 	mpic->isu_mask = (1 << mpic->isu_shift) - 1;
 
 	mpic->irqhost = irq_alloc_host(mpic->node, IRQ_HOST_MAP_LINEAR,
-				       isu_size ? isu_size : mpic->num_sources,
+				       isu_size ? isu_size *  MPIC_MAX_ISU :
+				       mpic->num_sources,
 				       &mpic_host_ops,
 				       flags & MPIC_LARGE_VECTORS ? 2048 : 256);
 

^ permalink raw reply related

* [PATCH] ppc-6xx: fix build failure in flipper-pic.c and hlwd-pic.c
From: Paul Gortmaker @ 2012-02-22 23:35 UTC (permalink / raw)
  To: grant.likely; +Cc: olof, Paul Gortmaker, linux-next, linuxppc-dev

The commit bae1d8f19983fbfa25559aa3cb6a81a84aa82a18 (linux-next)

  "irq_domain/powerpc: Use common irq_domain structure instead of irq_host"

made this change:

   -static struct irq_host *flipper_irq_host;
   +static struct irq_domain *flipper_irq_host;

and this change:

   -static struct irq_host *hlwd_irq_host;
   +static struct irq_domain *hlwd_irq_host;

The intent was to change the type, and not the name, but then in a
couple of instances, it looks like the sed to change the irq_domain_ops
name inadvertently also changed the irq_host name where it was not
supposed to, causing build failures.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

---

[seen in build tests on the linux-next tree from yesterday.]

diff --git a/arch/powerpc/platforms/embedded6xx/flipper-pic.c b/arch/powerpc/platforms/embedded6xx/flipper-pic.c
index 675335a..53d6eee 100644
--- a/arch/powerpc/platforms/embedded6xx/flipper-pic.c
+++ b/arch/powerpc/platforms/embedded6xx/flipper-pic.c
@@ -172,7 +172,7 @@ out:
 
 unsigned int flipper_pic_get_irq(void)
 {
-	void __iomem *io_base = flipper_irq_domain->host_data;
+	void __iomem *io_base = flipper_irq_host->host_data;
 	int irq;
 	u32 irq_status;
 
@@ -182,7 +182,7 @@ unsigned int flipper_pic_get_irq(void)
 		return NO_IRQ;	/* no more IRQs pending */
 
 	irq = __ffs(irq_status);
-	return irq_linear_revmap(flipper_irq_domain, irq);
+	return irq_linear_revmap(flipper_irq_host, irq);
 }
 
 /*
@@ -197,7 +197,7 @@ void __init flipper_pic_probe(void)
 	np = of_find_compatible_node(NULL, NULL, "nintendo,flipper-pic");
 	BUG_ON(!np);
 
-	flipper_irq_domain = flipper_pic_init(np);
+	flipper_irq_host = flipper_pic_init(np);
 	BUG_ON(!flipper_irq_host);
 
 	irq_set_default_host(flipper_irq_host);
diff --git a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c
index da6ca02..3006b51 100644
--- a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c
+++ b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c
@@ -189,7 +189,7 @@ struct irq_domain *hlwd_pic_init(struct device_node *np)
 
 unsigned int hlwd_pic_get_irq(void)
 {
-	return __hlwd_pic_get_irq(hlwd_irq_domain);
+	return __hlwd_pic_get_irq(hlwd_irq_host);
 }
 
 /*
@@ -213,7 +213,7 @@ void hlwd_pic_probe(void)
 			irq_set_handler_data(cascade_virq, host);
 			irq_set_chained_handler(cascade_virq,
 						hlwd_pic_irq_cascade);
-			hlwd_irq_domain = host;
+			hlwd_irq_host = host;
 			break;
 		}
 	}
@@ -227,7 +227,7 @@ void hlwd_pic_probe(void)
  */
 void hlwd_quiesce(void)
 {
-	void __iomem *io_base = hlwd_irq_domain->host_data;
+	void __iomem *io_base = hlwd_irq_host->host_data;
 
 	__hlwd_quiesce(io_base);
 }
-- 
1.7.9.1

^ permalink raw reply related

* Re: [PATCH v1 09/11] powerpc/PCI: replace pci_probe_only with pci_flags
From: Bjorn Helgaas @ 2012-02-22 22:47 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linux-arch, linux-pci, linuxppc-dev
In-Reply-To: <1329946909.20389.10.camel@pasglop>

On Wed, Feb 22, 2012 at 1:41 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> On Wed, 2012-02-22 at 11:19 -0700, Bjorn Helgaas wrote:
>> We already use pci_flags, so this just sets pci_flags directly and remov=
es
>> the intermediate step of figuring out pci_probe_only, then using it to s=
et
>> pci_flags.
>
> Ah yes, those flags are now common indeed.
>
>> The PCI core provides a pci_flags definition (currently __weak), so drop
>> the powerpc definitions in favor of that. =A0Note that we must set the p=
pc64
>> default (PCI_PROBE_ONLY set) in the 64-bit setup_arch() before calling
>> the platform .setup_arch() method, which may override the default.
>
> Ah wait, I have a patch about to hit -next that flips the ppc64
> default...
>
> Maybe it's easier if you just pick it up and stick it in your series,
> that will avoid integration clashes..
>
> http://patchwork.ozlabs.org/patch/141225/

Sure, I'll pick up that patch and repost the series.  I'll wait until
tomorrow or so in case anybody else has comments.

Thanks,
  Bjorn

^ permalink raw reply

* [PATCH] powerpc: icswx: fix race condition where threads do not get their ACOP register updated in time.
From: Jimi Xenidis @ 2012-02-22 22:07 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Anton Blanchard

There is a race where a thread causes a coprocessor type to be valid
in its own ACOP _and_ in the current context, but it does not
propagate to the ACOP register of other threads in time for them to
use it.  The original code tries to solve this by sending an IPI to
all threads on the system, which is heavy handed, but unfortunately
still provides a window where the icswx is issued by other threads and
the ACOP is not up to date.

This patch detects that the ACOP DSI fault was a "false positive" and
syncs the ACOP and causes the icswx to be replayed.

Signed-off-by: Jimi Xenidis <jimix@pobox.com>
Cc: Anton Blanchard <anton@samba.org>
---
 arch/powerpc/mm/icswx.c |   29 +++++++++++++++++++++++++++--
 arch/powerpc/mm/icswx.h |    6 ++++++
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/mm/icswx.c b/arch/powerpc/mm/icswx.c
index 5d9a59e..4db5b36 100644
--- a/arch/powerpc/mm/icswx.c
+++ b/arch/powerpc/mm/icswx.c
@@ -163,7 +163,7 @@ EXPORT_SYMBOL_GPL(drop_cop);
 
 static int acop_use_cop(int ct)
 {
-	/* todo */
+	/* There is no alternate policy, yet */
 	return -1;
 }
 
@@ -227,11 +227,36 @@ int acop_handle_fault(struct pt_regs *regs, unsigned long address,
 		ct = (ccw >> 16) & 0x3f;
 	}
 
+	/*
+	 * We could be here because another thread has enabled acop
+	 * but the ACOP register has yet to be updated.
+	 *
+	 * This should have been taken care of by the IPI to sync all
+	 * the threads (see smp_call_function(sync_cop, mm, 1)), but
+	 * that could take forever if there are a significant amount
+	 * of threads.
+	 *
+	 * Given the number of threads on some of these systems,
+	 * perhaps this is the best way to sync ACOP rather than whack
+	 * every thread with an IPI.
+	 */
+	if (acop_copro_type_bit(ct) && current->active_mm->context.acop) {
+		pr_debug("%s[%d]: Spurrious ACOP Fault, CT: %d, bit: 0x%llx "
+			"SPR: 0x%lx, mm->acop: 0x%lx\n",
+			current->comm, current->pid,
+			ct, acop_copro_type_bit(ct), mfspr(SPRN_ACOP),
+			current->active_mm->context.acop);
+
+		sync_cop(current->active_mm);
+		return 0;
+	}
+
+	/* check for alternate policy */
 	if (!acop_use_cop(ct))
 		return 0;
 
 	/* at this point the CT is unknown to the system */
-	pr_warn("%s[%d]: Coprocessor %d is unavailable",
+	pr_warn("%s[%d]: Coprocessor %d is unavailable\n",
 		current->comm, current->pid, ct);
 
 	/* get inst if we don't already have it */
diff --git a/arch/powerpc/mm/icswx.h b/arch/powerpc/mm/icswx.h
index 42176bd..6dedc08 100644
--- a/arch/powerpc/mm/icswx.h
+++ b/arch/powerpc/mm/icswx.h
@@ -59,4 +59,10 @@ extern void free_cop_pid(int free_pid);
 
 extern int acop_handle_fault(struct pt_regs *regs, unsigned long address,
 			     unsigned long error_code);
+
+static inline u64 acop_copro_type_bit(unsigned int type)
+{
+	return 1ULL << (63 - type);
+}
+
 #endif /* !_ARCH_POWERPC_MM_ICSWX_H_ */
-- 
1.7.0.4

^ permalink raw reply related

* Re: [PATCH v1 09/11] powerpc/PCI: replace pci_probe_only with pci_flags
From: Benjamin Herrenschmidt @ 2012-02-22 21:41 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-arch, linux-pci, linuxppc-dev
In-Reply-To: <20120222181948.27513.96215.stgit@bhelgaas.mtv.corp.google.com>

On Wed, 2012-02-22 at 11:19 -0700, Bjorn Helgaas wrote:
> We already use pci_flags, so this just sets pci_flags directly and removes
> the intermediate step of figuring out pci_probe_only, then using it to set
> pci_flags.

Ah yes, those flags are now common indeed.

> The PCI core provides a pci_flags definition (currently __weak), so drop
> the powerpc definitions in favor of that.  Note that we must set the ppc64
> default (PCI_PROBE_ONLY set) in the 64-bit setup_arch() before calling
> the platform .setup_arch() method, which may override the default.

Ah wait, I have a patch about to hit -next that flips the ppc64
default...

Maybe it's easier if you just pick it up and stick it in your series,
that will avoid integration clashes..

http://patchwork.ozlabs.org/patch/141225/

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH v1 09/11] powerpc/PCI: replace pci_probe_only with pci_flags
From: Benjamin Herrenschmidt @ 2012-02-22 21:41 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-arch, linux-pci, Olof Johansson, linuxppc-dev
In-Reply-To: <20120222181948.27513.96215.stgit@bhelgaas.mtv.corp.google.com>

On Wed, 2012-02-22 at 11:19 -0700, Bjorn Helgaas wrote:
>  int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel)
> diff --git a/arch/powerpc/platforms/pasemi/pci.c
> b/arch/powerpc/platforms/pasemi/pci.c
> index b6a0ec4..b27d886 100644
> --- a/arch/powerpc/platforms/pasemi/pci.c
> +++ b/arch/powerpc/platforms/pasemi/pci.c
> @@ -231,7 +231,7 @@ void __init pas_pci_init(void)
>         pci_devs_phb_init();
>  
>         /* Use the common resource allocation mechanism */
> -       pci_probe_only = 1;
> +       pci_add_flags(PCI_PROBE_ONLY);
>  }

Olof, do you remember why you used to set that on pasemi ?

I would have expected it to be clear, so the kernel can re-assign things
if needed. We really only want it set for pseries because of the
hypervisor being a PITA :-)

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH v5 1/4] KVM: PPC: epapr: Factor out the epapr init
From: Scott Wood @ 2012-02-22 18:28 UTC (permalink / raw)
  To: Liu Yu-B13201
  Cc: linuxppc-dev@ozlabs.org, Wood Scott-B07421, agraf@suse.de,
	kvm-ppc@vger.kernel.org, kvm@vger.kernel.org
In-Reply-To: <4CA99838F21AB847ACC344051E23170905749AD7@039-SN2MPN1-022.039d.mgd.msft.net>

On 02/21/2012 08:33 PM, Liu Yu-B13201 wrote:
>>> +bool epapr_para_enabled = false;
>>
>> No need to explicitly initialize to false.
> 
> Why not make code more readable?

It's common kernel style to not explicitly initialize global data to
zero or equivalent.  Historically this was due to toolchain issues that
are no longer relevant, but people still seem to prefer it that way.
It's subjective whether readability is enhanced by being explicit or by
being concise.

>> Do not warn just because there's no hypervisor or hcall-instructions.
>> There's nothing wrong with that.  Only warn if they are present but wrong.
>>
> 
> I see that it's not proper to warn in host.
> But if user forget to add hypervisor node or inst, how can he know something is wrong?

Print a message when paravirt is enabled (I think KVM already does
this).  This is no different than a user forgetting to add a certain
device to the device tree -- you'll silently just not get that device.

Ideally the hypervisor would take care of adding this stuff to the
device tree anyway, no user action required.

-Scott

^ permalink raw reply

* [PATCH v1 09/11] powerpc/PCI: replace pci_probe_only with pci_flags
From: Bjorn Helgaas @ 2012-02-22 18:19 UTC (permalink / raw)
  To: linux-pci; +Cc: linux-arch, linuxppc-dev
In-Reply-To: <20120222181556.27513.9413.stgit@bhelgaas.mtv.corp.google.com>

We already use pci_flags, so this just sets pci_flags directly and removes
the intermediate step of figuring out pci_probe_only, then using it to set
pci_flags.

The PCI core provides a pci_flags definition (currently __weak), so drop
the powerpc definitions in favor of that.  Note that we must set the ppc64
default (PCI_PROBE_ONLY set) in the 64-bit setup_arch() before calling
the platform .setup_arch() method, which may override the default.

CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 arch/powerpc/include/asm/ppc-pci.h        |    2 --
 arch/powerpc/kernel/pci-common.c          |    3 ---
 arch/powerpc/kernel/pci_64.c              |    5 -----
 arch/powerpc/kernel/rtas_pci.c            |   10 +++++++---
 arch/powerpc/kernel/setup_64.c            |    1 +
 arch/powerpc/platforms/iseries/pci.c      |    2 +-
 arch/powerpc/platforms/maple/pci.c        |    2 +-
 arch/powerpc/platforms/pasemi/pci.c       |    2 +-
 arch/powerpc/platforms/powermac/pci.c     |    2 +-
 arch/powerpc/platforms/powernv/pci-ioda.c |    5 ++---
 arch/powerpc/platforms/powernv/pci.c      |    4 ++--
 arch/powerpc/platforms/wsp/wsp_pci.c      |    2 +-
 12 files changed, 17 insertions(+), 23 deletions(-)

diff --git a/arch/powerpc/include/asm/ppc-pci.h b/arch/powerpc/include/asm/ppc-pci.h
index 6d42297..a96d012 100644
--- a/arch/powerpc/include/asm/ppc-pci.h
+++ b/arch/powerpc/include/asm/ppc-pci.h
@@ -45,8 +45,6 @@ extern void init_pci_config_tokens (void);
 extern unsigned long get_phb_buid (struct device_node *);
 extern int rtas_setup_phb(struct pci_controller *phb);
 
-extern unsigned long pci_probe_only;
-
 /* ---- EEH internal-use-only related routines ---- */
 #ifdef CONFIG_EEH
 
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index cce98d7..6d03da4 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -50,9 +50,6 @@ static int global_phb_number;		/* Global phb counter */
 /* ISA Memory physical address */
 resource_size_t isa_mem_base;
 
-/* Default PCI flags is 0 on ppc32, modified at boot on ppc64 */
-unsigned int pci_flags = 0;
-
 
 static struct dma_map_ops *pci_dma_ops = &dma_direct_ops;
 
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 3318d39..75417fd 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -33,8 +33,6 @@
 #include <asm/machdep.h>
 #include <asm/ppc-pci.h>
 
-unsigned long pci_probe_only = 1;
-
 /* pci_io_base -- the base address from which io bars are offsets.
  * This is the lowest I/O base address (so bar values are always positive),
  * and it *must* be the start of ISA space if an ISA bus exists because
@@ -55,9 +53,6 @@ static int __init pcibios_init(void)
 	 */
 	ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot;
 
-	if (pci_probe_only)
-		pci_add_flags(PCI_PROBE_ONLY);
-
 	/* On ppc64, we always enable PCI domains and we keep domain 0
 	 * backward compatible in /proc for video cards
 	 */
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c
index 6cd8f01..140735c 100644
--- a/arch/powerpc/kernel/rtas_pci.c
+++ b/arch/powerpc/kernel/rtas_pci.c
@@ -276,7 +276,7 @@ void __init find_and_init_phbs(void)
 	pci_devs_phb_init();
 
 	/*
-	 * pci_probe_only and pci_assign_all_buses can be set via properties
+	 * PCI_PROBE_ONLY and PCI_REASSIGN_ALL_BUS can be set via properties
 	 * in chosen.
 	 */
 	if (of_chosen) {
@@ -284,8 +284,12 @@ void __init find_and_init_phbs(void)
 
 		prop = of_get_property(of_chosen,
 				"linux,pci-probe-only", NULL);
-		if (prop)
-			pci_probe_only = *prop;
+		if (prop) {
+			if (*prop)
+				pci_add_flags(PCI_PROBE_ONLY);
+			else
+				pci_clear_flags(PCI_PROBE_ONLY);
+		}
 
 #ifdef CONFIG_PPC32 /* Will be made generic soon */
 		prop = of_get_property(of_chosen,
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 4cb8f1e..639baa9 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -590,6 +590,7 @@ void __init setup_arch(char **cmdline_p)
 	conswitchp = &dummy_con;
 #endif
 
+	pci_add_flags(PCI_PROBE_ONLY);
 	if (ppc_md.setup_arch)
 		ppc_md.setup_arch();
 
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index c754128..171b2f3 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -868,7 +868,7 @@ void __init iSeries_pcibios_init(void)
 	/* Install IO hooks */
 	ppc_pci_io = iseries_pci_io;
 
-	pci_probe_only = 1;
+	pci_add_flags(PCI_PROBE_ONLY);
 
 	/* iSeries has no IO space in the common sense, it needs to set
 	 * the IO base to 0
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c
index 401e3f3..465ee8f 100644
--- a/arch/powerpc/platforms/maple/pci.c
+++ b/arch/powerpc/platforms/maple/pci.c
@@ -620,7 +620,7 @@ void __init maple_pci_init(void)
 	}
 
 	/* Tell pci.c to not change any resource allocations.  */
-	pci_probe_only = 1;
+	pci_add_flags(PCI_PROBE_ONLY);
 }
 
 int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel)
diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
index b6a0ec4..b27d886 100644
--- a/arch/powerpc/platforms/pasemi/pci.c
+++ b/arch/powerpc/platforms/pasemi/pci.c
@@ -231,7 +231,7 @@ void __init pas_pci_init(void)
 	pci_devs_phb_init();
 
 	/* Use the common resource allocation mechanism */
-	pci_probe_only = 1;
+	pci_add_flags(PCI_PROBE_ONLY);
 }
 
 void __iomem *pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset)
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index 31a7d3a..c829e58 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -1060,7 +1060,7 @@ void __init pmac_pci_init(void)
 	/* pmac_check_ht_link(); */
 
 	/* We can allocate missing resources if any */
-	pci_probe_only = 0;
+	pci_clear_flags(PCI_PROBE_ONLY);
 
 #else /* CONFIG_PPC64 */
 	init_p2pbridge();
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 5e155df..fbdd74d 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -1299,15 +1299,14 @@ void __init pnv_pci_init_ioda1_phb(struct device_node *np)
 	/* Setup MSI support */
 	pnv_pci_init_ioda_msis(phb);
 
-	/* We set both probe_only and PCI_REASSIGN_ALL_RSRC. This is an
+	/* We set both PCI_PROBE_ONLY and PCI_REASSIGN_ALL_RSRC. This is an
 	 * odd combination which essentially means that we skip all resource
 	 * fixups and assignments in the generic code, and do it all
 	 * ourselves here
 	 */
-	pci_probe_only = 1;
 	ppc_md.pcibios_fixup_phb = pnv_pci_ioda_fixup_phb;
 	ppc_md.pcibios_enable_device_hook = pnv_pci_enable_device_hook;
-	pci_add_flags(PCI_REASSIGN_ALL_RSRC);
+	pci_add_flags(PCI_PROBE_ONLY | PCI_REASSIGN_ALL_RSRC);
 
 	/* Reset IODA tables to a clean state */
 	rc = opal_pci_reset(phb_id, OPAL_PCI_IODA_TABLE_RESET, OPAL_ASSERT_RESET);
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index f92b9ef..30abdd7 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -561,10 +561,10 @@ void __init pnv_pci_init(void)
 {
 	struct device_node *np;
 
-	pci_set_flags(PCI_CAN_SKIP_ISA_ALIGN);
+	pci_add_flags(PCI_CAN_SKIP_ISA_ALIGN);
 
 	/* We do not want to just probe */
-	pci_probe_only = 0;
+	pci_clear_flags(PCI_PROBE_ONLY);
 
 	/* OPAL absent, try POPAL first then RTAS detection of PHBs */
 	if (!firmware_has_feature(FW_FEATURE_OPAL)) {
diff --git a/arch/powerpc/platforms/wsp/wsp_pci.c b/arch/powerpc/platforms/wsp/wsp_pci.c
index d24b3ac..c5924ce 100644
--- a/arch/powerpc/platforms/wsp/wsp_pci.c
+++ b/arch/powerpc/platforms/wsp/wsp_pci.c
@@ -682,7 +682,7 @@ static int __init wsp_setup_one_phb(struct device_node *np)
 	/* XXX Force re-assigning of everything for now */
 	pci_add_flags(PCI_REASSIGN_ALL_BUS | PCI_REASSIGN_ALL_RSRC |
 		      PCI_ENABLE_PROC_DOMAINS);
-	pci_probe_only = 0;
+	pci_clear_flags(PCI_PROBE_ONLY);
 
 	/* Calculate how the TCE space is divided */
 	phb->dma32_base		= 0;

^ permalink raw reply related

* [PATCH] powerpc/mpc85xxcds: Fix PCI I/O space resource of PCI bridge
From: Zhao Chenhui @ 2012-02-22 10:20 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <1329906014-9896-1-git-send-email-chenhui.zhao@freescale.com>

From: chenhui zhao <chenhui.zhao@freescale.com>

There is a PCI bridge(Tsi310) between the MPC8548 and a VIA
southbridge chip.

The bootloader sets the PCI bridge to open a window from 0x0000
to 0x1fff on the PCI I/O space. But the kernel can't set the I/O
resource. In the routine pci_read_bridge_io(), if the base which
is read from PCI_IO_BASE is equal to zero, the routine don't set
the I/O resource of the child bus.

To allow the legacy I/O space on the VIA southbridge to be accessed,
use the fixup to fix the PCI I/O space of the PCI bridge.

Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
---
 arch/powerpc/platforms/85xx/mpc85xx_cds.c |   30 +++++++++++++++++++++++++++-
 include/linux/pci_ids.h                   |    1 +
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 40f03da..96947c4 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -3,7 +3,7 @@
  *
  * Maintained by Kumar Gala (see MAINTAINERS for contact information)
  *
- * Copyright 2005 Freescale Semiconductor Inc.
+ * Copyright 2005, 2011-2012 Freescale Semiconductor Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -158,6 +158,32 @@ DECLARE_PCI_FIXUP_EARLY(0x1957, 0x3fff, skip_fake_bridge);
 DECLARE_PCI_FIXUP_EARLY(0x3fff, 0x1957, skip_fake_bridge);
 DECLARE_PCI_FIXUP_EARLY(0xff3f, 0x5719, skip_fake_bridge);
 
+/*
+ * Fix Tsi310 PCI-X bridge resource.
+ * Force the bridge to open a window from 0x0000-0x1fff in PCI I/O space.
+ * This allows legacy I/O(i8259, etc) on the VIA southbridge to be accessed.
+ */
+void mpc85xx_cds_fixup_bus(struct pci_bus *bus)
+{
+	struct pci_dev *dev = bus->self;
+	struct resource *res = bus->resource[0];
+
+	if (dev != NULL &&
+	    dev->vendor == PCI_VENDOR_ID_IBM &&
+	    dev->device == PCI_DEVICE_ID_TSI310) {
+		if (res) {
+			res->start = 0;
+			res->end   = 0x1fff;
+			res->flags = IORESOURCE_IO;
+			pr_info("mpc85xx_cds: PCI bridge resource \
+							fixup applied\n");
+			pr_info("mpc85xx_cds: %pR\n", res);
+		}
+	}
+
+	fsl_pcibios_fixup_bus(bus);
+}
+
 #ifdef CONFIG_PPC_I8259
 static void mpc85xx_8259_cascade_handler(unsigned int irq,
 					 struct irq_desc *desc)
@@ -323,7 +349,7 @@ define_machine(mpc85xx_cds) {
 	.get_irq	= mpic_get_irq,
 #ifdef CONFIG_PCI
 	.restart	= mpc85xx_cds_restart,
-	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
+	.pcibios_fixup_bus	= mpc85xx_cds_fixup_bus,
 #else
 	.restart	= fsl_rstcr_restart,
 #endif
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 31d77af..17f1b95 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -484,6 +484,7 @@
 #define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM	0x0251
 #define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM_PCIE 0x0361
 #define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL	0x252
+#define PCI_DEVICE_ID_TSI310		0x01a7
 
 #define PCI_SUBVENDOR_ID_IBM		0x1014
 #define PCI_SUBDEVICE_ID_IBM_SATURN_SERIAL_ONE_PORT	0x03d4
-- 
1.6.4.1

^ permalink raw reply related

* [PATCH] l2sram: Add compatible entry for mpc8548
From: Zhao Chenhui @ 2012-02-22 10:20 UTC (permalink / raw)
  To: linuxppc-dev

From: chenhui zhao <chenhui.zhao@freescale.com>

Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
---
 arch/powerpc/sysdev/fsl_85xx_l2ctlr.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c b/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c
index 5f88797..2503cef 100644
--- a/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c
+++ b/arch/powerpc/sysdev/fsl_85xx_l2ctlr.c
@@ -200,6 +200,9 @@ static struct of_device_id mpc85xx_l2ctlr_of_match[] = {
 	{
 		.compatible = "fsl,p1022-l2-cache-controller",
 	},
+	{
+		.compatible = "fsl,mpc8548-l2-cache-controller",
+	},
 	{},
 };
 
-- 
1.6.4.1

^ permalink raw reply related

* [PATCH 2/2 v6] powerpc/85xx: Abstract common define of signal multiplex control for qe
From: Zhicheng Fan @ 2012-02-22  5:44 UTC (permalink / raw)
  To: linuxppc-dev, galak; +Cc: Zhicheng Fan
In-Reply-To: <1329889447-1756-1-git-send-email-B32736@freescale.com>

From: Zhicheng Fan <b32736@freescale.com>

The mpc85xx_rdb and mpc85xx_mds have commom define of signal multiplex for qe, so
they need to go in common header, the patch abstract them to fsl_guts.h

Signed-off-by: Zhicheng Fan <b32736@freescale.com>
---
 arch/powerpc/include/asm/fsl_guts.h       |    6 ++++-
 arch/powerpc/platforms/85xx/mpc85xx_mds.c |   35 ++++++++++++----------------
 2 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/arch/powerpc/include/asm/fsl_guts.h b/arch/powerpc/include/asm/fsl_guts.h
index bebd124..ce04530 100644
--- a/arch/powerpc/include/asm/fsl_guts.h
+++ b/arch/powerpc/include/asm/fsl_guts.h
@@ -4,7 +4,7 @@
  * Authors: Jeff Brown
  *          Timur Tabi <timur@freescale.com>
  *
- * Copyright 2004,2007 Freescale Semiconductor, Inc
+ * Copyright 2004,2007,2012 Freescale Semiconductor, Inc
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -114,6 +114,10 @@ struct ccsr_guts_86xx {
 	__be32	srds2cr1;	/* 0x.0f44 - SerDes2 Control Register 0 */
 } __attribute__ ((packed));
 
+
+/* Alternate function signal multiplex control */
+#define MPC85xx_PMUXCR_QE(x) (0x8000 >> (x))
+
 #ifdef CONFIG_PPC_86xx
 
 #define CCSR_GUTS_DMACR_DEV_SSI	0	/* DMA controller/channel set to SSI */
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 1d15a0c..71a316d 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -1,5 +1,6 @@
 /*
- * Copyright (C) Freescale Semicondutor, Inc. 2006-2010. All rights reserved.
+ * Copyright (C) 2006-2010, 2012 Freescale Semicondutor, Inc.
+ * All rights reserved.
  *
  * Author: Andy Fleming <afleming@freescale.com>
  *
@@ -51,6 +52,7 @@
 #include <asm/qe_ic.h>
 #include <asm/mpic.h>
 #include <asm/swiotlb.h>
+#include <asm/fsl_guts.h>
 #include "smp.h"
 
 #include "mpc85xx.h"
@@ -268,34 +270,27 @@ static void __init mpc85xx_mds_qe_init(void)
 	mpc85xx_mds_reset_ucc_phys();
 
 	if (machine_is(p1021_mds)) {
-#define MPC85xx_PMUXCR_OFFSET           0x60
-#define MPC85xx_PMUXCR_QE0              0x00008000
-#define MPC85xx_PMUXCR_QE3              0x00001000
-#define MPC85xx_PMUXCR_QE9              0x00000040
-#define MPC85xx_PMUXCR_QE12             0x00000008
-		static __be32 __iomem *pmuxcr;
 
-		np = of_find_node_by_name(NULL, "global-utilities");
+		struct ccsr_guts_85xx __iomem *guts;
 
+		np = of_find_node_by_name(NULL, "global-utilities");
 		if (np) {
-			pmuxcr = of_iomap(np, 0) + MPC85xx_PMUXCR_OFFSET;
-
-			if (!pmuxcr)
-				printk(KERN_EMERG "Error: Alternate function"
-					" signal multiplex control register not"
-					" mapped!\n");
-			else
+			guts = of_iomap(np, 0);
+			if (!guts)
+				pr_err("mpc85xx-rdb: could not map global utilities register\n");
+			else{
 			/* P1021 has pins muxed for QE and other functions. To
 			 * enable QE UEC mode, we need to set bit QE0 for UCC1
 			 * in Eth mode, QE0 and QE3 for UCC5 in Eth mode, QE9
 			 * and QE12 for QE MII management signals in PMUXCR
 			 * register.
 			 */
-				setbits32(pmuxcr, MPC85xx_PMUXCR_QE0 |
-						  MPC85xx_PMUXCR_QE3 |
-						  MPC85xx_PMUXCR_QE9 |
-						  MPC85xx_PMUXCR_QE12);
-
+				setbits32(&guts->pmuxcr, MPC85xx_PMUXCR_QE(0) |
+						  MPC85xx_PMUXCR_QE(3) |
+						  MPC85xx_PMUXCR_QE(9) |
+						  MPC85xx_PMUXCR_QE(12));
+				iounmap(guts);
+			}
 			of_node_put(np);
 		}
 
-- 
1.7.0.4

^ permalink raw reply related

* [PATCH 1/2 v6] powerpc/85xx: Add Quicc Engine support for p1025rdb
From: Zhicheng Fan @ 2012-02-22  5:44 UTC (permalink / raw)
  To: linuxppc-dev, galak; +Cc: Zhicheng Fan

From: Zhicheng Fan <b32736@freescale.com>

Signed-off-by: Zhicheng Fan <b32736@freescale.com>
---
 arch/powerpc/platforms/85xx/mpc85xx_rdb.c |   77 ++++++++++++++++++++++++++++-
 1 files changed, 76 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
index e95aef7..ca3c8e4 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
@@ -26,6 +26,9 @@
 #include <asm/prom.h>
 #include <asm/udbg.h>
 #include <asm/mpic.h>
+#include <asm/qe.h>
+#include <asm/qe_ic.h>
+#include <asm/fsl_guts.h>
 
 #include <sysdev/fsl_soc.h>
 #include <sysdev/fsl_pci.h>
@@ -47,6 +50,10 @@ void __init mpc85xx_rdb_pic_init(void)
 	struct mpic *mpic;
 	unsigned long root = of_get_flat_dt_root();
 
+#ifdef CONFIG_QUICC_ENGINE
+	struct device_node *np;
+#endif
+
 	if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) {
 		mpic = mpic_alloc(NULL, 0,
 			MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
@@ -62,6 +69,18 @@ void __init mpc85xx_rdb_pic_init(void)
 
 	BUG_ON(mpic == NULL);
 	mpic_init(mpic);
+
+#ifdef CONFIG_QUICC_ENGINE
+	np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
+	if (np) {
+		qe_ic_init(np, 0, qe_ic_cascade_low_mpic,
+				qe_ic_cascade_high_mpic);
+		of_node_put(np);
+
+	} else
+		pr_err("%s: Could not find qe-ic node\n", __func__);
+#endif
+
 }
 
 /*
@@ -69,7 +88,7 @@ void __init mpc85xx_rdb_pic_init(void)
  */
 static void __init mpc85xx_rdb_setup_arch(void)
 {
-#ifdef CONFIG_PCI
+#if defined(CONFIG_PCI) || defined(CONFIG_QUICC_ENGINE)
 	struct device_node *np;
 #endif
 
@@ -85,6 +104,62 @@ static void __init mpc85xx_rdb_setup_arch(void)
 #endif
 
 	mpc85xx_smp_init();
+
+#ifdef CONFIG_QUICC_ENGINE
+	np = of_find_compatible_node(NULL, NULL, "fsl,qe");
+	if (!np) {
+		pr_err("%s: Could not find Quicc Engine node\n", __func__);
+		goto qe_fail;
+	}
+
+	qe_reset();
+	of_node_put(np);
+
+	np = of_find_node_by_name(NULL, "par_io");
+	if (np) {
+		struct device_node *ucc;
+
+		par_io_init(np);
+		of_node_put(np);
+
+		for_each_node_by_name(ucc, "ucc")
+			par_io_of_config(ucc);
+
+	}
+#if defined(CONFIG_UCC_GETH) || defined(CONFIG_SERIAL_QE)
+	if (machine_is(p1025_rdb)) {
+
+		struct ccsr_guts_85xx __iomem *guts;
+
+		np = of_find_node_by_name(NULL, "global-utilities");
+		if (np) {
+			guts = of_iomap(np, 0);
+			if (!guts) {
+
+				pr_err("mpc85xx-rdb: could not map global utilities register\n");
+
+			} else {
+			/* P1025 has pins muxed for QE and other functions. To
+			* enable QE UEC mode, we need to set bit QE0 for UCC1
+			* in Eth mode, QE0 and QE3 for UCC5 in Eth mode, QE9
+			* and QE12 for QE MII management singals in PMUXCR
+			* register.
+			*/
+				setbits32(&guts->pmuxcr, MPC85xx_PMUXCR_QE(0) |
+						MPC85xx_PMUXCR_QE(3) |
+						MPC85xx_PMUXCR_QE(9) |
+						MPC85xx_PMUXCR_QE(12));
+				iounmap(guts);
+			}
+			of_node_put(np);
+		}
+
+	}
+#endif
+
+qe_fail:
+#endif	/* CONFIG_QUICC_ENGINE */
+
 	printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n");
 }
 
-- 
1.7.0.4

^ permalink raw reply related

* [PATCH]  powerpc: Fix various issues with return to userspace
From: Benjamin Herrenschmidt @ 2012-02-22  4:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard

We have a few problems when returning to userspace. This is a
quick set of fixes for 3.3, I'll look into a more comprehensive
rework for 3.4. This fixes:

 - We kept interrupts soft-disabled when schedule'ing or calling
do_signal when returning to userspace as a result of a hardware
interrupt.

 - Rename do_signal to do_notify_resume like all other archs (and
do_signal_pending back to do_signal, which it was before Roland
changed it).

 - Add the missing call to key_replace_session_keyring() to
do_notify_resume().

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 4f80cf1..3e57a00 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -1213,7 +1213,7 @@ do_user_signal:			/* r10 contains MSR_KERNEL here */
 	stw	r3,_TRAP(r1)
 2:	addi	r3,r1,STACK_FRAME_OVERHEAD
 	mr	r4,r9
-	bl	do_signal
+	bl	do_notify_resume
 	REST_NVGPRS(r1)
 	b	recheck
 
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index d834425..6597464 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -751,12 +751,16 @@ user_work:
 
 	andi.	r0,r4,_TIF_NEED_RESCHED
 	beq	1f
+	li	r5,1
+	TRACE_AND_RESTORE_IRQ(r5);	
 	bl	.schedule
 	b	.ret_from_except_lite
 
 1:	bl	.save_nvgprs
+	li	r5,1
+	TRACE_AND_RESTORE_IRQ(r5);	
 	addi	r3,r1,STACK_FRAME_OVERHEAD
-	bl	.do_signal
+	bl	.do_notify_resume
 	b	.ret_from_except
 
 unrecov_restore:
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c
index 2300426..ac6e437 100644
--- a/arch/powerpc/kernel/signal.c
+++ b/arch/powerpc/kernel/signal.c
@@ -11,6 +11,7 @@
 
 #include <linux/tracehook.h>
 #include <linux/signal.h>
+#include <linux/key.h>
 #include <asm/hw_breakpoint.h>
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
@@ -113,8 +114,9 @@ static void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka,
 	}
 }
 
-static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs)
+static int do_signal(struct pt_regs *regs)
 {
+	sigset_t *oldset;
 	siginfo_t info;
 	int signr;
 	struct k_sigaction ka;
@@ -123,7 +125,7 @@ static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs)
 
 	if (current_thread_info()->local_flags & _TLF_RESTORE_SIGMASK)
 		oldset = &current->saved_sigmask;
-	else if (!oldset)
+	else
 		oldset = &current->blocked;
 
 	signr = get_signal_to_deliver(&info, &ka, regs, NULL);
@@ -191,14 +193,16 @@ static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs)
 	return ret;
 }
 
-void do_signal(struct pt_regs *regs, unsigned long thread_info_flags)
+void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
 {
 	if (thread_info_flags & _TIF_SIGPENDING)
-		do_signal_pending(NULL, regs);
+		do_signal(regs);
 
 	if (thread_info_flags & _TIF_NOTIFY_RESUME) {
 		clear_thread_flag(TIF_NOTIFY_RESUME);
 		tracehook_notify_resume(regs);
+		if (current->replacement_session_keyring)
+			key_replace_session_keyring();
 	}
 }
 
diff --git a/arch/powerpc/kernel/signal.h b/arch/powerpc/kernel/signal.h
index 6c0ddfc..da7d838 100644
--- a/arch/powerpc/kernel/signal.h
+++ b/arch/powerpc/kernel/signal.h
@@ -12,8 +12,6 @@
 
 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
 
-extern void do_signal(struct pt_regs *regs, unsigned long thread_info_flags);
-
 extern void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
 				  size_t frame_size, int is_32);
 extern void restore_sigmask(sigset_t *set);

^ permalink raw reply related

* RE: [PATCH v5 3/4] KVM: PPC: epapr: install ev_idle hcall for e500 guest
From: Liu Yu-B13201 @ 2012-02-22  2:59 UTC (permalink / raw)
  To: tiejun.chen
  Cc: linuxppc-dev@ozlabs.org, Wood Scott-B07421, agraf@suse.de,
	kvm-ppc@vger.kernel.org, kvm@vger.kernel.org
In-Reply-To: <4F445845.8030606@windriver.com>

DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogdGllanVuLmNoZW4gW21h
aWx0bzp0aWVqdW4uY2hlbkB3aW5kcml2ZXIuY29tXQ0KPiBTZW50OiBXZWRuZXNkYXksIEZlYnJ1
YXJ5IDIyLCAyMDEyIDEwOjUyIEFNDQo+IFRvOiBMaXUgWXUtQjEzMjAxDQo+IENjOiBhZ3JhZkBz
dXNlLmRlOyBrdm0tcHBjQHZnZXIua2VybmVsLm9yZzsga3ZtQHZnZXIua2VybmVsLm9yZzsNCj4g
bGludXhwcGMtZGV2QG96bGFicy5vcmc7IFdvb2QgU2NvdHQtQjA3NDIxDQo+IFN1YmplY3Q6IFJl
OiBbUEFUQ0ggdjUgMy80XSBLVk06IFBQQzogZXBhcHI6IGluc3RhbGwgZXZfaWRsZSBoY2FsbCBm
b3INCj4gZTUwMCBndWVzdA0KPiANCj4gTGl1IFl1LUIxMzIwMSB3cm90ZToNCj4gPg0KPiA+PiAt
LS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiA+PiBGcm9tOiB0aWVqdW4uY2hlbiBbbWFpbHRv
OnRpZWp1bi5jaGVuQHdpbmRyaXZlci5jb21dDQo+ID4+IFNlbnQ6IFR1ZXNkYXksIEZlYnJ1YXJ5
IDIxLCAyMDEyIDY6NTQgUE0NCj4gPj4gVG86IExpdSBZdS1CMTMyMDENCj4gPj4gQ2M6IGFncmFm
QHN1c2UuZGU7IGt2bS1wcGNAdmdlci5rZXJuZWwub3JnOyBrdm1Admdlci5rZXJuZWwub3JnOw0K
PiA+PiBsaW51eHBwYy1kZXZAb3psYWJzLm9yZzsgV29vZCBTY290dC1CMDc0MjENCj4gPj4gU3Vi
amVjdDogUmU6IFtQQVRDSCB2NSAzLzRdIEtWTTogUFBDOiBlcGFwcjogaW5zdGFsbCBldl9pZGxl
IGhjYWxsDQo+ID4+IGZvciBlNTAwIGd1ZXN0DQo+ID4+DQo+ID4+IExpdSBZdSB3cm90ZToNCj4g
Pj4+IElmIHRoZSBndWVzdCBoeXBlcnZpc29yIG5vZGUgY29udGFpbnMgImhhcy1pZGxlIiBwcm9w
ZXJ0eS4NCj4gPj4+DQo+ID4+PiBTaWduZWQtb2ZmLWJ5OiBMaXUgWXUgPHl1LmxpdUBmcmVlc2Nh
bGUuY29tPg0KPiA+Pj4gLS0tDQo+ID4+PiB2NTogbm8gY2hhbmdlDQo+ID4+Pg0KPiA+Pj4gIGFy
Y2gvcG93ZXJwYy9rZXJuZWwvZXBhcHJfaGNhbGxzLlMgICB8ICAgMjkNCj4gPj4gKysrKysrKysr
KysrKysrKysrKysrKysrKysrKysNCj4gPj4+ICBhcmNoL3Bvd2VycGMva2VybmVsL2VwYXByX3Bh
cmF2aXJ0LmMgfCAgIDExICsrKysrKysrKystDQo+ID4+PiAgMiBmaWxlcyBjaGFuZ2VkLCAzOSBp
bnNlcnRpb25zKCspLCAxIGRlbGV0aW9ucygtKQ0KPiA+Pj4NCj4gPj4+IGRpZmYgLS1naXQgYS9h
cmNoL3Bvd2VycGMva2VybmVsL2VwYXByX2hjYWxscy5TDQo+ID4+PiBiL2FyY2gvcG93ZXJwYy9r
ZXJuZWwvZXBhcHJfaGNhbGxzLlMNCj4gPj4+IGluZGV4IDY5N2IzOTAuLjcyZmEyMzQgMTAwNjQ0
DQo+ID4+PiAtLS0gYS9hcmNoL3Bvd2VycGMva2VybmVsL2VwYXByX2hjYWxscy5TDQo+ID4+PiAr
KysgYi9hcmNoL3Bvd2VycGMva2VybmVsL2VwYXByX2hjYWxscy5TDQo+ID4+PiBAQCAtMTUsNiAr
MTUsMzUgQEANCj4gPj4+ICAjaW5jbHVkZSA8YXNtL3BwY19hc20uaD4NCj4gPj4+ICAjaW5jbHVk
ZSA8YXNtL2FzbS1vZmZzZXRzLmg+DQo+ID4+Pg0KPiA+Pj4gKyNkZWZpbmUgSENfVkVORE9SX0VQ
QVBSCQkoMSA8PCAxNikNCj4gPj4+ICsjZGVmaW5lIEhDX0VWX0lETEUJCTE2DQo+ID4+IFdoeSBu
b3QgdXNlICdFVl9JRExFJyBkaXJlY3RseT8NCj4gPj4NCj4gPj4+ICsNCj4gPj4+ICtfR0xPQkFM
KGVwYXByX2V2X2lkbGUpDQo+ID4+PiArZXBhcHJfZXZfaWRsZToNCj4gPj4+ICsJcmx3aW5tCXIz
LHIxLDAsMCwzMS1USFJFQURfU0hJRlQJLyogY3VycmVudCB0aHJlYWRfaW5mbyAqLw0KPiA+Pj4g
Kwlsd3oJcjQsVElfTE9DQUxfRkxBR1MocjMpCS8qIHNldCBuYXBwaW5nIGJpdCAqLw0KPiA+Pj4g
KwlvcmkJcjQscjQsX1RMRl9OQVBQSU5HCS8qIHNvIHdoZW4gd2UgdGFrZSBhbiBleGNlcHRpb24g
Ki8NCj4gPj4+ICsJc3R3CXI0LFRJX0xPQ0FMX0ZMQUdTKHIzKQkvKiBpdCB3aWxsIHJldHVybiB0
byBvdXIgY2FsbGVyICovDQo+ID4+PiArDQo+ID4+PiArCXdydGVlaQkxDQo+ID4+PiArDQo+ID4+
PiAraWRsZV9sb29wOg0KPiA+Pj4gKwlMT0FEX1JFR19JTU1FRElBVEUocjExLCBIQ19WRU5ET1Jf
RVBBUFIgfCBIQ19FVl9JRExFKQ0KPiA+PiBBbmQgY291bGQgdGhpcyBsaW5lIGJlIHNpbXBsaWZp
ZWQgYXMgc29tZXRoaW5nIGxpa2UgdGhpczoNCj4gPj4NCj4gPj4gTE9BRF9SRUdfSU1NRURJQVRF
KHIxMSwgRVZfSENBTExfVE9LRU4oRVZfSURMRSkpDQo+ID4+DQo+ID4+IElmIHNvLCBldmVuIHdl
IGNhbiByZW1vdmUgdGhlIHByZXZpb3VzIEhDX1ZFTkRPUl9FUEFQUiBkZWZpbml0aW9uIGFzDQo+
IHdlbGwuDQo+ID4+DQo+ID4NCj4gPiBCZWNhdXNlIHRoZSBlcGFwcl9oY2FsbHMuaCBjb250YWlu
cyBDIGZ1bmN0aW9ucywgc28gaXQgY2Fubm90IGJlDQo+ID4gaW5jbHVkZWQgYnkgYXNzZW1ibHkg
Y29kZS4NCj4gDQo+IFRoZXNlIGNvbW1vbiBkZWZpbml0aW9ucyBhcmUgYWxyZWFkeSBjb3ZlcmVk
IGluIGVwYXByX2hjYWxscy5oLCBidXQgbG9va3MNCj4geW91IHJlZGVmaW5lIHRoZSBzYW1lIGl0
ZW1zIG1hbnkgdGltZXMsIGluIGt2bV9wYXJhLmgvZXBhcHJfaGNhbGxzLlMuIEFuZA0KPiBJIHRo
aW5rIG1heWJlIHdlJ2xsIGFsc28gcmV1c2UgdGhlc2UgZ2VuZXJpY3MgZWxzZXdoZXJlIGxhdGVs
eS5cDQoNClRoZSBvbmVzIGluIGt2bV9wYXJhLmggYXJlIGFsaWFzLCBub3QgcmVkZWZpbmUuDQpC
ZWNhdXNlIGt2bSBoYXMgaXRzIG93biBuYW1lIHJ1bGUuDQoNCj4gDQo+IFNvIGNhbiB3ZSBsaW1p
dCB0aGF0IHdpdGggX19BU1NFTUJMWV9fIGluIGVwYXByX2hjYWxscy5oPyBPciBvdGhlciB3YXku
DQo+IElmIHNvIGl0IG1ha2VzIG91ciBsaWZlIGVhc3kgaW4gdGhlIGZ1dHVyZS4NCj4gDQoNClll
cy4gVGhpcyB3b3VsZCBiZSBoZWxwZnVsLg0KDQpUaGFua3MsDQpZdQ0K

^ permalink raw reply

* Re: [PATCH v5 3/4] KVM: PPC: epapr: install ev_idle hcall for e500 guest
From: tiejun.chen @ 2012-02-22  2:51 UTC (permalink / raw)
  To: Liu Yu-B13201
  Cc: linuxppc-dev@ozlabs.org, Wood Scott-B07421, agraf@suse.de,
	kvm-ppc@vger.kernel.org, kvm@vger.kernel.org
In-Reply-To: <4CA99838F21AB847ACC344051E23170905749AB6@039-SN2MPN1-022.039d.mgd.msft.net>

Liu Yu-B13201 wrote:
> 
>> -----Original Message-----
>> From: tiejun.chen [mailto:tiejun.chen@windriver.com]
>> Sent: Tuesday, February 21, 2012 6:54 PM
>> To: Liu Yu-B13201
>> Cc: agraf@suse.de; kvm-ppc@vger.kernel.org; kvm@vger.kernel.org;
>> linuxppc-dev@ozlabs.org; Wood Scott-B07421
>> Subject: Re: [PATCH v5 3/4] KVM: PPC: epapr: install ev_idle hcall for
>> e500 guest
>>
>> Liu Yu wrote:
>>> If the guest hypervisor node contains "has-idle" property.
>>>
>>> Signed-off-by: Liu Yu <yu.liu@freescale.com>
>>> ---
>>> v5: no change
>>>
>>>  arch/powerpc/kernel/epapr_hcalls.S   |   29
>> +++++++++++++++++++++++++++++
>>>  arch/powerpc/kernel/epapr_paravirt.c |   11 ++++++++++-
>>>  2 files changed, 39 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/arch/powerpc/kernel/epapr_hcalls.S
>>> b/arch/powerpc/kernel/epapr_hcalls.S
>>> index 697b390..72fa234 100644
>>> --- a/arch/powerpc/kernel/epapr_hcalls.S
>>> +++ b/arch/powerpc/kernel/epapr_hcalls.S
>>> @@ -15,6 +15,35 @@
>>>  #include <asm/ppc_asm.h>
>>>  #include <asm/asm-offsets.h>
>>>
>>> +#define HC_VENDOR_EPAPR		(1 << 16)
>>> +#define HC_EV_IDLE		16
>> Why not use 'EV_IDLE' directly?
>>
>>> +
>>> +_GLOBAL(epapr_ev_idle)
>>> +epapr_ev_idle:
>>> +	rlwinm	r3,r1,0,0,31-THREAD_SHIFT	/* current thread_info */
>>> +	lwz	r4,TI_LOCAL_FLAGS(r3)	/* set napping bit */
>>> +	ori	r4,r4,_TLF_NAPPING	/* so when we take an exception */
>>> +	stw	r4,TI_LOCAL_FLAGS(r3)	/* it will return to our caller */
>>> +
>>> +	wrteei	1
>>> +
>>> +idle_loop:
>>> +	LOAD_REG_IMMEDIATE(r11, HC_VENDOR_EPAPR | HC_EV_IDLE)
>> And could this line be simplified as something like this:
>>
>> LOAD_REG_IMMEDIATE(r11, EV_HCALL_TOKEN(EV_IDLE))
>>
>> If so, even we can remove the previous HC_VENDOR_EPAPR definition as well.
>>
> 
> Because the epapr_hcalls.h contains C functions,
> so it cannot be included by assembly code.

These common definitions are already covered in epapr_hcalls.h, but looks you
redefine the same items many times, in kvm_para.h/epapr_hcalls.S. And I think
maybe we'll also reuse these generics elsewhere lately.

So can we limit that with __ASSEMBLY__ in epapr_hcalls.h? Or other way. If so it
makes our life easy in the future.

Tiejun

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox