* [PATCH v4] powerpc/kvm: support to handle sw breakpoint
From: Madhavan Srinivasan @ 2014-08-20 5:52 UTC (permalink / raw)
To: agraf, benh, paulus, mpe; +Cc: Madhavan Srinivasan, linuxppc-dev, kvm-ppc, kvm
This patch adds kernel side support for software breakpoint.
Design is that, by using an illegal instruction, we trap to hypervisor
via Emulation Assistance interrupt, where we check for the illegal instruction
and accordingly we return to Host or Guest. Patch also adds support for
software breakpoint in PR KVM.
Changes v3->v4:
Made changes to code comments and removed #define of zero opcode
Added a new function to handle the debug instruction emulation in book3s_hv
Rebased the code to latest upstream source.
Changes v2->v3:
Changed the debug instructions. Using the all zero opcode in the instruction word
as illegal instruction as mentioned in Power ISA instead of ABS
Removed reg updated in emulation assist and added a call to
kvmppc_emulate_instruction for reg update.
Changes v1->v2:
Moved the debug instruction #def to kvm_book3s.h. This way PR_KVM can also share it.
Added code to use KVM get one reg infrastructure to get debug opcode.
Updated emulate.c to include emulation of debug instruction incase of PR_KVM.
Made changes to commit message.
Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/kvm_book3s.h | 7 +++++++
arch/powerpc/kvm/book3s.c | 3 ++-
arch/powerpc/kvm/book3s_hv.c | 32 ++++++++++++++++++++++++++++++--
arch/powerpc/kvm/book3s_pr.c | 3 +++
arch/powerpc/kvm/emulate.c | 11 +++++++++++
5 files changed, 53 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h
index 6acf0c2..a1944f8 100644
--- a/arch/powerpc/include/asm/kvm_book3s.h
+++ b/arch/powerpc/include/asm/kvm_book3s.h
@@ -24,6 +24,13 @@
#include <linux/kvm_host.h>
#include <asm/kvm_book3s_asm.h>
+/*
+ * KVMPPC_INST_BOOK3S_DEBUG is debug Instruction for supporting Software Breakpoint.
+ * Based on PowerISA v2.07, Instruction with primary opcode 0 will be treated as illegal
+ * instruction.
+ */
+#define KVMPPC_INST_BOOK3S_DEBUG 0x00dddd00
+
struct kvmppc_bat {
u64 raw;
u32 bepi;
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index dd03f6b..00e9c9f 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -778,7 +778,8 @@ int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,
int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
struct kvm_guest_debug *dbg)
{
- return -EINVAL;
+ vcpu->guest_debug = dbg->control;
+ return 0;
}
void kvmppc_decrementer_func(unsigned long data)
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 27cced9..0a92e45 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -725,6 +725,14 @@ static int kvmppc_hcall_impl_hv(unsigned long cmd)
return kvmppc_hcall_impl_hv_realmode(cmd);
}
+static int kvmppc_emulate_debug_instruction_hv(struct kvm_run *run,
+ struct kvm_vcpu *vcpu)
+{
+ run->exit_reason = KVM_EXIT_DEBUG;
+ run->debug.arch.address = kvmppc_get_pc(vcpu);
+ return 0;
+}
+
static int kvmppc_handle_exit_hv(struct kvm_run *run, struct kvm_vcpu *vcpu,
struct task_struct *tsk)
{
@@ -811,9 +819,26 @@ static int kvmppc_handle_exit_hv(struct kvm_run *run, struct kvm_vcpu *vcpu,
* we don't emulate any guest instructions at this stage.
*/
case BOOK3S_INTERRUPT_H_EMUL_ASSIST:
- kvmppc_core_queue_program(vcpu, SRR1_PROGILL);
- r = RESUME_GUEST;
+ {
+ u32 last_inst;
+ if(kvmppc_get_last_inst(vcpu, INST_GENERIC, &last_inst) !=
+ EMULATE_DONE) {
+ /*
+ * Fetch failed, so return to guest and
+ * try executing it again.
+ */
+ r = RESUME_GUEST;
+ } else {
+ if (last_inst == KVMPPC_INST_BOOK3S_DEBUG) {
+ kvmppc_emulate_debug_instruction_hv(run, vcpu);
+ r = RESUME_HOST;
+ } else {
+ kvmppc_core_queue_program(vcpu, SRR1_PROGILL);
+ r = RESUME_GUEST;
+ }
+ }
break;
+ }
/*
* This occurs if the guest (kernel or userspace), does something that
* is prohibited by HFSCR. We just generate a program interrupt to
@@ -922,6 +947,9 @@ static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,
long int i;
switch (id) {
+ case KVM_REG_PPC_DEBUG_INST:
+ *val = get_reg_val(id, KVMPPC_INST_BOOK3S_DEBUG);
+ break;
case KVM_REG_PPC_HIOR:
*val = get_reg_val(id, 0);
break;
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index faffb27..cd2a39d 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -1319,6 +1319,9 @@ static int kvmppc_get_one_reg_pr(struct kvm_vcpu *vcpu, u64 id,
int r = 0;
switch (id) {
+ case KVM_REG_PPC_DEBUG_INST:
+ *val = get_reg_val(id, KVMPPC_INST_BOOK3S_DEBUG);
+ break;
case KVM_REG_PPC_HIOR:
*val = get_reg_val(id, to_book3s(vcpu)->hior);
break;
diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
index e96b50d..68f38b2 100644
--- a/arch/powerpc/kvm/emulate.c
+++ b/arch/powerpc/kvm/emulate.c
@@ -274,6 +274,17 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
}
break;
+ case 0:
+ /*
+ * Instruction with primary opcode 0. Based on PowerISA
+ * these are illegal instructions.
+ */
+ run->exit_reason = KVM_EXIT_DEBUG;
+ run->debug.arch.address = kvmppc_get_pc(vcpu);
+ emulated = EMULATE_EXIT_USER;
+ advance = 0;
+ break;
+
default:
emulated = EMULATE_FAIL;
}
--
1.7.11.4
^ permalink raw reply related
* Re: [PATCH 1/2] fsl_ifc: Fix csor_ext position in fsl_ifc_regs
From: Prabhakar Kushwaha @ 2014-08-20 4:05 UTC (permalink / raw)
To: Aaron Sierra, linuxppc-dev; +Cc: Greg Kroah-Hartman, Arnd Bergmann
In-Reply-To: <1346443438.56997.1408136868975.JavaMail.zimbra@xes-inc.com>
[-- Attachment #1: Type: text/plain, Size: 496 bytes --]
On 8/16/2014 2:37 AM, Aaron Sierra wrote:
> According to Freescale manuals, the IFC_CSORn_EXT register is located
> immediately _after_ the bank's IFC_CSORn register.
>
> This patch adjusts the csor_ext member of and reserved register arrays
> immediately surrounding the csor_cs structure to provide proper access
> to this register.
>
> Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
> ---
>
Thanks for fixing it.
Acked-by: Prabhakar Kushwaha <prabhakar@freescale.com>
Thanks,
Prabhakar
[-- Attachment #2: Type: text/html, Size: 39412 bytes --]
^ permalink raw reply
* Re: [PATCH 2/2] fsl_ifc: Support all 8 IFC chip selects
From: Prabhakar Kushwaha @ 2014-08-20 3:35 UTC (permalink / raw)
To: Scott Wood, Aaron Sierra; +Cc: Greg Kroah-Hartman, linuxppc-dev, Arnd Bergmann
In-Reply-To: <1408493285.4058.55.camel@snotra.buserror.net>
On 8/20/2014 5:38 AM, Scott Wood wrote:
> On Fri, 2014-08-15 at 16:07 -0500, Aaron Sierra wrote:
>> Freescale's QorIQ T Series processors support 8 IFC chip selects
>> within a memory map backward compatible with previous P Series
>> processors which supported only 4 chip selects.
>>
>> Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
>> ---
>> include/linux/fsl_ifc.h | 10 +++++-----
>> 1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/include/linux/fsl_ifc.h b/include/linux/fsl_ifc.h
>> index 84d60cb..62762ff 100644
>> --- a/include/linux/fsl_ifc.h
>> +++ b/include/linux/fsl_ifc.h
>> @@ -29,7 +29,7 @@
>> #include <linux/of_platform.h>
>> #include <linux/interrupt.h>
>>
>> -#define FSL_IFC_BANK_COUNT 4
>> +#define FSL_IFC_BANK_COUNT 8
> First please modify fsl_ifc_nand.c to limit itself to the number of
> banks it dynamically determines are present based on the IFC version.
>
>
Number of available bank/chip select are defined by SoC and it is
independent of SoC.
It should be fix in following way
Option 1:
u-boot: fix device tree with number of available chip select. It may
require IFC binding change
Linux: Read device tree and determine the Chip Selects
or
Option 2:
Make it static because any way IFC NAND driver polls to
FSL_IFC_BANK_COUNT to know NAND flash chip select. This patch is doing same.
Regards,
Prabhakar
^ permalink raw reply
* Re: [PATCH V7 00/17] Enable SRIOV on POWER8
From: Wei Yang @ 2014-08-20 3:35 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Wei Yang, Benjamin Herrenschmidt, linux-pci@vger.kernel.org,
Gavin Shan, Guo Chao, Mike Qiu, linuxppc-dev
In-Reply-To: <CAErSpo5Dm4Eu0TcvJn2fYLVd005OgJCy-yZAhqsttjbb8jwm=A@mail.gmail.com>
On Tue, Aug 19, 2014 at 10:12:27PM -0500, Bjorn Helgaas wrote:
>On Tue, Aug 19, 2014 at 9:34 PM, Wei Yang <weiyang@linux.vnet.ibm.com> wrote:
>> On Tue, Aug 19, 2014 at 03:19:42PM -0600, Bjorn Helgaas wrote:
>>>On Thu, Jul 24, 2014 at 02:22:10PM +0800, Wei Yang wrote:
>>>> This patch set enables the SRIOV on POWER8.
>>>>
>>>> The gerneral idea is put each VF into one individual PE and allocate required
>>>> resources like DMA/MSI.
>>>>
>>>> One thing special for VF PE is we use M64BT to cover the IOV BAR. M64BT is one
>>>> hardware on POWER platform to map MMIO address to PE. By using M64BT, we could
>>>> map one individual VF to a VF PE, which introduce more flexiblity to users.
>>>>
>>>> To achieve this effect, we need to do some hack on pci devices's resources.
>>>> 1. Expand the IOV BAR properly.
>>>> Done by pnv_pci_ioda_fixup_iov_resources().
>>>> 2. Shift the IOV BAR properly.
>>>> Done by pnv_pci_vf_resource_shift().
>>>> 3. IOV BAR alignment is the total size instead of an individual size on
>>>> powernv platform.
>>>> Done by pnv_pcibios_sriov_resource_alignment().
>>>> 4. Take the IOV BAR alignment into consideration in the sizing and assigning.
>>>> This is achieved by commit: "PCI: Take additional IOV BAR alignment in
>>>> sizing and assigning"
>>>>
>>>> Test Environment:
>>>> The SRIOV device tested is Emulex Lancer and Mellanox ConnectX-3 on
>>>> POWER8.
>>>>
>>>> Examples on pass through a VF to guest through vfio:
>>>> 1. install necessary modules
>>>> modprobe vfio
>>>> modprobe vfio-pci
>>>> 2. retrieve the iommu_group the device belongs to
>>>> readlink /sys/bus/pci/devices/0000:06:0d.0/iommu_group
>>>> ../../../../kernel/iommu_groups/26
>>>> This means it belongs to group 26
>>>> 3. see how many devices under this iommu_group
>>>> ls /sys/kernel/iommu_groups/26/devices/
>>>> 4. unbind the original driver and bind to vfio-pci driver
>>>> echo 0000:06:0d.0 > /sys/bus/pci/devices/0000:06:0d.0/driver/unbind
>>>> echo 1102 0002 > /sys/bus/pci/drivers/vfio-pci/new_id
>>>> Note: this should be done for each device in the same iommu_group
>>>> 5. Start qemu and pass device through vfio
>>>> /home/ywywyang/git/qemu-impreza/ppc64-softmmu/qemu-system-ppc64 \
>>>> -M pseries -m 2048 -enable-kvm -nographic \
>>>> -drive file=/home/ywywyang/kvm/fc19.img \
>>>> -monitor telnet:localhost:5435,server,nowait -boot cd \
>>>> -device "spapr-pci-vfio-host-bridge,id=CXGB3,iommu=26,index=6"
>>>>
>>>> Verify this is the exact VF response:
>>>> 1. ping from a machine in the same subnet(the broadcast domain)
>>>> 2. run arp -n on this machine
>>>> 9.115.251.20 ether 00:00:c9:df:ed:bf C eth0
>>>> 3. ifconfig in the guest
>>>> # ifconfig eth1
>>>> eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
>>>> inet 9.115.251.20 netmask 255.255.255.0 broadcast 9.115.251.255
>>>> inet6 fe80::200:c9ff:fedf:edbf prefixlen 64 scopeid 0x20<link>
>>>> ether 00:00:c9:df:ed:bf txqueuelen 1000 (Ethernet)
>>>> RX packets 175 bytes 13278 (12.9 KiB)
>>>> RX errors 0 dropped 0 overruns 0 frame 0
>>>> TX packets 58 bytes 9276 (9.0 KiB)
>>>> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
>>>> 4. They have the same MAC address
>>>>
>>>> Note: make sure you shutdown other network interfaces in guest.
>>>>
>>>> ---
>>>> v6 -> v7:
>>>> 1. add IORESOURCE_ARCH flag for IOV BAR on powernv platform.
>>>> 2. when IOV BAR has IORESOURCE_ARCH flag, the size is retrieved from
>>>> hardware directly. If not, calculate as usual.
>>>> 3. reorder the patch set, group them by subsystem:
>>>> PCI, powerpc, powernv
>>>> 4. rebase it on 3.16-rc6
>>>
>>>This doesn't apply for me on v3.16-rc6:
>>>
>>> 02:48:57 ~/linux$ stg rebase v3.16-rc6
>>> Checking for changes in the working directory ... done
>>> Rebasing to "v3.16-rc6" ... done
>>> No patches applied
>>> 02:49:14 ~/linux$ stg import -M --sign m/wy
>>> Checking for changes in the working directory ... done
>>> Importing patch "pci-iov-export-interface-for" ... done
>>> Importing patch "pci-iov-get-vf-bar-size-from" ... done
>>> Importing patch "pci-add-weak" ... done
>>> Importing patch "pci-take-additional-iov-bar" ... done
>>> Importing patch "powerpc-pci-don-t-unset-pci" ... done
>>> Importing patch "powerpc-pci-define" ... done
>>> Importing patch "powrepc-pci-refactor-pci_dn" ... done
>>> Importing patch "powerpc-powernv-use-pci_dn-in" ... error: patch failed:
>>> arch/powerpc/platforms/powernv/pci.c:376
>>> error: arch/powerpc/platforms/powernv/pci.c: patch does not apply
>>> stg import: Diff does not apply cleanly
>>>
>>>What am I missing?
>>>
>>>I assume you intend these all to go through my tree just to keep them all
>>>together. The ideal rebase target for me would be v3.17-rc1.
>>
>> Ok, I will rebase it on v3.17-rc1 upstream. While I guess the conflict is due
>> to some patches from Gavin, which is not merged at that moment. I will make
>> sure it applies to v3.17-rc1.
>
>I tried applying them on v3.16-rc6 as well as on every change to
>arch/powerpc/platforms/powernv/pci.c between v3.16-rc6 and v3.17-rc1,
>and none applied cleanly. Patches you post should be based on some
>upstream tag, not on something that includes unmerged patches.
Sorry about this, I will pay attention to this next time.
>
>Bjorn
--
Richard Yang
Help you, Help me
^ permalink raw reply
* [PATCH] powerpc: Export dcr_ind_lock to fix build error
From: Pranith Kumar @ 2014-08-20 3:24 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
Grant Likely, open list:LINUX FOR POWERPC..., open list
Fix build error caused by missing export:
ERROR: "dcr_ind_lock" [drivers/net/ethernet/ibm/emac/ibm_emac.ko] undefined!
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
arch/powerpc/sysdev/dcr.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/sysdev/dcr.c b/arch/powerpc/sysdev/dcr.c
index e9056e4..2d8a101 100644
--- a/arch/powerpc/sysdev/dcr.c
+++ b/arch/powerpc/sysdev/dcr.c
@@ -230,5 +230,6 @@ EXPORT_SYMBOL_GPL(dcr_unmap_mmio);
#ifdef CONFIG_PPC_DCR_NATIVE
DEFINE_SPINLOCK(dcr_ind_lock);
+EXPORT_SYMBOL_GPL(dcr_ind_lock);
#endif /* defined(CONFIG_PPC_DCR_NATIVE) */
--
1.9.1
^ permalink raw reply related
* Re: [PATCH V7 00/17] Enable SRIOV on POWER8
From: Bjorn Helgaas @ 2014-08-20 3:12 UTC (permalink / raw)
To: Wei Yang
Cc: Benjamin Herrenschmidt, linux-pci@vger.kernel.org, Gavin Shan,
Mike Qiu, Guo Chao, linuxppc-dev
In-Reply-To: <20140820023404.GC6904@richard>
On Tue, Aug 19, 2014 at 9:34 PM, Wei Yang <weiyang@linux.vnet.ibm.com> wrote:
> On Tue, Aug 19, 2014 at 03:19:42PM -0600, Bjorn Helgaas wrote:
>>On Thu, Jul 24, 2014 at 02:22:10PM +0800, Wei Yang wrote:
>>> This patch set enables the SRIOV on POWER8.
>>>
>>> The gerneral idea is put each VF into one individual PE and allocate required
>>> resources like DMA/MSI.
>>>
>>> One thing special for VF PE is we use M64BT to cover the IOV BAR. M64BT is one
>>> hardware on POWER platform to map MMIO address to PE. By using M64BT, we could
>>> map one individual VF to a VF PE, which introduce more flexiblity to users.
>>>
>>> To achieve this effect, we need to do some hack on pci devices's resources.
>>> 1. Expand the IOV BAR properly.
>>> Done by pnv_pci_ioda_fixup_iov_resources().
>>> 2. Shift the IOV BAR properly.
>>> Done by pnv_pci_vf_resource_shift().
>>> 3. IOV BAR alignment is the total size instead of an individual size on
>>> powernv platform.
>>> Done by pnv_pcibios_sriov_resource_alignment().
>>> 4. Take the IOV BAR alignment into consideration in the sizing and assigning.
>>> This is achieved by commit: "PCI: Take additional IOV BAR alignment in
>>> sizing and assigning"
>>>
>>> Test Environment:
>>> The SRIOV device tested is Emulex Lancer and Mellanox ConnectX-3 on
>>> POWER8.
>>>
>>> Examples on pass through a VF to guest through vfio:
>>> 1. install necessary modules
>>> modprobe vfio
>>> modprobe vfio-pci
>>> 2. retrieve the iommu_group the device belongs to
>>> readlink /sys/bus/pci/devices/0000:06:0d.0/iommu_group
>>> ../../../../kernel/iommu_groups/26
>>> This means it belongs to group 26
>>> 3. see how many devices under this iommu_group
>>> ls /sys/kernel/iommu_groups/26/devices/
>>> 4. unbind the original driver and bind to vfio-pci driver
>>> echo 0000:06:0d.0 > /sys/bus/pci/devices/0000:06:0d.0/driver/unbind
>>> echo 1102 0002 > /sys/bus/pci/drivers/vfio-pci/new_id
>>> Note: this should be done for each device in the same iommu_group
>>> 5. Start qemu and pass device through vfio
>>> /home/ywywyang/git/qemu-impreza/ppc64-softmmu/qemu-system-ppc64 \
>>> -M pseries -m 2048 -enable-kvm -nographic \
>>> -drive file=/home/ywywyang/kvm/fc19.img \
>>> -monitor telnet:localhost:5435,server,nowait -boot cd \
>>> -device "spapr-pci-vfio-host-bridge,id=CXGB3,iommu=26,index=6"
>>>
>>> Verify this is the exact VF response:
>>> 1. ping from a machine in the same subnet(the broadcast domain)
>>> 2. run arp -n on this machine
>>> 9.115.251.20 ether 00:00:c9:df:ed:bf C eth0
>>> 3. ifconfig in the guest
>>> # ifconfig eth1
>>> eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
>>> inet 9.115.251.20 netmask 255.255.255.0 broadcast 9.115.251.255
>>> inet6 fe80::200:c9ff:fedf:edbf prefixlen 64 scopeid 0x20<link>
>>> ether 00:00:c9:df:ed:bf txqueuelen 1000 (Ethernet)
>>> RX packets 175 bytes 13278 (12.9 KiB)
>>> RX errors 0 dropped 0 overruns 0 frame 0
>>> TX packets 58 bytes 9276 (9.0 KiB)
>>> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
>>> 4. They have the same MAC address
>>>
>>> Note: make sure you shutdown other network interfaces in guest.
>>>
>>> ---
>>> v6 -> v7:
>>> 1. add IORESOURCE_ARCH flag for IOV BAR on powernv platform.
>>> 2. when IOV BAR has IORESOURCE_ARCH flag, the size is retrieved from
>>> hardware directly. If not, calculate as usual.
>>> 3. reorder the patch set, group them by subsystem:
>>> PCI, powerpc, powernv
>>> 4. rebase it on 3.16-rc6
>>
>>This doesn't apply for me on v3.16-rc6:
>>
>> 02:48:57 ~/linux$ stg rebase v3.16-rc6
>> Checking for changes in the working directory ... done
>> Rebasing to "v3.16-rc6" ... done
>> No patches applied
>> 02:49:14 ~/linux$ stg import -M --sign m/wy
>> Checking for changes in the working directory ... done
>> Importing patch "pci-iov-export-interface-for" ... done
>> Importing patch "pci-iov-get-vf-bar-size-from" ... done
>> Importing patch "pci-add-weak" ... done
>> Importing patch "pci-take-additional-iov-bar" ... done
>> Importing patch "powerpc-pci-don-t-unset-pci" ... done
>> Importing patch "powerpc-pci-define" ... done
>> Importing patch "powrepc-pci-refactor-pci_dn" ... done
>> Importing patch "powerpc-powernv-use-pci_dn-in" ... error: patch failed:
>> arch/powerpc/platforms/powernv/pci.c:376
>> error: arch/powerpc/platforms/powernv/pci.c: patch does not apply
>> stg import: Diff does not apply cleanly
>>
>>What am I missing?
>>
>>I assume you intend these all to go through my tree just to keep them all
>>together. The ideal rebase target for me would be v3.17-rc1.
>
> Ok, I will rebase it on v3.17-rc1 upstream. While I guess the conflict is due
> to some patches from Gavin, which is not merged at that moment. I will make
> sure it applies to v3.17-rc1.
I tried applying them on v3.16-rc6 as well as on every change to
arch/powerpc/platforms/powernv/pci.c between v3.16-rc6 and v3.17-rc1,
and none applied cleanly. Patches you post should be based on some
upstream tag, not on something that includes unmerged patches.
Bjorn
^ permalink raw reply
* Re: [PATCH V7 04/17] PCI: Take additional IOV BAR alignment in sizing and assigning
From: Bjorn Helgaas @ 2014-08-20 3:08 UTC (permalink / raw)
To: Wei Yang; +Cc: benh, linux-pci, gwshan, qiudayu, yan, linuxppc-dev
In-Reply-To: <1406182947-11302-5-git-send-email-weiyang@linux.vnet.ibm.com>
On Thu, Jul 24, 2014 at 02:22:14PM +0800, Wei Yang wrote:
> At resource sizing/assigning stage, resources are divided into two lists,
> requested list and additional list, while the alignement of the additional
> IOV BAR is not taken into the sizeing and assigning procedure.
>
> This is reasonable in the original implementation, since IOV BAR's alignment is
> mostly the size of a PF BAR alignemt. This means the alignment is already taken
> into consideration. While this rule may be violated on some platform.
>
> This patch take the additional IOV BAR alignment in sizing and assigning stage
> explicitly.
>
> Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
> ---
> drivers/pci/setup-bus.c | 68 +++++++++++++++++++++++++++++++++++++++++------
> 1 file changed, 60 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
> index a5a63ec..d83681f 100644
> --- a/drivers/pci/setup-bus.c
> +++ b/drivers/pci/setup-bus.c
> @@ -120,6 +120,28 @@ static resource_size_t get_res_add_size(struct list_head *head,
> return 0;
> }
>
> +static resource_size_t get_res_add_align(struct list_head *head,
> + struct resource *res)
> +{
> + struct pci_dev_resource *dev_res;
> +
> + list_for_each_entry(dev_res, head, list) {
> + if (dev_res->res == res) {
> + int idx = res - &dev_res->dev->resource[0];
> +
> + dev_printk(KERN_DEBUG, &dev_res->dev->dev,
> + "res[%d]=%pR get_res_add_align min_align %llx\n",
> + idx, dev_res->res,
> + (unsigned long long)dev_res->min_align);
> +
> + return dev_res->min_align;
> + }
> + }
> +
> + return 0;
> +}
I see that you copied the structure of the existing get_res_add_size()
here. But I don't understand *that* function. It looks basically like
this:
resource_size_t get_res_add_size(list, res)
{
list_for_each_entry(dev_res, head, list) {
if (dev_res->res == res)
return dev_res->add_size;
}
return 0;
}
and we call it like this:
dev_res->res->end += get_res_add_size(realloc_head, dev_res->res);
So we start out with dev_res", pass in dev_res->res, search the
realloc_head list to find dev_res again, and return dev_res->add_size.
That looks equivalent to just:
dev_res->res->end += dev_res->add_size;
It looks like get_res_add_size() merely adds a printk and some complexity.
Am I missing something?
I do see that there are other callers where we don't actually start with
dev_res, which makes it a little more complicated. But I think you should
either add something like this:
struct pci_dev_resource *res_to_dev_res(list, res)
{
list_for_each_entry(dev_res, head, list) {
if (dev_res->res == res)
return dev_res;
}
return NULL;
}
which can be used to replace get_res_add_size() and get_res_add_align(), OR
figure out whether the dev_res of interest is always one we've just added.
If it is, maybe you can just make add_to_list() return the dev_res pointer
instead of an errno, and hang onto the pointer. I'd like that much better
if that's possible.
> +
> +
> /* Sort resources by alignment */
> static void pdev_sort_resources(struct pci_dev *dev, struct list_head *head)
> {
> @@ -368,8 +390,9 @@ static void __assign_resources_sorted(struct list_head *head,
> LIST_HEAD(save_head);
> LIST_HEAD(local_fail_head);
> struct pci_dev_resource *save_res;
> - struct pci_dev_resource *dev_res, *tmp_res;
> + struct pci_dev_resource *dev_res, *tmp_res, *dev_res2;
> unsigned long fail_type;
> + resource_size_t add_align, align;
>
> /* Check if optional add_size is there */
> if (!realloc_head || list_empty(realloc_head))
> @@ -384,10 +407,31 @@ static void __assign_resources_sorted(struct list_head *head,
> }
>
> /* Update res in head list with add_size in realloc_head list */
> - list_for_each_entry(dev_res, head, list)
> + list_for_each_entry_safe(dev_res, tmp_res, head, list) {
> dev_res->res->end += get_res_add_size(realloc_head,
> dev_res->res);
>
> + if (!(dev_res->res->flags & IORESOURCE_STARTALIGN))
> + continue;
> +
> + add_align = get_res_add_align(realloc_head, dev_res->res);
> +
> + if (add_align > dev_res->res->start) {
> + dev_res->res->start = add_align;
> + dev_res->res->end = add_align +
> + resource_size(dev_res->res);
> +
> + list_for_each_entry(dev_res2, head, list) {
> + align = pci_resource_alignment(dev_res2->dev,
> + dev_res2->res);
> + if (add_align > align)
> + list_move_tail(&dev_res->list,
> + &dev_res2->list);
> + }
> + }
> +
> + }
> +
> /* Try updated head list with add_size added */
> assign_requested_resources_sorted(head, &local_fail_head);
>
> @@ -930,6 +974,8 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
> struct resource *b_res = find_free_bus_resource(bus,
> mask | IORESOURCE_PREFETCH, type);
> resource_size_t children_add_size = 0;
> + resource_size_t children_add_align = 0;
> + resource_size_t add_align = 0;
>
> if (!b_res)
> return -ENOSPC;
> @@ -954,6 +1000,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
> /* put SRIOV requested res to the optional list */
> if (realloc_head && i >= PCI_IOV_RESOURCES &&
> i <= PCI_IOV_RESOURCE_END) {
> + add_align = max(pci_resource_alignment(dev, r), add_align);
> r->end = r->start - 1;
> add_to_list(realloc_head, dev, r, r_size, 0/* don't care */);
> children_add_size += r_size;
> @@ -984,8 +1031,11 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
> if (order > max_order)
> max_order = order;
>
> - if (realloc_head)
> + if (realloc_head) {
> children_add_size += get_res_add_size(realloc_head, r);
> + children_add_align = get_res_add_align(realloc_head, r);
> + add_align = max(add_align, children_add_align);
> + }
> }
> }
>
> @@ -996,7 +1046,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
> add_size = children_add_size;
> size1 = (!realloc_head || (realloc_head && !add_size)) ? size0 :
> calculate_memsize(size, min_size, add_size,
> - resource_size(b_res), min_align);
> + resource_size(b_res), max(min_align, add_align));
> if (!size0 && !size1) {
> if (b_res->start || b_res->end)
> dev_info(&bus->self->dev, "disabling bridge window %pR to %pR (unused)\n",
> @@ -1008,10 +1058,12 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
> b_res->end = size0 + min_align - 1;
> b_res->flags |= IORESOURCE_STARTALIGN;
> if (size1 > size0 && realloc_head) {
> - add_to_list(realloc_head, bus->self, b_res, size1-size0, min_align);
> - dev_printk(KERN_DEBUG, &bus->self->dev, "bridge window %pR to %pR add_size %llx\n",
> - b_res, &bus->busn_res,
> - (unsigned long long)size1-size0);
> + add_to_list(realloc_head, bus->self, b_res, size1-size0,
> + max(min_align, add_align));
> + dev_printk(KERN_DEBUG, &bus->self->dev, "bridge window "
> + "%pR to %pR add_size %llx add_align %llx\n", b_res,
> + &bus->busn_res, (unsigned long long)size1-size0,
> + max(min_align, add_align));
Factor out this "max(min_align, add_align)" thing so we don't have to
change these lines. Bonus points if you can also factor it out of the
calculate_memsize() call above. That one is a pretty complicated ternary
expression that should probably be turned into an "if" instead anyway.
> }
> return 0;
> }
> --
> 1.7.9.5
>
^ permalink raw reply
* Re: [PATCH v2] PC, KVM, CMA: Fix regression caused by wrong get_order() use
From: Joonsoo Kim @ 2014-08-20 2:44 UTC (permalink / raw)
To: Alexey Kardashevskiy
Cc: kvm, Gleb Natapov, Alexander Graf, kvm-ppc, linux-kernel,
Paul Mackerras, Aneesh Kumar K.V, Paolo Bonzini, linuxppc-dev
In-Reply-To: <1407992587-9164-1-git-send-email-aik@ozlabs.ru>
On Thu, Aug 14, 2014 at 03:03:07PM +1000, Alexey Kardashevskiy wrote:
> fc95ca7284bc54953165cba76c3228bd2cdb9591 claims that there is no
> functional change but this is not true as it calls get_order() (which
> takes bytes) where it should have called ilog2() and the kernel stops
> on VM_BUG_ON().
>
> This replaces get_order() with order_base_2() (round-up version of ilog2).
>
> Suggested-by: Paul Mackerras <paulus@samba.org>
> Cc: Alexander Graf <agraf@suse.de>
> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Sorry for my fault. :(
Acked-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Thanks.
^ permalink raw reply
* Re: [PATCH V7 00/17] Enable SRIOV on POWER8
From: Wei Yang @ 2014-08-20 2:34 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Wei Yang, benh, linux-pci, gwshan, yan, qiudayu, linuxppc-dev
In-Reply-To: <20140819211942.GA6295@google.com>
On Tue, Aug 19, 2014 at 03:19:42PM -0600, Bjorn Helgaas wrote:
>On Thu, Jul 24, 2014 at 02:22:10PM +0800, Wei Yang wrote:
>> This patch set enables the SRIOV on POWER8.
>>
>> The gerneral idea is put each VF into one individual PE and allocate required
>> resources like DMA/MSI.
>>
>> One thing special for VF PE is we use M64BT to cover the IOV BAR. M64BT is one
>> hardware on POWER platform to map MMIO address to PE. By using M64BT, we could
>> map one individual VF to a VF PE, which introduce more flexiblity to users.
>>
>> To achieve this effect, we need to do some hack on pci devices's resources.
>> 1. Expand the IOV BAR properly.
>> Done by pnv_pci_ioda_fixup_iov_resources().
>> 2. Shift the IOV BAR properly.
>> Done by pnv_pci_vf_resource_shift().
>> 3. IOV BAR alignment is the total size instead of an individual size on
>> powernv platform.
>> Done by pnv_pcibios_sriov_resource_alignment().
>> 4. Take the IOV BAR alignment into consideration in the sizing and assigning.
>> This is achieved by commit: "PCI: Take additional IOV BAR alignment in
>> sizing and assigning"
>>
>> Test Environment:
>> The SRIOV device tested is Emulex Lancer and Mellanox ConnectX-3 on
>> POWER8.
>>
>> Examples on pass through a VF to guest through vfio:
>> 1. install necessary modules
>> modprobe vfio
>> modprobe vfio-pci
>> 2. retrieve the iommu_group the device belongs to
>> readlink /sys/bus/pci/devices/0000:06:0d.0/iommu_group
>> ../../../../kernel/iommu_groups/26
>> This means it belongs to group 26
>> 3. see how many devices under this iommu_group
>> ls /sys/kernel/iommu_groups/26/devices/
>> 4. unbind the original driver and bind to vfio-pci driver
>> echo 0000:06:0d.0 > /sys/bus/pci/devices/0000:06:0d.0/driver/unbind
>> echo 1102 0002 > /sys/bus/pci/drivers/vfio-pci/new_id
>> Note: this should be done for each device in the same iommu_group
>> 5. Start qemu and pass device through vfio
>> /home/ywywyang/git/qemu-impreza/ppc64-softmmu/qemu-system-ppc64 \
>> -M pseries -m 2048 -enable-kvm -nographic \
>> -drive file=/home/ywywyang/kvm/fc19.img \
>> -monitor telnet:localhost:5435,server,nowait -boot cd \
>> -device "spapr-pci-vfio-host-bridge,id=CXGB3,iommu=26,index=6"
>>
>> Verify this is the exact VF response:
>> 1. ping from a machine in the same subnet(the broadcast domain)
>> 2. run arp -n on this machine
>> 9.115.251.20 ether 00:00:c9:df:ed:bf C eth0
>> 3. ifconfig in the guest
>> # ifconfig eth1
>> eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
>> inet 9.115.251.20 netmask 255.255.255.0 broadcast 9.115.251.255
>> inet6 fe80::200:c9ff:fedf:edbf prefixlen 64 scopeid 0x20<link>
>> ether 00:00:c9:df:ed:bf txqueuelen 1000 (Ethernet)
>> RX packets 175 bytes 13278 (12.9 KiB)
>> RX errors 0 dropped 0 overruns 0 frame 0
>> TX packets 58 bytes 9276 (9.0 KiB)
>> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
>> 4. They have the same MAC address
>>
>> Note: make sure you shutdown other network interfaces in guest.
>>
>> ---
>> v6 -> v7:
>> 1. add IORESOURCE_ARCH flag for IOV BAR on powernv platform.
>> 2. when IOV BAR has IORESOURCE_ARCH flag, the size is retrieved from
>> hardware directly. If not, calculate as usual.
>> 3. reorder the patch set, group them by subsystem:
>> PCI, powerpc, powernv
>> 4. rebase it on 3.16-rc6
>
>This doesn't apply for me on v3.16-rc6:
>
> 02:48:57 ~/linux$ stg rebase v3.16-rc6
> Checking for changes in the working directory ... done
> Rebasing to "v3.16-rc6" ... done
> No patches applied
> 02:49:14 ~/linux$ stg import -M --sign m/wy
> Checking for changes in the working directory ... done
> Importing patch "pci-iov-export-interface-for" ... done
> Importing patch "pci-iov-get-vf-bar-size-from" ... done
> Importing patch "pci-add-weak" ... done
> Importing patch "pci-take-additional-iov-bar" ... done
> Importing patch "powerpc-pci-don-t-unset-pci" ... done
> Importing patch "powerpc-pci-define" ... done
> Importing patch "powrepc-pci-refactor-pci_dn" ... done
> Importing patch "powerpc-powernv-use-pci_dn-in" ... error: patch failed:
> arch/powerpc/platforms/powernv/pci.c:376
> error: arch/powerpc/platforms/powernv/pci.c: patch does not apply
> stg import: Diff does not apply cleanly
>
>What am I missing?
>
>I assume you intend these all to go through my tree just to keep them all
>together. The ideal rebase target for me would be v3.17-rc1.
Ok, I will rebase it on v3.17-rc1 upstream. While I guess the conflict is due
to some patches from Gavin, which is not merged at that moment. I will make
sure it applies to v3.17-rc1.
>
>Given the arch/powerpc parts, I'll want an ack from Ben. I just chatted
>with him about these, so I assume that's not a problem, but we should make
>it explicit.
>
>Bjorn
--
Richard Yang
Help you, Help me
^ permalink raw reply
* Re: [PATCH V7 02/17] PCI/IOV: Get VF BAR size from hardware directly when platform needs
From: Wei Yang @ 2014-08-20 2:31 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Wei Yang, benh, linux-pci, gwshan, yan, qiudayu, linuxppc-dev
In-Reply-To: <20140819214459.GC6295@google.com>
On Tue, Aug 19, 2014 at 03:44:59PM -0600, Bjorn Helgaas wrote:
>On Thu, Jul 24, 2014 at 02:22:12PM +0800, Wei Yang wrote:
>> Current implementation calculates VF BAR size from dividing the total size of
>> IOV BAR by total VF number. It won't work on PowerNV platform because we're
>> going to expand IOV BAR size for finely alignment.
>>
>> The patch enforces getting IOV BAR size from hardware and then calculate
>> the VF BAR size based on that when platform wants so.
>>
>> Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
>> ---
>> drivers/pci/iov.c | 28 ++++++++++++++++++++++++----
>> include/linux/ioport.h | 1 +
>> 2 files changed, 25 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
>> index 7566238..ef1c546 100644
>> --- a/drivers/pci/iov.c
>> +++ b/drivers/pci/iov.c
>> @@ -55,6 +55,9 @@ static int virtfn_add(struct pci_dev *dev, int id, int reset)
>> struct resource *res;
>> struct pci_sriov *iov = dev->sriov;
>> struct pci_bus *bus;
>> + struct resource tmp;
>> + enum pci_bar_type type;
>> + int reg;
>>
>> mutex_lock(&iov->dev->sriov->lock);
>> bus = virtfn_add_bus(dev->bus, pci_iov_virtfn_bus(dev, id));
>> @@ -80,12 +83,29 @@ static int virtfn_add(struct pci_dev *dev, int id, int reset)
>> continue;
>> virtfn->resource[i].name = pci_name(virtfn);
>> virtfn->resource[i].flags = res->flags;
>> - size = resource_size(res);
>> - do_div(size, iov->total_VFs);
>> + /* When res has IORESOURCE_ARCH, retrieve the IOV BAR size
>> + * from hardware directly.
>> + */
>> + if (res->flags & IORESOURCE_ARCH) {
>> + reg = pci_iov_resource_bar(dev, i + PCI_IOV_RESOURCES, &type);
>> + __pci_read_base(dev, type, &tmp, reg);
>> + size = resource_size(&tmp);
>> + /* When __pci_read_base fails, flags is set to 0.
>> + * In this case, reset size to 0, which means the VF
>> + * will not be enabled.
>> + */
>> + if (!tmp.flags)
>> + size = 0;
>
>I don't like the IORESOURCE_ARCH flag because it really doesn't have any
>specific meaning. You're using it to enable some arch-specific code here
>for this specific case. But there are any number of other places that
>could do something similar, and there's no way to coordinate them all.
>
>I'd rather have some sort of pcibios_*() hook here where powerpc could
>override the default implementation.
Yep, got it. I will write a pcibios_sriov_resource_size() and override it in
powerpc arch.
>
>> + } else {
>> + size = resource_size(res);
>> + do_div(size, iov->total_VFs);
>> + }
>> virtfn->resource[i].start = res->start + size * id;
>> virtfn->resource[i].end = virtfn->resource[i].start + size - 1;
>> - rc = request_resource(res, &virtfn->resource[i]);
>> - BUG_ON(rc);
>> + if (resource_size(&virtfn->resource[i])) {
>> + rc = request_resource(res, &virtfn->resource[i]);
>> + BUG_ON(rc);
>> + }
>> }
>>
>> if (reset)
>> diff --git a/include/linux/ioport.h b/include/linux/ioport.h
>> index 5e3a906..de8b57c 100644
>> --- a/include/linux/ioport.h
>> +++ b/include/linux/ioport.h
>> @@ -48,6 +48,7 @@ struct resource {
>> #define IORESOURCE_MEM_64 0x00100000
>> #define IORESOURCE_WINDOW 0x00200000 /* forwarded by bridge */
>> #define IORESOURCE_MUXED 0x00400000 /* Resource is software muxed */
>> +#define IORESOURCE_ARCH 0x00800000 /* Resource arch tagged */
>>
>> #define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */
>> #define IORESOURCE_DISABLED 0x10000000
>> --
>> 1.7.9.5
>>
--
Richard Yang
Help you, Help me
^ permalink raw reply
* Re: [PATCH V7 01/17] PCI/IOV: Export interface for retrieve VF's BDF
From: Wei Yang @ 2014-08-20 2:25 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Wei Yang, benh, linux-pci, gwshan, yan, qiudayu, linuxppc-dev
In-Reply-To: <20140819213726.GB6295@google.com>
On Tue, Aug 19, 2014 at 03:37:26PM -0600, Bjorn Helgaas wrote:
>On Thu, Jul 24, 2014 at 02:22:11PM +0800, Wei Yang wrote:
>> When implementing the SR-IOV on PowerNV platform, some resource reservation is
>> needed for VFs which don't exist at the bootup stage. To do the match between
>> resources and VFs, the code need to get the VF's BDF in advance.
>
>Ben started explaining this whole hardware PE/VF/etc stuff to me, but it
>hasn't all sunk in yet. We need to describe it somewhere (it sounds pretty
>involved, so maybe an extended description in Documentation/ would be
>appropriate).
Yes, this is not that easy to understand the whole stuff. I'd like to write a
file in Documentation/. By scaning the directory, I am not sure which one
would be proper, the Documentation/powerpc/ would be fine?
>
>What I'm concerned about is that PCI resource assignment is a huge mess,
>and this obviously complicates it even more. That's necessary and OK, but
>I want to at least preserve the possibility that somebody could rework it
>to make it manageable, and that means we need to know what the special
>constraints of PowerNV are.
Sure, let me try my best to explain it, my English is not that good, hope it
is understandable. :-)
>
>Code question below.
>
>> In this patch, it exports the interface to retrieve VF's BDF:
>> * Make the virtfn_bus as an interface
>> * Make the virtfn_devfn as an interface
>> * rename them with more specific name
>> * code cleanup in pci_sriov_resource_alignment()
>>
>> Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
>> ---
>> drivers/pci/iov.c | 26 +++++++-------------------
>> drivers/pci/pci.h | 19 -------------------
>> include/linux/pci.h | 44 ++++++++++++++++++++++++++++++++++++++++++++
>> 3 files changed, 51 insertions(+), 38 deletions(-)
>>
>> diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
>> index cb6f247..7566238 100644
>> --- a/drivers/pci/iov.c
>> +++ b/drivers/pci/iov.c
>> @@ -19,18 +19,6 @@
>>
>> #define VIRTFN_ID_LEN 16
>>
>> -static inline u8 virtfn_bus(struct pci_dev *dev, int id)
>> -{
>> - return dev->bus->number + ((dev->devfn + dev->sriov->offset +
>> - dev->sriov->stride * id) >> 8);
>> -}
>> -
>> -static inline u8 virtfn_devfn(struct pci_dev *dev, int id)
>> -{
>> - return (dev->devfn + dev->sriov->offset +
>> - dev->sriov->stride * id) & 0xff;
>> -}
>> -
>> static struct pci_bus *virtfn_add_bus(struct pci_bus *bus, int busnr)
>> {
>> struct pci_bus *child;
>> @@ -69,7 +57,7 @@ static int virtfn_add(struct pci_dev *dev, int id, int reset)
>> struct pci_bus *bus;
>>
>> mutex_lock(&iov->dev->sriov->lock);
>> - bus = virtfn_add_bus(dev->bus, virtfn_bus(dev, id));
>> + bus = virtfn_add_bus(dev->bus, pci_iov_virtfn_bus(dev, id));
>> if (!bus)
>> goto failed;
>>
>> @@ -77,7 +65,7 @@ static int virtfn_add(struct pci_dev *dev, int id, int reset)
>> if (!virtfn)
>> goto failed0;
>>
>> - virtfn->devfn = virtfn_devfn(dev, id);
>> + virtfn->devfn = pci_iov_virtfn_devfn(dev, id);
>> virtfn->vendor = dev->vendor;
>> pci_read_config_word(dev, iov->pos + PCI_SRIOV_VF_DID, &virtfn->device);
>> pci_setup_device(virtfn);
>> @@ -140,8 +128,8 @@ static void virtfn_remove(struct pci_dev *dev, int id, int reset)
>> struct pci_sriov *iov = dev->sriov;
>>
>> virtfn = pci_get_domain_bus_and_slot(pci_domain_nr(dev->bus),
>> - virtfn_bus(dev, id),
>> - virtfn_devfn(dev, id));
>> + pci_iov_virtfn_bus(dev, id),
>> + pci_iov_virtfn_devfn(dev, id));
>> if (!virtfn)
>> return;
>>
>> @@ -216,7 +204,7 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
>> iov->offset = offset;
>> iov->stride = stride;
>>
>> - if (virtfn_bus(dev, nr_virtfn - 1) > dev->bus->busn_res.end) {
>> + if (pci_iov_virtfn_bus(dev, nr_virtfn - 1) > dev->bus->busn_res.end) {
>> dev_err(&dev->dev, "SR-IOV: bus number out of range\n");
>> return -ENOMEM;
>> }
>> @@ -516,7 +504,7 @@ resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno)
>> if (!reg)
>> return 0;
>>
>> - __pci_read_base(dev, type, &tmp, reg);
>> + __pci_read_base(dev, type, &tmp, reg);
>> return resource_alignment(&tmp);
>> }
>>
>> @@ -546,7 +534,7 @@ int pci_iov_bus_range(struct pci_bus *bus)
>> list_for_each_entry(dev, &bus->devices, bus_list) {
>> if (!dev->is_physfn)
>> continue;
>> - busnr = virtfn_bus(dev, dev->sriov->total_VFs - 1);
>> + busnr = pci_iov_virtfn_bus(dev, dev->sriov->total_VFs - 1);
>> if (busnr > max)
>> max = busnr;
>> }
>> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
>> index 0601890..a3158b2 100644
>> --- a/drivers/pci/pci.h
>> +++ b/drivers/pci/pci.h
>> @@ -221,25 +221,6 @@ static inline int pci_ari_enabled(struct pci_bus *bus)
>> void pci_reassigndev_resource_alignment(struct pci_dev *dev);
>> void pci_disable_bridge_window(struct pci_dev *dev);
>>
>> -/* Single Root I/O Virtualization */
>> -struct pci_sriov {
>> - int pos; /* capability position */
>> - int nres; /* number of resources */
>> - u32 cap; /* SR-IOV Capabilities */
>> - u16 ctrl; /* SR-IOV Control */
>> - u16 total_VFs; /* total VFs associated with the PF */
>> - u16 initial_VFs; /* initial VFs associated with the PF */
>> - u16 num_VFs; /* number of VFs available */
>> - u16 offset; /* first VF Routing ID offset */
>> - u16 stride; /* following VF stride */
>> - u32 pgsz; /* page size for BAR alignment */
>> - u8 link; /* Function Dependency Link */
>> - u16 driver_max_VFs; /* max num VFs driver supports */
>> - struct pci_dev *dev; /* lowest numbered PF */
>> - struct pci_dev *self; /* this PF */
>> - struct mutex lock; /* lock for VF bus */
>> -};
>> -
>> #ifdef CONFIG_PCI_ATS
>> void pci_restore_ats_state(struct pci_dev *dev);
>> #else
>> diff --git a/include/linux/pci.h b/include/linux/pci.h
>> index 466bcd1..194db52 100644
>> --- a/include/linux/pci.h
>> +++ b/include/linux/pci.h
>> @@ -245,6 +245,27 @@ struct pci_vpd;
>> struct pci_sriov;
>> struct pci_ats;
>>
>> +/* Single Root I/O Virtualization */
>> +struct pci_sriov {
>> + int pos; /* capability position */
>> + int nres; /* number of resources */
>> + u32 cap; /* SR-IOV Capabilities */
>> + u16 ctrl; /* SR-IOV Control */
>> + u16 total_VFs; /* total VFs associated with the PF */
>> + u16 initial_VFs; /* initial VFs associated with the PF */
>> + u16 num_VFs; /* number of VFs available */
>> + u16 offset; /* first VF Routing ID offset */
>> + u16 stride; /* following VF stride */
>> + u32 pgsz; /* page size for BAR alignment */
>> + u8 link; /* Function Dependency Link */
>> + u16 driver_max_VFs; /* max num VFs driver supports */
>> + struct pci_dev *dev; /* lowest numbered PF */
>> + struct pci_dev *self; /* this PF */
>> + struct mutex lock; /* lock for VF bus */
>> + struct work_struct mtask; /* VF Migration task */
>> + u8 __iomem *mstate; /* VF Migration State Array */
>> +};
>> +
>> /*
>> * The pci_dev structure is used to describe PCI devices.
>> */
>> @@ -1616,6 +1637,21 @@ int pci_ext_cfg_avail(void);
>> void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar);
>>
>> #ifdef CONFIG_PCI_IOV
>> +static inline int pci_iov_virtfn_bus(struct pci_dev *dev, int id)
>> +{
>> + if (!dev->is_physfn)
>> + return -EINVAL;
>> + return dev->bus->number + ((dev->devfn + dev->sriov->offset +
>> + dev->sriov->stride * id) >> 8);
>> +}
>> +static inline int pci_iov_virtfn_devfn(struct pci_dev *dev, int id)
>> +{
>> + if (!dev->is_physfn)
>> + return -EINVAL;
>> + return (dev->devfn + dev->sriov->offset +
>> + dev->sriov->stride * id) & 0xff;
>> +}
>
>Do these really need to be inline? If they weren't inline, we wouldn't
>have to move struct pci_sriov to the public header file.
>
Not necessary to be inline, I think.
I will rework it and hide pci_sriov from public.
>> +
>> int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn);
>> void pci_disable_sriov(struct pci_dev *dev);
>> int pci_num_vf(struct pci_dev *dev);
>> @@ -1623,6 +1659,14 @@ int pci_vfs_assigned(struct pci_dev *dev);
>> int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs);
>> int pci_sriov_get_totalvfs(struct pci_dev *dev);
>> #else
>> +static inline int pci_iov_virtfn_bus(struct pci_dev *dev, int id)
>> +{
>> + return -ENXIO;
>> +}
>> +static inline int pci_iov_virtfn_devfn(struct pci_dev *dev, int id)
>> +{
>> + return -ENXIO;
>> +}
>> static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
>> { return -ENODEV; }
>> static inline void pci_disable_sriov(struct pci_dev *dev) { }
>> --
>> 1.7.9.5
>>
--
Richard Yang
Help you, Help me
^ permalink raw reply
* Re: [PATCH] powerpc/eeh: fix crashing when passing VF
From: Gavin Shan @ 2014-08-20 2:07 UTC (permalink / raw)
To: Wei Yang; +Cc: linuxppc-dev, gwshan
In-Reply-To: <1408415229-16765-1-git-send-email-weiyang@linux.vnet.ibm.com>
On Tue, Aug 19, 2014 at 10:27:09AM +0800, Wei Yang wrote:
The subject would be "powerpc/eeh: Fix kernel crash when passing through VF".
>When doing vfio passthrough a VF, the kernel will crash with following
>message:
>
>[ 442.656459] Unable to handle kernel paging request for data at address 0x00000060
>[ 442.656593] Faulting instruction address: 0xc000000000038b88
>[ 442.656706] Oops: Kernel access of bad area, sig: 11 [#1]
>[ 442.656798] SMP NR_CPUS=1024 NUMA PowerNV
>[ 442.656890] Modules linked in: vfio_pci mlx4_core nf_conntrack_netbios_ns nf_conntrack_broadcast ipt_MASQUERADE ip6t_REJECT xt_conntrack bnep bluetooth rfkill ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw tg3 nfsd be2net nfs_acl ses lockd ptp enclosure pps_core kvm_hv kvm_pr shpchp binfmt_misc kvm sunrpc uinput lpfc scsi_transport_fc ipr scsi_tgt [last unloaded: mlx4_core]
>[ 442.658152] CPU: 40 PID: 14948 Comm: qemu-system-ppc Not tainted 3.10.42yw-pkvm+ #37
>[ 442.658219] task: c000000f7e2a9a00 ti: c000000f6dc3c000 task.ti: c000000f6dc3c000
>[ 442.658287] NIP: c000000000038b88 LR: c0000000004435a8 CTR: c000000000455bc0
>[ 442.658352] REGS: c000000f6dc3f580 TRAP: 0300 Not tainted (3.10.42yw-pkvm+)
>[ 442.658419] MSR: 9000000000009032 <SF,HV,EE,ME,IR,DR,RI> CR: 28004882 XER: 20000000
>[ 442.658577] CFAR: c00000000000908c DAR: 0000000000000060 DSISR: 40000000 SOFTE: 1
>GPR00: c0000000004435a8 c000000f6dc3f800 c0000000012b1c10 c00000000da24000
>GPR04: 0000000000000003 0000000000001004 00000000000015b3 000000000000ffff
>GPR08: c00000000127f5d8 0000000000000000 000000000000ffff 0000000000000000
>GPR12: c000000000068078 c00000000fdd6800 000001003c320c80 000001003c3607f0
>GPR16: 0000000000000001 00000000105480c8 000000001055aaa8 000001003c31ab18
>GPR20: 000001003c10fb40 000001003c360ae8 000000001063bcf0 000000001063bdb0
>GPR24: 000001003c15ed70 0000000010548f40 c000001fe5514c88 c000001fe5514cb0
>GPR28: c00000000da24000 0000000000000000 c00000000da24000 0000000000000003
>[ 442.659471] NIP [c000000000038b88] .pcibios_set_pcie_reset_state+0x28/0x130
>[ 442.659530] LR [c0000000004435a8] .pci_set_pcie_reset_state+0x28/0x40
>[ 442.659585] Call Trace:
>[ 442.659610] [c000000f6dc3f800] [00000000000719e0] 0x719e0 (unreliable)
>[ 442.659677] [c000000f6dc3f880] [c0000000004435a8] .pci_set_pcie_reset_state+0x28/0x40
>[ 442.659757] [c000000f6dc3f900] [c000000000455bf8] .reset_fundamental+0x38/0x80
>[ 442.659835] [c000000f6dc3f980] [c0000000004562a8] .pci_dev_specific_reset+0xa8/0xf0
>[ 442.659913] [c000000f6dc3fa00] [c0000000004448c4] .__pci_dev_reset+0x44/0x430
>[ 442.659980] [c000000f6dc3fab0] [c000000000444d5c] .pci_reset_function+0x7c/0xc0
>[ 442.660059] [c000000f6dc3fb30] [d00000001c141ab8] .vfio_pci_open+0xe8/0x2b0 [vfio_pci]
>[ 442.660139] [c000000f6dc3fbd0] [c000000000586c30] .vfio_group_fops_unl_ioctl+0x3a0/0x630
>[ 442.660219] [c000000f6dc3fc90] [c000000000255fbc] .do_vfs_ioctl+0x4ec/0x7c0
>[ 442.660286] [c000000f6dc3fd80] [c000000000256364] .SyS_ioctl+0xd4/0xf0
>[ 442.660354] [c000000f6dc3fe30] [c000000000009e54] syscall_exit+0x0/0x98
>[ 442.660420] Instruction dump:
>[ 442.660454] 4bfffce9 4bfffee4 7c0802a6 fbc1fff0 fbe1fff8 f8010010 f821ff81 7c7e1b78
>[ 442.660566] 7c9f2378 60000000 60000000 e93e02c8 <e8690060> 2fa30000 41de00c4 2b9f0002
>[ 442.660679] ---[ end trace a64ac9546bcf0328 ]---
>[ 442.660724]
>
>The reason is current VF is not EEH enabled.
>
>This patch is a quick fix for this problem.
>
>Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
With all minor comments fixed:
Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
>---
> arch/powerpc/kernel/eeh.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
>index 0ba4392..d2d2130 100644
>--- a/arch/powerpc/kernel/eeh.c
>+++ b/arch/powerpc/kernel/eeh.c
>@@ -630,7 +630,7 @@ int eeh_pci_enable(struct eeh_pe *pe, int function)
> int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state)
> {
> struct eeh_dev *edev = pci_dev_to_eeh_dev(dev);
>- struct eeh_pe *pe = edev->pe;
>+ struct eeh_pe *pe = edev ? edev->pe:NULL;
It would be:
struct eeh_pe *pe = edev ? edev->pe : NULL;
>
> if (!pe) {
> pr_err("%s: No PE found on PCI device %s\n",
Thanks,
Gavin
^ permalink raw reply
* Re: [PATCH 4/4] powerpc/fsl_msi: spread msi ints across different MSIRs
From: Scott Wood @ 2014-08-20 0:20 UTC (permalink / raw)
To: Laurentiu Tudor; +Cc: Mihai Caraman, Laurentiu Tudor, linuxppc-dev
In-Reply-To: <53F33413.3050009@freescale.com>
A couple nits that don't necessarily warrant a respin:
On Tue, 2014-08-19 at 14:25 +0300, Laurentiu Tudor wrote:
> Allocate msis such that each time a new
> interrupt is requested, the SRS (MSIR
> register select) to be used is allocated
> in a round-robin fashion.
> The end result is that the msi interrupts
> will be spread across distinct MSIRs with
> the main benefit that now users can set
> affinity to each msi int through the mpic
> irq backing up the MSIR register.
> This is achieved with the help of a newly
> introduced msi bitmap api that allows
> specifying the starting point when
> searching for a free msi interrupt.
Please wrap at around 60-70 columns.
> + } else {
> + off = (atomic_inc_return(&msi_data->msi_alloc_cnt) %
> + msi_data->msir_num);
> + off *= (1 << msi_data->srs_shift);
This is an unusual way to write "off <<= msi->data->srs_shift"...
-Scott
^ permalink raw reply
* Re: [PATCH 2/2] fsl_ifc: Support all 8 IFC chip selects
From: Scott Wood @ 2014-08-20 0:08 UTC (permalink / raw)
To: Aaron Sierra
Cc: Greg Kroah-Hartman, linuxppc-dev, Prabhakar Kushwaha,
Arnd Bergmann
In-Reply-To: <1234993482.57039.1408136876321.JavaMail.zimbra@xes-inc.com>
On Fri, 2014-08-15 at 16:07 -0500, Aaron Sierra wrote:
> Freescale's QorIQ T Series processors support 8 IFC chip selects
> within a memory map backward compatible with previous P Series
> processors which supported only 4 chip selects.
>
> Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
> ---
> include/linux/fsl_ifc.h | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/fsl_ifc.h b/include/linux/fsl_ifc.h
> index 84d60cb..62762ff 100644
> --- a/include/linux/fsl_ifc.h
> +++ b/include/linux/fsl_ifc.h
> @@ -29,7 +29,7 @@
> #include <linux/of_platform.h>
> #include <linux/interrupt.h>
>
> -#define FSL_IFC_BANK_COUNT 4
> +#define FSL_IFC_BANK_COUNT 8
First please modify fsl_ifc_nand.c to limit itself to the number of
banks it dynamically determines are present based on the IFC version.
-Scott
^ permalink raw reply
* Re: PCIe driver not working properly after upgrading to linux 3.8.13
From: Scott Wood @ 2014-08-19 23:46 UTC (permalink / raw)
To: Gokul C G; +Cc: meta-freescale, linux-pci, linuxppc-dev, djiang
In-Reply-To: <53F3629A.6060208@kalkitech.in>
On Tue, 2014-08-19 at 20:13 +0530, Gokul C G wrote:
> HI,
>
>
>
> I am facing problem with PCIE driver in new Linux kernel compiled for
> powerpc architecture (Big endian) ,freescales P2040 processor.I was
> using old kernel Linux version 3.0.48 previously and now updated to
> Linux version 3.8.13-rt9.After updating to the new kernel,
3.8.13-rt9 is also an old kernel. :-)
It is also presumably a Freescale SDK kernel (not even the most recent
one), so it would be best to stick with community.freescale.com (you
didn't follow up to my response there) or, in the case of problems with
third party code you've added on to the SDK kernel, the support channels
of whoever provided you with the software.
> PCIe device drivers not working properly and i am getting some error
> messages in the boot-up .My intention is to use EXAR PCIe Multiport
> serial driver and add 8 serial ports in addition to 4 built in serial
> ports provided by P2040 processor. The PCIe driver form EXAR is
> compiled and loaded as kernel module . The same was working with
> linux kernel 3.0.48 and following prints observed while loading kernel
> module.
>
>
> linux 3.0.48 ,working insmod log
>
>
> ========================
>
>
>
>
> Exar PCIe (XR17V35x) serial driver Revision: 1.2
I don't see this driver in the kernel tree. We can't help you with code
we can't see. Are you sure that the driver is expected to work with
3.8? Have you tried debugging it and/or contacting Exar for support
with their driver?
> PCI: Probing PCI hardware
>
> fsl-pci ffe201000.pcie: PCI host bridge to bus 0000:00
>
> pci_bus 0000:00: root bus resource [io 0x0000-0xffff]
>
> pci_bus 0000:00: root bus resource [mem 0xc20000000-0xc3fffffff] (bus
> address [0xe0000000-0xffffffff])
>
> pci_bus 0000:00: root bus resource [bus 00-ff]
>
> PCIE error(s) detected
>
> PCIE ERR_DR register: 0x80020000
>
> PCIE ERR_CAP_STAT register: 0x80000001
>
> PCIE ERR_CAP_R0 register: 0x00000800
>
> pci 0000:00:00.0: PCI bridge to [bus 01-ff]
>
> PCIE ERR_CAP_R1 register: 0x00000000
>
> PCIE ERR_CAP_R2 register: 0x00000000
>
> PCIE ERR_CAP_R3 register: 0x00000000
>
> PCI: Cannot allocate resource region 0 of device 0000:00:00.0, will
> remap
>
> pci 0000:00:00.0: BAR 0: can't assign mem (size 0x1000000)
>
> pci 0000:00:00.0: BAR 9: can't assign mem pref (size 0x200000)
>
> pci 0000:00:00.0: PCI bridge to [bus 01]
>
> pci 0000:00:00.0: bridge window [io 0x0000-0xffff]
>
> pci 0000:00:00.0: bridge window [mem 0xc20000000-0xc3fffffff]
>
>
>
I get very similar errors on Freescale's SDK 1.5 kernel (based on
v3.8.13-rt9), and it doesn't stop a PCIe network card from working. So
I wouldn't focus too much on these errors.
-Scott
^ permalink raw reply
* [PATCH 4/4] powerpc: Move htab_remove_mapping function prototype into header file
From: Anton Blanchard @ 2014-08-19 22:55 UTC (permalink / raw)
To: benh, paulus, mpe; +Cc: linuxppc-dev
In-Reply-To: <1408488921-19187-1-git-send-email-anton@samba.org>
A recent patch added a function prototype for htab_remove_mapping in
c code. Fix it.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/include/asm/mmu-hash64.h | 2 ++
arch/powerpc/mm/init_64.c | 3 ---
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/include/asm/mmu-hash64.h b/arch/powerpc/include/asm/mmu-hash64.h
index d765144..92bc3a6 100644
--- a/arch/powerpc/include/asm/mmu-hash64.h
+++ b/arch/powerpc/include/asm/mmu-hash64.h
@@ -342,6 +342,8 @@ extern void hash_failure_debug(unsigned long ea, unsigned long access,
extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
unsigned long pstart, unsigned long prot,
int psize, int ssize);
+int htab_remove_mapping(unsigned long vstart, unsigned long vend,
+ int psize, int ssize);
extern void add_gpage(u64 addr, u64 page_size, unsigned long number_of_pages);
extern void demote_segment_4k(struct mm_struct *mm, unsigned long addr);
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index 253b4b9..3481556 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -233,9 +233,6 @@ static void __meminit vmemmap_create_mapping(unsigned long start,
}
#ifdef CONFIG_MEMORY_HOTPLUG
-extern int htab_remove_mapping(unsigned long vstart, unsigned long vend,
- int psize, int ssize);
-
static void vmemmap_remove_mapping(unsigned long start,
unsigned long page_size)
{
--
1.9.1
^ permalink raw reply related
* [PATCH 3/4] powerpc: Remove stale function prototypes
From: Anton Blanchard @ 2014-08-19 22:55 UTC (permalink / raw)
To: benh, paulus, mpe; +Cc: linuxppc-dev
In-Reply-To: <1408488921-19187-1-git-send-email-anton@samba.org>
There were a number of prototypes for functions that no longer
exist. Remove them.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/include/asm/bug.h | 1 -
arch/powerpc/include/asm/hydra.h | 1 -
arch/powerpc/include/asm/irq.h | 5 -----
arch/powerpc/include/asm/kexec.h | 1 -
arch/powerpc/include/asm/page_64.h | 1 -
arch/powerpc/include/asm/pgtable-ppc32.h | 2 --
arch/powerpc/include/asm/prom.h | 2 --
arch/powerpc/include/asm/rio.h | 1 -
arch/powerpc/include/asm/tsi108.h | 4 ----
arch/powerpc/include/asm/udbg.h | 1 -
arch/powerpc/platforms/pseries/lpar.c | 2 --
11 files changed, 21 deletions(-)
diff --git a/arch/powerpc/include/asm/bug.h b/arch/powerpc/include/asm/bug.h
index 3eb53d7..3a39283 100644
--- a/arch/powerpc/include/asm/bug.h
+++ b/arch/powerpc/include/asm/bug.h
@@ -133,7 +133,6 @@ extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long);
extern void bad_page_fault(struct pt_regs *, unsigned long, int);
extern void _exception(int, struct pt_regs *, int, unsigned long);
extern void die(const char *, struct pt_regs *, long);
-extern void print_backtrace(unsigned long *);
#endif /* !__ASSEMBLY__ */
diff --git a/arch/powerpc/include/asm/hydra.h b/arch/powerpc/include/asm/hydra.h
index 5b0c98bd..1cb39c9 100644
--- a/arch/powerpc/include/asm/hydra.h
+++ b/arch/powerpc/include/asm/hydra.h
@@ -95,7 +95,6 @@ extern volatile struct Hydra __iomem *Hydra;
#define HYDRA_INT_SPARE 19
extern int hydra_init(void);
-extern void macio_adb_init(void);
#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h
index 41f13ce..e8e3a0a 100644
--- a/arch/powerpc/include/asm/irq.h
+++ b/arch/powerpc/include/asm/irq.h
@@ -31,11 +31,6 @@ extern atomic_t ppc_n_lost_interrupts;
extern irq_hw_number_t virq_to_hw(unsigned int virq);
-/**
- * irq_early_init - Init irq remapping subsystem
- */
-extern void irq_early_init(void);
-
static __inline__ int irq_canonicalize(int irq)
{
return irq;
diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h
index 16d7e33..19c36cb 100644
--- a/arch/powerpc/include/asm/kexec.h
+++ b/arch/powerpc/include/asm/kexec.h
@@ -81,7 +81,6 @@ extern void default_machine_crash_shutdown(struct pt_regs *regs);
extern int crash_shutdown_register(crash_shutdown_t handler);
extern int crash_shutdown_unregister(crash_shutdown_t handler);
-extern void machine_kexec_simple(struct kimage *image);
extern void crash_kexec_secondary(struct pt_regs *regs);
extern int overlaps_crashkernel(unsigned long start, unsigned long size);
extern void reserve_crashkernel(void);
diff --git a/arch/powerpc/include/asm/page_64.h b/arch/powerpc/include/asm/page_64.h
index 88693ce..d0d6afb 100644
--- a/arch/powerpc/include/asm/page_64.h
+++ b/arch/powerpc/include/asm/page_64.h
@@ -104,7 +104,6 @@ extern unsigned long slice_get_unmapped_area(unsigned long addr,
extern unsigned int get_slice_psize(struct mm_struct *mm,
unsigned long addr);
-extern void slice_init_context(struct mm_struct *mm, unsigned int psize);
extern void slice_set_user_psize(struct mm_struct *mm, unsigned int psize);
extern void slice_set_range_psize(struct mm_struct *mm, unsigned long start,
unsigned long len, unsigned int psize);
diff --git a/arch/powerpc/include/asm/pgtable-ppc32.h b/arch/powerpc/include/asm/pgtable-ppc32.h
index 47edde8..622672f 100644
--- a/arch/powerpc/include/asm/pgtable-ppc32.h
+++ b/arch/powerpc/include/asm/pgtable-ppc32.h
@@ -8,8 +8,6 @@
#include <linux/threads.h>
#include <asm/io.h> /* For sub-arch specific PPC_PIN_SIZE */
-extern unsigned long va_to_phys(unsigned long address);
-extern pte_t *va_to_pte(unsigned long address);
extern unsigned long ioremap_bot;
#ifdef CONFIG_44x
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h
index 74b79f0..7f436ba 100644
--- a/arch/powerpc/include/asm/prom.h
+++ b/arch/powerpc/include/asm/prom.h
@@ -76,8 +76,6 @@ void of_parse_dma_window(struct device_node *dn, const __be32 *dma_window,
unsigned long *busno, unsigned long *phys,
unsigned long *size);
-extern void kdump_move_device_tree(void);
-
extern void of_instantiate_rtc(void);
extern int of_get_ibm_chip_id(struct device_node *np);
diff --git a/arch/powerpc/include/asm/rio.h b/arch/powerpc/include/asm/rio.h
index b1d2dec..ec800f2 100644
--- a/arch/powerpc/include/asm/rio.h
+++ b/arch/powerpc/include/asm/rio.h
@@ -13,7 +13,6 @@
#ifndef ASM_PPC_RIO_H
#define ASM_PPC_RIO_H
-extern void platform_rio_init(void);
#ifdef CONFIG_FSL_RIO
extern int fsl_rio_mcheck_exception(struct pt_regs *);
#else
diff --git a/arch/powerpc/include/asm/tsi108.h b/arch/powerpc/include/asm/tsi108.h
index f8b6079..d531d9e 100644
--- a/arch/powerpc/include/asm/tsi108.h
+++ b/arch/powerpc/include/asm/tsi108.h
@@ -84,10 +84,6 @@
extern u32 tsi108_pci_cfg_base;
/* Exported functions */
-extern int tsi108_bridge_init(struct pci_controller *hose, uint phys_csr_base);
-extern unsigned long tsi108_get_mem_size(void);
-extern unsigned long tsi108_get_cpu_clk(void);
-extern unsigned long tsi108_get_sdc_clk(void);
extern int tsi108_direct_write_config(struct pci_bus *bus, unsigned int devfn,
int offset, int len, u32 val);
extern int tsi108_direct_read_config(struct pci_bus *bus, unsigned int devfn,
diff --git a/arch/powerpc/include/asm/udbg.h b/arch/powerpc/include/asm/udbg.h
index b51fba1..78f2675 100644
--- a/arch/powerpc/include/asm/udbg.h
+++ b/arch/powerpc/include/asm/udbg.h
@@ -52,7 +52,6 @@ extern void __init udbg_init_44x_as1(void);
extern void __init udbg_init_40x_realmode(void);
extern void __init udbg_init_cpm(void);
extern void __init udbg_init_usbgecko(void);
-extern void __init udbg_init_wsp(void);
extern void __init udbg_init_memcons(void);
extern void __init udbg_init_ehv_bc(void);
extern void __init udbg_init_ps3gelic(void);
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 34e6423..6affea7 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -59,8 +59,6 @@ EXPORT_SYMBOL(plpar_hcall);
EXPORT_SYMBOL(plpar_hcall9);
EXPORT_SYMBOL(plpar_hcall_norets);
-extern void pSeries_find_serial_port(void);
-
void vpa_init(int cpu)
{
int hwcpu = get_hard_smp_processor_id(cpu);
--
1.9.1
^ permalink raw reply related
* [PATCH 2/4] powerpc: Ensure global functions include their prototype
From: Anton Blanchard @ 2014-08-19 22:55 UTC (permalink / raw)
To: benh, paulus, mpe; +Cc: linuxppc-dev
In-Reply-To: <1408488921-19187-1-git-send-email-anton@samba.org>
Fix a number of places where global functions were not including
their prototype. This ensures the prototype and the function match.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/kernel/smp.c | 1 +
arch/powerpc/mm/slice.c | 2 ++
arch/powerpc/oprofile/backtrace.c | 1 +
arch/powerpc/platforms/powernv/subcore.c | 1 +
arch/powerpc/platforms/pseries/dlpar.c | 1 +
arch/powerpc/platforms/pseries/hotplug-memory.c | 1 +
arch/powerpc/platforms/pseries/pci.c | 1 +
7 files changed, 8 insertions(+)
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index a0738af..4866d5d 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -52,6 +52,7 @@
#endif
#include <asm/vdso.h>
#include <asm/debug.h>
+#include <asm/kexec.h>
#ifdef DEBUG
#include <asm/udbg.h>
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index b0c75cc..86f6a75 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -30,9 +30,11 @@
#include <linux/err.h>
#include <linux/spinlock.h>
#include <linux/export.h>
+#include <linux/hugetlb.h>
#include <asm/mman.h>
#include <asm/mmu.h>
#include <asm/spu.h>
+#include <asm/hugetlb.h>
/* some sanity checks */
#if (PGTABLE_RANGE >> 43) > SLICE_MASK_SIZE
diff --git a/arch/powerpc/oprofile/backtrace.c b/arch/powerpc/oprofile/backtrace.c
index f75301f..6adf55f 100644
--- a/arch/powerpc/oprofile/backtrace.c
+++ b/arch/powerpc/oprofile/backtrace.c
@@ -12,6 +12,7 @@
#include <asm/processor.h>
#include <asm/uaccess.h>
#include <asm/compat.h>
+#include <asm/oprofile_impl.h>
#define STACK_SP(STACK) *(STACK)
diff --git a/arch/powerpc/platforms/powernv/subcore.c b/arch/powerpc/platforms/powernv/subcore.c
index 894ecb3..c87f96b 100644
--- a/arch/powerpc/platforms/powernv/subcore.c
+++ b/arch/powerpc/platforms/powernv/subcore.c
@@ -24,6 +24,7 @@
#include <asm/smp.h>
#include "subcore.h"
+#include "powernv.h"
/*
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index d37ba4f..86f3136 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -17,6 +17,7 @@
#include <linux/slab.h>
#include <linux/of.h>
#include "offline_states.h"
+#include "pseries.h"
#include <asm/prom.h>
#include <asm/machdep.h>
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 24abc5c..6169497 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -20,6 +20,7 @@
#include <asm/machdep.h>
#include <asm/prom.h>
#include <asm/sparsemem.h>
+#include "pseries.h"
unsigned long pseries_memory_block_size(void)
{
diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c
index c413ec1..67e4859 100644
--- a/arch/powerpc/platforms/pseries/pci.c
+++ b/arch/powerpc/platforms/pseries/pci.c
@@ -29,6 +29,7 @@
#include <asm/pci-bridge.h>
#include <asm/prom.h>
#include <asm/ppc-pci.h>
+#include "pseries.h"
#if 0
void pcibios_name_device(struct pci_dev *dev)
--
1.9.1
^ permalink raw reply related
* [PATCH 1/4] powerpc: Make a bunch of things static
From: Anton Blanchard @ 2014-08-19 22:55 UTC (permalink / raw)
To: benh, paulus, mpe; +Cc: linuxppc-dev
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/kernel/hw_breakpoint.c | 2 +-
arch/powerpc/kernel/nvram_64.c | 2 +-
arch/powerpc/kernel/pci-common.c | 2 +-
arch/powerpc/kernel/pci_of_scan.c | 2 +-
arch/powerpc/kernel/prom.c | 5 +++--
arch/powerpc/kernel/ptrace.c | 2 +-
arch/powerpc/kernel/rtasd.c | 2 +-
arch/powerpc/kernel/time.c | 4 ++--
arch/powerpc/lib/feature-fixups.c | 2 +-
arch/powerpc/mm/hash_utils_64.c | 2 +-
arch/powerpc/mm/pgtable.c | 2 +-
arch/powerpc/perf/core-book3s.c | 18 +++++++++---------
arch/powerpc/platforms/powernv/eeh-ioda.c | 4 ++--
arch/powerpc/platforms/powernv/pci-ioda.c | 6 +++---
arch/powerpc/platforms/powernv/setup.c | 2 +-
arch/powerpc/platforms/powernv/smp.c | 2 +-
arch/powerpc/platforms/pseries/dlpar.c | 4 ++--
arch/powerpc/platforms/pseries/nvram.c | 12 +++++++-----
arch/powerpc/platforms/pseries/ras.c | 2 +-
arch/powerpc/platforms/pseries/setup.c | 2 +-
arch/powerpc/sysdev/mpic.c | 2 +-
arch/powerpc/sysdev/msi_bitmap.c | 6 +++---
22 files changed, 45 insertions(+), 42 deletions(-)
diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c
index 0bb5918..1f7d84e 100644
--- a/arch/powerpc/kernel/hw_breakpoint.c
+++ b/arch/powerpc/kernel/hw_breakpoint.c
@@ -293,7 +293,7 @@ out:
/*
* Handle single-step exceptions following a DABR hit.
*/
-int __kprobes single_step_dabr_instruction(struct die_args *args)
+static int __kprobes single_step_dabr_instruction(struct die_args *args)
{
struct pt_regs *regs = args->regs;
struct perf_event *bp = NULL;
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index 28b898e..34f7c9b 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -567,7 +567,7 @@ static int __init nvram_init(void)
return rc;
}
-void __exit nvram_cleanup(void)
+static void __exit nvram_cleanup(void)
{
misc_deregister( &nvram_dev );
}
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index b2814e2..bd84771 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1140,7 +1140,7 @@ static int reparent_resources(struct resource *parent,
* as well.
*/
-void pcibios_allocate_bus_resources(struct pci_bus *bus)
+static void pcibios_allocate_bus_resources(struct pci_bus *bus)
{
struct pci_bus *b;
int i;
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
index 44562aa..e6245e9 100644
--- a/arch/powerpc/kernel/pci_of_scan.c
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -38,7 +38,7 @@ static u32 get_int_prop(struct device_node *np, const char *name, u32 def)
* @addr0: value of 1st cell of a device tree PCI address.
* @bridge: Set this flag if the address is from a bridge 'ranges' property
*/
-unsigned int pci_parse_of_flags(u32 addr0, int bridge)
+static unsigned int pci_parse_of_flags(u32 addr0, int bridge)
{
unsigned int flags = 0;
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 1a3b105..6d8c4cb 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -386,8 +386,9 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
return 0;
}
-int __init early_init_dt_scan_chosen_ppc(unsigned long node, const char *uname,
- int depth, void *data)
+static int __init early_init_dt_scan_chosen_ppc(unsigned long node,
+ const char *uname,
+ int depth, void *data)
{
const unsigned long *lprop; /* All these set by kernel, so no need to convert endian */
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 2e3d2bf..cdb404e 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -932,7 +932,7 @@ void ptrace_triggered(struct perf_event *bp,
}
#endif /* CONFIG_HAVE_HW_BREAKPOINT */
-int ptrace_set_debugreg(struct task_struct *task, unsigned long addr,
+static int ptrace_set_debugreg(struct task_struct *task, unsigned long addr,
unsigned long data)
{
#ifdef CONFIG_HAVE_HW_BREAKPOINT
diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c
index e736387..5a2c049 100644
--- a/arch/powerpc/kernel/rtasd.c
+++ b/arch/powerpc/kernel/rtasd.c
@@ -286,7 +286,7 @@ static void prrn_work_fn(struct work_struct *work)
static DECLARE_WORK(prrn_work, prrn_work_fn);
-void prrn_schedule_update(u32 scope)
+static void prrn_schedule_update(u32 scope)
{
flush_work(&prrn_work);
prrn_update_scope = scope;
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 368ab37..f6b3430 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -479,7 +479,7 @@ void arch_irq_work_raise(void)
#endif /* CONFIG_IRQ_WORK */
-void __timer_interrupt(void)
+static void __timer_interrupt(void)
{
struct pt_regs *regs = get_irq_regs();
u64 *next_tb = &__get_cpu_var(decrementers_next_tb);
@@ -643,7 +643,7 @@ static int __init get_freq(char *name, int cells, unsigned long *val)
return found;
}
-void start_cpu_decrementer(void)
+static void start_cpu_decrementer(void)
{
#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
/* Clear any pending timer interrupts */
diff --git a/arch/powerpc/lib/feature-fixups.c b/arch/powerpc/lib/feature-fixups.c
index 7a8a748..7ce3870 100644
--- a/arch/powerpc/lib/feature-fixups.c
+++ b/arch/powerpc/lib/feature-fixups.c
@@ -164,7 +164,7 @@ static long calc_offset(struct fixup_entry *entry, unsigned int *p)
return (unsigned long)p - (unsigned long)entry;
}
-void test_basic_patching(void)
+static void test_basic_patching(void)
{
extern unsigned int ftr_fixup_test1;
extern unsigned int end_ftr_fixup_test1;
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index daee7f4..18df45f 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -867,7 +867,7 @@ unsigned int hash_page_do_lazy_icache(unsigned int pp, pte_t pte, int trap)
}
#ifdef CONFIG_PPC_MM_SLICES
-unsigned int get_paca_psize(unsigned long addr)
+static unsigned int get_paca_psize(unsigned long addr)
{
u64 lpsizes;
unsigned char *hpsizes;
diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c
index c695943..c90e602 100644
--- a/arch/powerpc/mm/pgtable.c
+++ b/arch/powerpc/mm/pgtable.c
@@ -48,7 +48,7 @@ static inline int pte_looks_normal(pte_t pte)
(_PAGE_PRESENT | _PAGE_USER);
}
-struct page * maybe_pte_to_page(pte_t pte)
+static struct page *maybe_pte_to_page(pte_t pte)
{
unsigned long pfn = pte_pfn(pte);
struct page *page;
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index b7cd00b..a6995d4 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -59,9 +59,9 @@ struct cpu_hw_events {
struct perf_branch_entry bhrb_entries[BHRB_MAX_ENTRIES];
};
-DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events);
+static DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events);
-struct power_pmu *ppmu;
+static struct power_pmu *ppmu;
/*
* Normally, to ignore kernel events we set the FCS (freeze counters
@@ -124,7 +124,7 @@ static unsigned long ebb_switch_in(bool ebb, struct cpu_hw_events *cpuhw)
static inline void power_pmu_bhrb_enable(struct perf_event *event) {}
static inline void power_pmu_bhrb_disable(struct perf_event *event) {}
-void power_pmu_flush_branch_stack(void) {}
+static void power_pmu_flush_branch_stack(void) {}
static inline void power_pmu_bhrb_read(struct cpu_hw_events *cpuhw) {}
static void pmao_restore_workaround(bool ebb) { }
#endif /* CONFIG_PPC32 */
@@ -375,7 +375,7 @@ static void power_pmu_bhrb_disable(struct perf_event *event)
/* Called from ctxsw to prevent one process's branch entries to
* mingle with the other process's entries during context switch.
*/
-void power_pmu_flush_branch_stack(void)
+static void power_pmu_flush_branch_stack(void)
{
if (ppmu->bhrb_nr)
power_pmu_bhrb_reset();
@@ -408,7 +408,7 @@ static __u64 power_pmu_bhrb_to(u64 addr)
}
/* Processing BHRB entries */
-void power_pmu_bhrb_read(struct cpu_hw_events *cpuhw)
+static void power_pmu_bhrb_read(struct cpu_hw_events *cpuhw)
{
u64 val;
u64 addr;
@@ -1573,7 +1573,7 @@ static void power_pmu_stop(struct perf_event *event, int ef_flags)
* Set the flag to make pmu::enable() not perform the
* schedulability test, it will be performed at commit time
*/
-void power_pmu_start_txn(struct pmu *pmu)
+static void power_pmu_start_txn(struct pmu *pmu)
{
struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
@@ -1587,7 +1587,7 @@ void power_pmu_start_txn(struct pmu *pmu)
* Clear the flag and pmu::enable() will perform the
* schedulability test.
*/
-void power_pmu_cancel_txn(struct pmu *pmu)
+static void power_pmu_cancel_txn(struct pmu *pmu)
{
struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
@@ -1600,7 +1600,7 @@ void power_pmu_cancel_txn(struct pmu *pmu)
* Perform the group schedulability test as a whole
* Return 0 if success
*/
-int power_pmu_commit_txn(struct pmu *pmu)
+static int power_pmu_commit_txn(struct pmu *pmu)
{
struct cpu_hw_events *cpuhw;
long i, n;
@@ -1888,7 +1888,7 @@ ssize_t power_events_sysfs_show(struct device *dev,
return sprintf(page, "event=0x%02llx\n", pmu_attr->id);
}
-struct pmu power_pmu = {
+static struct pmu power_pmu = {
.pmu_enable = power_pmu_enable,
.pmu_disable = power_pmu_disable,
.event_init = power_pmu_event_init,
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c
index c945bed..df5c2cc 100644
--- a/arch/powerpc/platforms/powernv/eeh-ioda.c
+++ b/arch/powerpc/platforms/powernv/eeh-ioda.c
@@ -628,8 +628,8 @@ static int ioda_eeh_reset(struct eeh_pe *pe, int option)
* Retrieve error log, which contains log from device driver
* and firmware.
*/
-int ioda_eeh_get_log(struct eeh_pe *pe, int severity,
- char *drv_log, unsigned long len)
+static int ioda_eeh_get_log(struct eeh_pe *pe, int severity,
+ char *drv_log, unsigned long len)
{
pnv_pci_dump_phb_diag_data(pe->phb, pe->data);
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index df241b1..4441bfa 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -385,7 +385,7 @@ static void pnv_ioda_freeze_pe(struct pnv_phb *phb, int pe_no)
}
}
-int pnv_ioda_unfreeze_pe(struct pnv_phb *phb, int pe_no, int opt)
+static int pnv_ioda_unfreeze_pe(struct pnv_phb *phb, int pe_no, int opt)
{
struct pnv_ioda_pe *pe, *slave;
s64 rc;
@@ -1631,8 +1631,8 @@ static void pnv_pci_ioda_shutdown(struct pnv_phb *phb)
OPAL_ASSERT_RESET);
}
-void __init pnv_pci_init_ioda_phb(struct device_node *np,
- u64 hub_id, int ioda_type)
+static void __init pnv_pci_init_ioda_phb(struct device_node *np,
+ u64 hub_id, int ioda_type)
{
struct pci_controller *hose;
struct pnv_phb *phb;
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
index 5a0e2dc..bb1fc9b 100644
--- a/arch/powerpc/platforms/powernv/setup.c
+++ b/arch/powerpc/platforms/powernv/setup.c
@@ -307,7 +307,7 @@ static int __init pnv_probe(void)
* Returns the cpu frequency for 'cpu' in Hz. This is used by
* /proc/cpuinfo
*/
-unsigned long pnv_get_proc_freq(unsigned int cpu)
+static unsigned long pnv_get_proc_freq(unsigned int cpu)
{
unsigned long ret_freq;
diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c
index 5fcfcf4..b73adc5 100644
--- a/arch/powerpc/platforms/powernv/smp.c
+++ b/arch/powerpc/platforms/powernv/smp.c
@@ -54,7 +54,7 @@ static void pnv_smp_setup_cpu(int cpu)
#endif
}
-int pnv_smp_kick_cpu(int nr)
+static int pnv_smp_kick_cpu(int nr)
{
unsigned int pcpu = get_hard_smp_processor_id(nr);
unsigned long start_here =
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index a2450b8..d37ba4f 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -312,7 +312,7 @@ int dlpar_detach_node(struct device_node *dn)
#define ISOLATE 0
#define UNISOLATE 1
-int dlpar_acquire_drc(u32 drc_index)
+static int dlpar_acquire_drc(u32 drc_index)
{
int dr_status, rc;
@@ -334,7 +334,7 @@ int dlpar_acquire_drc(u32 drc_index)
return 0;
}
-int dlpar_release_drc(u32 drc_index)
+static int dlpar_release_drc(u32 drc_index)
{
int dr_status, rc;
diff --git a/arch/powerpc/platforms/pseries/nvram.c b/arch/powerpc/platforms/pseries/nvram.c
index 0cc240b..11a3b61 100644
--- a/arch/powerpc/platforms/pseries/nvram.c
+++ b/arch/powerpc/platforms/pseries/nvram.c
@@ -276,8 +276,10 @@ static ssize_t pSeries_nvram_get_size(void)
* sequence #: The unique sequence # for each event. (until it wraps)
* error log: The error log from event_scan
*/
-int nvram_write_os_partition(struct nvram_os_partition *part, char * buff,
- int length, unsigned int err_type, unsigned int error_log_cnt)
+static int nvram_write_os_partition(struct nvram_os_partition *part,
+ char *buff, int length,
+ unsigned int err_type,
+ unsigned int error_log_cnt)
{
int rc;
loff_t tmp_index;
@@ -330,9 +332,9 @@ int nvram_write_error_log(char * buff, int length,
*
* Reads nvram partition for at most 'length'
*/
-int nvram_read_partition(struct nvram_os_partition *part, char *buff,
- int length, unsigned int *err_type,
- unsigned int *error_log_cnt)
+static int nvram_read_partition(struct nvram_os_partition *part, char *buff,
+ int length, unsigned int *err_type,
+ unsigned int *error_log_cnt)
{
int rc;
loff_t tmp_index;
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
index dff05b9..5a4d0fc 100644
--- a/arch/powerpc/platforms/pseries/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -126,7 +126,7 @@ struct epow_errorlog {
#define EPOW_MAIN_ENCLOSURE 5
#define EPOW_POWER_OFF 7
-void rtas_parse_epow_errlog(struct rtas_error_log *log)
+static void rtas_parse_epow_errlog(struct rtas_error_log *log)
{
struct pseries_errorlog *pseries_log;
struct epow_errorlog *epow_log;
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index cfe8a63..bbe0e91 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -562,7 +562,7 @@ void pSeries_coalesce_init(void)
* fw_cmo_feature_init - FW_FEATURE_CMO is not stored in ibm,hypertas-functions,
* handle that here. (Stolen from parse_system_parameter_string)
*/
-void pSeries_cmo_feature_init(void)
+static void pSeries_cmo_feature_init(void)
{
char *ptr, *key, *value, *end;
int call_status;
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index be33c97..89cec0e 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -960,7 +960,7 @@ void mpic_set_vector(unsigned int virq, unsigned int vector)
mpic_irq_write(src, MPIC_INFO(IRQ_VECTOR_PRI), vecpri);
}
-void mpic_set_destination(unsigned int virq, unsigned int cpuid)
+static void mpic_set_destination(unsigned int virq, unsigned int cpuid)
{
struct mpic *mpic = mpic_from_irq(virq);
unsigned int src = virq_to_hw(virq);
diff --git a/arch/powerpc/sysdev/msi_bitmap.c b/arch/powerpc/sysdev/msi_bitmap.c
index 2ff6302..a7c7a9f 100644
--- a/arch/powerpc/sysdev/msi_bitmap.c
+++ b/arch/powerpc/sysdev/msi_bitmap.c
@@ -143,7 +143,7 @@ void msi_bitmap_free(struct msi_bitmap *bmp)
#define check(x) \
if (!(x)) printk("msi_bitmap: test failed at line %d\n", __LINE__);
-void __init test_basics(void)
+static void __init test_basics(void)
{
struct msi_bitmap bmp;
int i, size = 512;
@@ -188,7 +188,7 @@ void __init test_basics(void)
kfree(bmp.bitmap);
}
-void __init test_of_node(void)
+static void __init test_of_node(void)
{
u32 prop_data[] = { 10, 10, 25, 3, 40, 1, 100, 100, 200, 20 };
const char *expected_str = "0-9,20-24,28-39,41-99,220-255";
@@ -236,7 +236,7 @@ void __init test_of_node(void)
kfree(bmp.bitmap);
}
-int __init msi_bitmap_selftest(void)
+static int __init msi_bitmap_selftest(void)
{
printk(KERN_DEBUG "Running MSI bitmap self-tests ...\n");
--
1.9.1
^ permalink raw reply related
* Re: [PATCH] powerpc: Make 256k pages depend on PPC32=n
From: Scott Wood @ 2014-08-19 22:30 UTC (permalink / raw)
To: Pranith Kumar; +Cc: Paul Mackerras, open list:LINUX FOR POWERPC..., open list
In-Reply-To: <CAJhHMCAA3rLkszp=Fk9mC81f9+qe8JU_TB6RG3rzdnmpR07jJA@mail.gmail.com>
On Tue, 2014-08-19 at 18:23 -0400, Pranith Kumar wrote:
> On Tue, Aug 19, 2014 at 6:19 PM, Scott Wood <scottwood@freescale.com> wrote:
>
> >> config PPC_256K_PAGES
> >> bool "256k page size" if 44x
> >> - depends on !STDBINUTILS
> >> + depends on !PPC32 && !STDBINUTILS
> >> help
> >> Make the page size 256k.
> >>
> >
> > How will this ever be selected then? 44x is 32-bit only.
>
> Indeed. I am actually confused about the error which is being thrown
> here. The operand (65536) is actually within the range. Any suggestions
> on how to fix this?
It's not within range of "li". I wonder if whatever non-"STD" binutils
this is supposed to be used with is rewriting it into an lis
instruction. This sort of external dependency is a poor fit for the
randconfig concept (plus, shouldn't the symbol be indicating what
binutils you're supposed to have rather than anything that isn't
"standard"?).
In any case, you could use something like LOAD_REG_IMMEDIATE().
-Scott
^ permalink raw reply
* Re: [PATCH] powerpc: Make 256k pages depend on PPC32=n
From: Pranith Kumar @ 2014-08-19 22:23 UTC (permalink / raw)
To: Scott Wood; +Cc: Paul Mackerras, open list:LINUX FOR POWERPC..., open list
In-Reply-To: <1408486751.4058.37.camel@snotra.buserror.net>
On Tue, Aug 19, 2014 at 6:19 PM, Scott Wood <scottwood@freescale.com> wrote:
>> config PPC_256K_PAGES
>> bool "256k page size" if 44x
>> - depends on !STDBINUTILS
>> + depends on !PPC32 && !STDBINUTILS
>> help
>> Make the page size 256k.
>>
>
> How will this ever be selected then? 44x is 32-bit only.
Indeed. I am actually confused about the error which is being thrown
here. The operand (65536) is actually within the range. Any suggestions
on how to fix this?
--
Pranith
^ permalink raw reply
* Re: [PATCH] powerpc: Make 256k pages depend on PPC32=n
From: Scott Wood @ 2014-08-19 22:19 UTC (permalink / raw)
To: Pranith Kumar; +Cc: Paul Mackerras, open list:LINUX FOR POWERPC..., open list
In-Reply-To: <1408484166-20711-1-git-send-email-bobby.prani@gmail.com>
On Tue, 2014-08-19 at 17:36 -0400, Pranith Kumar wrote:
> 256k pages are not tested on PPC32. On a randconfig I got the following error:
>
> arch/powerpc/kernel/misc_32.S:1171: Error: operand out of range (0x0000000000010000 is not between 0xffffffffffff8000 and 0x0000000000007fff)
>
> Disable 256K pages if PPC32=y
>
> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
> ---
> arch/powerpc/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index da16ffe..6cc518f 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -556,7 +556,7 @@ config PPC_64K_PAGES
>
> config PPC_256K_PAGES
> bool "256k page size" if 44x
> - depends on !STDBINUTILS
> + depends on !PPC32 && !STDBINUTILS
> help
> Make the page size 256k.
>
How will this ever be selected then? 44x is 32-bit only.
-Scott
^ permalink raw reply
* [PATCH 6/6] powerpc: Separate ppc32 symbol exports into ppc_ksyms_32.c
From: Anton Blanchard @ 2014-08-19 22:00 UTC (permalink / raw)
To: benh, paulus, mpe; +Cc: linuxppc-dev
In-Reply-To: <1408485605-10490-1-git-send-email-anton@samba.org>
Simplify things considerably by moving all the ppc32 specific
symbol exports into its own file.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/kernel/Makefile | 3 +
arch/powerpc/kernel/ppc_ksyms.c | 123 +++++--------------------------------
arch/powerpc/kernel/ppc_ksyms_32.c | 61 ++++++++++++++++++
3 files changed, 79 insertions(+), 108 deletions(-)
create mode 100644 arch/powerpc/kernel/ppc_ksyms_32.c
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 670c312..502cf69 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -93,6 +93,9 @@ obj-$(CONFIG_PPC32) += entry_32.o setup_32.o
obj-$(CONFIG_PPC64) += dma-iommu.o iommu.o
obj-$(CONFIG_KGDB) += kgdb.o
obj-$(CONFIG_MODULES) += ppc_ksyms.o
+ifeq ($(CONFIG_PPC32),y)
+obj-$(CONFIG_MODULES) += ppc_ksyms_32.o
+endif
obj-$(CONFIG_BOOTX_TEXT) += btext.o
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_KPROBES) += kprobes.o
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index aba41f3..c4dfff6 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -1,135 +1,42 @@
-#include <linux/export.h>
-#include <linux/threads.h>
-#include <linux/smp.h>
-#include <linux/sched.h>
-#include <linux/elfcore.h>
-#include <linux/string.h>
-#include <linux/interrupt.h>
-#include <linux/vt_kern.h>
-#include <linux/nvram.h>
-#include <linux/irq.h>
-#include <linux/pci.h>
-#include <linux/delay.h>
-#include <linux/bitops.h>
+#include <linux/ftrace.h>
+#include <linux/mm.h>
-#include <asm/page.h>
#include <asm/processor.h>
-#include <asm/cacheflush.h>
-#include <asm/uaccess.h>
-#include <asm/io.h>
-#include <linux/atomic.h>
-#include <asm/checksum.h>
-#include <asm/pgtable.h>
-#include <asm/tlbflush.h>
-#include <linux/adb.h>
-#include <linux/cuda.h>
-#include <linux/pmu.h>
-#include <asm/prom.h>
-#include <asm/pci-bridge.h>
-#include <asm/irq.h>
-#include <asm/pmac_feature.h>
-#include <asm/dma.h>
-#include <asm/machdep.h>
-#include <asm/hw_irq.h>
-#include <asm/nvram.h>
-#include <asm/mmu_context.h>
-#include <asm/backlight.h>
-#include <asm/time.h>
-#include <asm/cputable.h>
-#include <asm/btext.h>
-#include <asm/div64.h>
-#include <asm/signal.h>
-#include <asm/dcr.h>
-#include <asm/ftrace.h>
#include <asm/switch_to.h>
+#include <asm/cacheflush.h>
#include <asm/epapr_hcalls.h>
-#ifdef CONFIG_PPC32
-EXPORT_SYMBOL(clear_pages);
-EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
-EXPORT_SYMBOL(DMA_MODE_READ);
-EXPORT_SYMBOL(DMA_MODE_WRITE);
-#endif
+EXPORT_SYMBOL(flush_dcache_range);
+EXPORT_SYMBOL(flush_icache_range);
+
+EXPORT_SYMBOL(empty_zero_page);
+
+long long __bswapdi2(long long);
+EXPORT_SYMBOL(__bswapdi2);
#ifdef CONFIG_FUNCTION_TRACER
EXPORT_SYMBOL(_mcount);
#endif
-#if defined(CONFIG_PCI) && defined(CONFIG_PPC32)
-EXPORT_SYMBOL(isa_io_base);
-EXPORT_SYMBOL(isa_mem_base);
-EXPORT_SYMBOL(pci_dram_offset);
-#endif /* CONFIG_PCI */
-
#ifdef CONFIG_PPC_FPU
EXPORT_SYMBOL(giveup_fpu);
EXPORT_SYMBOL(load_fp_state);
EXPORT_SYMBOL(store_fp_state);
#endif
+
#ifdef CONFIG_ALTIVEC
EXPORT_SYMBOL(giveup_altivec);
EXPORT_SYMBOL(load_vr_state);
EXPORT_SYMBOL(store_vr_state);
-#endif /* CONFIG_ALTIVEC */
-#ifdef CONFIG_VSX
-EXPORT_SYMBOL_GPL(__giveup_vsx);
-#endif /* CONFIG_VSX */
-#ifdef CONFIG_SPE
-EXPORT_SYMBOL(giveup_spe);
-#endif /* CONFIG_SPE */
-
-#ifndef CONFIG_PPC64
-EXPORT_SYMBOL(flush_instruction_cache);
-#endif
-EXPORT_SYMBOL(flush_dcache_range);
-EXPORT_SYMBOL(flush_icache_range);
-
-#ifdef CONFIG_SMP
-#ifdef CONFIG_PPC32
-EXPORT_SYMBOL(smp_hw_index);
-#endif
-#endif
-
-#ifdef CONFIG_PPC32
-long long __ashrdi3(long long, int);
-long long __ashldi3(long long, int);
-long long __lshrdi3(long long, int);
-EXPORT_SYMBOL(__ashrdi3);
-EXPORT_SYMBOL(__ashldi3);
-EXPORT_SYMBOL(__lshrdi3);
-int __ucmpdi2(unsigned long long, unsigned long long);
-EXPORT_SYMBOL(__ucmpdi2);
-int __cmpdi2(long long, long long);
-EXPORT_SYMBOL(__cmpdi2);
-#endif
-long long __bswapdi2(long long);
-EXPORT_SYMBOL(__bswapdi2);
-
-#ifdef CONFIG_PPC32
-EXPORT_SYMBOL(timer_interrupt);
-EXPORT_SYMBOL(tb_ticks_per_jiffy);
#endif
-#ifdef CONFIG_PPC32
-EXPORT_SYMBOL(switch_mmu_context);
+#ifdef CONFIG_VSX
+EXPORT_SYMBOL_GPL(__giveup_vsx);
#endif
-#ifdef CONFIG_PPC_STD_MMU_32
-extern long mol_trampoline;
-EXPORT_SYMBOL(mol_trampoline); /* For MOL */
-EXPORT_SYMBOL(flush_hash_pages); /* For MOL */
-#ifdef CONFIG_SMP
-extern int mmu_hash_lock;
-EXPORT_SYMBOL(mmu_hash_lock); /* For MOL */
-#endif /* CONFIG_SMP */
-extern long *intercept_table;
-EXPORT_SYMBOL(intercept_table);
-#endif /* CONFIG_PPC_STD_MMU_32 */
-#ifdef CONFIG_PPC_DCR_NATIVE
-EXPORT_SYMBOL(__mtdcr);
-EXPORT_SYMBOL(__mfdcr);
+#ifdef CONFIG_SPE
+EXPORT_SYMBOL(giveup_spe);
#endif
-EXPORT_SYMBOL(empty_zero_page);
#ifdef CONFIG_EPAPR_PARAVIRT
EXPORT_SYMBOL(epapr_hypercall_start);
diff --git a/arch/powerpc/kernel/ppc_ksyms_32.c b/arch/powerpc/kernel/ppc_ksyms_32.c
new file mode 100644
index 0000000..30ddd8a
--- /dev/null
+++ b/arch/powerpc/kernel/ppc_ksyms_32.c
@@ -0,0 +1,61 @@
+#include <linux/export.h>
+#include <linux/smp.h>
+
+#include <asm/page.h>
+#include <asm/dma.h>
+#include <asm/io.h>
+#include <asm/hw_irq.h>
+#include <asm/time.h>
+#include <asm/mmu_context.h>
+#include <asm/pgtable.h>
+#include <asm/dcr.h>
+
+EXPORT_SYMBOL(clear_pages);
+EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
+EXPORT_SYMBOL(DMA_MODE_READ);
+EXPORT_SYMBOL(DMA_MODE_WRITE);
+
+#if defined(CONFIG_PCI)
+EXPORT_SYMBOL(isa_io_base);
+EXPORT_SYMBOL(isa_mem_base);
+EXPORT_SYMBOL(pci_dram_offset);
+#endif
+
+#ifdef CONFIG_SMP
+EXPORT_SYMBOL(smp_hw_index);
+#endif
+
+long long __ashrdi3(long long, int);
+long long __ashldi3(long long, int);
+long long __lshrdi3(long long, int);
+int __ucmpdi2(unsigned long long, unsigned long long);
+int __cmpdi2(long long, long long);
+EXPORT_SYMBOL(__ashrdi3);
+EXPORT_SYMBOL(__ashldi3);
+EXPORT_SYMBOL(__lshrdi3);
+EXPORT_SYMBOL(__ucmpdi2);
+EXPORT_SYMBOL(__cmpdi2);
+
+EXPORT_SYMBOL(timer_interrupt);
+EXPORT_SYMBOL(tb_ticks_per_jiffy);
+
+EXPORT_SYMBOL(switch_mmu_context);
+
+#ifdef CONFIG_PPC_STD_MMU_32
+extern long mol_trampoline;
+EXPORT_SYMBOL(mol_trampoline); /* For MOL */
+EXPORT_SYMBOL(flush_hash_pages); /* For MOL */
+#ifdef CONFIG_SMP
+extern int mmu_hash_lock;
+EXPORT_SYMBOL(mmu_hash_lock); /* For MOL */
+#endif /* CONFIG_SMP */
+extern long *intercept_table;
+EXPORT_SYMBOL(intercept_table);
+#endif /* CONFIG_PPC_STD_MMU_32 */
+
+#ifdef CONFIG_PPC_DCR_NATIVE
+EXPORT_SYMBOL(__mtdcr);
+EXPORT_SYMBOL(__mfdcr);
+#endif
+
+EXPORT_SYMBOL(flush_instruction_cache);
--
1.9.1
^ permalink raw reply related
* [PATCH 5/6] powerpc: Move lib symbol exports into arch/powerpc/lib/ppc_ksyms.c
From: Anton Blanchard @ 2014-08-19 22:00 UTC (permalink / raw)
To: benh, paulus, mpe; +Cc: linuxppc-dev
In-Reply-To: <1408485605-10490-1-git-send-email-anton@samba.org>
Move the lib symbol exports closer to their function definitions
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/kernel/ppc_ksyms.c | 32 --------------------------------
arch/powerpc/lib/Makefile | 2 +-
arch/powerpc/lib/ppc_ksyms.c | 39 +++++++++++++++++++++++++++++++++++++++
3 files changed, 40 insertions(+), 33 deletions(-)
create mode 100644 arch/powerpc/lib/ppc_ksyms.c
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index ab4f0bc..aba41f3 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -55,24 +55,6 @@ EXPORT_SYMBOL(DMA_MODE_WRITE);
EXPORT_SYMBOL(_mcount);
#endif
-EXPORT_SYMBOL(strcpy);
-EXPORT_SYMBOL(strncpy);
-EXPORT_SYMBOL(strcat);
-EXPORT_SYMBOL(strlen);
-EXPORT_SYMBOL(strcmp);
-EXPORT_SYMBOL(strncmp);
-
-#ifndef CONFIG_GENERIC_CSUM
-EXPORT_SYMBOL(csum_partial);
-EXPORT_SYMBOL(csum_partial_copy_generic);
-EXPORT_SYMBOL(ip_fast_csum);
-EXPORT_SYMBOL(csum_tcpudp_magic);
-#endif
-
-EXPORT_SYMBOL(__copy_tofrom_user);
-EXPORT_SYMBOL(__clear_user);
-EXPORT_SYMBOL(copy_page);
-
#if defined(CONFIG_PCI) && defined(CONFIG_PPC32)
EXPORT_SYMBOL(isa_io_base);
EXPORT_SYMBOL(isa_mem_base);
@@ -122,17 +104,10 @@ EXPORT_SYMBOL(__cmpdi2);
#endif
long long __bswapdi2(long long);
EXPORT_SYMBOL(__bswapdi2);
-EXPORT_SYMBOL(memcpy);
-EXPORT_SYMBOL(memset);
-EXPORT_SYMBOL(memmove);
-EXPORT_SYMBOL(memcmp);
-EXPORT_SYMBOL(memchr);
#ifdef CONFIG_PPC32
EXPORT_SYMBOL(timer_interrupt);
EXPORT_SYMBOL(tb_ticks_per_jiffy);
-EXPORT_SYMBOL(cacheable_memcpy);
-EXPORT_SYMBOL(cacheable_memzero);
#endif
#ifdef CONFIG_PPC32
@@ -156,13 +131,6 @@ EXPORT_SYMBOL(__mfdcr);
#endif
EXPORT_SYMBOL(empty_zero_page);
-#ifdef CONFIG_PPC64
-EXPORT_SYMBOL(__arch_hweight8);
-EXPORT_SYMBOL(__arch_hweight16);
-EXPORT_SYMBOL(__arch_hweight32);
-EXPORT_SYMBOL(__arch_hweight64);
-#endif
-
#ifdef CONFIG_EPAPR_PARAVIRT
EXPORT_SYMBOL(epapr_hypercall_start);
#endif
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 59fa2de..9f342f1 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -10,7 +10,7 @@ CFLAGS_REMOVE_code-patching.o = -pg
CFLAGS_REMOVE_feature-fixups.o = -pg
obj-y := string.o alloc.o \
- crtsavres.o
+ crtsavres.o ppc_ksyms.o
obj-$(CONFIG_PPC32) += div64.o copy_32.o
obj-$(CONFIG_HAS_IOMEM) += devres.o
diff --git a/arch/powerpc/lib/ppc_ksyms.c b/arch/powerpc/lib/ppc_ksyms.c
new file mode 100644
index 0000000..f993959
--- /dev/null
+++ b/arch/powerpc/lib/ppc_ksyms.c
@@ -0,0 +1,39 @@
+#include <linux/string.h>
+#include <linux/uaccess.h>
+#include <linux/bitops.h>
+#include <net/checksum.h>
+
+EXPORT_SYMBOL(memcpy);
+EXPORT_SYMBOL(memset);
+EXPORT_SYMBOL(memmove);
+EXPORT_SYMBOL(memcmp);
+EXPORT_SYMBOL(memchr);
+#ifdef CONFIG_PPC32
+EXPORT_SYMBOL(cacheable_memcpy);
+EXPORT_SYMBOL(cacheable_memzero);
+#endif
+
+EXPORT_SYMBOL(strcpy);
+EXPORT_SYMBOL(strncpy);
+EXPORT_SYMBOL(strcat);
+EXPORT_SYMBOL(strlen);
+EXPORT_SYMBOL(strcmp);
+EXPORT_SYMBOL(strncmp);
+
+#ifndef CONFIG_GENERIC_CSUM
+EXPORT_SYMBOL(csum_partial);
+EXPORT_SYMBOL(csum_partial_copy_generic);
+EXPORT_SYMBOL(ip_fast_csum);
+EXPORT_SYMBOL(csum_tcpudp_magic);
+#endif
+
+EXPORT_SYMBOL(__copy_tofrom_user);
+EXPORT_SYMBOL(__clear_user);
+EXPORT_SYMBOL(copy_page);
+
+#ifdef CONFIG_PPC64
+EXPORT_SYMBOL(__arch_hweight8);
+EXPORT_SYMBOL(__arch_hweight16);
+EXPORT_SYMBOL(__arch_hweight32);
+EXPORT_SYMBOL(__arch_hweight64);
+#endif
--
1.9.1
^ permalink raw reply related
* [PATCH 4/6] powerpc: Remove unused 32bit symbol exports
From: Anton Blanchard @ 2014-08-19 22:00 UTC (permalink / raw)
To: benh, paulus, mpe; +Cc: linuxppc-dev
In-Reply-To: <1408485605-10490-1-git-send-email-anton@samba.org>
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/kernel/ppc_ksyms.c | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index 4a42a1f..ab4f0bc 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -45,26 +45,10 @@
#include <asm/epapr_hcalls.h>
#ifdef CONFIG_PPC32
-extern void transfer_to_handler(void);
-extern void do_IRQ(struct pt_regs *regs);
-extern void machine_check_exception(struct pt_regs *regs);
-extern void alignment_exception(struct pt_regs *regs);
-extern void program_check_exception(struct pt_regs *regs);
-extern void single_step_exception(struct pt_regs *regs);
-extern int sys_sigreturn(struct pt_regs *regs);
-
EXPORT_SYMBOL(clear_pages);
EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
EXPORT_SYMBOL(DMA_MODE_READ);
EXPORT_SYMBOL(DMA_MODE_WRITE);
-
-EXPORT_SYMBOL(transfer_to_handler);
-EXPORT_SYMBOL(do_IRQ);
-EXPORT_SYMBOL(machine_check_exception);
-EXPORT_SYMBOL(alignment_exception);
-EXPORT_SYMBOL(program_check_exception);
-EXPORT_SYMBOL(single_step_exception);
-EXPORT_SYMBOL(sys_sigreturn);
#endif
#ifdef CONFIG_FUNCTION_TRACER
--
1.9.1
^ permalink raw reply related
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