* Re: [PATCH v2 2/4] vfio: spapr: Fix build error
From: Alex Williamson @ 2014-08-06 3:12 UTC (permalink / raw)
To: Alexey Kardashevskiy; +Cc: linuxppc-dev, Gavin Shan, kvm
In-Reply-To: <1407293313-24894-3-git-send-email-aik@ozlabs.ru>
On Wed, 2014-08-06 at 12:48 +1000, Alexey Kardashevskiy wrote:
> From: Gavin Shan <gwshan@linux.vnet.ibm.com>
>
> The VFIO related components could be built as dynamic modules.
> Unfortunately, CONFIG_EEH can't be configured to "m". The patch
> fixes the build errors when configuring VFIO related components
> as dynamic modules as follows:
>
> CC [M] drivers/vfio/vfio_iommu_spapr_tce.o
> In file included from drivers/vfio/vfio.c:33:0:
> include/linux/vfio.h:101:43: warning: ‘struct pci_dev’ declared \
> inside parameter list [enabled by default]
> :
> WRAP arch/powerpc/boot/zImage.pseries
> WRAP arch/powerpc/boot/zImage.maple
> WRAP arch/powerpc/boot/zImage.pmac
> WRAP arch/powerpc/boot/zImage.epapr
> MODPOST 1818 modules
> ERROR: ".vfio_spapr_iommu_eeh_ioctl" [drivers/vfio/vfio_iommu_spapr_tce.ko]\
> undefined!
> ERROR: ".vfio_spapr_pci_eeh_open" [drivers/vfio/pci/vfio-pci.ko] undefined!
> ERROR: ".vfio_spapr_pci_eeh_release" [drivers/vfio/pci/vfio-pci.ko] undefined!
>
> Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
> [removed include "pci.h" in vfio.c]
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> Changes:
> v2:
> * removed #include <linux/pci.h> from vfio.c and tested
I also commented regarding the ifdef around all of vfio_spapr_eeh.c:
Why not add a new CONFIG_VFIO_SPAPR_EEH option to handle this
instead?
Did you disagree? The ifdef is pretty ugly.
> ---
> drivers/vfio/Makefile | 4 ++--
> drivers/vfio/vfio_spapr_eeh.c | 6 ++++++
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/vfio/Makefile b/drivers/vfio/Makefile
> index 50e30bc..4891cca 100644
> --- a/drivers/vfio/Makefile
> +++ b/drivers/vfio/Makefile
> @@ -1,5 +1,5 @@
> obj-$(CONFIG_VFIO) += vfio.o
> obj-$(CONFIG_VFIO_IOMMU_TYPE1) += vfio_iommu_type1.o
> -obj-$(CONFIG_VFIO_IOMMU_SPAPR_TCE) += vfio_iommu_spapr_tce.o
> -obj-$(CONFIG_EEH) += vfio_spapr_eeh.o
> +obj-$(CONFIG_VFIO_IOMMU_SPAPR_TCE) += vfio_iommu_spapr_tce.o \
> + vfio_spapr_eeh.o
> obj-$(CONFIG_VFIO_PCI) += pci/
> diff --git a/drivers/vfio/vfio_spapr_eeh.c b/drivers/vfio/vfio_spapr_eeh.c
> index f834b4c..1a93e83 100644
> --- a/drivers/vfio/vfio_spapr_eeh.c
> +++ b/drivers/vfio/vfio_spapr_eeh.c
> @@ -14,15 +14,19 @@
> #include <asm/eeh.h>
>
> /* We might build address mapping here for "fast" path later */
> +#ifdef CONFIG_EEH
> +
> int vfio_spapr_pci_eeh_open(struct pci_dev *pdev)
> {
> return eeh_dev_open(pdev);
> }
> +EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_open);
>
> void vfio_spapr_pci_eeh_release(struct pci_dev *pdev)
> {
> eeh_dev_release(pdev);
> }
> +EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_release);
>
> long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
> unsigned int cmd, unsigned long arg)
> @@ -85,3 +89,5 @@ long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
>
> return ret;
> }
> +EXPORT_SYMBOL_GPL(vfio_spapr_iommu_eeh_ioctl);
> +#endif /* CONFIG_EEH */
^ permalink raw reply
* Re: [PATCH v2 4/4] vfio_pci: spapr: Enable VFIO if EEH is not supported
From: Alex Williamson @ 2014-08-06 3:44 UTC (permalink / raw)
To: Alexey Kardashevskiy; +Cc: linuxppc-dev, Gavin Shan, kvm
In-Reply-To: <1407293313-24894-5-git-send-email-aik@ozlabs.ru>
On Wed, 2014-08-06 at 12:48 +1000, Alexey Kardashevskiy wrote:
> The existing vfio_pci_open() fails if there is no EEH support for PCI.
> This breaks POWER7's P5IOC2 PHB support which this patch brings back.
>
> It is a warning because this should not normally happen on supported
> configurations such as POWER8+IODA so we always want to see it in dmesg.
> It is _once() as the message may be triggered by non-privileged userspace
> and we do not want to pollute dmesg.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> Changes:
> v2:
> * discussed with Ben Herrenschmidt and did s/pr_warn/pr_warn_once/
> * updated commit log
> ---
> drivers/vfio/pci/vfio_pci.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
> index e2ee80f..68dc8da 100644
> --- a/drivers/vfio/pci/vfio_pci.c
> +++ b/drivers/vfio/pci/vfio_pci.c
> @@ -179,10 +179,8 @@ static int vfio_pci_open(void *device_data)
> goto error;
>
> ret = vfio_spapr_pci_eeh_open(vdev->pdev);
> - if (ret) {
> - vfio_pci_disable(vdev);
> - goto error;
> - }
> + if (ret)
> + pr_warn_once("EEH is not supported\n");
> }
>
> return 0;
Now the next question, what's the point of vfio_spapr_pci_eeh_open()
returning a value? Couldn't it return void now and this warning can go
into eeh specific code? Thanks,
Alex
^ permalink raw reply
* Re: [PATCH v2 2/4] vfio: spapr: Fix build error
From: Gavin Shan @ 2014-08-06 3:54 UTC (permalink / raw)
To: Alex Williamson; +Cc: Alexey Kardashevskiy, linuxppc-dev, Gavin Shan, kvm
In-Reply-To: <1407294770.316.76.camel@ul30vt.home>
On Tue, Aug 05, 2014 at 09:12:50PM -0600, Alex Williamson wrote:
>On Wed, 2014-08-06 at 12:48 +1000, Alexey Kardashevskiy wrote:
>> From: Gavin Shan <gwshan@linux.vnet.ibm.com>
>>=20
>> The VFIO related components could be built as dynamic modules.
>> Unfortunately, CONFIG_EEH can't be configured to "m". The patch
>> fixes the build errors when configuring VFIO related components
>> as dynamic modules as follows:
>>=20
>> CC [M] drivers/vfio/vfio_iommu_spapr_tce.o
>> In file included from drivers/vfio/vfio.c:33:0:
>> include/linux/vfio.h:101:43: warning: =E2=80=98struct pci_dev=E2=80=99=
declared \
>> inside parameter list [enabled by default]
>> :
>> WRAP arch/powerpc/boot/zImage.pseries
>> WRAP arch/powerpc/boot/zImage.maple
>> WRAP arch/powerpc/boot/zImage.pmac
>> WRAP arch/powerpc/boot/zImage.epapr
>> MODPOST 1818 modules
>> ERROR: ".vfio_spapr_iommu_eeh_ioctl" [drivers/vfio/vfio_iommu_spapr_tc=
e.ko]\
>> undefined!
>> ERROR: ".vfio_spapr_pci_eeh_open" [drivers/vfio/pci/vfio-pci.ko] undef=
ined!
>> ERROR: ".vfio_spapr_pci_eeh_release" [drivers/vfio/pci/vfio-pci.ko] un=
defined!
>>=20
>> Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
>> [removed include "pci.h" in vfio.c]
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> ---
>> Changes:
>> v2:
>> * removed #include <linux/pci.h> from vfio.c and tested
Appreciated for Alexey's help on it :)
>
>I also commented regarding the ifdef around all of vfio_spapr_eeh.c:
>
> Why not add a new CONFIG_VFIO_SPAPR_EEH option to handle this
> instead?
>
>Did you disagree? The ifdef is pretty ugly.
>
I'll introduce CONFIG_VFIO_SPAPR_EEH.
Thanks,
Gavin
>> ---
>> drivers/vfio/Makefile | 4 ++--
>> drivers/vfio/vfio_spapr_eeh.c | 6 ++++++
>> 2 files changed, 8 insertions(+), 2 deletions(-)
>>=20
>> diff --git a/drivers/vfio/Makefile b/drivers/vfio/Makefile
>> index 50e30bc..4891cca 100644
>> --- a/drivers/vfio/Makefile
>> +++ b/drivers/vfio/Makefile
>> @@ -1,5 +1,5 @@
>> obj-$(CONFIG_VFIO) +=3D vfio.o
>> obj-$(CONFIG_VFIO_IOMMU_TYPE1) +=3D vfio_iommu_type1.o
>> -obj-$(CONFIG_VFIO_IOMMU_SPAPR_TCE) +=3D vfio_iommu_spapr_tce.o
>> -obj-$(CONFIG_EEH) +=3D vfio_spapr_eeh.o
>> +obj-$(CONFIG_VFIO_IOMMU_SPAPR_TCE) +=3D vfio_iommu_spapr_tce.o \
>> + vfio_spapr_eeh.o
>> obj-$(CONFIG_VFIO_PCI) +=3D pci/
>> diff --git a/drivers/vfio/vfio_spapr_eeh.c b/drivers/vfio/vfio_spapr_e=
eh.c
>> index f834b4c..1a93e83 100644
>> --- a/drivers/vfio/vfio_spapr_eeh.c
>> +++ b/drivers/vfio/vfio_spapr_eeh.c
>> @@ -14,15 +14,19 @@
>> #include <asm/eeh.h>
>> =20
>> /* We might build address mapping here for "fast" path later */
>> +#ifdef CONFIG_EEH
>> +
>> int vfio_spapr_pci_eeh_open(struct pci_dev *pdev)
>> {
>> return eeh_dev_open(pdev);
>> }
>> +EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_open);
>> =20
>> void vfio_spapr_pci_eeh_release(struct pci_dev *pdev)
>> {
>> eeh_dev_release(pdev);
>> }
>> +EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_release);
>> =20
>> long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
>> unsigned int cmd, unsigned long arg)
>> @@ -85,3 +89,5 @@ long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *=
group,
>> =20
>> return ret;
>> }
>> +EXPORT_SYMBOL_GPL(vfio_spapr_iommu_eeh_ioctl);
>> +#endif /* CONFIG_EEH */
>
>
>
^ permalink raw reply
* [PATCH] powerpc/ppc64: Print CPU/MMU/FW features at boot
From: Benjamin Herrenschmidt @ 2014-08-06 4:31 UTC (permalink / raw)
To: linuxppc-dev
Helps debug funky firmware issues
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/kernel/setup_64.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 93991ed..a06edf6 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -451,6 +451,11 @@ void __init setup_system(void)
if (ppc64_caches.iline_size != 0x80)
printk("ppc64_caches.icache_line_size = 0x%x\n",
ppc64_caches.iline_size);
+ printk("cpu_features = 0x%016lx\n", cur_cpu_spec->cpu_features);
+ printk("cpu_user_features = 0x%08x 0x%08x\n",
+ cur_cpu_spec->cpu_user_features, cur_cpu_spec->cpu_user_features2);
+ printk("mmu_features = 0x%08x\n", cur_cpu_spec->mmu_features);
+ printk("fw_features = 0x%016lx\n", powerpc_firmware_features);
#ifdef CONFIG_PPC_STD_MMU_64
if (htab_address)
printk("htab_address = 0x%p\n", htab_address);
^ permalink raw reply related
* Re: [PATCH v2 4/4] vfio_pci: spapr: Enable VFIO if EEH is not supported
From: Benjamin Herrenschmidt @ 2014-08-06 4:34 UTC (permalink / raw)
To: Alex Williamson; +Cc: Alexey Kardashevskiy, linuxppc-dev, Gavin Shan, kvm
In-Reply-To: <1407296659.316.78.camel@ul30vt.home>
On Tue, 2014-08-05 at 21:44 -0600, Alex Williamson wrote:
> > ret = vfio_spapr_pci_eeh_open(vdev->pdev);
> > - if (ret) {
> > - vfio_pci_disable(vdev);
> > - goto error;
> > - }
> > + if (ret)
> > + pr_warn_once("EEH is not supported\n");
> > }
> >
> > return 0;
>
> Now the next question, what's the point of vfio_spapr_pci_eeh_open()
> returning a value? Couldn't it return void now and this warning can
> go into eeh specific code? Thanks,
In order to call vfio_pci_disable() when that happens ?
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH 2/2] powerpc/nohash: Split __early_init_mmu() into boot and secondary
From: Benjamin Herrenschmidt @ 2014-08-06 4:58 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <1407286090.7427.19.camel@snotra.buserror.net>
On Tue, 2014-08-05 at 19:48 -0500, Scott Wood wrote:
> I'll do s/mmu_allcpus/this_mmu/ but early_init_mmu() needs to do things
> both before and after early_init_mmu_common(). Do you want two new
> functions (before and after) or is it OK to just rename
> early_init_mmu_allcpus() and put a comment before early_init_mmu()
> saying it's just for the boot cpu?
Do we really need that before/after ? The "after" code is the linear
mapping setup but does it rely on the MAS4 setting done above ?
Otherwise you can do before/after using a separate function
mmu_set_linear_map()
Always nicer to break down too large functions anyway.
Cheers,
Ben.
^ permalink raw reply
* [PATCH] powerpc: Add POWER8 features to CPU_FTRS_POSSIBLE/ALWAYS
From: Michael Ellerman @ 2014-08-06 5:42 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Michael Neuling
We have been a bit slack about updating the CPU_FTRS_POSSIBLE and
CPU_FTRS_ALWAYS masks. When we added POWER8, and also POWER8E we forgot
to update the ALWAYS mask. And when we added POWER8_DD1 we forgot to
update both the POSSIBLE and ALWAYS masks.
Luckily this hasn't caused any actual bugs AFAICS. Failing to update the
ALWAYS mask just forgoes a potential optimisation opportunity. Failing
to update the POSSIBLE mask for POWER8_DD1 is also OK because it only
removes a bit rather than adding any.
Regardless they should all be in both masks so as to avoid any future
bugs when the set of ALWAYS/POSSIBLE bits changes, or the masks
themselves change.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/include/asm/cputable.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index af5598688daf..d696eeb2def0 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -458,7 +458,8 @@ extern const char *powerpc_base_platform;
#define CPU_FTRS_POSSIBLE \
(CPU_FTRS_POWER4 | CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | \
CPU_FTRS_POWER6 | CPU_FTRS_POWER7 | CPU_FTRS_POWER8E | \
- CPU_FTRS_POWER8 | CPU_FTRS_CELL | CPU_FTRS_PA6T | CPU_FTR_VSX)
+ CPU_FTRS_POWER8 | CPU_FTRS_POWER8_DD1 | CPU_FTRS_CELL | \
+ CPU_FTRS_PA6T | CPU_FTR_VSX)
#endif
#else
enum {
@@ -508,7 +509,8 @@ enum {
#define CPU_FTRS_ALWAYS \
(CPU_FTRS_POWER4 & CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & \
CPU_FTRS_POWER6 & CPU_FTRS_POWER7 & CPU_FTRS_CELL & \
- CPU_FTRS_PA6T & CPU_FTRS_POSSIBLE)
+ CPU_FTRS_PA6T & CPU_FTRS_POWER8 & CPU_FTRS_POWER8E & \
+ CPU_FTRS_POWER8_DD1 & CPU_FTRS_POSSIBLE)
#endif
#else
enum {
--
1.9.1
^ permalink raw reply related
* Re: [PATCH v4 11/16] powerpc/powernv: Release replaced TCE
From: Benjamin Herrenschmidt @ 2014-08-06 6:25 UTC (permalink / raw)
To: Alexey Kardashevskiy
Cc: Michael Ellerman, Paul Mackerras, linuxppc-dev, Gavin Shan
In-Reply-To: <1406712695-9491-12-git-send-email-aik@ozlabs.ru>
On Wed, 2014-07-30 at 19:31 +1000, Alexey Kardashevskiy wrote:
> + if (oldtce & (TCE_PCI_WRITE | TCE_PCI_READ))
> + put_page(pfn_to_page(__pa(oldtce) >> PAGE_SHIFT));
That probably needs set_page_dirty if TCE_PCI_WRITE is set
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH v4 11/16] powerpc/powernv: Release replaced TCE
From: Benjamin Herrenschmidt @ 2014-08-06 6:27 UTC (permalink / raw)
To: Alexey Kardashevskiy
Cc: Michael Ellerman, Paul Mackerras, linuxppc-dev, Gavin Shan
In-Reply-To: <1406712695-9491-12-git-send-email-aik@ozlabs.ru>
On Wed, 2014-07-30 at 19:31 +1000, Alexey Kardashevskiy wrote:
>
> static int pnv_tce_build(struct iommu_table *tbl, long index, long npages,
> - unsigned long uaddr, enum dma_data_direction direction,
> + unsigned long uaddr, unsigned long *old_tces,
> + enum dma_data_direction direction,
> struct dma_attrs *attrs, bool rm)
> {
> u64 proto_tce;
> __be64 *tcep, *tces;
> u64 rpn;
> + long i;
>
> proto_tce = TCE_PCI_READ; // Read allowed
>
> @@ -587,9 +589,13 @@ static int pnv_tce_build(struct iommu_table *tbl, long index, long npages,
> tces = tcep = ((__be64 *)tbl->it_base) + index - tbl->it_offset;
> rpn = __pa(uaddr) >> tbl->it_page_shift;
>
> - while (npages--)
> - *(tcep++) = cpu_to_be64(proto_tce |
> - (rpn++ << tbl->it_page_shift));
> + for (i = 0; i < npages; i++) {
> + unsigned long oldtce = xchg(tcep, cpu_to_be64(proto_tce |
> + (rpn++ << tbl->it_page_shift)));
> + if (old_tces)
> + old_tces[i] = (unsigned long) __va(oldtce);
> + tcep++;
> + }
xchg() is slow, please keep separate implementation for build and
set_and_get() to avoid the performance loss on normal TCE host
operations.
Cheers,
Ben.
> pnv_tce_invalidate(tbl, tces, tcep - 1, rm);
>
> @@ -601,8 +607,18 @@ static int pnv_tce_build_vm(struct iommu_table *tbl, long index, long npages,
> enum dma_data_direction direction,
> struct dma_attrs *attrs)
> {
> - return pnv_tce_build(tbl, index, npages, uaddr, direction, attrs,
> - false);
> + return pnv_tce_build(tbl, index, npages, uaddr, NULL, direction,
> + attrs, false);
> +}
> +
> +static int pnv_tce_set_and_get_vm(struct iommu_table *tbl, long index,
> + long npages,
> + unsigned long uaddr, unsigned long *old_tces,
> + enum dma_data_direction direction,
> + struct dma_attrs *attrs)
> +{
> + return pnv_tce_build(tbl, index, npages, uaddr, old_tces, direction,
> + attrs, false);
> }
>
> static void pnv_tce_free(struct iommu_table *tbl, long index, long npages,
> @@ -630,6 +646,7 @@ static unsigned long pnv_tce_get(struct iommu_table *tbl, long index)
>
> struct iommu_table_ops pnv_iommu_ops = {
> .set = pnv_tce_build_vm,
> + .set_and_get = pnv_tce_set_and_get_vm,
> .clear = pnv_tce_free_vm,
> .get = pnv_tce_get,
^ permalink raw reply
* Re: [PATCH v4 11/16] powerpc/powernv: Release replaced TCE
From: Benjamin Herrenschmidt @ 2014-08-06 6:27 UTC (permalink / raw)
To: Alexey Kardashevskiy
Cc: Michael Ellerman, Paul Mackerras, linuxppc-dev, Gavin Shan
In-Reply-To: <1406712695-9491-12-git-send-email-aik@ozlabs.ru>
On Wed, 2014-07-30 at 19:31 +1000, Alexey Kardashevskiy wrote:
>
> This adds a set_and_get() callback to iommu_table_ops which does the
> same
> thing as set() plus it returns replaced TCE(s) so the caller can
> release
> the pages afterwards.
Call it xchg() instead of set_and_get(), it better reflects the
atomicity requirement.
Cheers,
Ben.
^ permalink raw reply
* linux-next: build failure after merge of the powerpc tree
From: Stephen Rothwell @ 2014-08-06 6:31 UTC (permalink / raw)
To: Benjamin Herrenschmidt, linuxppc-dev
Cc: Mahesh Salgaonkar, linux-next, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 643 bytes --]
Hi all,
After merging the powerpc tree, today's linux-next build (powerpc
allyesconfig) failed like this:
arch/powerpc/kernel/exceptions-64s.S: Assembler messages:
arch/powerpc/kernel/exceptions-64s.S:865: Error: attempt to move .org backwards
arch/powerpc/kernel/exceptions-64s.S:866: Error: attempt to move .org backwards
arch/powerpc/kernel/exceptions-64s.S:890: Error: attempt to move .org backwards
Its back again and I have left it broken.
Maybe caused by commit 0869b6fd209b ("powerpc/book3s: Add basic
infrastructure to handle HMI in Linux").
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH v2 2/4] vfio: spapr: Fix build error
From: Alexey Kardashevskiy @ 2014-08-06 6:33 UTC (permalink / raw)
To: Gavin Shan; +Cc: Alex Williamson, linuxppc-dev, kvm
In-Reply-To: <20140806035413.GA7681@shangw>
On 08/06/2014 01:54 PM, Gavin Shan wrote:
> On Tue, Aug 05, 2014 at 09:12:50PM -0600, Alex Williamson wrote:
>> On Wed, 2014-08-06 at 12:48 +1000, Alexey Kardashevskiy wrote:
>>> From: Gavin Shan <gwshan@linux.vnet.ibm.com>
>>>
>>> The VFIO related components could be built as dynamic modules.
>>> Unfortunately, CONFIG_EEH can't be configured to "m". The patch
>>> fixes the build errors when configuring VFIO related components
>>> as dynamic modules as follows:
>>>
>>> CC [M] drivers/vfio/vfio_iommu_spapr_tce.o
>>> In file included from drivers/vfio/vfio.c:33:0:
>>> include/linux/vfio.h:101:43: warning: ‘struct pci_dev’ declared \
>>> inside parameter list [enabled by default]
>>> :
>>> WRAP arch/powerpc/boot/zImage.pseries
>>> WRAP arch/powerpc/boot/zImage.maple
>>> WRAP arch/powerpc/boot/zImage.pmac
>>> WRAP arch/powerpc/boot/zImage.epapr
>>> MODPOST 1818 modules
>>> ERROR: ".vfio_spapr_iommu_eeh_ioctl" [drivers/vfio/vfio_iommu_spapr_tce.ko]\
>>> undefined!
>>> ERROR: ".vfio_spapr_pci_eeh_open" [drivers/vfio/pci/vfio-pci.ko] undefined!
>>> ERROR: ".vfio_spapr_pci_eeh_release" [drivers/vfio/pci/vfio-pci.ko] undefined!
>>>
>>> Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
>>> [removed include "pci.h" in vfio.c]
>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>> ---
>>> Changes:
>>> v2:
>>> * removed #include <linux/pci.h> from vfio.c and tested
>
> Appreciated for Alexey's help on it :)
My bad, that was wrong actually, we still need this:
diff --git a/include/linux/vfio.h b/include/linux/vfio.h
index 25a0fbd..224128a 100644
--- a/include/linux/vfio.h
+++ b/include/linux/vfio.h
@@ -98,6 +98,7 @@ extern int vfio_external_user_iommu_id(struct vfio_group
*group);
extern long vfio_external_check_extension(struct vfio_group *group,
unsigned long arg);
+struct pci_dev;
#ifdef CONFIG_EEH
extern int vfio_spapr_pci_eeh_open(struct pci_dev *pdev);
extern void vfio_spapr_pci_eeh_release(struct pci_dev *pdev);
Otherwise it is "warning: ‘struct pci_dev’ declared inside parameter list".
For some reason I only see this warning when backporting this patch to 3.10
and I do not see it in 3.16-rc7, I guess pci.h gets included somewhere.
>
>>
>> I also commented regarding the ifdef around all of vfio_spapr_eeh.c:
>>
>> Why not add a new CONFIG_VFIO_SPAPR_EEH option to handle this
>> instead?
>>
>> Did you disagree? The ifdef is pretty ugly.
>>
>
> I'll introduce CONFIG_VFIO_SPAPR_EEH.
So, Gavin, then the patchset is yours (again), ok?
> Thanks,
> Gavin
>
>>> ---
>>> drivers/vfio/Makefile | 4 ++--
>>> drivers/vfio/vfio_spapr_eeh.c | 6 ++++++
>>> 2 files changed, 8 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/vfio/Makefile b/drivers/vfio/Makefile
>>> index 50e30bc..4891cca 100644
>>> --- a/drivers/vfio/Makefile
>>> +++ b/drivers/vfio/Makefile
>>> @@ -1,5 +1,5 @@
>>> obj-$(CONFIG_VFIO) += vfio.o
>>> obj-$(CONFIG_VFIO_IOMMU_TYPE1) += vfio_iommu_type1.o
>>> -obj-$(CONFIG_VFIO_IOMMU_SPAPR_TCE) += vfio_iommu_spapr_tce.o
>>> -obj-$(CONFIG_EEH) += vfio_spapr_eeh.o
>>> +obj-$(CONFIG_VFIO_IOMMU_SPAPR_TCE) += vfio_iommu_spapr_tce.o \
>>> + vfio_spapr_eeh.o
>>> obj-$(CONFIG_VFIO_PCI) += pci/
>>> diff --git a/drivers/vfio/vfio_spapr_eeh.c b/drivers/vfio/vfio_spapr_eeh.c
>>> index f834b4c..1a93e83 100644
>>> --- a/drivers/vfio/vfio_spapr_eeh.c
>>> +++ b/drivers/vfio/vfio_spapr_eeh.c
>>> @@ -14,15 +14,19 @@
>>> #include <asm/eeh.h>
>>>
>>> /* We might build address mapping here for "fast" path later */
>>> +#ifdef CONFIG_EEH
>>> +
>>> int vfio_spapr_pci_eeh_open(struct pci_dev *pdev)
>>> {
>>> return eeh_dev_open(pdev);
>>> }
>>> +EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_open);
>>>
>>> void vfio_spapr_pci_eeh_release(struct pci_dev *pdev)
>>> {
>>> eeh_dev_release(pdev);
>>> }
>>> +EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_release);
>>>
>>> long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
>>> unsigned int cmd, unsigned long arg)
>>> @@ -85,3 +89,5 @@ long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
>>>
>>> return ret;
>>> }
>>> +EXPORT_SYMBOL_GPL(vfio_spapr_iommu_eeh_ioctl);
>>> +#endif /* CONFIG_EEH */
>>
>>
>>
>
--
Alexey
^ permalink raw reply related
* Re: [PATCH v2 2/4] vfio: spapr: Fix build error
From: Gavin Shan @ 2014-08-06 6:57 UTC (permalink / raw)
To: Alexey Kardashevskiy; +Cc: Alex Williamson, linuxppc-dev, Gavin Shan, kvm
In-Reply-To: <53E1CC39.9000401@ozlabs.ru>
On Wed, Aug 06, 2014 at 04:33:29PM +1000, Alexey Kardashevskiy wrote:
>On 08/06/2014 01:54 PM, Gavin Shan wrote:
>> On Tue, Aug 05, 2014 at 09:12:50PM -0600, Alex Williamson wrote:
>>> On Wed, 2014-08-06 at 12:48 +1000, Alexey Kardashevskiy wrote:
>>>> From: Gavin Shan <gwshan@linux.vnet.ibm.com>
>>>>
>>>> The VFIO related components could be built as dynamic modules.
>>>> Unfortunately, CONFIG_EEH can't be configured to "m". The patch
>>>> fixes the build errors when configuring VFIO related components
>>>> as dynamic modules as follows:
>>>>
>>>> CC [M] drivers/vfio/vfio_iommu_spapr_tce.o
>>>> In file included from drivers/vfio/vfio.c:33:0:
>>>> include/linux/vfio.h:101:43: warning: =E2=80=98struct pci_dev=E2=80=99=
declared \
>>>> inside parameter list [enabled by default]
>>>> :
>>>> WRAP arch/powerpc/boot/zImage.pseries
>>>> WRAP arch/powerpc/boot/zImage.maple
>>>> WRAP arch/powerpc/boot/zImage.pmac
>>>> WRAP arch/powerpc/boot/zImage.epapr
>>>> MODPOST 1818 modules
>>>> ERROR: ".vfio_spapr_iommu_eeh_ioctl" [drivers/vfio/vfio_iommu_spapr_=
tce.ko]\
>>>> undefined!
>>>> ERROR: ".vfio_spapr_pci_eeh_open" [drivers/vfio/pci/vfio-pci.ko] und=
efined!
>>>> ERROR: ".vfio_spapr_pci_eeh_release" [drivers/vfio/pci/vfio-pci.ko] =
undefined!
>>>>
>>>> Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>>> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
>>>> [removed include "pci.h" in vfio.c]
>>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>>> ---
>>>> Changes:
>>>> v2:
>>>> * removed #include <linux/pci.h> from vfio.c and tested
>>=20
>> Appreciated for Alexey's help on it :)
>
>
>My bad, that was wrong actually, we still need this:
>
Yep, no worries. I'll fix it in next revision.
>diff --git a/include/linux/vfio.h b/include/linux/vfio.h
>index 25a0fbd..224128a 100644
>--- a/include/linux/vfio.h
>+++ b/include/linux/vfio.h
>@@ -98,6 +98,7 @@ extern int vfio_external_user_iommu_id(struct vfio_gro=
up
>*group);
> extern long vfio_external_check_extension(struct vfio_group *group,
> unsigned long arg);
>
>+struct pci_dev;
> #ifdef CONFIG_EEH
> extern int vfio_spapr_pci_eeh_open(struct pci_dev *pdev);
> extern void vfio_spapr_pci_eeh_release(struct pci_dev *pdev);
>
>
>
>Otherwise it is "warning: =E2=80=98struct pci_dev=E2=80=99 declared insi=
de parameter list".
>For some reason I only see this warning when backporting this patch to 3=
.10
>and I do not see it in 3.16-rc7, I guess pci.h gets included somewhere.
>
>
>>=20
>>>
>>> I also commented regarding the ifdef around all of vfio_spapr_eeh.c:
>>>
>>> Why not add a new CONFIG_VFIO_SPAPR_EEH option to handle this
>>> instead?
>>>
>>> Did you disagree? The ifdef is pretty ugly.
>>>
>>=20
>> I'll introduce CONFIG_VFIO_SPAPR_EEH.
>
>
>So, Gavin, then the patchset is yours (again), ok?
>
Sure. Thanks for your help, Alexey. I was busy with other
bugs with higher priority recently. I'm working on this.
Thanks,
Gavin
>
>
>
>> Thanks,
>> Gavin
>>=20
>>>> ---
>>>> drivers/vfio/Makefile | 4 ++--
>>>> drivers/vfio/vfio_spapr_eeh.c | 6 ++++++
>>>> 2 files changed, 8 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/vfio/Makefile b/drivers/vfio/Makefile
>>>> index 50e30bc..4891cca 100644
>>>> --- a/drivers/vfio/Makefile
>>>> +++ b/drivers/vfio/Makefile
>>>> @@ -1,5 +1,5 @@
>>>> obj-$(CONFIG_VFIO) +=3D vfio.o
>>>> obj-$(CONFIG_VFIO_IOMMU_TYPE1) +=3D vfio_iommu_type1.o
>>>> -obj-$(CONFIG_VFIO_IOMMU_SPAPR_TCE) +=3D vfio_iommu_spapr_tce.o
>>>> -obj-$(CONFIG_EEH) +=3D vfio_spapr_eeh.o
>>>> +obj-$(CONFIG_VFIO_IOMMU_SPAPR_TCE) +=3D vfio_iommu_spapr_tce.o \
>>>> + vfio_spapr_eeh.o
>>>> obj-$(CONFIG_VFIO_PCI) +=3D pci/
>>>> diff --git a/drivers/vfio/vfio_spapr_eeh.c b/drivers/vfio/vfio_spapr=
_eeh.c
>>>> index f834b4c..1a93e83 100644
>>>> --- a/drivers/vfio/vfio_spapr_eeh.c
>>>> +++ b/drivers/vfio/vfio_spapr_eeh.c
>>>> @@ -14,15 +14,19 @@
>>>> #include <asm/eeh.h>
>>>> =20
>>>> /* We might build address mapping here for "fast" path later */
>>>> +#ifdef CONFIG_EEH
>>>> +
>>>> int vfio_spapr_pci_eeh_open(struct pci_dev *pdev)
>>>> {
>>>> return eeh_dev_open(pdev);
>>>> }
>>>> +EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_open);
>>>> =20
>>>> void vfio_spapr_pci_eeh_release(struct pci_dev *pdev)
>>>> {
>>>> eeh_dev_release(pdev);
>>>> }
>>>> +EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_release);
>>>> =20
>>>> long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
>>>> unsigned int cmd, unsigned long arg)
>>>> @@ -85,3 +89,5 @@ long vfio_spapr_iommu_eeh_ioctl(struct iommu_group=
*group,
>>>> =20
>>>> return ret;
>>>> }
>>>> +EXPORT_SYMBOL_GPL(vfio_spapr_iommu_eeh_ioctl);
>>>> +#endif /* CONFIG_EEH */
>>>
>>>
>>>
>>=20
>
>
>--=20
>Alexey
>
^ permalink raw reply
* [PATCH] powerpc/ppc476: Disable BTAC
From: Alistair Popple @ 2014-08-06 7:03 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Alistair Popple
This patch disables the branch target address CAM which under specific
circumstances may cause the processor to skip execution of 1-4
instructions. This fixes IBM Erratum #47.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
---
arch/powerpc/kernel/head_44x.S | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index c334f53..b5061ab 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -1210,10 +1210,12 @@ clear_utlb_entry:
/* We configure icbi to invalidate 128 bytes at a time since the
* current 32-bit kernel code isn't too happy with icache != dcache
- * block size
+ * block size. We also disable the BTAC as this can cause errors
+ * in some circumstances (see IBM Erratum 47).
*/
mfspr r3,SPRN_CCR0
oris r3,r3,0x0020
+ ori r3,r3,0x0040
mtspr SPRN_CCR0,r3
isync
--
1.8.3.2
^ permalink raw reply related
* [PATCH 1/2 v2] powerpc/powernv: Fix IOMMU group lost
From: Gavin Shan @ 2014-08-06 7:10 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Gavin Shan, stable
When we take full hotplug to recover from EEH errors, PCI buses
could be involved. For the case, the child devices of involved
PCI buses can't be attached to IOMMU group properly, which is
caused by commit 3f28c5a ("powerpc/powernv: Reduce multi-hit of
iommu_add_device()").
When adding the PCI devices of the newly created PCI buses to
the system, the IOMMU group is expected to be added in (C).
(A) fails to bind the IOMMU group because bus->is_added is
false. (B) fails because the device doesn't have binding IOMMU
table yet. bus->is_added is set to true at end of (C) and
pdev->is_added is set to true at (D).
pcibios_add_pci_devices()
pci_scan_bridge()
pci_scan_child_bus()
pci_scan_slot()
pci_scan_single_device()
pci_scan_device()
pci_device_add()
pcibios_add_device() A: Ignore
device_add() B: Ignore
pcibios_fixup_bus()
pcibios_setup_bus_devices()
pcibios_setup_device() C: Hit
pcibios_finish_adding_to_bus()
pci_bus_add_devices()
pci_bus_add_device() D: Add device
If the parent PCI bus isn't involved in hotplug, the IOMMU
group is expected to be bound in (B). (A) should fail as the
sysfs entries aren't populated.
The patch fixes the issue by reverting commit 3f28c5a and remove
WARN_ON() in iommu_add_device() to allow calling the function
even the specified device already has associated IOMMU group.
Cc: <stable@vger.kernel.org> # 3.16+
Reported-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Acked-by: Wei Yang <weiyang@linux.vnet.ibm.com>
---
v2: Bail if sysfs entries aren't populated in iommu_add_device()
---
arch/powerpc/kernel/iommu.c | 38 +++++++++++++++++--------------
arch/powerpc/platforms/powernv/pci-ioda.c | 2 +-
2 files changed, 22 insertions(+), 18 deletions(-)
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index 88e3ec6..48fb2c1 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -1120,37 +1120,41 @@ EXPORT_SYMBOL_GPL(iommu_release_ownership);
int iommu_add_device(struct device *dev)
{
struct iommu_table *tbl;
- int ret = 0;
- if (WARN_ON(dev->iommu_group)) {
- pr_warn("iommu_tce: device %s is already in iommu group %d, skipping\n",
- dev_name(dev),
- iommu_group_id(dev->iommu_group));
+ /*
+ * The sysfs entries should be populated before
+ * binding IOMMU group. If sysfs entries isn't
+ * ready, we simply bail.
+ */
+ if (!device_is_registered(dev))
+ return -ENOENT;
+
+ if (dev->iommu_group) {
+ pr_debug("%s: Skipping device %s with iommu group %d\n",
+ __func__, dev_name(dev),
+ iommu_group_id(dev->iommu_group));
return -EBUSY;
}
tbl = get_iommu_table_base(dev);
if (!tbl || !tbl->it_group) {
- pr_debug("iommu_tce: skipping device %s with no tbl\n",
- dev_name(dev));
+ pr_debug("%s: Skipping device %s with no tbl\n",
+ __func__, dev_name(dev));
return 0;
}
- pr_debug("iommu_tce: adding %s to iommu group %d\n",
- dev_name(dev), iommu_group_id(tbl->it_group));
+ pr_debug("%s: Adding %s to iommu group %d\n",
+ __func__, dev_name(dev),
+ iommu_group_id(tbl->it_group));
if (PAGE_SIZE < IOMMU_PAGE_SIZE(tbl)) {
- pr_err("iommu_tce: unsupported iommu page size.");
- pr_err("%s has not been added\n", dev_name(dev));
+ pr_err("%s: Invalid IOMMU page size %lx (%lx) on %s\n",
+ __func__, IOMMU_PAGE_SIZE(tbl),
+ PAGE_SIZE, dev_name(dev));
return -EINVAL;
}
- ret = iommu_group_add_device(tbl->it_group, dev);
- if (ret < 0)
- pr_err("iommu_tce: %s has not been added, ret=%d\n",
- dev_name(dev), ret);
-
- return ret;
+ return iommu_group_add_device(tbl->it_group, dev);
}
EXPORT_SYMBOL_GPL(iommu_add_device);
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index de19ede..86290eb 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -462,7 +462,7 @@ static void pnv_pci_ioda_dma_dev_setup(struct pnv_phb *phb, struct pci_dev *pdev
pe = &phb->ioda.pe_array[pdn->pe_number];
WARN_ON(get_dma_ops(&pdev->dev) != &dma_iommu_ops);
- set_iommu_table_base(&pdev->dev, &pe->tce32_table);
+ set_iommu_table_base_and_group(&pdev->dev, &pe->tce32_table);
}
static int pnv_pci_ioda_dma_set_mask(struct pnv_phb *phb,
--
1.8.3.2
^ permalink raw reply related
* [PATCH 2/2] powerpc/powernv: Remove duplicate check in tce_iommu_bus_notifier()
From: Gavin Shan @ 2014-08-06 7:10 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Gavin Shan
In-Reply-To: <1407309017-13870-1-git-send-email-gwshan@linux.vnet.ibm.com>
The called function iommu_del_device() checks if the device has
attached IOMMU group, we needn't check it again in the parent
function call tce_iommu_bus_notifier().
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
arch/powerpc/platforms/powernv/pci.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index f91a4e5..b562b0d 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -820,17 +820,18 @@ static int tce_iommu_bus_notifier(struct notifier_block *nb,
unsigned long action, void *data)
{
struct device *dev = data;
+ int ret = 0;
switch (action) {
case BUS_NOTIFY_ADD_DEVICE:
- return iommu_add_device(dev);
+ ret = iommu_add_device(dev);
+ break;
case BUS_NOTIFY_DEL_DEVICE:
- if (dev->iommu_group)
- iommu_del_device(dev);
- return 0;
- default:
- return 0;
+ iommu_del_device(dev);
+ break;
}
+
+ return ret;
}
static struct notifier_block tce_iommu_bus_nb = {
--
1.8.3.2
^ permalink raw reply related
* Re: mm: BUG in unmap_page_range
From: Aneesh Kumar K.V @ 2014-08-06 7:14 UTC (permalink / raw)
To: Mel Gorman, Hugh Dickins
Cc: Rik van Riel, linuxppc-dev, Peter Zijlstra, Johannes Weiner, LKML,
Cyrill Gorcunov, linux-mm@kvack.org, Sasha Levin, Dave Jones,
Andrew Morton, Kirill A. Shutemov
In-Reply-To: <20140805144439.GW10819@suse.de>
Mel Gorman <mgorman@suse.de> writes:
> From d0c77a2b497da46c52792ead066d461e5111a594 Mon Sep 17 00:00:00 2001
> From: Mel Gorman <mgorman@suse.de>
> Date: Tue, 5 Aug 2014 12:06:50 +0100
> Subject: [PATCH] mm: Remove misleading ARCH_USES_NUMA_PROT_NONE
>
> ARCH_USES_NUMA_PROT_NONE was defined for architectures that implemented
> _PAGE_NUMA using _PROT_NONE. This saved using an additional PTE bit and
> relied on the fact that PROT_NONE vmas were skipped by the NUMA hinting
> fault scanner. This was found to be conceptually confusing with a lot of
> implicit assumptions and it was asked that an alternative be found.
>
> Commit c46a7c81 "x86: define _PAGE_NUMA by reusing software bits on the
> PMD and PTE levels" redefined _PAGE_NUMA on x86 to be one of the swap
> PTE bits and shrunk the maximum possible swap size but it did not go far
> enough. There are no architectures that reuse _PROT_NONE as _PROT_NUMA
> but the relics still exist.
>
> This patch removes ARCH_USES_NUMA_PROT_NONE and removes some unnecessary
> duplication in powerpc vs the generic implementation by defining the types
> the core NUMA helpers expected to exist from x86 with their ppc64 equivalent.
> The unification for ppc64 is less than ideal because types do not exist
> that the "generic" code expects to. This patch works around the problem
> but it would be preferred if the powerpc people would look at this to see
> if they have opinions on what might suit them better.
>
> Signed-off-by: Mel Gorman <mgorman@suse.de>
> ---
> arch/powerpc/include/asm/pgtable.h | 55 ++++++++------------------------------
> arch/x86/Kconfig | 1 -
> include/asm-generic/pgtable.h | 35 ++++++++++++------------
> init/Kconfig | 11 --------
> 4 files changed, 29 insertions(+), 73 deletions(-)
>
....
> -
> #define pmdp_set_numa pmdp_set_numa
> static inline void pmdp_set_numa(struct mm_struct *mm, unsigned long addr,
> pmd_t *pmdp)
> @@ -109,16 +71,21 @@ static inline void pmdp_set_numa(struct mm_struct *mm, unsigned long addr,
> return;
> }
>
> -#define pmd_mknonnuma pmd_mknonnuma
> -static inline pmd_t pmd_mknonnuma(pmd_t pmd)
> +/*
> + * Generic NUMA pte helpers expect pteval_t and pmdval_t types to exist
> + * which was inherited from x86. For the purposes of powerpc pte_basic_t is
> + * equivalent
> + */
> +#define pteval_t pte_basic_t
> +#define pmdval_t pmd_t
> +static inline pteval_t pte_flags(pte_t pte)
> {
> - return pte_pmd(pte_mknonnuma(pmd_pte(pmd)));
> + return pte_val(pte) & PAGE_PROT_BITS;
PAGE_PROT_BITS don't get the _PAGE_NUMA and _PAGE_PRESENT. I will have
to check further to find out why the mask doesn't include
_PAGE_PRESENT.
> }
>
> -#define pmd_mknuma pmd_mknuma
> -static inline pmd_t pmd_mknuma(pmd_t pmd)
> +static inline pteval_t pmd_flags(pte_t pte)
> {
static inline pmdval_t ?
> - return pte_pmd(pte_mknuma(pmd_pte(pmd)));
> + return pmd_val(pte) & PAGE_PROT_BITS;
> }
>
-aneesh
^ permalink raw reply
* [PATCH] powerpc: Remove CPU_FTR_HVMODE from CPU_FTRS_ALWAYS
From: Michael Ellerman @ 2014-08-06 8:22 UTC (permalink / raw)
To: linuxppc-dev
We potentially clear CPU_FTR_HVMODE at runtime in __init_hvmode_206(),
so we must make sure it's not set in CPU_FTRS_ALWAYS.
This doesn't hurt us in practice at the moment, because we don't support
compiling only for CPUs that support CPU_FTR_HVMODE.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/include/asm/cputable.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index 0fdd7eece6d9..16d355e4a58b 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -520,7 +520,8 @@ enum {
#define CPU_FTRS_ALWAYS \
(CPU_FTRS_POWER3 & CPU_FTRS_RS64 & CPU_FTRS_POWER4 & \
CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & CPU_FTRS_POWER6 & \
- CPU_FTRS_POWER7 & CPU_FTRS_CELL & CPU_FTRS_PA6T & CPU_FTRS_POSSIBLE)
+ CPU_FTRS_POWER7 & CPU_FTRS_CELL & CPU_FTRS_PA6T & \
+ ~CPU_FTR_HVMODE & CPU_FTRS_POSSIBLE)
#endif
#else
enum {
--
1.9.1
^ permalink raw reply related
* [PATCH] powerpc: Remove unused CPU_FTRS_A2
From: Michael Ellerman @ 2014-08-06 8:26 UTC (permalink / raw)
To: linuxppc-dev
In commit fb5a515704d7 "Remove platforms/wsp and associated pieces" we
removed the last user of CPU_FTRS_A2, so we should remove it too.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/include/asm/cputable.h | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index 0fdd7eece6d9..1de5ff3b7e42 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -458,13 +458,9 @@ extern const char *powerpc_base_platform;
CPU_FTR_PURR | CPU_FTR_REAL_LE | CPU_FTR_DABRX)
#define CPU_FTRS_COMPATIBLE (CPU_FTR_USE_TB | CPU_FTR_PPCAS_ARCH_V2)
-#define CPU_FTRS_A2 (CPU_FTR_USE_TB | CPU_FTR_SMT | CPU_FTR_DBELL | \
- CPU_FTR_NOEXECUTE | CPU_FTR_NODSISRALIGN | \
- CPU_FTR_ICSWX | CPU_FTR_DABRX )
-
#ifdef __powerpc64__
#ifdef CONFIG_PPC_BOOK3E
-#define CPU_FTRS_POSSIBLE (CPU_FTRS_E6500 | CPU_FTRS_E5500 | CPU_FTRS_A2)
+#define CPU_FTRS_POSSIBLE (CPU_FTRS_E6500 | CPU_FTRS_E5500)
#else
#define CPU_FTRS_POSSIBLE \
(CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \
@@ -515,7 +511,7 @@ enum {
#ifdef __powerpc64__
#ifdef CONFIG_PPC_BOOK3E
-#define CPU_FTRS_ALWAYS (CPU_FTRS_E6500 & CPU_FTRS_E5500 & CPU_FTRS_A2)
+#define CPU_FTRS_ALWAYS (CPU_FTRS_E6500 & CPU_FTRS_E5500)
#else
#define CPU_FTRS_ALWAYS \
(CPU_FTRS_POWER3 & CPU_FTRS_RS64 & CPU_FTRS_POWER4 & \
--
1.9.1
^ permalink raw reply related
* [PATCH 1/2] powerpc/booke: Restrict SPE exception handlers to e200/e500 cores
From: Mihai Caraman @ 2014-08-06 8:39 UTC (permalink / raw)
To: linuxppc-dev; +Cc: scottwood, Mihai Caraman, kvm-ppc
SPE exception handlers are now defined for 32-bit e500mc cores even though
SPE unit is not present and CONFIG_SPE is undefined.
Restrict SPE exception handlers to e200/e500 cores adding CONFIG_SPE_POSSIBLE
and consequently guard __stup_ivors and __setup_cpu functions.
Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
---
arch/powerpc/kernel/cpu_setup_fsl_booke.S | 12 +++++++++++-
arch/powerpc/kernel/cputable.c | 5 +++++
arch/powerpc/kernel/head_fsl_booke.S | 18 +++++++++++++-----
arch/powerpc/platforms/Kconfig.cputype | 6 +++++-
4 files changed, 34 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/kernel/cpu_setup_fsl_booke.S b/arch/powerpc/kernel/cpu_setup_fsl_booke.S
index 4f1393d..44bb2c9 100644
--- a/arch/powerpc/kernel/cpu_setup_fsl_booke.S
+++ b/arch/powerpc/kernel/cpu_setup_fsl_booke.S
@@ -91,6 +91,7 @@ _GLOBAL(setup_altivec_idle)
blr
+#if defined(CONFIG_E500) && defined(CONFIG_PPC_E500MC)
_GLOBAL(__setup_cpu_e6500)
mflr r6
#ifdef CONFIG_PPC64
@@ -107,14 +108,20 @@ _GLOBAL(__setup_cpu_e6500)
bl __setup_cpu_e5500
mtlr r6
blr
+#endif /* CONFIG_E500 && CONFIG_PPC_E500MC */
#ifdef CONFIG_PPC32
+#ifdef CONFIG_E200
_GLOBAL(__setup_cpu_e200)
/* enable dedicated debug exception handling resources (Debug APU) */
mfspr r3,SPRN_HID0
ori r3,r3,HID0_DAPUEN@l
mtspr SPRN_HID0,r3
b __setup_e200_ivors
+#endif /* CONFIG_E200 */
+
+#ifdef CONFIG_E500
+#ifndef CONFIG_PPC_E500MC
_GLOBAL(__setup_cpu_e500v1)
_GLOBAL(__setup_cpu_e500v2)
mflr r4
@@ -129,6 +136,7 @@ _GLOBAL(__setup_cpu_e500v2)
#endif
mtlr r4
blr
+#else /* CONFIG_PPC_E500MC */
_GLOBAL(__setup_cpu_e500mc)
_GLOBAL(__setup_cpu_e5500)
mflr r5
@@ -159,7 +167,9 @@ _GLOBAL(__setup_cpu_e5500)
2:
mtlr r5
blr
-#endif
+#endif /* CONFIG_PPC_E500MC */
+#endif /* CONFIG_E500 */
+#endif /* CONFIG_PPC32 */
#ifdef CONFIG_PPC_BOOK3E_64
_GLOBAL(__restore_cpu_e6500)
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 965291b..c98719f 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -2031,6 +2031,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
#endif /* CONFIG_PPC32 */
#ifdef CONFIG_E500
#ifdef CONFIG_PPC32
+#ifndef CONFIG_PPC_E500MC
{ /* e500 */
.pvr_mask = 0xffff0000,
.pvr_value = 0x80200000,
@@ -2070,6 +2071,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
.machine_check = machine_check_e500,
.platform = "ppc8548",
},
+#else
{ /* e500mc */
.pvr_mask = 0xffff0000,
.pvr_value = 0x80230000,
@@ -2088,7 +2090,9 @@ static struct cpu_spec __initdata cpu_specs[] = {
.machine_check = machine_check_e500mc,
.platform = "ppce500mc",
},
+#endif /* CONFIG_PPC_E500MC */
#endif /* CONFIG_PPC32 */
+#ifdef CONFIG_PPC_E500MC
{ /* e5500 */
.pvr_mask = 0xffff0000,
.pvr_value = 0x80240000,
@@ -2132,6 +2136,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
.machine_check = machine_check_e500mc,
.platform = "ppce6500",
},
+#endif /* CONFIG_PPC_E500MC */
#ifdef CONFIG_PPC32
{ /* default match */
.pvr_mask = 0x00000000,
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index b497188..4f8930f 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -613,6 +613,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
mfspr r10, SPRN_SPRG_RSCRATCH0
b InstructionStorage
+/* Define SPE handlers for e200 and e500v2 */
#ifdef CONFIG_SPE
/* SPE Unavailable */
START_EXCEPTION(SPEUnavailable)
@@ -622,10 +623,10 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
b fast_exception_return
1: addi r3,r1,STACK_FRAME_OVERHEAD
EXC_XFER_EE_LITE(0x2010, KernelSPE)
-#else
+#elif CONFIG_SPE_POSSIBLE
EXCEPTION(0x2020, SPE_ALTIVEC_UNAVAIL, SPEUnavailable, \
unknown_exception, EXC_XFER_EE)
-#endif /* CONFIG_SPE */
+#endif /* CONFIG_SPE_POSSIBLE */
/* SPE Floating Point Data */
#ifdef CONFIG_SPE
@@ -635,12 +636,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
/* SPE Floating Point Round */
EXCEPTION(0x2050, SPE_FP_ROUND, SPEFloatingPointRound, \
SPEFloatingPointRoundException, EXC_XFER_EE)
-#else
+#elif CONFIG_SPE_POSSIBLE
EXCEPTION(0x2040, SPE_FP_DATA_ALTIVEC_ASSIST, SPEFloatingPointData,
unknown_exception, EXC_XFER_EE)
EXCEPTION(0x2050, SPE_FP_ROUND, SPEFloatingPointRound, \
unknown_exception, EXC_XFER_EE)
-#endif /* CONFIG_SPE */
+#endif /* CONFIG_SPE_POSSIBLE */
+
/* Performance Monitor */
EXCEPTION(0x2060, PERFORMANCE_MONITOR, PerformanceMonitor, \
@@ -947,6 +949,7 @@ get_phys_addr:
* Global functions
*/
+#ifdef CONFIG_E200
/* Adjust or setup IVORs for e200 */
_GLOBAL(__setup_e200_ivors)
li r3,DebugDebug@l
@@ -959,7 +962,10 @@ _GLOBAL(__setup_e200_ivors)
mtspr SPRN_IVOR34,r3
sync
blr
+#endif
+#ifdef CONFIG_E500
+#ifndef CONFIG_PPC_E500MC
/* Adjust or setup IVORs for e500v1/v2 */
_GLOBAL(__setup_e500_ivors)
li r3,DebugCrit@l
@@ -974,7 +980,7 @@ _GLOBAL(__setup_e500_ivors)
mtspr SPRN_IVOR35,r3
sync
blr
-
+#else
/* Adjust or setup IVORs for e500mc */
_GLOBAL(__setup_e500mc_ivors)
li r3,DebugDebug@l
@@ -1000,6 +1006,8 @@ _GLOBAL(__setup_ehv_ivors)
mtspr SPRN_IVOR41,r3
sync
blr
+#endif /* CONFIG_PPC_E500MC */
+#endif /* CONFIG_E500 */
#ifdef CONFIG_SPE
/*
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index a41bd02..bb81571 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -311,9 +311,13 @@ config PPC_ICSWX_USE_SIGILL
If in doubt, say N here.
+config SPE_POSSIBLE
+ def_bool y
+ depends on E200 || (E500 && !PPC_E500MC)
+
config SPE
bool "SPE Support"
- depends on E200 || (E500 && !PPC_E500MC)
+ depends on SPE_POSSIBLE
default y
---help---
This option enables kernel support for the Signal Processing
--
1.7.11.7
^ permalink raw reply related
* [PATCH 2/2] powerpc/booke: Revert SPE/AltiVec common defines for interrupt numbers
From: Mihai Caraman @ 2014-08-06 8:39 UTC (permalink / raw)
To: linuxppc-dev; +Cc: scottwood, Mihai Caraman, kvm-ppc
In-Reply-To: <1407314358-17653-1-git-send-email-mihai.caraman@freescale.com>
Though SPE/AltiVec shares interrupts numbers on BookE cores, use distinct
defines to identify these numbers. This improves code readability especially
in KVM.
Revert c58ce397 and 6b310fc5 patches that added common defines.
Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
---
arch/powerpc/kernel/exceptions-64e.S | 4 ++--
arch/powerpc/kernel/head_fsl_booke.S | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
index bb9cac6..3e68d1c 100644
--- a/arch/powerpc/kernel/exceptions-64e.S
+++ b/arch/powerpc/kernel/exceptions-64e.S
@@ -635,7 +635,7 @@ interrupt_end_book3e:
/* Altivec Unavailable Interrupt */
START_EXCEPTION(altivec_unavailable);
- NORMAL_EXCEPTION_PROLOG(0x200, BOOKE_INTERRUPT_SPE_ALTIVEC_UNAVAIL,
+ NORMAL_EXCEPTION_PROLOG(0x200, BOOKE_INTERRUPT_ALTIVEC_UNAVAIL,
PROLOG_ADDITION_NONE)
/* we can probably do a shorter exception entry for that one... */
EXCEPTION_COMMON(0x200)
@@ -658,7 +658,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
/* AltiVec Assist */
START_EXCEPTION(altivec_assist);
NORMAL_EXCEPTION_PROLOG(0x220,
- BOOKE_INTERRUPT_SPE_FP_DATA_ALTIVEC_ASSIST,
+ BOOKE_INTERRUPT_ALTIVEC_ASSIST,
PROLOG_ADDITION_NONE)
EXCEPTION_COMMON(0x220)
INTS_DISABLE
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 4f8930f..7ac2dbb 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -617,27 +617,27 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
#ifdef CONFIG_SPE
/* SPE Unavailable */
START_EXCEPTION(SPEUnavailable)
- NORMAL_EXCEPTION_PROLOG(SPE_ALTIVEC_UNAVAIL)
+ NORMAL_EXCEPTION_PROLOG(SPE_UNAVAIL)
beq 1f
bl load_up_spe
b fast_exception_return
1: addi r3,r1,STACK_FRAME_OVERHEAD
EXC_XFER_EE_LITE(0x2010, KernelSPE)
#elif CONFIG_SPE_POSSIBLE
- EXCEPTION(0x2020, SPE_ALTIVEC_UNAVAIL, SPEUnavailable, \
+ EXCEPTION(0x2020, SPE_UNAVAIL, SPEUnavailable, \
unknown_exception, EXC_XFER_EE)
#endif /* CONFIG_SPE_POSSIBLE */
/* SPE Floating Point Data */
#ifdef CONFIG_SPE
- EXCEPTION(0x2030, SPE_FP_DATA_ALTIVEC_ASSIST, SPEFloatingPointData,
+ EXCEPTION(0x2030, SPE_FP_DATA, SPEFloatingPointData,
SPEFloatingPointException, EXC_XFER_EE)
/* SPE Floating Point Round */
EXCEPTION(0x2050, SPE_FP_ROUND, SPEFloatingPointRound, \
SPEFloatingPointRoundException, EXC_XFER_EE)
#elif CONFIG_SPE_POSSIBLE
- EXCEPTION(0x2040, SPE_FP_DATA_ALTIVEC_ASSIST, SPEFloatingPointData,
+ EXCEPTION(0x2040, SPE_FP_DATA, SPEFloatingPointData,
unknown_exception, EXC_XFER_EE)
EXCEPTION(0x2050, SPE_FP_ROUND, SPEFloatingPointRound, \
unknown_exception, EXC_XFER_EE)
--
1.7.11.7
^ permalink raw reply related
* RE: qe: move qe from arch/powerpc to drivers
From: qiang.zhao @ 2014-08-06 8:53 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev@lists.ozlabs.org, Xiaobo Xie
In-Reply-To: <20140730001923.GA4151@home.buserror.net>
On Wed, Jul 30, 2014 at 08:19 AM, Wood Scott wrote:
> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Wednesday, July 30, 2014 8:19 AM
> To: Zhao Qiang-B45475
> Cc: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; Xie Xiaobo-R63061
> Subject: Re: qe: move qe from arch/powerpc to drivers
>=20
> On Tue, Jun 24, 2014 at 11:31:52AM +0800, Zhao Qiang wrote:
> > ls1 has qe and ls1 has arm cpu.
> > move qe from arch/powerpc to drivers.
> >
> > Signed-off-by: Zhao Qiang <B45475@freescale.com>
>=20
> This is a very terse changelog. Explain more about what QE is, and what
> this patch accomplishes (it doesn't seem to get rid of the PPC dependency=
,
> just moving code at this stage)
>=20
> I don't see a MAINTAINERS update for the new path. Who is going to
> maintain it?
>=20
> I don't think drivers/qe is the right place for it. Directories directly
> under drivers/ tend to be for classes of devices, not instances. In any
> case, LKML should be CCed when creating a new directory directly under
> drivers/ or under a subdirectory of drivers/ that doesn't have its own
> mailing list.
So which directory do you recommend?
Actually qe is a kind of IP block, so in my opinion, it is proper to put it=
under driver/(just in my opinion).
>=20
> This came up before, without a resolution. See:
> http://www.spinics.net/lists/kernel/msg1621335.html
>=20
> > diff --git a/arch/powerpc/platforms/83xx/km83xx.c
> > b/arch/powerpc/platforms/83xx/km83xx.c
> > index bf4c447..22c0d6d 100644
> > --- a/arch/powerpc/platforms/83xx/km83xx.c
> > +++ b/arch/powerpc/platforms/83xx/km83xx.c
> > @@ -37,8 +37,8 @@
> > #include <asm/udbg.h>
> > #include <sysdev/fsl_soc.h>
> > #include <sysdev/fsl_pci.h>
> > -#include <asm/qe.h>
> > -#include <asm/qe_ic.h>
> > +#include <linux/qe.h>
> > +#include <linux/qe_ic.h>
>=20
> If you're moving it out of asm/ please give it an fsl prefix.
>=20
> > diff --git a/drivers/qe/Kconfig b/drivers/qe/Kconfig new file mode
> > 100644 index 0000000..dc16e9a
> > --- /dev/null
> > +++ b/drivers/qe/Kconfig
> > @@ -0,0 +1,35 @@
> > +#
> > +# QE Communication options
> > +#
> > +menuconfig QUICC_ENGINE
> > + bool "Freescale QUICC Engine (QE) Support"
> > + depends on FSL_SOC && PPC32
> > + select PPC_LIB_RHEAP
> > + select CRC32
> > + help
> > + The QUICC Engine (QE) is a new generation of communications
> > + coprocessors on Freescale embedded CPUs (akin to CPM in older
> chips).
> > + Selecting this option means that you wish to build a kernel
> > + for a machine with a QE coprocessor.
> > +
> > +if QUICC_ENGINE
> > +
> > +config UCC_SLOW
> > + bool
> > + default y if SERIAL_QE
> > + help
> > + This option provides qe_lib support to UCC slow
> > + protocols: UART, BISYNC, QMC
> > +
> > +config UCC_FAST
> > + bool
> > + default y if UCC_GETH
> > + help
> > + This option provides qe_lib support to UCC fast
> > + protocols: HDLC, Ethernet, ATM, transparent
> > +
> > +config UCC
> > + bool
> > + default y if UCC_FAST || UCC_SLOW
> > +
> > +endif
>=20
> These config options could use better namespacing.
>=20
> -Scott
Regards,
Zhao Qiang
^ permalink raw reply
* [PATCH 1/2] powerpc/ppc64: Clean up the boot-time settings display
From: Michael Ellerman @ 2014-08-06 9:08 UTC (permalink / raw)
To: linuxppc-dev
At boot we display a bunch of low level settings which can be useful to
know, and can help to spot bugs when things are fundamentally
misconfigured.
At the moment they are very widely spaced, so that we can accommodate
the line:
ppc64_caches.dcache_line_size = 0xYY
But we only print that line when the cache line size is not 128, ie.
almost never, so it just makes the display look odd usually.
The ppc64_caches prefix is redundant so remove it, which means we can
align things a bit closer for the common case. While we're there
replace the last use of camelCase (physicalMemorySize), and use
phys_mem_size.
Before:
Starting Linux PPC64 #104 SMP Wed Aug 6 18:41:34 EST 2014
-----------------------------------------------------
ppc64_pft_size = 0x1a
physicalMemorySize = 0x200000000
ppc64_caches.dcache_line_size = 0xf0
ppc64_caches.icache_line_size = 0xf0
htab_address = 0xdeadbeef
htab_hash_mask = 0x7ffff
physical_start = 0xf000bar
-----------------------------------------------------
After:
Starting Linux PPC64 #103 SMP Wed Aug 6 18:38:04 EST 2014
-----------------------------------------------------
ppc64_pft_size = 0x1a
phys_mem_size = 0x200000000
dcache_line_size = 0xf0
icache_line_size = 0xf0
htab_address = 0xdeadbeef
htab_hash_mask = 0x7ffff
physical_start = 0xf000bar
-----------------------------------------------------
This patch is final, no bike shedding ;)
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/kernel/setup_64.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index ee082d771178..b364f7bd0a94 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -517,21 +517,23 @@ void __init setup_system(void)
printk("Starting Linux PPC64 %s\n", init_utsname()->version);
printk("-----------------------------------------------------\n");
- printk("ppc64_pft_size = 0x%llx\n", ppc64_pft_size);
- printk("physicalMemorySize = 0x%llx\n", memblock_phys_mem_size());
+ printk("ppc64_pft_size = 0x%llx\n", ppc64_pft_size);
+ printk("phys_mem_size = 0x%llx\n", memblock_phys_mem_size());
+
if (ppc64_caches.dline_size != 0x80)
- printk("ppc64_caches.dcache_line_size = 0x%x\n",
- ppc64_caches.dline_size);
+ printk("dcache_line_size = 0x%x\n", ppc64_caches.dline_size);
if (ppc64_caches.iline_size != 0x80)
- printk("ppc64_caches.icache_line_size = 0x%x\n",
- ppc64_caches.iline_size);
+ printk("icache_line_size = 0x%x\n", ppc64_caches.iline_size);
+
#ifdef CONFIG_PPC_STD_MMU_64
if (htab_address)
- printk("htab_address = 0x%p\n", htab_address);
- printk("htab_hash_mask = 0x%lx\n", htab_hash_mask);
-#endif /* CONFIG_PPC_STD_MMU_64 */
+ printk("htab_address = 0x%p\n", htab_address);
+
+ printk("htab_hash_mask = 0x%lx\n", htab_hash_mask);
+#endif
+
if (PHYSICAL_START > 0)
- printk("physical_start = 0x%llx\n",
+ printk("physical_start = 0x%llx\n",
(unsigned long long)PHYSICAL_START);
printk("-----------------------------------------------------\n");
--
1.9.1
^ permalink raw reply related
* [PATCH 2/2] powerpc/ppc64: Print CPU/MMU/FW features at boot
From: Michael Ellerman @ 2014-08-06 9:08 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1407316102-22917-1-git-send-email-mpe@ellerman.id.au>
"Helps debug funky firmware issues".
After:
Starting Linux PPC64 #108 SMP Wed Aug 6 19:04:51 EST 2014
-----------------------------------------------------
ppc64_pft_size = 0x1a
phys_mem_size = 0x200000000
cpu_features = 0x17fc7a6c18500249
possible = 0x1fffffff18700649
always = 0x0000000000000040
cpu_user_features = 0xdc0065c2 0xee000000
mmu_features = 0x5a000001
firmware_features = 0x00000001405a440b
htab_hash_mask = 0x7ffff
-----------------------------------------------------
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
v2: Add CPU_FTRS_ALWAYS & CPU_FTRS_POSSIBLE.
---
arch/powerpc/kernel/setup_64.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index b364f7bd0a94..dce860181b5c 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -525,6 +525,14 @@ void __init setup_system(void)
if (ppc64_caches.iline_size != 0x80)
printk("icache_line_size = 0x%x\n", ppc64_caches.iline_size);
+ printk("cpu_features = 0x%016lx\n", cur_cpu_spec->cpu_features);
+ printk(" possible = 0x%016lx\n", CPU_FTRS_POSSIBLE);
+ printk(" always = 0x%016lx\n", CPU_FTRS_ALWAYS);
+ printk("cpu_user_features = 0x%08x 0x%08x\n", cur_cpu_spec->cpu_user_features,
+ cur_cpu_spec->cpu_user_features2);
+ printk("mmu_features = 0x%08x\n", cur_cpu_spec->mmu_features);
+ printk("firmware_features = 0x%016lx\n", powerpc_firmware_features);
+
#ifdef CONFIG_PPC_STD_MMU_64
if (htab_address)
printk("htab_address = 0x%p\n", htab_address);
--
1.9.1
^ permalink raw reply related
* [PATCH v3 0/4] drivers/vfio: EEH Compile and compatibility
From: Gavin Shan @ 2014-08-06 9:49 UTC (permalink / raw)
To: linuxppc-dev; +Cc: aik, alex.williamson, Gavin Shan, kvm
The patchset is mainly for fixing errors from building VFIO compoments
as dynamic modules. PATCH[4/4] allows VFIO can be used though EEH fails
to initialize for VFIO PCI devices.
Alexey Kardashevskiy (2):
drivers/vfio: Allow EEH to be built as module
drivers/vfio: Enable VFIO if EEH is not supported
Gavin Shan (2):
powerpc/eeh: Export eeh_iommu_group_to_pe()
drivers/vfio: Fix EEH build error
arch/powerpc/kernel/eeh.c | 1 +
drivers/vfio/Kconfig | 6 ++++++
drivers/vfio/Makefile | 2 +-
drivers/vfio/pci/vfio_pci.c | 6 +-----
drivers/vfio/vfio_spapr_eeh.c | 17 +++++++++++++++--
include/linux/vfio.h | 6 +++---
6 files changed, 27 insertions(+), 11 deletions(-)
--=20
1.8.3.2
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox