* Re: [PATCH] powerpc: platform: cell: spufs: Change return type to vm_fault_t
From: Matthew Wilcox @ 2018-04-18 19:38 UTC (permalink / raw)
To: Souptick Joarder
Cc: Jeremy Kerr, Arnd Bergmann, benh, paulus, mpe, linuxppc-dev
In-Reply-To: <CAFqt6zY7Yzzh+iFfc0FmD9mzvCj3C67cqZQ3+xDU6D7+jGDRuw@mail.gmail.com>
On Thu, Apr 19, 2018 at 01:03:43AM +0530, Souptick Joarder wrote:
> On Thu, Apr 19, 2018 at 12:57 AM, Matthew Wilcox <willy@infradead.org> wrote:
> > On Thu, Apr 19, 2018 at 12:34:15AM +0530, Souptick Joarder wrote:
> >> > Re-reading spufs_ps_fault(), I wouldn't change anything inside it. Just
> >> > change its return type to vm_fault_t and call it done.
> >>
> >> In that case, return value of spufs_wait() has to changed
> >> to VM_FAULT_ type and we end with changing all the
> >> references where spufs_wait() is called. I think we shouldn't
> >> go with that approach. That's the reason I introduce inline
> >> vmf_handle_error() and convert err to VM_FAULT_ type.
> >
> > No, don't change the type of 'ret' or spufs_wait. Just do this:
> >
> > -static int spufs_ps_fault(struct vm_fault *vmf,
> > +static vm_fault_t spufs_ps_fault(struct vm_fault *vmf,
> > unsigned long ps_offs,
> > unsigned long ps_size)
> >
>
> Agree. but vm_insert_pfn should be replaced with new
> vmf_insert_pfn, right ?
Oh, right, sorry, I missed that.
So something like this:
-static int spufs_ps_fault(struct vm_fault *vmf,
+static vm_fault_t spufs_ps_fault(struct vm_fault *vmf,
unsigned long ps_offs,
unsigned long ps_size)
{
struct spu_context *ctx = vmf->vma->vm_file->private_data;
unsigned long area, offset = vmf->pgoff << PAGE_SHIFT;
- int ret = 0;
+ int err = 0;
+ vm_fault_t ret = VM_FAULT_NOPAGE;
spu_context_nospu_trace(spufs_ps_fault__enter, ctx);
@@ -349,21 +350,22 @@ static int spufs_ps_fault(struct vm_fault *vmf,
if (ctx->state == SPU_STATE_SAVED) {
up_read(¤t->mm->mmap_sem);
spu_context_nospu_trace(spufs_ps_fault__sleep, ctx);
- ret = spufs_wait(ctx->run_wq, ctx->state == SPU_STATE_RUNNABLE);
+ err = spufs_wait(ctx->run_wq, ctx->state == SPU_STATE_RUNNABLE);
spu_context_trace(spufs_ps_fault__wake, ctx, ctx->spu);
down_read(¤t->mm->mmap_sem);
} else {
area = ctx->spu->problem_phys + ps_offs;
- vm_insert_pfn(vmf->vma, vmf->address, (area + offset) >> PAGE_SHIFT);
+ ret = vmf_insert_pfn(vmf->vma, vmf->address,
+ (area + offset) >> PAGE_SHIFT);
spu_context_trace(spufs_ps_fault__insert, ctx, ctx->spu);
}
- if (!ret)
+ if (!err)
spu_release(ctx);
refault:
put_spu_context(ctx);
- return VM_FAULT_NOPAGE;
+ return ret;
}
^ permalink raw reply
* Re: [PATCH] powerpc: platform: cell: spufs: Change return type to vm_fault_t
From: Souptick Joarder @ 2018-04-18 19:33 UTC (permalink / raw)
To: Matthew Wilcox
Cc: Jeremy Kerr, Arnd Bergmann, benh, paulus, mpe, linuxppc-dev
In-Reply-To: <20180418192732.GD30953@bombadil.infradead.org>
On Thu, Apr 19, 2018 at 12:57 AM, Matthew Wilcox <willy@infradead.org> wrote:
> On Thu, Apr 19, 2018 at 12:34:15AM +0530, Souptick Joarder wrote:
>> > Re-reading spufs_ps_fault(), I wouldn't change anything inside it. Just
>> > change its return type to vm_fault_t and call it done.
>>
>> In that case, return value of spufs_wait() has to changed
>> to VM_FAULT_ type and we end with changing all the
>> references where spufs_wait() is called. I think we shouldn't
>> go with that approach. That's the reason I introduce inline
>> vmf_handle_error() and convert err to VM_FAULT_ type.
>
> No, don't change the type of 'ret' or spufs_wait. Just do this:
>
> -static int spufs_ps_fault(struct vm_fault *vmf,
> +static vm_fault_t spufs_ps_fault(struct vm_fault *vmf,
> unsigned long ps_offs,
> unsigned long ps_size)
>
Agree. but vm_insert_pfn should be replaced with new
vmf_insert_pfn, right ?
^ permalink raw reply
* Re: [PATCH] powerpc: platform: cell: spufs: Change return type to vm_fault_t
From: Matthew Wilcox @ 2018-04-18 19:27 UTC (permalink / raw)
To: Souptick Joarder
Cc: Jeremy Kerr, Arnd Bergmann, benh, paulus, mpe, linuxppc-dev
In-Reply-To: <CAFqt6zbhHm7s=_N8QOh-+qcw=dbyx-qgq3ajp3OmGLGYANO0ww@mail.gmail.com>
On Thu, Apr 19, 2018 at 12:34:15AM +0530, Souptick Joarder wrote:
> > Re-reading spufs_ps_fault(), I wouldn't change anything inside it. Just
> > change its return type to vm_fault_t and call it done.
>
> In that case, return value of spufs_wait() has to changed
> to VM_FAULT_ type and we end with changing all the
> references where spufs_wait() is called. I think we shouldn't
> go with that approach. That's the reason I introduce inline
> vmf_handle_error() and convert err to VM_FAULT_ type.
No, don't change the type of 'ret' or spufs_wait. Just do this:
-static int spufs_ps_fault(struct vm_fault *vmf,
+static vm_fault_t spufs_ps_fault(struct vm_fault *vmf,
unsigned long ps_offs,
unsigned long ps_size)
^ permalink raw reply
* [PATCH] kvm: Change return type to vm_fault_t
From: Souptick Joarder @ 2018-04-18 19:19 UTC (permalink / raw)
To: jhogan, ralf, paulus, benh, mpe, borntraeger, frankja, david,
cohuck, schwidefsky, pbonzini, tglx, mingo, christoffer.dall,
marc.zyngier
Cc: linux-mips, linux-kernel, kvm-ppc, linuxppc-dev, linux-s390, kvm,
linux-arm-kernel, kvmarm, willy
Use new return type vm_fault_t for fault handler. For
now, this is just documenting that the function returns
a VM_FAULT value rather than an errno. Once all instances
are converted, vm_fault_t will become a distinct type.
commit 1c8f422059ae ("mm: change return type to vm_fault_t")
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
---
arch/mips/kvm/mips.c | 2 +-
arch/powerpc/kvm/powerpc.c | 2 +-
arch/s390/kvm/kvm-s390.c | 2 +-
arch/x86/kvm/x86.c | 2 +-
include/linux/kvm_host.h | 2 +-
virt/kvm/arm/arm.c | 2 +-
virt/kvm/kvm_main.c | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c
index 2549fdd..03e0e0f 100644
--- a/arch/mips/kvm/mips.c
+++ b/arch/mips/kvm/mips.c
@@ -1076,7 +1076,7 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
return -ENOIOCTLCMD;
}
-int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)
+vm_fault_t kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)
{
return VM_FAULT_SIGBUS;
}
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 403e642..3099dee 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -1825,7 +1825,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
return r;
}
-int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)
+vm_fault_t kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)
{
return VM_FAULT_SIGBUS;
}
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index ba4c709..24af487 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -3941,7 +3941,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
return r;
}
-int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)
+vm_fault_t kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)
{
#ifdef CONFIG_KVM_S390_UCONTROL
if ((vmf->pgoff == KVM_S390_SIE_PAGE_OFFSET)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index c8a0b54..95d8102 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3827,7 +3827,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
return r;
}
-int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)
+vm_fault_t kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)
{
return VM_FAULT_SIGBUS;
}
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index ac0062b..8eeb062 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -736,7 +736,7 @@ long kvm_arch_dev_ioctl(struct file *filp,
unsigned int ioctl, unsigned long arg);
long kvm_arch_vcpu_ioctl(struct file *filp,
unsigned int ioctl, unsigned long arg);
-int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf);
+vm_fault_t kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf);
int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext);
diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c
index 86941f6..6c8cc31 100644
--- a/virt/kvm/arm/arm.c
+++ b/virt/kvm/arm/arm.c
@@ -163,7 +163,7 @@ int kvm_arch_create_vcpu_debugfs(struct kvm_vcpu *vcpu)
return 0;
}
-int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)
+vm_fault_t kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)
{
return VM_FAULT_SIGBUS;
}
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 4501e65..45eb54b 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -2341,7 +2341,7 @@ void kvm_vcpu_on_spin(struct kvm_vcpu *me, bool yield_to_kernel_mode)
}
EXPORT_SYMBOL_GPL(kvm_vcpu_on_spin);
-static int kvm_vcpu_fault(struct vm_fault *vmf)
+static vm_fault_t kvm_vcpu_fault(struct vm_fault *vmf)
{
struct kvm_vcpu *vcpu = vmf->vma->vm_file->private_data;
struct page *page;
--
1.9.1
^ permalink raw reply related
* Re: [PATCH] powerpc: platform: cell: spufs: Change return type to vm_fault_t
From: Souptick Joarder @ 2018-04-18 19:04 UTC (permalink / raw)
To: Matthew Wilcox
Cc: Jeremy Kerr, Arnd Bergmann, benh, paulus, mpe, linuxppc-dev
In-Reply-To: <20180417204712.GB3603@bombadil.infradead.org>
On Wed, Apr 18, 2018 at 2:17 AM, Matthew Wilcox <willy@infradead.org> wrote:
> On Wed, Apr 18, 2018 at 12:50:38AM +0530, Souptick Joarder wrote:
>> Use new return type vm_fault_t for fault handler. For
>> now, this is just documenting that the function returns
>> a VM_FAULT value rather than an errno. Once all instances
>> are converted, vm_fault_t will become a distinct type.
>>
>> Reference id -> 1c8f422059ae ("mm: change return type to
>> vm_fault_t")
>>
>> Previously vm_insert_pfn() returns err but driver returns
>> VM_FAULT_NOPAGE as default. The new function vmf_insert_pfn()
>> will replace this inefficiency by returning correct VM_FAULT_*
>> type.
>>
>> vmf_handle_error is a inline wrapper function which
>> will convert error number to vm_fault_t type err.
>
> I think you sent the wrong version of this one ...
>
> The commit message should mention that we're fixing a minor bug, that
> the error from vm_insert_pfn() was being ignored and the effect of this
> is likely to be only felt in OOM situations.
Ok, I will add this.
>
>> @@ -256,11 +257,11 @@ static ssize_t spufs_attr_write(struct file *file, const char __user *buf,
>> vma->vm_page_prot = pgprot_noncached_wc(vma->vm_page_prot);
>> pfn = (ctx->spu->local_store_phys + offset) >> PAGE_SHIFT;
>> }
>> - vm_insert_pfn(vma, vmf->address, pfn);
>> + ret = vmf_insert_pfn(vma, vmf->address, pfn);
>>
>> spu_release(ctx);
>>
>> - return VM_FAULT_NOPAGE;
>> + return ret;
>> }
>
> I thought I said not to introduce vmf_handle_error(), because it's too
> trivial and obfuscates what's actually going on.
>
>> -static int spufs_ps_fault(struct vm_fault *vmf,
>> +static inline vm_fault_t vmf_handle_error(int err)
>> +{
>> + return VM_FAULT_NOPAGE;
>> +}
>> +
>
> Re-reading spufs_ps_fault(), I wouldn't change anything inside it. Just
> change its return type to vm_fault_t and call it done.
In that case, return value of spufs_wait() has to changed
to VM_FAULT_ type and we end with changing all the
references where spufs_wait() is called. I think we shouldn't
go with that approach. That's the reason I introduce inline
vmf_handle_error() and convert err to VM_FAULT_ type.
^ permalink raw reply
* Re: [RFC PATCH 0/3] Dealing with the aliases of SI_USER
From: Eric W. Biederman @ 2018-04-18 17:58 UTC (permalink / raw)
To: Linus Torvalds
Cc: Dave Martin, Linux Kernel Mailing List, Dmitry V. Levin,
sparclinux, ppc-dev, linux-arm-kernel, Russell King - ARM Linux,
linux-arch
In-Reply-To: <CA+55aFw1gmfFH1o+oWMo4TnU5hEczAOiY1g=eMxqYZmy9JqDYw@mail.gmail.com>
Linus Torvalds <torvalds@linux-foundation.org> writes:
> (
>
> On Sun, Apr 15, 2018 at 8:56 AM, Eric W. Biederman
> <ebiederm@xmission.com> wrote:
[snip bit about wanting what is effectively force_sig_fault instead of
clear_siginfo everywhere]
> The other thing we should do is to get rid of the stupid padding.
> Right now "struct siginfo" is pointlessly padded to 128 bytes. That is
> completely insane, when it's always just zero in the kernel.
>
> So put that _pad[] thing inside #ifndef __KERNEL__, and make
> copy_siginfo_to_user() write the padding zeroes when copying to user
> space. The reason for the padding is "future expansion", so we do want
> to tell the user space that it's maybe up to 128 bytes in size, but if
> we don't fill it all, we shouldn't waste time and memory on clearing
> the padding internally.
>
> I'm certainly *hoping* nobody depends on the whole 128 bytes in
> rt_sigqueueinfo(). In theory you can fill it all (as long as si_code
> is negative), but the man-page only says "si_value", and the compat
> function doesn't copy any more than that either, so any user that
> tries to fill in more than si_value is already broken. In fact, it
> might even be worth enforcing that in rt_sigqueueinfo(), just to see
> if anybody plays any games..
>From my earlier looking I think this is all doable except detecting
if
> On x86-64, without the pointless padding, the size of 'struct siginfo'
> inside the kernel would be 48 bytes. That's quite a big difference for
> something that is often allocated on the kernel stack.
>From my earlier looking I can say that I know of no case where signals
are injected into the kernel that we need more bytes than the kernel
currently provides.
The two cases I know of are signal reinjection for checkpoint/restart
or something that just uses pid, uid and ptr. Generally that is
enough.
If we just truncate siginfo to everything except the pad bytes in the
kernel there should be no problems. What I don't see how to do is to
limit the size of struct siginfo the kernel accepts in a forward
compatible way. Something that would fail if for some reason you used
more siginfo bytes.
Looking at userspace. glibc always memsets siginfo_t to 0.
Criu just uses whatever it captured with PTRACE_PEEKSIGINFO,
and criu uses unitialized memory for the target of PTRACE_PEEKSIGINFO.
If we truncate siginfo in the kernel then we check for a known si_code
in which case we are safe to truncate siginfo. If the si_code is
unknown then we should check to see if the extra bytes are 0. That
should work with everything. Plus it is a natural point to test to
see if userspace is using signals that the kernel does not currently
support.
I will put that in my queue.
> So I'm certainly willing to make those kinds of changes, but let's
> make them real *improvements* now, ok? Wasn't that the point of all
> the cleanups in the end?
Definitely. With the strace test case causing people to talk about
regressions I was just looking to see if it would make sense to do
something minimal for -rc2 so reduce concerns about regressions.
Now I am going to focus on getting what I can ready for the next merge
window.
Eric
^ permalink raw reply
* Re: [RFC] virtio: Use DMA MAP API for devices without an IOMMU
From: Michael S. Tsirkin @ 2018-04-18 16:20 UTC (permalink / raw)
To: Anshuman Khandual
Cc: Christoph Hellwig, Benjamin Herrenschmidt, robh, aik, jasowang,
linux-kernel, virtualization, joe, david, linuxppc-dev, elfring
In-Reply-To: <002f153f-452d-f64b-4fc7-7f3383b39162@linux.vnet.ibm.com>
On Wed, Apr 18, 2018 at 08:47:10AM +0530, Anshuman Khandual wrote:
> On 04/15/2018 05:41 PM, Christoph Hellwig wrote:
> > On Fri, Apr 06, 2018 at 06:37:18PM +1000, Benjamin Herrenschmidt wrote:
> >>>> implemented as DMA API which the virtio core understands. There is no
> >>>> need for an IOMMU to be involved for the device representation in this
> >>>> case IMHO.
> >>>
> >>> This whole virtio translation issue is a mess. I think we need to
> >>> switch it to the dma API, and then quirk the legacy case to always
> >>> use the direct mapping inside the dma API.
> >>
> >> Fine with using a dma API always on the Linux side, but we do want to
> >> special case virtio still at the arch and qemu side to have a "direct
> >> mapping" mode. Not sure how (special flags on PCI devices) to avoid
> >> actually going through an emulated IOMMU on the qemu side, because that
> >> slows things down, esp. with vhost.
> >>
> >> IE, we can't I think just treat it the same as a physical device.
> >
> > We should have treated it like a physical device from the start, but
> > that device has unfortunately sailed.
> >
> > But yes, we'll need a per-device quirk that says 'don't attach an
> > iommu'.
>
> How about doing it per platform basis as suggested in this RFC through
> an arch specific callback. Because all the virtio devices in the given
> platform would require and exercise this option (to avail bounce buffer
> mechanism for secure guests as an example). So the flag basically is a
> platform specific one not a device specific one.
That's not the case. A single platform can have a mix of virtio and
non-virtio devices. Same applies even within virtio, e.g. the balloon
device always bypasses an iommu. Further, QEMU supports out of process
devices some of which might bypass the IOMMU.
--
MST
^ permalink raw reply
* Re: [PATCH] powerpc: Allow selection of CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
From: Michael Ellerman @ 2018-04-18 15:13 UTC (permalink / raw)
To: Mathieu Malaterre, Christophe LEROY
Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev, LKML
In-Reply-To: <CA+7wUszJzG4CyfO2_Tvmc_u9oMPxLQMaiP+HnhpEex6KCRgSYw@mail.gmail.com>
Mathieu Malaterre <malat@debian.org> writes:
> On Wed, Apr 18, 2018 at 8:34 AM, Christophe LEROY
...
>
>> Can you also provide a copy of the messages you can see (prom_init ...) when
>> boot is ok ?
>
> Hum. I've always been interested in seeing it also myself. Is there a
> way to setup env to see those message (netconsole, delayed boot
> messages ...) ? I never found a clear documentation on how to do that
> on (closed) Apple hardware.
If you see nothing after prom_init it usually indicates the kernel died
very early in boot before it could find the console.
The only option then is to enable one of the hard-coded EARLY_DEBUG
options.
I don't know which one works on a G4, maybe CONFIG_PPC_EARLY_DEBUG_BOOTX ?
I assume it doesn't have a serial port.
cheers
^ permalink raw reply
* Re: [RFC PATCH 1/3] signal: Ensure every siginfo we send has all bits initialized
From: Eric W. Biederman @ 2018-04-18 14:22 UTC (permalink / raw)
To: Dave Martin
Cc: linux-arch, ppc-dev, Linux Kernel Mailing List,
Russell King - ARM Linux, sparclinux, Dmitry V. Levin,
Linus Torvalds, linux-arm-kernel
In-Reply-To: <20180418124717.GI16308@e103592.cambridge.arm.com>
Dave Martin <Dave.Martin@arm.com> writes:
> On Tue, Apr 17, 2018 at 02:37:38PM -0500, Eric W. Biederman wrote:
>> Dave Martin <Dave.Martin@arm.com> writes:
>>
>> > Hmmm
>> >
>> > memset()/clear_siginfo() may ensure that there are no uninitialised
>> > explicit fields except for those in inactive union members, but I'm not
>> > sure that this approach is guaranteed to sanitise the padding seen by
>> > userspace.
>> >
>> > Rationale below, though it's a bit theoretical...
>> >
>> > With this in mind, I tend agree with Linus that hiding memset() calls
>> > from the maintainer may be a bad idea unless they are also hidden from
>> > the compiler. If the compiler sees the memset() it may be able to
>> > optimise it in ways that wouldn't be possible for some other random
>> > external function call, including optimising all or part of the call
>> > out.
>> >
>> > As a result, the breakdown into individual put_user()s etc. in
>> > copy_siginfo_to_user() may still be valuable even if all paths have the
>> > memset().
>>
>> The breakdown into individual put_user()s is known to be problematically
>> slow, and is actually wrong.
>
> Slowness certainly looked like a potential problem.
>
>> Even exclusing the SI_USER duplication in a small number of cases the
>> fields filled out in siginfo by architecture code are not the fields
>> that copy_siginfo_to_user is copying. Which is much worse. The code
>> looks safe but is not.
>>
>> My intention is to leave 0 instances of clear_siginfo in the
>> architecture specific code. Ideally struct siginfo will be limited to
>> kernel/signal.c but I am not certain I can quite get that far.
>> The function do_coredump appears to have a legit need for siginfo.
>
> So, you mean we can't detect that the caller didn't initialise all the
> members, or initialised the wrong union member?
Correct. Even when we smuggled the the union member in the upper bits
of si_code we got it wrong. So an interface that helps out and does
more and is harder to misues looks desirable.
> What would be the alternative? Have a separate interface for each SIL_
> type, with only kernel/signal.c translating that into the siginfo_t that
> userspace sees?
Yes. It really isn't bad as architecture specific code only generates
faults. In general faults only take a pointer. I have already merged
the needed helpers into kernel/signal.c
> Either way, I don't see how we force the caller to initilise the whole
> structure.
In general the plan is to convert the callers to call force_sig_fault,
and then there is no need to have siginfo in the architecture specific
code. I have all of the necessary helpers are already merged into
kernel/signal.c
>
>> > (Rationale for an arch/arm example:)
>> >
>> >> diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
>> >> index 4c375e11ae95..adda3fc2dde8 100644
>> >> --- a/arch/arm/vfp/vfpmodule.c
>> >> +++ b/arch/arm/vfp/vfpmodule.c
>> >> @@ -218,8 +218,7 @@ static void vfp_raise_sigfpe(unsigned int sicode, struct pt_regs *regs)
>> >> {
>> >> siginfo_t info;
>> >>
>> >> - memset(&info, 0, sizeof(info));
>> >> -
>> >> + clear_siginfo(&info);
>> >> info.si_signo = SIGFPE;
>> >
>> > /* by c11 (n1570) 6.2.6.1 para 6 [1], all padding bytes in info now take
>> > unspecified values */
>> >
>> >> info.si_code = sicode;
>> >> info.si_addr = (void __user *)(instruction_pointer(regs) - 4);
>> >
>> > /* by c11 (n1570) 6.2.6.1 para 7 [2], all bytes of the union info._sifields
>> > other than than those corresponding to _sigfault take unspecified
>> > values */
>> >
>> > So I don't see why the compiler needs to ensure that any of the affected
>> > bytes are zero: it could potentially skip a lot of the memset() as a
>> > result, in theory.
>> >
>> > I've not seen a compiler actually take advantage of that, but I'm now
>> > not sure what forbids it.
>>
>> I took a quick look at gcc-4.9 which I have handy.
>>
>> The passes -f-no-strict-aliasing which helps, and gcc actually
>> documents that if you access things through the union it will
>> not take advantage of c11.
>>
>> gcc-4.9 Documents it this way:
>>
>> > -fstrict-aliasing'
>> > Allow the compiler to assume the strictest aliasing rules
>> > applicable to the language being compiled. For C (and C++), this
>> > activates optimizations based on the type of expressions. In
>> > particular, an object of one type is assumed never to reside at the
>> > same address as an object of a different type, unless the types are
>> > almost the same. For example, an 'unsigned int' can alias an
>> > 'int', but not a 'void*' or a 'double'. A character type may alias
>> > any other type.
>> >
>> > Pay special attention to code like this:
>> > union a_union {
>> > int i;
>> > double d;
>> > };
>> >
>> > int f() {
>> > union a_union t;
>> > t.d = 3.0;
>> > return t.i;
>> > }
>> > The practice of reading from a different union member than the one
>> > most recently written to (called "type-punning") is common. Even
>> > with '-fstrict-aliasing', type-punning is allowed, provided the
>> > memory is accessed through the union type. So, the code above
>> > works as expected.
>
> This makes the C standard look precise (I love the "works as expected"),
> and says nothing about the cumulative effect of assigning to multiple
> members of a union, or about the effects on padding bytes.
>
> I'm not convinced that all of this falls under strict-aliasing, but
> I'd have to do more digging to confirm it.
>> > If this can happen, I only see two watertight workarounds:
>> >
>> > 1) Ensure that there is no implicit padding in any UAPI structure, e.g.
>> > aeb1f39d814b: ("arm64/ptrace: Avoid uninitialised struct padding in
>> > fpr_set()"). This would include tail-padding of any union member that
>> > is smaller than the containing union.
>> >
>> > It would be significantly more effort to ensure this for siginfo though.
>> >
>> > 2) Poke all values directly into allocated or user memory directly
>> > via pointers to paddingless types; never assign to objects on the kernel
>> > stack if you care what ends up in the padding, e.g., what your
>> > copy_siginfo_to_user() does prior to this series.
>> >
>> >
>> > If I'm not barking up the wrong tree, memset() cannot generally be
>> > used to determine the value of padding bytes, but it may still be
>> > useful for forcing otherwise uninitialised members to sane initial
>> > values.
>> >
>> > This likely affects many more things than just siginfo.
>>
>> Unless gcc has changed it's stance on type-punning through unions
>> or it's semantics with -fno-strict_aliasing we should be good.
>
> In practice you're probably right.
>
> Today, gcc is pretty conservative in this area, and I haven't been able
> to convince clang to optimise away memset in this way either.
>
> My concern is that is this assumption turns out to be wrong it may be
> some time before anybody notices, because the leakage of kernel stack may
> be the only symptom.
>
> I'll try to nail down a compiler guy to see if we can get a promise on
> this at least with -fno-strict-aliasing.
>
>
> I wonder whether it's worth protecting ourselves with something like:
>
>
> static void clear_siginfo(siginfo_t *si)
> {
> asm ("" : "=m" (*si));
> memset(si, 0, sizeof(*si));
> asm ("" : "+m" (*si));
> }
>
> Probably needs to be thought about more widely though. I guess it's out
> of scope for this series.
It is definitely a question worth asking.
Eric
^ permalink raw reply
* [PATCH v2 2/2] powerpc: Allow selection of CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
From: Christophe Leroy @ 2018-04-18 13:36 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: linux-kernel, linuxppc-dev
In-Reply-To: <fe9959328efb520e6030476553ed23541c547639.1524055122.git.christophe.leroy@c-s.fr>
This option does dead code and data elimination with the linker by
compiling with -ffunction-sections -fdata-sections and linking with
--gc-sections.
By selecting this option on mpc885_ads_defconfig,
vmlinux LOAD segment size gets reduced by 10%
Program Header before the patch:
LOAD off 0x00010000 vaddr 0xc0000000 paddr 0x00000000 align 2**16
filesz 0x0036eda4 memsz 0x0038de04 flags rwx
Program Header after the patch:
LOAD off 0x00010000 vaddr 0xc0000000 paddr 0x00000000 align 2**16
filesz 0x00316da4 memsz 0x00334268 flags rwx
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
arch/powerpc/Kconfig | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 8fe4353be5e3..e1fac49cf465 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -888,6 +888,14 @@ config PPC_MEM_KEYS
If unsure, say y.
+config PPC_UNUSED_ELIMINATION
+ bool "Eliminate unused functions and data from vmlinux"
+ default n
+ select LD_DEAD_CODE_DATA_ELIMINATION
+ help
+ Select this to do dead code and data elimination with the linker
+ by compiling with -ffunction-sections -fdata-sections and linking
+ with --gc-sections.
endmenu
config ISA_DMA_API
--
2.13.3
^ permalink raw reply related
* [PATCH v2 1/2] powerpc: fix vmlinux.lds to build with CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
From: Christophe Leroy @ 2018-04-18 13:36 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
Arnd Bergmann
Cc: linux-kernel, linuxppc-dev, linux-arch
This patch fixes vmlinux.lds script to build properly with
CONFIG_LD_DEAD_CODE_DATA_ELIMINATION enabled
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
arch/powerpc/kernel/vmlinux.lds.S | 4 ++--
include/asm-generic/vmlinux.lds.h | 6 +++++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index c8af90ff49f0..afff03e9be39 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -98,7 +98,7 @@ SECTIONS
ALIGN_FUNCTION();
#endif
/* careful! __ftr_alt_* sections need to be close to .text */
- *(.text.hot .text .text.fixup .text.unlikely .fixup __ftr_alt_* .ref.text);
+ *(.text.hot TEXT_MAIN .text.fixup .text.unlikely .fixup __ftr_alt_* .ref.text);
SCHED_TEXT
CPUIDLE_TEXT
LOCK_TEXT
@@ -274,7 +274,7 @@ SECTIONS
.data : AT(ADDR(.data) - LOAD_OFFSET) {
DATA_DATA
*(.data.rel*)
- *(.sdata)
+ *(SDATA_MAIN)
*(.sdata2)
*(.got.plt) *(.got)
*(.plt)
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 278841c75b97..5549be081931 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -68,11 +68,15 @@
#ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
#define TEXT_MAIN .text .text.[0-9a-zA-Z_]*
#define DATA_MAIN .data .data.[0-9a-zA-Z_]*
+#define SDATA_MAIN .sdata .sdata.[0-9a-zA-Z_]*
#define BSS_MAIN .bss .bss.[0-9a-zA-Z_]*
+#define SBSS_MAIN .sbss .sbss.[0-9a-zA-Z_]*
#else
#define TEXT_MAIN .text
#define DATA_MAIN .data
+#define SDATA_MAIN .sdata
#define BSS_MAIN .bss
+#define SBSS_MAIN .sbss
#endif
/*
@@ -629,7 +633,7 @@
. = ALIGN(sbss_align); \
.sbss : AT(ADDR(.sbss) - LOAD_OFFSET) { \
*(.dynsbss) \
- *(.sbss) \
+ *(SBSS_MAIN) \
*(.scommon) \
}
--
2.13.3
^ permalink raw reply related
* Re: [PATCH] powerpc: Allow selection of CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
From: Christophe LEROY @ 2018-04-18 13:11 UTC (permalink / raw)
To: Mathieu Malaterre
Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
linuxppc-dev, LKML
In-Reply-To: <CA+7wUszJzG4CyfO2_Tvmc_u9oMPxLQMaiP+HnhpEex6KCRgSYw@mail.gmail.com>
Le 18/04/2018 à 10:36, Mathieu Malaterre a écrit :
> Christophe,
>
> On Wed, Apr 18, 2018 at 8:34 AM, Christophe LEROY
> <christophe.leroy@c-s.fr> wrote:
>>
>>
>> Le 17/04/2018 à 19:10, Mathieu Malaterre a écrit :
>>>
>>> On Tue, Apr 17, 2018 at 6:49 PM, Christophe LEROY
>>> <christophe.leroy@c-s.fr> wrote:
>>>>
>>>>
>>>>
>>>> Le 17/04/2018 à 18:45, Mathieu Malaterre a écrit :
>>>>>
>>>>>
>>>>> On Tue, Apr 17, 2018 at 12:49 PM, Christophe Leroy
>>>>> <christophe.leroy@c-s.fr> wrote:
>>>>>>
>>>>>>
>>>>>> This option does dead code and data elimination with the linker by
>>>>>> compiling with -ffunction-sections -fdata-sections and linking with
>>>>>> --gc-sections.
>>>>>>
>>>>>> By selecting this option on mpc885_ads_defconfig,
>>>>>> vmlinux LOAD segment size gets reduced by 10%
>>>>>>
>>>>>> Program Header before the patch:
>>>>>> LOAD off 0x00010000 vaddr 0xc0000000 paddr 0x00000000 align
>>>>>> 2**16
>>>>>> filesz 0x0036eda4 memsz 0x0038de04 flags rwx
>>>>>>
>>>>>> Program Header after the patch:
>>>>>> LOAD off 0x00010000 vaddr 0xc0000000 paddr 0x00000000 align
>>>>>> 2**16
>>>>>> filesz 0x00316da4 memsz 0x00334268 flags rwx
>>>>>>
>>>>>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>>>>>> ---
>>>>>> arch/powerpc/Kconfig | 8 ++++++++
>>>>>> 1 file changed, 8 insertions(+)
>>>>>>
>>>>>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>>>>>> index 8fe4353be5e3..e1fac49cf465 100644
>>>>>> --- a/arch/powerpc/Kconfig
>>>>>> +++ b/arch/powerpc/Kconfig
>>>>>> @@ -888,6 +888,14 @@ config PPC_MEM_KEYS
>>>>>>
>>>>>> If unsure, say y.
>>>>>>
>>>>>> +config PPC_UNUSED_ELIMINATION
>>>>>> + bool "Eliminate unused functions and data from vmlinux"
>>>>>> + default n
>>>>>> + select LD_DEAD_CODE_DATA_ELIMINATION
>>>>>> + help
>>>>>> + Select this to do dead code and data elimination with the
>>>>>> linker
>>>>>> + by compiling with -ffunction-sections -fdata-sections and
>>>>>> linking
>>>>>> + with --gc-sections.
>>>>>> endmenu
>>>>>>
>>>>>
>>>>> Just for reference, I cannot boot my Mac Mini G4 anymore (yaboot). The
>>>>> messages I can see (prom_init) are:
>>>>
>>>>
>>>>
>>>> Which version of GCC do you use ?
>>>
>>>
>>> $ powerpc-linux-gnu-gcc --version
>>> powerpc-linux-gnu-gcc (Debian 6.3.0-18) 6.3.0 20170516
>>> Copyright (C) 2016 Free Software Foundation, Inc.
>>> This is free software; see the source for copying conditions. There is NO
>>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
>>> PURPOSE.
>>>
>>> this is simply coming from:
>>>
>>> $ apt-cache policy crossbuild-essential-powerpc
>>> crossbuild-essential-powerpc:
>>> Installed: 12.3
>>> Candidate: 12.3
>>> Version table:
>>> *** 12.3 500
>>> 500 http://ftp.fr.debian.org/debian stretch/main amd64 Packages
>>> 500 http://ftp.fr.debian.org/debian stretch/main i386 Packages
>>> 100 /var/lib/dpkg/status
>>>
>>>
>>>> Can you provide the generated System.map with and without that option
>>>> active
>>>> ?
>>>
>>>
>>> $ du -sh g4/System.map.*
>>> 1.7M g4/System.map.with
>>> 1.8M g4/System.map.without
>>
>>
>> Here below is the list of objects removed with the option selected. I can't
>> see anything suspect at first.
>
> Does this help:
>
> $ grep orphan /tmp/g4.log|grep prom_init
> powerpc-linux-gnu-ld: warning: orphan section `.sbss.of_workarounds'
> from `arch/powerpc/kernel/prom_init.o' being placed in section
> `.sbss.of_workarounds'.
> powerpc-linux-gnu-ld: warning: orphan section `.sbss.of_workarounds'
> from `arch/powerpc/kernel/prom_init.o' being placed in section
> `.sbss.of_workarounds'.
> powerpc-linux-gnu-ld: warning: orphan section `.sbss.of_workarounds'
> from `arch/powerpc/kernel/prom_init.o' being placed in section
> `.sbss.of_workarounds'.
Well, in a way yes. I initially thought that all those warnings where
normal, but indeed not. We were missing some things in powerpc linker
script, and most likely some sections ended up in the wrong place.
Last week I tested on an 8xx and it was booting without any issue.
I tested today on an 83xx and it was not booting.
I will soon send new patches with the fixes in the linker scripts.
Thanks for your help
Christophe
>
>
>> Do you use one of the defconfigs of the kernel ? Otherwise, can you provide
>> your .config ?
>
> This is a custom (ugly) one:
>
> https://raw.githubusercontent.com/malaterre/linux/g4/arch/powerpc/configs/g4_defconfig
>
>> Can you also provide a copy of the messages you can see (prom_init ...) when
>> boot is ok ?
>
> Hum. I've always been interested in seeing it also myself. Is there a
> way to setup env to see those message (netconsole, delayed boot
> messages ...) ? I never found a clear documentation on how to do that
> on (closed) Apple hardware.
>
>> Maybe you can also send me the two vmlinux objects.
>
> Well if that can help. I'll send them by private emails.
>
>> Thanks
>> Christophe
>>
>> account_steal_time
>> adbhid_exit
>> adb_reset_bus
>> add_range
>> add_range_with_merge
>> aes_fini
>> af_unix_exit
>> agp_exit
>> agp_find_client_by_pid
>> agp_find_mem_by_key
>> agp_find_private
>> agp_free_memory_wrap
>> agpioc_protect_wrap
>> agpioc_release_wrap
>> agp_uninorth_cleanup
>> __alloc_reserved_percpu
>> all_stat_sessions
>> all_stat_sessions_mutex
>> apple_driver_exit
>> arch_cpu_idle_dead
>> arch_setup_msi_irq
>> arch_teardown_msi_irq
>> arch_tlb_gather_mmu
>> asymmetric_key_cleanup
>> asymmetric_key_hex_to_key_id
>> ata_exit
>> ata_tf_to_lba
>> ata_tf_to_lba48
>> attribute_container_add_class_device_adapter
>> attribute_container_trigger
>> backlight_class_exit
>> bdi_lock
>> bhrb_table
>> biovec_create_pool
>> blk_stat_enable_accounting
>> boot_mapsize
>> bpf_map_meta_equal
>> bvec_free
>> bvec_nr_vecs
>> calc_load_fold_active
>> can_request_irq
>> capacity_margin
>> cap_inode_getsecurity
>> cap_mmap_file
>> cfq_exit
>> cgroup_is_threaded
>> cgroup_is_thread_root
>> cgroup_migrate_add_src
>> cgroup_migrate_vet_dst
>> cgroup_on_dfl
>> cgroup_sk_update_lock
>> cgroupstats_build
>> cgroup_task_count
>> cgroup_transfer_tasks
>> change_protection
>> clean_sort_range
>> clear_ftrace_function
>> clear_zone_contiguous
>> __clockevents_update_freq
>> clockevents_update_freq
>> clocksource_mark_unstable
>> clocksource_touch_watchdog
>> clone_property.isra.2
>> cmp_range
>> cn_fini
>> cn_queue_free_dev
>> collect_mounts
>> compaction_restarting
>> copy_fpr_from_user
>> copy_fpr_to_user
>> copy_mount_string
>> copy_msg
>> cpu_check_up_prepare
>> cpufreq_boost_trigger_state
>> cpufreq_gov_performance_exit
>> cpu_hotplug_state
>> cpu_in_idle
>> cpu_report_state
>> cpu_set_state_online
>> cpu_temp
>> crashk_low_res
>> crash_wake_offline
>> create_prof_cpu_mask
>> crypto_algapi_exit
>> crypto_exit_proc
>> crypto_null_mod_fini
>> crypto_wq_exit
>> css_rightmost_descendant
>> css_set_lock
>> cubictcp_unregister
>> __current_kernel_time
>> d_absolute_path
>> dbg_release_bp_slot
>> dbg_reserve_bp_slot
>> deadline_exit
>> deadline_exit
>> debug_guardpage_ops
>> default_restore_msi_irqs
>> default_teardown_msi_irqs
>> del_named_trigger
>> dereference_module_function_descriptor
>> __dev_pm_qos_flags
>> dev_pm_qos_read_value
>> devtree_lock
>> die_will_crash
>> disable_cpufreq
>> dma_buf_deinit
>> dma_common_contiguous_remap
>> dma_common_pages_remap
>> __dma_get_required_mask
>> dma_pfn_limit_to_zone
>> do_execveat
>> do_fork
>> __domain_nr
>> do_msg_redirect_map
>> do_pipe_flags
>> do_sk_redirect_map
>> drmem_lmb_memory_max
>> drmem_update_dt
>> dst_discard
>> dummy_cmp
>> dump_cpu_task
>> dump_stack_set_arch_desc
>> earlycon_acpi_spcr_enable
>> early_find_capability
>> early_printk
>> early_read_config_byte
>> early_write_config_byte
>> exar_pci_driver_exit
>> exit_elf_binfmt
>> exit_misc_binfmt
>> exit_pmz
>> exit_script_binfmt
>> exit_scsi
>> fdt_add_mem_rsv
>> fdt_add_property_
>> fdt_add_subnode
>> fdt_add_subnode_namelen
>> fdt_appendprop
>> fdt_del_mem_rsv
>> fdt_del_node
>> fdt_delprop
>> fdt_find_string_
>> fdt_get_alias
>> fdt_get_max_phandle
>> fdt_get_path
>> fdt_get_property
>> fdt_get_property_by_offset
>> fdt_get_property_namelen
>> fdt_move
>> fdt_node_depth
>> fdt_node_end_offset_
>> fdt_node_offset_by_compatible
>> fdt_node_offset_by_phandle
>> fdt_node_offset_by_prop_value
>> fdt_nop_node
>> fdt_nop_property
>> fdt_num_mem_rsv
>> fdt_offset_ptr
>> fdt_open_into
>> fdt_pack
>> fdt_packblocks_
>> fdt_rw_check_header_
>> fdt_set_name
>> fdt_setprop
>> fdt_setprop_inplace
>> fdt_setprop_inplace_namelen_partial
>> fdt_setprop_placeholder
>> fdt_splice_
>> fdt_string
>> fdt_stringlist_count
>> fdt_stringlist_get
>> fdt_stringlist_search
>> fdt_subnode_offset
>> feature_lock
>> fib_table_flush_external
>> fib_trie_unmerge
>> fib_unmerge
>> find_named_trigger
>> __finish_swait
>> firmware_class_exit
>> fixup_red_left
>> force_printk_to_btext
>> force_sig_bnderr
>> force_sig_fault
>> force_sig_pkuerr
>> force_sig_ptrace_errno_trap
>> fork_idle
>> fprop_fraction_single
>> __fprop_inc_percpu
>> __fprop_inc_single
>> fprop_local_destroy_single
>> fprop_local_init_single
>> free_page_and_swap_cache
>> free_workqueue_attrs
>> fsl_mpic_primary_get_version
>> fsnotify_add_mark
>> fsnotify_finish_user_wait
>> fsnotify_get_mark_safe
>> fsnotify_prepare_user_wait
>> fsnotify_put_mark_wake
>> ftrace_exports
>> ftrace_get_addr_curr
>> ftrace_get_addr_new
>> ftrace_graph_ret_addr
>> ftrace_graph_stop
>> ftrace_nr_registered_ops
>> ftrace_ops_assist_func
>> ftrace_ops_get_func
>> ftrace_ops_trampoline
>> ftrace_run_stop_machine
>> ftrace_test_record
>> ftrace_text_reserved
>> __func__.3126
>> __func__.53147
>> func_ptr_is_kernel_text
>> generic_ptrace_pokedata
>> generic_rtc_driver_exit
>> __get_cached_msi_msg
>> get_cpu_cacheinfo
>> get_iowait_load
>> get_named_trigger_data
>> get_safe_page
>> get_syscall_name
>> get_vm_area
>> __get_vm_area_caller
>> grub_reclaim
>> gup_fast_permitted
>> gup_hugepte
>> handle_hmi_exception
>> handle_percpu_devid_irq
>> handle_percpu_irq
>> has_unmovable_pages
>> has_unmovable_pages.part.31
>> hdec_interrupt
>> hid_debug_exit
>> hid_exit
>> hid_generic_exit
>> hidraw_exit
>> hrtimers_prepare_cpu
>> hwmon_exit
>> i2c_register_board_info
>> igmp_mcf_get_next.isra.4
>> igmp_mcf_seq_fops
>> igmp_mcf_seq_next
>> igmp_mcf_seq_open
>> igmp_mcf_seq_ops
>> igmp_mcf_seq_show
>> igmp_mcf_seq_start
>> igmp_mcf_seq_stop
>> igmp_mc_init
>> igmp_mc_seq_fops
>> igmp_mc_seq_next
>> igmp_mc_seq_open
>> igmp_mc_seq_ops
>> igmp_mc_seq_show
>> igmp_mc_seq_start
>> igmp_mc_seq_stop
>> igmp_netdev_event
>> igmp_net_exit
>> igmp_net_init
>> igmp_net_ops
>> igmp_notifier
>> init_cpu_online
>> init_cpu_possible
>> init_cpu_present
>> init_kernel_text
>> init_thread_info
>> input_exit
>> input_leds_exit
>> insert_resource_conflict
>> insert_resource_expand_to_fit
>> insert_stat
>> instr_is_branch_to_addr
>> instr_is_relative_link_branch
>> iomem_map_sanity_check
>> io_range_mutex
>> ip6_ra_lock
>> ipv4_blackhole_route
>> ipv6_renew_options_kern
>> ipv6_sysctl_unregister
>> irq_chip_compose_msi_msg
>> irqchip_init
>> irq_cpu_offline
>> irq_cpu_online
>> irq_domain_set_info
>> irq_domain_update_bus_token
>> irq_get_next_irq
>> irq_set_percpu_devid
>> irq_set_percpu_devid_partition
>> isa_io_special
>> is_file_shm_hugepages
>> is_hardlockup
>> __is_kernel_percpu_address
>> is_kernel_percpu_address
>> is_module_address
>> __is_module_percpu_address
>> is_module_percpu_address
>> is_named_trigger
>> is_offset_in_branch_range
>> isolate_freepages_range
>> isolate_migratepages_range
>> is_pageblock_removable_nolock
>> __is_ram
>> is_tracing_stopped
>> is_vmalloc_or_module_addr
>> is_vma_temporary_stack
>> iterate_mounts
>> k2_skiplist
>> kcompactd_stop
>> __key.36706
>> keyctl_negate_key
>> key_serial_lock
>> kimage_is_destination_range
>> kmap_flush_unused
>> __kmem_cache_alloc_bulk
>> __kmem_cache_empty
>> kobj_child_ns_ops
>> kobj_ns_initial
>> kobj_ns_netlink
>> kobj_ns_type_registered
>> kretprobe_blacklist
>> kstat_incr_irq_this_cpu
>> kswapd_stop
>> ldsem_down_write_trylock
>> leds_exit
>> libata_transport_exit
>> lockup_detector_cleanup
>> lockup_detector_soft_poweroff
>> log_buf_addr_get
>> log_buf_len_get
>> logbuf_lock
>> logic_pio_register_range
>> logic_pio_to_hwaddr
>> logic_pio_trans_cpuaddr
>> lookup_module_symbol_attrs
>> lookup_page_ext
>> lookup_resource
>> lookup_symbol_attrs
>> mac_var_to_vmode
>> map_kernel_range_noflush
>> max_cfs_quota_period
>> max_possible_pfn
>> memblock_add_node
>> memblock_clear_nomap
>> memblock_get_current_limit
>> memblock_is_map_memory
>> memblock_is_region_memory
>> memblock_is_region_reserved
>> memblock_mark_mirror
>> memblock_mark_nomap
>> memblock_overlaps_region
>> memblock_reserved_size
>> memblock_start_of_DRAM
>> memblock_trim_memory
>> metadata_dst_free
>> migrate_huge_page_move_mapping
>> migrate_prep
>> migrate_reason_names
>> migration_entry_wait_huge
>> min_cfs_quota_period
>> mmc_blk_exit
>> mmc_exit
>> mmc_pwrseq_emmc_driver_exit
>> mmc_pwrseq_simple_driver_exit
>> mm_find_pmd
>> mmlist_lock
>> mmput_async
>> mmput_async_fn
>> mnt_clone_internal
>> mousedev_exit
>> mpc6xx_enter_standby
>> mpic_get_one_irq
>> mpic_setup_this_cpu
>> named_triggers
>> n_null_exit
>> noop_exit
>> nr_free_pagecache_pages
>> nsecs_to_usecs
>> num_powerpc_operands
>> nvmem_exit
>> nvram_cleanup
>> of_device_compatible_match
>> of_fdt_is_big_endian
>> of_fdt_limit_memory
>> __of_find_all_nodes
>> of_find_last_cache_level
>> of_find_matching_node_by_address
>> of_get_flat_dt_subnode_by_name
>> __of_get_property
>> of_msi_map_get_device_domain
>> __of_msi_map_rid
>> of_msi_map_rid
>> of_node_is_attached
>> of_parse_dma_window
>> of_pci_map_rid
>> of_print_phandle_args
>> __of_remove_property
>> __of_sysfs_remove_bin_file
>> oops_may_print
>> our_mnt
>> p4d_clear_bad
>> packet_exit
>> page_counter_cancel
>> page_mapped_in_vma
>> page_mapping_file
>> page_unlock_anon_vma_read
>> panic_flush_kmsg_end
>> panic_flush_kmsg_start
>> pata_macio_exit
>> patch_branch
>> pause_named_trigger
>> __pause_named_trigger.isra.4
>> pci_acs_enabled
>> pci_acs_flags_enabled
>> pci_acs_path_enabled
>> pci_add_cap_save_buffer
>> pcibios_max_latency
>> pcibios_penalize_isa_irq
>> pcibios_resource_survey_bus
>> pci_bridge_group
>> pci_bridge_groups
>> pci_bus_set_current_state
>> pci_dev_acs_enabled
>> pci_devs_are_dma_aliases
>> pci_dev_specific_acs_enabled
>> pcie_cap_has_lnkctl
>> pcie_dev_group
>> pcie_dev_groups
>> pci_ext_cfg_avail
>> pci_for_each_dma_alias
>> pci_get_interrupt_pin
>> pci_get_new_domain_nr
>> pci_lock
>> __pci_msix_desc_mask_irq
>> pci_parse_request_of_pci_ranges
>> pci_pio_to_address
>> pci_pme_wakeup
>> pci_pme_wakeup_bus
>> pci_quirk_amd_sb_acs
>> pci_quirk_cavium_acs
>> pci_quirk_intel_pch_acs
>> pci_quirk_intel_spt_pch_acs
>> pci_quirk_mf_endpoint_acs
>> pci_quirk_qcom_rp_acs
>> pci_quirk_xgene_acs
>> pci_request_acs
>> pci_set_platform_pm
>> pci_setup_bridge
>> pci_wakeup_bus
>> pcpu_lock
>> perf_duration_warn
>> perf_duration_work
>> perf_event_account_interrupt
>> perf_event_attrs
>> perf_event_exit_cpu
>> perf_event_itrace_started
>> perf_log_lost_samples
>> perf_pmu_name
>> perf_sample_event_took
>> perf_sched_cb_dec
>> perf_sched_cb_inc
>> pgd_clear_bad
>> phy_core_exit
>> pin_insert
>> pmac_get_uninorth_variant
>> pm_generic_prepare
>> pm_labels
>> pm_system_cancel_wakeup
>> power_events_sysfs_show
>> powerpc_macros
>> powerpc_num_macros
>> power_supply_class_exit
>> prandom_reseed_late
>> pr_cont_kernfs_name
>> prep_compound_page
>> __print_once.21255
>> print_vma_addr
>> prof_cpu_mask_proc_fops
>> prof_cpu_mask_proc_open
>> prof_cpu_mask_proc_show
>> prof_cpu_mask_proc_write
>> ptrace_get_reg
>> ptrace_writedata
>> pud_clear_bad
>> randomize_page
>> rcu_test_sync_prims
>> read_bhrb
>> reclaim_clean_pages_from_list
>> refined_jiffies
>> register_refined_jiffies
>> register_stat_tracer
>> regs_query_register_name
>> relay_prepare_cpu
>> remove_percpu_irq
>> __report_allowed
>> __report_avg
>> reset_node_managed_pages
>> __reset_stat_session
>> restore_math
>> ret_from_standby
>> ring_buffer_event_time_stamp
>> ring_buffer_nest_end
>> ring_buffer_nest_start
>> ring_buffer_page_len
>> _rs.53145
>> rsa_exit
>> rtc_dev_exit
>> s2idle_set_ops
>> save_named_trigger
>> sched_idle_set_state
>> sched_setattr_nocheck
>> scsi_sysfs_unregister
>> sdio_unregister_bus
>> secondary_cpu_time_init
>> send_sig_fault
>> serial8250_exit
>> serial_pci_driver_exit
>> __se_sys_fadvise64_64
>> __se_sys_gethostname
>> __se_sys_mmap_pgoff
>> __se_sys_msgctl
>> __se_sys_msgget
>> __se_sys_msgrcv
>> __se_sys_msgsnd
>> __se_sys_semctl
>> __se_sys_semget
>> __se_sys_semop
>> __se_sys_semtimedop
>> __se_sys_shmat
>> __se_sys_shmctl
>> __se_sys_shmdt
>> __se_sys_shmget
>> __se_sys_sync_file_range
>> set_breakpoint
>> set_graph_array
>> set_iounmap_nonlazy
>> set_named_trigger_data
>> set_pci_dma_ops
>> set_thread_uses_vas
>> setup_percpu_irq
>> setup_per_zone_wmarks
>> sg_pool_exit
>> shmem_charge
>> shmem_getpage
>> shmem_uncharge
>> shm_file_operations_huge
>> simple_xattr_list_add
>> skb_crc32c_csum_help
>> skb_do_redirect
>> smpboot_create_threads
>> smpboot_park_threads
>> smpboot_unpark_threads
>> smu_init
>> snapshot_additional_pages
>> sort_range
>> spi_register_board_info
>> stack_trace_max_lock
>> stat_dir
>> stat_seq_next
>> stat_seq_show
>> stat_seq_start
>> stat_seq_stop
>> subtract_range
>> swap_buf_le16
>> swap_lock
>> sysctl_schedstats
>> sys_fadvise64_64
>> sysfs_symlink_target_lock
>> sys_gethostname
>> sys_mmap_pgoff
>> sys_msgctl
>> sys_msgget
>> sys_msgrcv
>> sys_msgsnd
>> __sysrq_get_key_op
>> sys_semctl
>> sys_semget
>> sys_semop
>> sys_semtimedop
>> sys_shmat
>> sys_shmctl
>> sys_shmdt
>> sys_shmget
>> sys_switch_endian
>> sys_sync_file_range
>> tasklist_lock
>> task_rcu_dereference
>> __task_rq_lock
>> tau_interrupts
>> tcp_fastopen_active_should_disable
>> tcp_set_ulp_id
>> tcpudp_mt_exit
>> tg_set_cfs_period
>> tg_set_cfs_quota
>> tick_broadcast_ipi_handler
>> tick_cancel_sched_timer
>> tick_freeze
>> tick_freeze_depth
>> tick_nohz_get_idle_calls
>> tick_nohz_get_idle_calls_cpu
>> tick_nohz_idle_got_tick
>> tick_nohz_idle_retain_tick
>> tick_nohz_tick_stopped_cpu
>> tick_suspend_local
>> tick_unfreeze
>> timer_migration_handler
>> __tlb_remove_page_size
>> tnum_sbin
>> tnum_xor
>> touch_softlockup_watchdog_sync
>> trace_array_printk
>> trace_array_printk_buf
>> trace_array_vprintk
>> trace_clock_in_ns
>> trace_find_filtered_pid
>> tracefs_remove
>> trace_graph_function
>> trace_keep_overwrite
>> trace_latency_header
>> tracer_init
>> trace_stat_seq_ops
>> tracing_is_enabled
>> tracing_record_tgid
>> tracing_start
>> tracing_stat_fops
>> tracing_stat_open
>> tracing_stat_release
>> uart_get_console
>> udbg_printf
>> unix_get_socket
>> unpause_named_trigger
>> unregister_stat_tracer
>> uprobe_get_trap_addr
>> using_ftrace_ops_list_func
>> vfs_getxattr_alloc
>> vfs_ioctl
>> vle_num_opcodes
>> vle_opcodes
>> vma_is_special_mapping
>> vma_is_stack_for_current
>> vm_numa_stat_key
>> vsx_unavailable_exception
>> vwrite
>> walk_iomem_res_desc
>> walk_mem_res
>> walk_system_ram_res
>> watchdog_dev_exit
>> watchdog_exit
>> workqueue_prepare_cpu
>> wq_update_unbound_numa
>> x509_key_exit
>> xt_fini
>> xtime_update
>> zone_pcp_reset
>>
>>
>>
>>>
>>> Will send them by private emails.
>>>
>>>> Thanks
>>>> Christophe
>>>>
>>>>
>>>>>
>>>>> ---
>>>>> done
>>>>> copying OF device tree...
>>>>> Building dt strings...
>>>>> Building dt structure...
>>>>> Device tree strings 0x01100000 -> 0x01100e02
>>>>> Device tree struct 0x01101000 -> 0x01109000
>>>>> Quiescing Open Firmware ...
>>>>> Booting Linux via __start() @ 0x00140000 ...
>>>>> _
>>>>> ---
>>>>>
>>>>>
>>>>>
>>>>>> config ISA_DMA_API
>>>>>> --
>>>>>> 2.13.3
>>>>>>
>>>>
>>
^ permalink raw reply
* Re: [RFC PATCH 1/3] signal: Ensure every siginfo we send has all bits initialized
From: Dave Martin @ 2018-04-18 12:47 UTC (permalink / raw)
To: Eric W. Biederman
Cc: linux-arch, ppc-dev, Linux Kernel Mailing List,
Russell King - ARM Linux, sparclinux, Dmitry V. Levin,
Linus Torvalds, linux-arm-kernel
In-Reply-To: <87d0yxzksd.fsf@xmission.com>
On Tue, Apr 17, 2018 at 02:37:38PM -0500, Eric W. Biederman wrote:
> Dave Martin <Dave.Martin@arm.com> writes:
>
> > Hmmm
> >
> > memset()/clear_siginfo() may ensure that there are no uninitialised
> > explicit fields except for those in inactive union members, but I'm not
> > sure that this approach is guaranteed to sanitise the padding seen by
> > userspace.
> >
> > Rationale below, though it's a bit theoretical...
> >
> > With this in mind, I tend agree with Linus that hiding memset() calls
> > from the maintainer may be a bad idea unless they are also hidden from
> > the compiler. If the compiler sees the memset() it may be able to
> > optimise it in ways that wouldn't be possible for some other random
> > external function call, including optimising all or part of the call
> > out.
> >
> > As a result, the breakdown into individual put_user()s etc. in
> > copy_siginfo_to_user() may still be valuable even if all paths have the
> > memset().
>
> The breakdown into individual put_user()s is known to be problematically
> slow, and is actually wrong.
Slowness certainly looked like a potential problem.
> Even exclusing the SI_USER duplication in a small number of cases the
> fields filled out in siginfo by architecture code are not the fields
> that copy_siginfo_to_user is copying. Which is much worse. The code
> looks safe but is not.
>
> My intention is to leave 0 instances of clear_siginfo in the
> architecture specific code. Ideally struct siginfo will be limited to
> kernel/signal.c but I am not certain I can quite get that far.
> The function do_coredump appears to have a legit need for siginfo.
So, you mean we can't detect that the caller didn't initialise all the
members, or initialised the wrong union member?
What would be the alternative? Have a separate interface for each SIL_
type, with only kernel/signal.c translating that into the siginfo_t that
userspace sees?
Either way, I don't see how we force the caller to initilise the whole
structure.
> > (Rationale for an arch/arm example:)
> >
> >> diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
> >> index 4c375e11ae95..adda3fc2dde8 100644
> >> --- a/arch/arm/vfp/vfpmodule.c
> >> +++ b/arch/arm/vfp/vfpmodule.c
> >> @@ -218,8 +218,7 @@ static void vfp_raise_sigfpe(unsigned int sicode, struct pt_regs *regs)
> >> {
> >> siginfo_t info;
> >>
> >> - memset(&info, 0, sizeof(info));
> >> -
> >> + clear_siginfo(&info);
> >> info.si_signo = SIGFPE;
> >
> > /* by c11 (n1570) 6.2.6.1 para 6 [1], all padding bytes in info now take
> > unspecified values */
> >
> >> info.si_code = sicode;
> >> info.si_addr = (void __user *)(instruction_pointer(regs) - 4);
> >
> > /* by c11 (n1570) 6.2.6.1 para 7 [2], all bytes of the union info._sifields
> > other than than those corresponding to _sigfault take unspecified
> > values */
> >
> > So I don't see why the compiler needs to ensure that any of the affected
> > bytes are zero: it could potentially skip a lot of the memset() as a
> > result, in theory.
> >
> > I've not seen a compiler actually take advantage of that, but I'm now
> > not sure what forbids it.
>
> I took a quick look at gcc-4.9 which I have handy.
>
> The passes -f-no-strict-aliasing which helps, and gcc actually
> documents that if you access things through the union it will
> not take advantage of c11.
>
> gcc-4.9 Documents it this way:
>
> > -fstrict-aliasing'
> > Allow the compiler to assume the strictest aliasing rules
> > applicable to the language being compiled. For C (and C++), this
> > activates optimizations based on the type of expressions. In
> > particular, an object of one type is assumed never to reside at the
> > same address as an object of a different type, unless the types are
> > almost the same. For example, an 'unsigned int' can alias an
> > 'int', but not a 'void*' or a 'double'. A character type may alias
> > any other type.
> >
> > Pay special attention to code like this:
> > union a_union {
> > int i;
> > double d;
> > };
> >
> > int f() {
> > union a_union t;
> > t.d = 3.0;
> > return t.i;
> > }
> > The practice of reading from a different union member than the one
> > most recently written to (called "type-punning") is common. Even
> > with '-fstrict-aliasing', type-punning is allowed, provided the
> > memory is accessed through the union type. So, the code above
> > works as expected.
This makes the C standard look precise (I love the "works as expected"),
and says nothing about the cumulative effect of assigning to multiple
members of a union, or about the effects on padding bytes.
I'm not convinced that all of this falls under strict-aliasing, but
I'd have to do more digging to confirm it.
> > If this can happen, I only see two watertight workarounds:
> >
> > 1) Ensure that there is no implicit padding in any UAPI structure, e.g.
> > aeb1f39d814b: ("arm64/ptrace: Avoid uninitialised struct padding in
> > fpr_set()"). This would include tail-padding of any union member that
> > is smaller than the containing union.
> >
> > It would be significantly more effort to ensure this for siginfo though.
> >
> > 2) Poke all values directly into allocated or user memory directly
> > via pointers to paddingless types; never assign to objects on the kernel
> > stack if you care what ends up in the padding, e.g., what your
> > copy_siginfo_to_user() does prior to this series.
> >
> >
> > If I'm not barking up the wrong tree, memset() cannot generally be
> > used to determine the value of padding bytes, but it may still be
> > useful for forcing otherwise uninitialised members to sane initial
> > values.
> >
> > This likely affects many more things than just siginfo.
>
> Unless gcc has changed it's stance on type-punning through unions
> or it's semantics with -fno-strict_aliasing we should be good.
In practice you're probably right.
Today, gcc is pretty conservative in this area, and I haven't been able
to convince clang to optimise away memset in this way either.
My concern is that is this assumption turns out to be wrong it may be
some time before anybody notices, because the leakage of kernel stack may
be the only symptom.
I'll try to nail down a compiler guy to see if we can get a promise on
this at least with -fno-strict-aliasing.
I wonder whether it's worth protecting ourselves with something like:
static void clear_siginfo(siginfo_t *si)
{
asm ("" : "=m" (*si));
memset(si, 0, sizeof(*si));
asm ("" : "+m" (*si));
}
Probably needs to be thought about more widely though. I guess it's out
of scope for this series.
Cheers
---Dave
^ permalink raw reply
* [PATCH] powerpc64s: Print exception vector name alongside the trap number
From: Naveen N. Rao @ 2018-04-18 9:02 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev
Print a small help text indicating the exception vector alongside the
trap number to make it easier while analyzing back traces. As an
example:
Unable to handle kernel paging request for data at address 0x00000000
Faulting instruction address: 0xc0000000006e3728
Oops: Kernel access of bad area, sig: 11 [#1]
LE SMP NR_CPUS=2048 NUMA PowerNV
Modules linked in:
CPU: 0 PID: 1 Comm: bash Not tainted 4.16.0-nnr #226
NIP: c0000000006e3728 LR: c0000000006e4774 CTR: c0000000006e3700
REGS: c0000000f0aa3980 TRAP: 0300 (DSI) Not tainted (4.16.0-nnr)
MSR: 9000000000009033 <SF,HV,EE,ME,IR,DR,RI,LE> CR: 28222222 XER: 20000000
CFAR: c0000000006e4770 DAR: 0000000000000000 DSISR: 42000000 SOFTE: 0
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
I find this useful to have in backtraces, instead of having to look it
up. Some of the names could probably be tweaked a bit to be more
sensible.
- Naveen
arch/powerpc/kernel/process.c | 42 +++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 1237f13fed51..71bfe29af456 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1414,6 +1414,42 @@ static void print_msr_bits(unsigned long val)
#define LAST_VOLATILE 12
#endif
+#ifdef CONFIG_PPC_BOOK3S_64
+static char *print_trap(unsigned long trapno)
+{
+ trapno &= 0xff0;
+ switch (trapno) {
+ case 0x100: return "SRESET";
+ case 0x200: return "MCE";
+ case 0x300: return "DSI";
+ case 0x380: return "DSISLB";
+ case 0x400: return "ISI";
+ case 0x480: return "ISISLB";
+ case 0x500: return "EXT";
+ case 0x600: return "ALIGN";
+ case 0x700: return "PCHECK";
+ case 0x800: return "FP";
+ case 0x900: return "DEC";
+ case 0x980: return "HDEC";
+ case 0xa00: return "DBELL";
+ case 0xc00: return "SC";
+ case 0xd00: return "SSTEP";
+ case 0xe00: return "HDSI";
+ case 0xe20: return "HISI";
+ case 0xe40: return "HEMUL";
+ case 0xe60: return "HMI";
+ case 0xe80: return "HDBELL";
+ case 0xea0: return "HVIRT";
+ case 0xf00: return "PMI";
+ case 0xf20: return "ALTIVEC";
+ case 0xf40: return "VSX";
+ case 0xf60: return "UNAVAIL";
+ case 0xf80: return "HUNAVAIL";
+ }
+ return "UNKNOWN";
+}
+#endif
+
void show_regs(struct pt_regs * regs)
{
int i, trap;
@@ -1422,8 +1458,14 @@ void show_regs(struct pt_regs * regs)
printk("NIP: "REG" LR: "REG" CTR: "REG"\n",
regs->nip, regs->link, regs->ctr);
+#ifdef CONFIG_PPC_BOOK3S_64
+ printk("REGS: %px TRAP: %04lx (%s) %s (%s)\n",
+ regs, regs->trap, print_trap(regs->trap), print_tainted(),
+ init_utsname()->release);
+#else
printk("REGS: %px TRAP: %04lx %s (%s)\n",
regs, regs->trap, print_tainted(), init_utsname()->release);
+#endif
printk("MSR: "REG" ", regs->msr);
print_msr_bits(regs->msr);
pr_cont(" CR: %08lx XER: %08lx\n", regs->ccr, regs->xer);
--
2.17.0
^ permalink raw reply related
* Re: [PATCH] powerpc: Allow selection of CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
From: Mathieu Malaterre @ 2018-04-18 8:36 UTC (permalink / raw)
To: Christophe LEROY
Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
linuxppc-dev, LKML
In-Reply-To: <48cdb73c-f0c4-0c8a-19f5-8fce000e7050@c-s.fr>
Christophe,
On Wed, Apr 18, 2018 at 8:34 AM, Christophe LEROY
<christophe.leroy@c-s.fr> wrote:
>
>
> Le 17/04/2018 =C3=A0 19:10, Mathieu Malaterre a =C3=A9crit :
>>
>> On Tue, Apr 17, 2018 at 6:49 PM, Christophe LEROY
>> <christophe.leroy@c-s.fr> wrote:
>>>
>>>
>>>
>>> Le 17/04/2018 =C3=A0 18:45, Mathieu Malaterre a =C3=A9crit :
>>>>
>>>>
>>>> On Tue, Apr 17, 2018 at 12:49 PM, Christophe Leroy
>>>> <christophe.leroy@c-s.fr> wrote:
>>>>>
>>>>>
>>>>> This option does dead code and data elimination with the linker by
>>>>> compiling with -ffunction-sections -fdata-sections and linking with
>>>>> --gc-sections.
>>>>>
>>>>> By selecting this option on mpc885_ads_defconfig,
>>>>> vmlinux LOAD segment size gets reduced by 10%
>>>>>
>>>>> Program Header before the patch:
>>>>> LOAD off 0x00010000 vaddr 0xc0000000 paddr 0x00000000 align
>>>>> 2**16
>>>>> filesz 0x0036eda4 memsz 0x0038de04 flags rwx
>>>>>
>>>>> Program Header after the patch:
>>>>> LOAD off 0x00010000 vaddr 0xc0000000 paddr 0x00000000 align
>>>>> 2**16
>>>>> filesz 0x00316da4 memsz 0x00334268 flags rwx
>>>>>
>>>>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>>>>> ---
>>>>> arch/powerpc/Kconfig | 8 ++++++++
>>>>> 1 file changed, 8 insertions(+)
>>>>>
>>>>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>>>>> index 8fe4353be5e3..e1fac49cf465 100644
>>>>> --- a/arch/powerpc/Kconfig
>>>>> +++ b/arch/powerpc/Kconfig
>>>>> @@ -888,6 +888,14 @@ config PPC_MEM_KEYS
>>>>>
>>>>> If unsure, say y.
>>>>>
>>>>> +config PPC_UNUSED_ELIMINATION
>>>>> + bool "Eliminate unused functions and data from vmlinux"
>>>>> + default n
>>>>> + select LD_DEAD_CODE_DATA_ELIMINATION
>>>>> + help
>>>>> + Select this to do dead code and data elimination with the
>>>>> linker
>>>>> + by compiling with -ffunction-sections -fdata-sections and
>>>>> linking
>>>>> + with --gc-sections.
>>>>> endmenu
>>>>>
>>>>
>>>> Just for reference, I cannot boot my Mac Mini G4 anymore (yaboot). The
>>>> messages I can see (prom_init) are:
>>>
>>>
>>>
>>> Which version of GCC do you use ?
>>
>>
>> $ powerpc-linux-gnu-gcc --version
>> powerpc-linux-gnu-gcc (Debian 6.3.0-18) 6.3.0 20170516
>> Copyright (C) 2016 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions. There is =
NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
>> PURPOSE.
>>
>> this is simply coming from:
>>
>> $ apt-cache policy crossbuild-essential-powerpc
>> crossbuild-essential-powerpc:
>> Installed: 12.3
>> Candidate: 12.3
>> Version table:
>> *** 12.3 500
>> 500 http://ftp.fr.debian.org/debian stretch/main amd64 Packages
>> 500 http://ftp.fr.debian.org/debian stretch/main i386 Packages
>> 100 /var/lib/dpkg/status
>>
>>
>>> Can you provide the generated System.map with and without that option
>>> active
>>> ?
>>
>>
>> $ du -sh g4/System.map.*
>> 1.7M g4/System.map.with
>> 1.8M g4/System.map.without
>
>
> Here below is the list of objects removed with the option selected. I can=
't
> see anything suspect at first.
Does this help:
$ grep orphan /tmp/g4.log|grep prom_init
powerpc-linux-gnu-ld: warning: orphan section `.sbss.of_workarounds'
from `arch/powerpc/kernel/prom_init.o' being placed in section
`.sbss.of_workarounds'.
powerpc-linux-gnu-ld: warning: orphan section `.sbss.of_workarounds'
from `arch/powerpc/kernel/prom_init.o' being placed in section
`.sbss.of_workarounds'.
powerpc-linux-gnu-ld: warning: orphan section `.sbss.of_workarounds'
from `arch/powerpc/kernel/prom_init.o' being placed in section
`.sbss.of_workarounds'.
> Do you use one of the defconfigs of the kernel ? Otherwise, can you provi=
de
> your .config ?
This is a custom (ugly) one:
https://raw.githubusercontent.com/malaterre/linux/g4/arch/powerpc/configs/g=
4_defconfig
> Can you also provide a copy of the messages you can see (prom_init ...) w=
hen
> boot is ok ?
Hum. I've always been interested in seeing it also myself. Is there a
way to setup env to see those message (netconsole, delayed boot
messages ...) ? I never found a clear documentation on how to do that
on (closed) Apple hardware.
> Maybe you can also send me the two vmlinux objects.
Well if that can help. I'll send them by private emails.
> Thanks
> Christophe
>
> account_steal_time
> adbhid_exit
> adb_reset_bus
> add_range
> add_range_with_merge
> aes_fini
> af_unix_exit
> agp_exit
> agp_find_client_by_pid
> agp_find_mem_by_key
> agp_find_private
> agp_free_memory_wrap
> agpioc_protect_wrap
> agpioc_release_wrap
> agp_uninorth_cleanup
> __alloc_reserved_percpu
> all_stat_sessions
> all_stat_sessions_mutex
> apple_driver_exit
> arch_cpu_idle_dead
> arch_setup_msi_irq
> arch_teardown_msi_irq
> arch_tlb_gather_mmu
> asymmetric_key_cleanup
> asymmetric_key_hex_to_key_id
> ata_exit
> ata_tf_to_lba
> ata_tf_to_lba48
> attribute_container_add_class_device_adapter
> attribute_container_trigger
> backlight_class_exit
> bdi_lock
> bhrb_table
> biovec_create_pool
> blk_stat_enable_accounting
> boot_mapsize
> bpf_map_meta_equal
> bvec_free
> bvec_nr_vecs
> calc_load_fold_active
> can_request_irq
> capacity_margin
> cap_inode_getsecurity
> cap_mmap_file
> cfq_exit
> cgroup_is_threaded
> cgroup_is_thread_root
> cgroup_migrate_add_src
> cgroup_migrate_vet_dst
> cgroup_on_dfl
> cgroup_sk_update_lock
> cgroupstats_build
> cgroup_task_count
> cgroup_transfer_tasks
> change_protection
> clean_sort_range
> clear_ftrace_function
> clear_zone_contiguous
> __clockevents_update_freq
> clockevents_update_freq
> clocksource_mark_unstable
> clocksource_touch_watchdog
> clone_property.isra.2
> cmp_range
> cn_fini
> cn_queue_free_dev
> collect_mounts
> compaction_restarting
> copy_fpr_from_user
> copy_fpr_to_user
> copy_mount_string
> copy_msg
> cpu_check_up_prepare
> cpufreq_boost_trigger_state
> cpufreq_gov_performance_exit
> cpu_hotplug_state
> cpu_in_idle
> cpu_report_state
> cpu_set_state_online
> cpu_temp
> crashk_low_res
> crash_wake_offline
> create_prof_cpu_mask
> crypto_algapi_exit
> crypto_exit_proc
> crypto_null_mod_fini
> crypto_wq_exit
> css_rightmost_descendant
> css_set_lock
> cubictcp_unregister
> __current_kernel_time
> d_absolute_path
> dbg_release_bp_slot
> dbg_reserve_bp_slot
> deadline_exit
> deadline_exit
> debug_guardpage_ops
> default_restore_msi_irqs
> default_teardown_msi_irqs
> del_named_trigger
> dereference_module_function_descriptor
> __dev_pm_qos_flags
> dev_pm_qos_read_value
> devtree_lock
> die_will_crash
> disable_cpufreq
> dma_buf_deinit
> dma_common_contiguous_remap
> dma_common_pages_remap
> __dma_get_required_mask
> dma_pfn_limit_to_zone
> do_execveat
> do_fork
> __domain_nr
> do_msg_redirect_map
> do_pipe_flags
> do_sk_redirect_map
> drmem_lmb_memory_max
> drmem_update_dt
> dst_discard
> dummy_cmp
> dump_cpu_task
> dump_stack_set_arch_desc
> earlycon_acpi_spcr_enable
> early_find_capability
> early_printk
> early_read_config_byte
> early_write_config_byte
> exar_pci_driver_exit
> exit_elf_binfmt
> exit_misc_binfmt
> exit_pmz
> exit_script_binfmt
> exit_scsi
> fdt_add_mem_rsv
> fdt_add_property_
> fdt_add_subnode
> fdt_add_subnode_namelen
> fdt_appendprop
> fdt_del_mem_rsv
> fdt_del_node
> fdt_delprop
> fdt_find_string_
> fdt_get_alias
> fdt_get_max_phandle
> fdt_get_path
> fdt_get_property
> fdt_get_property_by_offset
> fdt_get_property_namelen
> fdt_move
> fdt_node_depth
> fdt_node_end_offset_
> fdt_node_offset_by_compatible
> fdt_node_offset_by_phandle
> fdt_node_offset_by_prop_value
> fdt_nop_node
> fdt_nop_property
> fdt_num_mem_rsv
> fdt_offset_ptr
> fdt_open_into
> fdt_pack
> fdt_packblocks_
> fdt_rw_check_header_
> fdt_set_name
> fdt_setprop
> fdt_setprop_inplace
> fdt_setprop_inplace_namelen_partial
> fdt_setprop_placeholder
> fdt_splice_
> fdt_string
> fdt_stringlist_count
> fdt_stringlist_get
> fdt_stringlist_search
> fdt_subnode_offset
> feature_lock
> fib_table_flush_external
> fib_trie_unmerge
> fib_unmerge
> find_named_trigger
> __finish_swait
> firmware_class_exit
> fixup_red_left
> force_printk_to_btext
> force_sig_bnderr
> force_sig_fault
> force_sig_pkuerr
> force_sig_ptrace_errno_trap
> fork_idle
> fprop_fraction_single
> __fprop_inc_percpu
> __fprop_inc_single
> fprop_local_destroy_single
> fprop_local_init_single
> free_page_and_swap_cache
> free_workqueue_attrs
> fsl_mpic_primary_get_version
> fsnotify_add_mark
> fsnotify_finish_user_wait
> fsnotify_get_mark_safe
> fsnotify_prepare_user_wait
> fsnotify_put_mark_wake
> ftrace_exports
> ftrace_get_addr_curr
> ftrace_get_addr_new
> ftrace_graph_ret_addr
> ftrace_graph_stop
> ftrace_nr_registered_ops
> ftrace_ops_assist_func
> ftrace_ops_get_func
> ftrace_ops_trampoline
> ftrace_run_stop_machine
> ftrace_test_record
> ftrace_text_reserved
> __func__.3126
> __func__.53147
> func_ptr_is_kernel_text
> generic_ptrace_pokedata
> generic_rtc_driver_exit
> __get_cached_msi_msg
> get_cpu_cacheinfo
> get_iowait_load
> get_named_trigger_data
> get_safe_page
> get_syscall_name
> get_vm_area
> __get_vm_area_caller
> grub_reclaim
> gup_fast_permitted
> gup_hugepte
> handle_hmi_exception
> handle_percpu_devid_irq
> handle_percpu_irq
> has_unmovable_pages
> has_unmovable_pages.part.31
> hdec_interrupt
> hid_debug_exit
> hid_exit
> hid_generic_exit
> hidraw_exit
> hrtimers_prepare_cpu
> hwmon_exit
> i2c_register_board_info
> igmp_mcf_get_next.isra.4
> igmp_mcf_seq_fops
> igmp_mcf_seq_next
> igmp_mcf_seq_open
> igmp_mcf_seq_ops
> igmp_mcf_seq_show
> igmp_mcf_seq_start
> igmp_mcf_seq_stop
> igmp_mc_init
> igmp_mc_seq_fops
> igmp_mc_seq_next
> igmp_mc_seq_open
> igmp_mc_seq_ops
> igmp_mc_seq_show
> igmp_mc_seq_start
> igmp_mc_seq_stop
> igmp_netdev_event
> igmp_net_exit
> igmp_net_init
> igmp_net_ops
> igmp_notifier
> init_cpu_online
> init_cpu_possible
> init_cpu_present
> init_kernel_text
> init_thread_info
> input_exit
> input_leds_exit
> insert_resource_conflict
> insert_resource_expand_to_fit
> insert_stat
> instr_is_branch_to_addr
> instr_is_relative_link_branch
> iomem_map_sanity_check
> io_range_mutex
> ip6_ra_lock
> ipv4_blackhole_route
> ipv6_renew_options_kern
> ipv6_sysctl_unregister
> irq_chip_compose_msi_msg
> irqchip_init
> irq_cpu_offline
> irq_cpu_online
> irq_domain_set_info
> irq_domain_update_bus_token
> irq_get_next_irq
> irq_set_percpu_devid
> irq_set_percpu_devid_partition
> isa_io_special
> is_file_shm_hugepages
> is_hardlockup
> __is_kernel_percpu_address
> is_kernel_percpu_address
> is_module_address
> __is_module_percpu_address
> is_module_percpu_address
> is_named_trigger
> is_offset_in_branch_range
> isolate_freepages_range
> isolate_migratepages_range
> is_pageblock_removable_nolock
> __is_ram
> is_tracing_stopped
> is_vmalloc_or_module_addr
> is_vma_temporary_stack
> iterate_mounts
> k2_skiplist
> kcompactd_stop
> __key.36706
> keyctl_negate_key
> key_serial_lock
> kimage_is_destination_range
> kmap_flush_unused
> __kmem_cache_alloc_bulk
> __kmem_cache_empty
> kobj_child_ns_ops
> kobj_ns_initial
> kobj_ns_netlink
> kobj_ns_type_registered
> kretprobe_blacklist
> kstat_incr_irq_this_cpu
> kswapd_stop
> ldsem_down_write_trylock
> leds_exit
> libata_transport_exit
> lockup_detector_cleanup
> lockup_detector_soft_poweroff
> log_buf_addr_get
> log_buf_len_get
> logbuf_lock
> logic_pio_register_range
> logic_pio_to_hwaddr
> logic_pio_trans_cpuaddr
> lookup_module_symbol_attrs
> lookup_page_ext
> lookup_resource
> lookup_symbol_attrs
> mac_var_to_vmode
> map_kernel_range_noflush
> max_cfs_quota_period
> max_possible_pfn
> memblock_add_node
> memblock_clear_nomap
> memblock_get_current_limit
> memblock_is_map_memory
> memblock_is_region_memory
> memblock_is_region_reserved
> memblock_mark_mirror
> memblock_mark_nomap
> memblock_overlaps_region
> memblock_reserved_size
> memblock_start_of_DRAM
> memblock_trim_memory
> metadata_dst_free
> migrate_huge_page_move_mapping
> migrate_prep
> migrate_reason_names
> migration_entry_wait_huge
> min_cfs_quota_period
> mmc_blk_exit
> mmc_exit
> mmc_pwrseq_emmc_driver_exit
> mmc_pwrseq_simple_driver_exit
> mm_find_pmd
> mmlist_lock
> mmput_async
> mmput_async_fn
> mnt_clone_internal
> mousedev_exit
> mpc6xx_enter_standby
> mpic_get_one_irq
> mpic_setup_this_cpu
> named_triggers
> n_null_exit
> noop_exit
> nr_free_pagecache_pages
> nsecs_to_usecs
> num_powerpc_operands
> nvmem_exit
> nvram_cleanup
> of_device_compatible_match
> of_fdt_is_big_endian
> of_fdt_limit_memory
> __of_find_all_nodes
> of_find_last_cache_level
> of_find_matching_node_by_address
> of_get_flat_dt_subnode_by_name
> __of_get_property
> of_msi_map_get_device_domain
> __of_msi_map_rid
> of_msi_map_rid
> of_node_is_attached
> of_parse_dma_window
> of_pci_map_rid
> of_print_phandle_args
> __of_remove_property
> __of_sysfs_remove_bin_file
> oops_may_print
> our_mnt
> p4d_clear_bad
> packet_exit
> page_counter_cancel
> page_mapped_in_vma
> page_mapping_file
> page_unlock_anon_vma_read
> panic_flush_kmsg_end
> panic_flush_kmsg_start
> pata_macio_exit
> patch_branch
> pause_named_trigger
> __pause_named_trigger.isra.4
> pci_acs_enabled
> pci_acs_flags_enabled
> pci_acs_path_enabled
> pci_add_cap_save_buffer
> pcibios_max_latency
> pcibios_penalize_isa_irq
> pcibios_resource_survey_bus
> pci_bridge_group
> pci_bridge_groups
> pci_bus_set_current_state
> pci_dev_acs_enabled
> pci_devs_are_dma_aliases
> pci_dev_specific_acs_enabled
> pcie_cap_has_lnkctl
> pcie_dev_group
> pcie_dev_groups
> pci_ext_cfg_avail
> pci_for_each_dma_alias
> pci_get_interrupt_pin
> pci_get_new_domain_nr
> pci_lock
> __pci_msix_desc_mask_irq
> pci_parse_request_of_pci_ranges
> pci_pio_to_address
> pci_pme_wakeup
> pci_pme_wakeup_bus
> pci_quirk_amd_sb_acs
> pci_quirk_cavium_acs
> pci_quirk_intel_pch_acs
> pci_quirk_intel_spt_pch_acs
> pci_quirk_mf_endpoint_acs
> pci_quirk_qcom_rp_acs
> pci_quirk_xgene_acs
> pci_request_acs
> pci_set_platform_pm
> pci_setup_bridge
> pci_wakeup_bus
> pcpu_lock
> perf_duration_warn
> perf_duration_work
> perf_event_account_interrupt
> perf_event_attrs
> perf_event_exit_cpu
> perf_event_itrace_started
> perf_log_lost_samples
> perf_pmu_name
> perf_sample_event_took
> perf_sched_cb_dec
> perf_sched_cb_inc
> pgd_clear_bad
> phy_core_exit
> pin_insert
> pmac_get_uninorth_variant
> pm_generic_prepare
> pm_labels
> pm_system_cancel_wakeup
> power_events_sysfs_show
> powerpc_macros
> powerpc_num_macros
> power_supply_class_exit
> prandom_reseed_late
> pr_cont_kernfs_name
> prep_compound_page
> __print_once.21255
> print_vma_addr
> prof_cpu_mask_proc_fops
> prof_cpu_mask_proc_open
> prof_cpu_mask_proc_show
> prof_cpu_mask_proc_write
> ptrace_get_reg
> ptrace_writedata
> pud_clear_bad
> randomize_page
> rcu_test_sync_prims
> read_bhrb
> reclaim_clean_pages_from_list
> refined_jiffies
> register_refined_jiffies
> register_stat_tracer
> regs_query_register_name
> relay_prepare_cpu
> remove_percpu_irq
> __report_allowed
> __report_avg
> reset_node_managed_pages
> __reset_stat_session
> restore_math
> ret_from_standby
> ring_buffer_event_time_stamp
> ring_buffer_nest_end
> ring_buffer_nest_start
> ring_buffer_page_len
> _rs.53145
> rsa_exit
> rtc_dev_exit
> s2idle_set_ops
> save_named_trigger
> sched_idle_set_state
> sched_setattr_nocheck
> scsi_sysfs_unregister
> sdio_unregister_bus
> secondary_cpu_time_init
> send_sig_fault
> serial8250_exit
> serial_pci_driver_exit
> __se_sys_fadvise64_64
> __se_sys_gethostname
> __se_sys_mmap_pgoff
> __se_sys_msgctl
> __se_sys_msgget
> __se_sys_msgrcv
> __se_sys_msgsnd
> __se_sys_semctl
> __se_sys_semget
> __se_sys_semop
> __se_sys_semtimedop
> __se_sys_shmat
> __se_sys_shmctl
> __se_sys_shmdt
> __se_sys_shmget
> __se_sys_sync_file_range
> set_breakpoint
> set_graph_array
> set_iounmap_nonlazy
> set_named_trigger_data
> set_pci_dma_ops
> set_thread_uses_vas
> setup_percpu_irq
> setup_per_zone_wmarks
> sg_pool_exit
> shmem_charge
> shmem_getpage
> shmem_uncharge
> shm_file_operations_huge
> simple_xattr_list_add
> skb_crc32c_csum_help
> skb_do_redirect
> smpboot_create_threads
> smpboot_park_threads
> smpboot_unpark_threads
> smu_init
> snapshot_additional_pages
> sort_range
> spi_register_board_info
> stack_trace_max_lock
> stat_dir
> stat_seq_next
> stat_seq_show
> stat_seq_start
> stat_seq_stop
> subtract_range
> swap_buf_le16
> swap_lock
> sysctl_schedstats
> sys_fadvise64_64
> sysfs_symlink_target_lock
> sys_gethostname
> sys_mmap_pgoff
> sys_msgctl
> sys_msgget
> sys_msgrcv
> sys_msgsnd
> __sysrq_get_key_op
> sys_semctl
> sys_semget
> sys_semop
> sys_semtimedop
> sys_shmat
> sys_shmctl
> sys_shmdt
> sys_shmget
> sys_switch_endian
> sys_sync_file_range
> tasklist_lock
> task_rcu_dereference
> __task_rq_lock
> tau_interrupts
> tcp_fastopen_active_should_disable
> tcp_set_ulp_id
> tcpudp_mt_exit
> tg_set_cfs_period
> tg_set_cfs_quota
> tick_broadcast_ipi_handler
> tick_cancel_sched_timer
> tick_freeze
> tick_freeze_depth
> tick_nohz_get_idle_calls
> tick_nohz_get_idle_calls_cpu
> tick_nohz_idle_got_tick
> tick_nohz_idle_retain_tick
> tick_nohz_tick_stopped_cpu
> tick_suspend_local
> tick_unfreeze
> timer_migration_handler
> __tlb_remove_page_size
> tnum_sbin
> tnum_xor
> touch_softlockup_watchdog_sync
> trace_array_printk
> trace_array_printk_buf
> trace_array_vprintk
> trace_clock_in_ns
> trace_find_filtered_pid
> tracefs_remove
> trace_graph_function
> trace_keep_overwrite
> trace_latency_header
> tracer_init
> trace_stat_seq_ops
> tracing_is_enabled
> tracing_record_tgid
> tracing_start
> tracing_stat_fops
> tracing_stat_open
> tracing_stat_release
> uart_get_console
> udbg_printf
> unix_get_socket
> unpause_named_trigger
> unregister_stat_tracer
> uprobe_get_trap_addr
> using_ftrace_ops_list_func
> vfs_getxattr_alloc
> vfs_ioctl
> vle_num_opcodes
> vle_opcodes
> vma_is_special_mapping
> vma_is_stack_for_current
> vm_numa_stat_key
> vsx_unavailable_exception
> vwrite
> walk_iomem_res_desc
> walk_mem_res
> walk_system_ram_res
> watchdog_dev_exit
> watchdog_exit
> workqueue_prepare_cpu
> wq_update_unbound_numa
> x509_key_exit
> xt_fini
> xtime_update
> zone_pcp_reset
>
>
>
>>
>> Will send them by private emails.
>>
>>> Thanks
>>> Christophe
>>>
>>>
>>>>
>>>> ---
>>>> done
>>>> copying OF device tree...
>>>> Building dt strings...
>>>> Building dt structure...
>>>> Device tree strings 0x01100000 -> 0x01100e02
>>>> Device tree struct 0x01101000 -> 0x01109000
>>>> Quiescing Open Firmware ...
>>>> Booting Linux via __start() @ 0x00140000 ...
>>>> _
>>>> ---
>>>>
>>>>
>>>>
>>>>> config ISA_DMA_API
>>>>> --
>>>>> 2.13.3
>>>>>
>>>
>
^ permalink raw reply
* Re: [PATCH v2 7/7] ocxl: Document new OCXL IOCTLs
From: Andrew Donnellan @ 2018-04-18 7:29 UTC (permalink / raw)
To: Alastair D'Silva, linuxppc-dev
Cc: linux-kernel, linux-doc, mikey, vaibhav, aneesh.kumar, malat,
felix, pombredanne, sukadev, npiggin, gregkh, arnd, fbarrat,
corbet, Alastair D'Silva
In-Reply-To: <20180418010810.30937-8-alastair@au1.ibm.com>
On 18/04/18 11:08, Alastair D'Silva wrote:
> From: Alastair D'Silva <alastair@d-silva.org>
>
> Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
This looks better.
Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
> ---
> Documentation/accelerators/ocxl.rst | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/Documentation/accelerators/ocxl.rst b/Documentation/accelerators/ocxl.rst
> index 7904adcc07fd..3b8d3b99795c 100644
> --- a/Documentation/accelerators/ocxl.rst
> +++ b/Documentation/accelerators/ocxl.rst
> @@ -157,6 +157,17 @@ OCXL_IOCTL_GET_METADATA:
> Obtains configuration information from the card, such at the size of
> MMIO areas, the AFU version, and the PASID for the current context.
>
> +OCXL_IOCTL_ENABLE_P9_WAIT:
> +
> + Allows the AFU to wake a userspace thread executing 'wait'. Returns
> + information to userspace to allow it to configure the AFU. Note that
> + this is only available on Power 9.
Nitpicking time, if you do a v3 you should stay on brand and call it
POWER9. :D
> +
> +OCXL_IOCTL_GET_FEATURES:
> +
> + Reports on which CPU features that affect OpenCAPI are usable from
> + userspace.
> +
> mmap
> ----
>
>
--
Andrew Donnellan OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com IBM Australia Limited
^ permalink raw reply
* Re: [PATCH v2 2/7] powerpc: Use TIDR CPU feature to control TIDR allocation
From: Andrew Donnellan @ 2018-04-18 7:13 UTC (permalink / raw)
To: Alastair D'Silva, linuxppc-dev
Cc: linux-kernel, linux-doc, mikey, vaibhav, aneesh.kumar, malat,
felix, pombredanne, sukadev, npiggin, gregkh, arnd, fbarrat,
corbet, Alastair D'Silva
In-Reply-To: <20180418010810.30937-3-alastair@au1.ibm.com>
On 18/04/18 11:08, Alastair D'Silva wrote:
> From: Alastair D'Silva <alastair@d-silva.org>
>
> Switch the use of TIDR on it's CPU feature, rather than assuming it
> is available based on architecture.
>
> Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
--
Andrew Donnellan OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com IBM Australia Limited
^ permalink raw reply
* Re: [PATCH v2 1/7] powerpc: Add TIDR CPU feature for Power9
From: Andrew Donnellan @ 2018-04-18 7:03 UTC (permalink / raw)
To: Alastair D'Silva, linuxppc-dev
Cc: linux-kernel, linux-doc, mikey, vaibhav, aneesh.kumar, malat,
felix, pombredanne, sukadev, npiggin, gregkh, arnd, fbarrat,
corbet, Alastair D'Silva
In-Reply-To: <20180418010810.30937-2-alastair@au1.ibm.com>
On 18/04/18 11:08, Alastair D'Silva wrote:
> From: Alastair D'Silva <alastair@d-silva.org>
>
> This patch adds a CPU feature bit to show whether the CPU has
> the TIDR register available, enabling as_notify/wait in userspace.
>
> Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
Per my previous email:
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
--
Andrew Donnellan OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com IBM Australia Limited
^ permalink raw reply
* Re: [PATCH] powerpc: Allow selection of CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
From: Christophe LEROY @ 2018-04-18 6:34 UTC (permalink / raw)
To: Mathieu Malaterre
Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
linuxppc-dev, LKML
In-Reply-To: <CA+7wUswJoGnb50y8jbPfsi9ztCO1jZ+O4cirHtXc7gp7MXRm5Q@mail.gmail.com>
Le 17/04/2018 à 19:10, Mathieu Malaterre a écrit :
> On Tue, Apr 17, 2018 at 6:49 PM, Christophe LEROY
> <christophe.leroy@c-s.fr> wrote:
>>
>>
>> Le 17/04/2018 à 18:45, Mathieu Malaterre a écrit :
>>>
>>> On Tue, Apr 17, 2018 at 12:49 PM, Christophe Leroy
>>> <christophe.leroy@c-s.fr> wrote:
>>>>
>>>> This option does dead code and data elimination with the linker by
>>>> compiling with -ffunction-sections -fdata-sections and linking with
>>>> --gc-sections.
>>>>
>>>> By selecting this option on mpc885_ads_defconfig,
>>>> vmlinux LOAD segment size gets reduced by 10%
>>>>
>>>> Program Header before the patch:
>>>> LOAD off 0x00010000 vaddr 0xc0000000 paddr 0x00000000 align 2**16
>>>> filesz 0x0036eda4 memsz 0x0038de04 flags rwx
>>>>
>>>> Program Header after the patch:
>>>> LOAD off 0x00010000 vaddr 0xc0000000 paddr 0x00000000 align 2**16
>>>> filesz 0x00316da4 memsz 0x00334268 flags rwx
>>>>
>>>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>>>> ---
>>>> arch/powerpc/Kconfig | 8 ++++++++
>>>> 1 file changed, 8 insertions(+)
>>>>
>>>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>>>> index 8fe4353be5e3..e1fac49cf465 100644
>>>> --- a/arch/powerpc/Kconfig
>>>> +++ b/arch/powerpc/Kconfig
>>>> @@ -888,6 +888,14 @@ config PPC_MEM_KEYS
>>>>
>>>> If unsure, say y.
>>>>
>>>> +config PPC_UNUSED_ELIMINATION
>>>> + bool "Eliminate unused functions and data from vmlinux"
>>>> + default n
>>>> + select LD_DEAD_CODE_DATA_ELIMINATION
>>>> + help
>>>> + Select this to do dead code and data elimination with the
>>>> linker
>>>> + by compiling with -ffunction-sections -fdata-sections and
>>>> linking
>>>> + with --gc-sections.
>>>> endmenu
>>>>
>>>
>>> Just for reference, I cannot boot my Mac Mini G4 anymore (yaboot). The
>>> messages I can see (prom_init) are:
>>
>>
>> Which version of GCC do you use ?
>
> $ powerpc-linux-gnu-gcc --version
> powerpc-linux-gnu-gcc (Debian 6.3.0-18) 6.3.0 20170516
> Copyright (C) 2016 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> this is simply coming from:
>
> $ apt-cache policy crossbuild-essential-powerpc
> crossbuild-essential-powerpc:
> Installed: 12.3
> Candidate: 12.3
> Version table:
> *** 12.3 500
> 500 http://ftp.fr.debian.org/debian stretch/main amd64 Packages
> 500 http://ftp.fr.debian.org/debian stretch/main i386 Packages
> 100 /var/lib/dpkg/status
>
>
>> Can you provide the generated System.map with and without that option active
>> ?
>
> $ du -sh g4/System.map.*
> 1.7M g4/System.map.with
> 1.8M g4/System.map.without
Here below is the list of objects removed with the option selected. I
can't see anything suspect at first.
Do you use one of the defconfigs of the kernel ? Otherwise, can you
provide your .config ?
Can you also provide a copy of the messages you can see (prom_init ...)
when boot is ok ?
Maybe you can also send me the two vmlinux objects.
Thanks
Christophe
account_steal_time
adbhid_exit
adb_reset_bus
add_range
add_range_with_merge
aes_fini
af_unix_exit
agp_exit
agp_find_client_by_pid
agp_find_mem_by_key
agp_find_private
agp_free_memory_wrap
agpioc_protect_wrap
agpioc_release_wrap
agp_uninorth_cleanup
__alloc_reserved_percpu
all_stat_sessions
all_stat_sessions_mutex
apple_driver_exit
arch_cpu_idle_dead
arch_setup_msi_irq
arch_teardown_msi_irq
arch_tlb_gather_mmu
asymmetric_key_cleanup
asymmetric_key_hex_to_key_id
ata_exit
ata_tf_to_lba
ata_tf_to_lba48
attribute_container_add_class_device_adapter
attribute_container_trigger
backlight_class_exit
bdi_lock
bhrb_table
biovec_create_pool
blk_stat_enable_accounting
boot_mapsize
bpf_map_meta_equal
bvec_free
bvec_nr_vecs
calc_load_fold_active
can_request_irq
capacity_margin
cap_inode_getsecurity
cap_mmap_file
cfq_exit
cgroup_is_threaded
cgroup_is_thread_root
cgroup_migrate_add_src
cgroup_migrate_vet_dst
cgroup_on_dfl
cgroup_sk_update_lock
cgroupstats_build
cgroup_task_count
cgroup_transfer_tasks
change_protection
clean_sort_range
clear_ftrace_function
clear_zone_contiguous
__clockevents_update_freq
clockevents_update_freq
clocksource_mark_unstable
clocksource_touch_watchdog
clone_property.isra.2
cmp_range
cn_fini
cn_queue_free_dev
collect_mounts
compaction_restarting
copy_fpr_from_user
copy_fpr_to_user
copy_mount_string
copy_msg
cpu_check_up_prepare
cpufreq_boost_trigger_state
cpufreq_gov_performance_exit
cpu_hotplug_state
cpu_in_idle
cpu_report_state
cpu_set_state_online
cpu_temp
crashk_low_res
crash_wake_offline
create_prof_cpu_mask
crypto_algapi_exit
crypto_exit_proc
crypto_null_mod_fini
crypto_wq_exit
css_rightmost_descendant
css_set_lock
cubictcp_unregister
__current_kernel_time
d_absolute_path
dbg_release_bp_slot
dbg_reserve_bp_slot
deadline_exit
deadline_exit
debug_guardpage_ops
default_restore_msi_irqs
default_teardown_msi_irqs
del_named_trigger
dereference_module_function_descriptor
__dev_pm_qos_flags
dev_pm_qos_read_value
devtree_lock
die_will_crash
disable_cpufreq
dma_buf_deinit
dma_common_contiguous_remap
dma_common_pages_remap
__dma_get_required_mask
dma_pfn_limit_to_zone
do_execveat
do_fork
__domain_nr
do_msg_redirect_map
do_pipe_flags
do_sk_redirect_map
drmem_lmb_memory_max
drmem_update_dt
dst_discard
dummy_cmp
dump_cpu_task
dump_stack_set_arch_desc
earlycon_acpi_spcr_enable
early_find_capability
early_printk
early_read_config_byte
early_write_config_byte
exar_pci_driver_exit
exit_elf_binfmt
exit_misc_binfmt
exit_pmz
exit_script_binfmt
exit_scsi
fdt_add_mem_rsv
fdt_add_property_
fdt_add_subnode
fdt_add_subnode_namelen
fdt_appendprop
fdt_del_mem_rsv
fdt_del_node
fdt_delprop
fdt_find_string_
fdt_get_alias
fdt_get_max_phandle
fdt_get_path
fdt_get_property
fdt_get_property_by_offset
fdt_get_property_namelen
fdt_move
fdt_node_depth
fdt_node_end_offset_
fdt_node_offset_by_compatible
fdt_node_offset_by_phandle
fdt_node_offset_by_prop_value
fdt_nop_node
fdt_nop_property
fdt_num_mem_rsv
fdt_offset_ptr
fdt_open_into
fdt_pack
fdt_packblocks_
fdt_rw_check_header_
fdt_set_name
fdt_setprop
fdt_setprop_inplace
fdt_setprop_inplace_namelen_partial
fdt_setprop_placeholder
fdt_splice_
fdt_string
fdt_stringlist_count
fdt_stringlist_get
fdt_stringlist_search
fdt_subnode_offset
feature_lock
fib_table_flush_external
fib_trie_unmerge
fib_unmerge
find_named_trigger
__finish_swait
firmware_class_exit
fixup_red_left
force_printk_to_btext
force_sig_bnderr
force_sig_fault
force_sig_pkuerr
force_sig_ptrace_errno_trap
fork_idle
fprop_fraction_single
__fprop_inc_percpu
__fprop_inc_single
fprop_local_destroy_single
fprop_local_init_single
free_page_and_swap_cache
free_workqueue_attrs
fsl_mpic_primary_get_version
fsnotify_add_mark
fsnotify_finish_user_wait
fsnotify_get_mark_safe
fsnotify_prepare_user_wait
fsnotify_put_mark_wake
ftrace_exports
ftrace_get_addr_curr
ftrace_get_addr_new
ftrace_graph_ret_addr
ftrace_graph_stop
ftrace_nr_registered_ops
ftrace_ops_assist_func
ftrace_ops_get_func
ftrace_ops_trampoline
ftrace_run_stop_machine
ftrace_test_record
ftrace_text_reserved
__func__.3126
__func__.53147
func_ptr_is_kernel_text
generic_ptrace_pokedata
generic_rtc_driver_exit
__get_cached_msi_msg
get_cpu_cacheinfo
get_iowait_load
get_named_trigger_data
get_safe_page
get_syscall_name
get_vm_area
__get_vm_area_caller
grub_reclaim
gup_fast_permitted
gup_hugepte
handle_hmi_exception
handle_percpu_devid_irq
handle_percpu_irq
has_unmovable_pages
has_unmovable_pages.part.31
hdec_interrupt
hid_debug_exit
hid_exit
hid_generic_exit
hidraw_exit
hrtimers_prepare_cpu
hwmon_exit
i2c_register_board_info
igmp_mcf_get_next.isra.4
igmp_mcf_seq_fops
igmp_mcf_seq_next
igmp_mcf_seq_open
igmp_mcf_seq_ops
igmp_mcf_seq_show
igmp_mcf_seq_start
igmp_mcf_seq_stop
igmp_mc_init
igmp_mc_seq_fops
igmp_mc_seq_next
igmp_mc_seq_open
igmp_mc_seq_ops
igmp_mc_seq_show
igmp_mc_seq_start
igmp_mc_seq_stop
igmp_netdev_event
igmp_net_exit
igmp_net_init
igmp_net_ops
igmp_notifier
init_cpu_online
init_cpu_possible
init_cpu_present
init_kernel_text
init_thread_info
input_exit
input_leds_exit
insert_resource_conflict
insert_resource_expand_to_fit
insert_stat
instr_is_branch_to_addr
instr_is_relative_link_branch
iomem_map_sanity_check
io_range_mutex
ip6_ra_lock
ipv4_blackhole_route
ipv6_renew_options_kern
ipv6_sysctl_unregister
irq_chip_compose_msi_msg
irqchip_init
irq_cpu_offline
irq_cpu_online
irq_domain_set_info
irq_domain_update_bus_token
irq_get_next_irq
irq_set_percpu_devid
irq_set_percpu_devid_partition
isa_io_special
is_file_shm_hugepages
is_hardlockup
__is_kernel_percpu_address
is_kernel_percpu_address
is_module_address
__is_module_percpu_address
is_module_percpu_address
is_named_trigger
is_offset_in_branch_range
isolate_freepages_range
isolate_migratepages_range
is_pageblock_removable_nolock
__is_ram
is_tracing_stopped
is_vmalloc_or_module_addr
is_vma_temporary_stack
iterate_mounts
k2_skiplist
kcompactd_stop
__key.36706
keyctl_negate_key
key_serial_lock
kimage_is_destination_range
kmap_flush_unused
__kmem_cache_alloc_bulk
__kmem_cache_empty
kobj_child_ns_ops
kobj_ns_initial
kobj_ns_netlink
kobj_ns_type_registered
kretprobe_blacklist
kstat_incr_irq_this_cpu
kswapd_stop
ldsem_down_write_trylock
leds_exit
libata_transport_exit
lockup_detector_cleanup
lockup_detector_soft_poweroff
log_buf_addr_get
log_buf_len_get
logbuf_lock
logic_pio_register_range
logic_pio_to_hwaddr
logic_pio_trans_cpuaddr
lookup_module_symbol_attrs
lookup_page_ext
lookup_resource
lookup_symbol_attrs
mac_var_to_vmode
map_kernel_range_noflush
max_cfs_quota_period
max_possible_pfn
memblock_add_node
memblock_clear_nomap
memblock_get_current_limit
memblock_is_map_memory
memblock_is_region_memory
memblock_is_region_reserved
memblock_mark_mirror
memblock_mark_nomap
memblock_overlaps_region
memblock_reserved_size
memblock_start_of_DRAM
memblock_trim_memory
metadata_dst_free
migrate_huge_page_move_mapping
migrate_prep
migrate_reason_names
migration_entry_wait_huge
min_cfs_quota_period
mmc_blk_exit
mmc_exit
mmc_pwrseq_emmc_driver_exit
mmc_pwrseq_simple_driver_exit
mm_find_pmd
mmlist_lock
mmput_async
mmput_async_fn
mnt_clone_internal
mousedev_exit
mpc6xx_enter_standby
mpic_get_one_irq
mpic_setup_this_cpu
named_triggers
n_null_exit
noop_exit
nr_free_pagecache_pages
nsecs_to_usecs
num_powerpc_operands
nvmem_exit
nvram_cleanup
of_device_compatible_match
of_fdt_is_big_endian
of_fdt_limit_memory
__of_find_all_nodes
of_find_last_cache_level
of_find_matching_node_by_address
of_get_flat_dt_subnode_by_name
__of_get_property
of_msi_map_get_device_domain
__of_msi_map_rid
of_msi_map_rid
of_node_is_attached
of_parse_dma_window
of_pci_map_rid
of_print_phandle_args
__of_remove_property
__of_sysfs_remove_bin_file
oops_may_print
our_mnt
p4d_clear_bad
packet_exit
page_counter_cancel
page_mapped_in_vma
page_mapping_file
page_unlock_anon_vma_read
panic_flush_kmsg_end
panic_flush_kmsg_start
pata_macio_exit
patch_branch
pause_named_trigger
__pause_named_trigger.isra.4
pci_acs_enabled
pci_acs_flags_enabled
pci_acs_path_enabled
pci_add_cap_save_buffer
pcibios_max_latency
pcibios_penalize_isa_irq
pcibios_resource_survey_bus
pci_bridge_group
pci_bridge_groups
pci_bus_set_current_state
pci_dev_acs_enabled
pci_devs_are_dma_aliases
pci_dev_specific_acs_enabled
pcie_cap_has_lnkctl
pcie_dev_group
pcie_dev_groups
pci_ext_cfg_avail
pci_for_each_dma_alias
pci_get_interrupt_pin
pci_get_new_domain_nr
pci_lock
__pci_msix_desc_mask_irq
pci_parse_request_of_pci_ranges
pci_pio_to_address
pci_pme_wakeup
pci_pme_wakeup_bus
pci_quirk_amd_sb_acs
pci_quirk_cavium_acs
pci_quirk_intel_pch_acs
pci_quirk_intel_spt_pch_acs
pci_quirk_mf_endpoint_acs
pci_quirk_qcom_rp_acs
pci_quirk_xgene_acs
pci_request_acs
pci_set_platform_pm
pci_setup_bridge
pci_wakeup_bus
pcpu_lock
perf_duration_warn
perf_duration_work
perf_event_account_interrupt
perf_event_attrs
perf_event_exit_cpu
perf_event_itrace_started
perf_log_lost_samples
perf_pmu_name
perf_sample_event_took
perf_sched_cb_dec
perf_sched_cb_inc
pgd_clear_bad
phy_core_exit
pin_insert
pmac_get_uninorth_variant
pm_generic_prepare
pm_labels
pm_system_cancel_wakeup
power_events_sysfs_show
powerpc_macros
powerpc_num_macros
power_supply_class_exit
prandom_reseed_late
pr_cont_kernfs_name
prep_compound_page
__print_once.21255
print_vma_addr
prof_cpu_mask_proc_fops
prof_cpu_mask_proc_open
prof_cpu_mask_proc_show
prof_cpu_mask_proc_write
ptrace_get_reg
ptrace_writedata
pud_clear_bad
randomize_page
rcu_test_sync_prims
read_bhrb
reclaim_clean_pages_from_list
refined_jiffies
register_refined_jiffies
register_stat_tracer
regs_query_register_name
relay_prepare_cpu
remove_percpu_irq
__report_allowed
__report_avg
reset_node_managed_pages
__reset_stat_session
restore_math
ret_from_standby
ring_buffer_event_time_stamp
ring_buffer_nest_end
ring_buffer_nest_start
ring_buffer_page_len
_rs.53145
rsa_exit
rtc_dev_exit
s2idle_set_ops
save_named_trigger
sched_idle_set_state
sched_setattr_nocheck
scsi_sysfs_unregister
sdio_unregister_bus
secondary_cpu_time_init
send_sig_fault
serial8250_exit
serial_pci_driver_exit
__se_sys_fadvise64_64
__se_sys_gethostname
__se_sys_mmap_pgoff
__se_sys_msgctl
__se_sys_msgget
__se_sys_msgrcv
__se_sys_msgsnd
__se_sys_semctl
__se_sys_semget
__se_sys_semop
__se_sys_semtimedop
__se_sys_shmat
__se_sys_shmctl
__se_sys_shmdt
__se_sys_shmget
__se_sys_sync_file_range
set_breakpoint
set_graph_array
set_iounmap_nonlazy
set_named_trigger_data
set_pci_dma_ops
set_thread_uses_vas
setup_percpu_irq
setup_per_zone_wmarks
sg_pool_exit
shmem_charge
shmem_getpage
shmem_uncharge
shm_file_operations_huge
simple_xattr_list_add
skb_crc32c_csum_help
skb_do_redirect
smpboot_create_threads
smpboot_park_threads
smpboot_unpark_threads
smu_init
snapshot_additional_pages
sort_range
spi_register_board_info
stack_trace_max_lock
stat_dir
stat_seq_next
stat_seq_show
stat_seq_start
stat_seq_stop
subtract_range
swap_buf_le16
swap_lock
sysctl_schedstats
sys_fadvise64_64
sysfs_symlink_target_lock
sys_gethostname
sys_mmap_pgoff
sys_msgctl
sys_msgget
sys_msgrcv
sys_msgsnd
__sysrq_get_key_op
sys_semctl
sys_semget
sys_semop
sys_semtimedop
sys_shmat
sys_shmctl
sys_shmdt
sys_shmget
sys_switch_endian
sys_sync_file_range
tasklist_lock
task_rcu_dereference
__task_rq_lock
tau_interrupts
tcp_fastopen_active_should_disable
tcp_set_ulp_id
tcpudp_mt_exit
tg_set_cfs_period
tg_set_cfs_quota
tick_broadcast_ipi_handler
tick_cancel_sched_timer
tick_freeze
tick_freeze_depth
tick_nohz_get_idle_calls
tick_nohz_get_idle_calls_cpu
tick_nohz_idle_got_tick
tick_nohz_idle_retain_tick
tick_nohz_tick_stopped_cpu
tick_suspend_local
tick_unfreeze
timer_migration_handler
__tlb_remove_page_size
tnum_sbin
tnum_xor
touch_softlockup_watchdog_sync
trace_array_printk
trace_array_printk_buf
trace_array_vprintk
trace_clock_in_ns
trace_find_filtered_pid
tracefs_remove
trace_graph_function
trace_keep_overwrite
trace_latency_header
tracer_init
trace_stat_seq_ops
tracing_is_enabled
tracing_record_tgid
tracing_start
tracing_stat_fops
tracing_stat_open
tracing_stat_release
uart_get_console
udbg_printf
unix_get_socket
unpause_named_trigger
unregister_stat_tracer
uprobe_get_trap_addr
using_ftrace_ops_list_func
vfs_getxattr_alloc
vfs_ioctl
vle_num_opcodes
vle_opcodes
vma_is_special_mapping
vma_is_stack_for_current
vm_numa_stat_key
vsx_unavailable_exception
vwrite
walk_iomem_res_desc
walk_mem_res
walk_system_ram_res
watchdog_dev_exit
watchdog_exit
workqueue_prepare_cpu
wq_update_unbound_numa
x509_key_exit
xt_fini
xtime_update
zone_pcp_reset
>
> Will send them by private emails.
>
>> Thanks
>> Christophe
>>
>>
>>>
>>> ---
>>> done
>>> copying OF device tree...
>>> Building dt strings...
>>> Building dt structure...
>>> Device tree strings 0x01100000 -> 0x01100e02
>>> Device tree struct 0x01101000 -> 0x01109000
>>> Quiescing Open Firmware ...
>>> Booting Linux via __start() @ 0x00140000 ...
>>> _
>>> ---
>>>
>>>
>>>
>>>> config ISA_DMA_API
>>>> --
>>>> 2.13.3
>>>>
>>
^ permalink raw reply
* RE: [PATCH 2/6 v2] iommu: of: make of_pci_map_rid() available for other devices too
From: Nipun Gupta @ 2018-04-18 6:21 UTC (permalink / raw)
To: Robin Murphy, robh+dt@kernel.org, frowand.list@gmail.com
Cc: will.deacon@arm.com, mark.rutland@arm.com,
catalin.marinas@arm.com, hch@lst.de, gregkh@linuxfoundation.org,
joro@8bytes.org, m.szyprowski@samsung.com, shawnguo@kernel.org,
bhelgaas@google.com, iommu@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linuxppc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jdCBv
Zl9waGFuZGxlX2FyZ3MgaW9tbXVfc3BlYyA9IHsgLmFyZ3NfY291bnQgPSAxIH07DQo+ID4gICAJ
aW50IGVycjsNCj4gPg0KPiA+IC0JZXJyID0gb2ZfcGNpX21hcF9yaWQoaW5mby0+bnAsIGFsaWFz
LCAiaW9tbXUtbWFwIiwNCj4gPiAtCQkJICAgICAiaW9tbXUtbWFwLW1hc2siLCAmaW9tbXVfc3Bl
Yy5ucCwNCj4gPiAtCQkJICAgICBpb21tdV9zcGVjLmFyZ3MpOw0KPiA+ICsJZXJyID0gb2ZfbWFw
X3JpZChpbmZvLT5ucCwgYWxpYXMsICJpb21tdS1tYXAiLA0KPiA+ICsJCQkgImlvbW11LW1hcC1t
YXNrIiwgJmlvbW11X3NwZWMubnAsDQo+ID4gKwkJCSBpb21tdV9zcGVjLmFyZ3MpOw0KPiANCj4g
U3VwZXItbml0OiBBcHBhcmVudGx5IEkgbWlzc2VkIHJld3JhcHBpbmcgdGhpcyB0byAyIGxpbmVz
IGluIGQ4N2JlYjc0OTI4MSwgYnV0IGlmDQo+IGl0J3MgYmVpbmcgdG91Y2hlZCBhZ2FpbiwgdGhh
dCB3b3VsZCBiZSBuaWNlIDspDQoNClN1cmUuLiBJJ2xsIHRha2UgY2FyZSBvZiB0aGlzIGluIHRo
ZSBuZXh0IHZlcnNpb24gOikNCg0KUmVnYXJkcywNCk5pcHVuDQo=
^ permalink raw reply
* Re: [PATCH] powerpc/8xx: Build fix with Hugetlbfs enabled
From: Michael Ellerman @ 2018-04-18 5:42 UTC (permalink / raw)
To: Aneesh Kumar K.V, benh, paulus
Cc: linuxppc-dev, Aneesh Kumar K.V, Christophe LEROY
In-Reply-To: <20180416112724.9677-2-aneesh.kumar@linux.ibm.com>
"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com> writes:
> 8xx use slice code when hugetlbfs is enabled. We missed a header include on
> 8xx which resulted in the below build failure.
>
> config: mpc885_ads_defconfig + CONFIG_HUGETLBFS
>
> CC arch/powerpc/mm/slice.o
> arch/powerpc/mm/slice.c: In function 'slice_get_unmapped_area':
> arch/powerpc/mm/slice.c:655:2: error: implicit declaration of function 'need_extra_context' [-Werror=implicit-function-declaration]
> arch/powerpc/mm/slice.c:656:3: error: implicit declaration of function 'alloc_extended_context' [-Werror=implicit-function-declaration]
> cc1: all warnings being treated as errors
> make[1]: *** [arch/powerpc/mm/slice.o] Error 1
> make: *** [arch/powerpc/mm] Error 2
>
> on PPC64 the mmu_context.h was included via linux/pkeys.h
>
> CC: Christophe LEROY <christophe.leroy@c-s.fr>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
> ---
> arch/powerpc/mm/slice.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
> index 9cd87d11fe4e..205fe557ca10 100644
> --- a/arch/powerpc/mm/slice.c
> +++ b/arch/powerpc/mm/slice.c
> @@ -35,6 +35,7 @@
> #include <asm/mmu.h>
> #include <asm/copro.h>
> #include <asm/hugetlb.h>
> +#include <asm/mmu_context.h>
I already merged this, didn't I?
cheers
^ permalink raw reply
* RE: [PATCH 2/6 v2] iommu: of: make of_pci_map_rid() available for other devices too
From: Bharat Bhushan @ 2018-04-18 5:09 UTC (permalink / raw)
To: Robin Murphy, Nipun Gupta, robh+dt@kernel.org,
frowand.list@gmail.com
Cc: will.deacon@arm.com, mark.rutland@arm.com,
catalin.marinas@arm.com, hch@lst.de, gregkh@linuxfoundation.org,
joro@8bytes.org, m.szyprowski@samsung.com, shawnguo@kernel.org,
bhelgaas@google.com, iommu@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org,
stuyoder@gmail.com, Laurentiu Tudor, Leo Li
In-Reply-To: <41b32766-e21a-e946-6c8f-440e5c87d0ee@arm.com>
DQoNCj4gLS0tLS1Pcm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BfbmFtZSwgY29uc3QgY2hhciAqbWFwX21hc2tf
bmFtZSwNCj4gPiAtCQkJc3RydWN0IGRldmljZV9ub2RlICoqdGFyZ2V0LCB1MzIgKmlkX291dCkN
Cj4gPiAtew0KPiA+IC0JcmV0dXJuIC1FSU5WQUw7DQo+ID4gLX0NCj4gPiAtDQo+ID4gICBzdGF0
aWMgaW5saW5lIGludA0KPiA+ICAgb2ZfcGNpX2dldF9tYXhfbGlua19zcGVlZChzdHJ1Y3QgZGV2
aWNlX25vZGUgKm5vZGUpDQo+ID4gICB7DQo+ID4NCg==
^ permalink raw reply
* Re: [RFC] virtio: Use DMA MAP API for devices without an IOMMU
From: Anshuman Khandual @ 2018-04-18 3:17 UTC (permalink / raw)
To: Christoph Hellwig, Benjamin Herrenschmidt
Cc: robh, Michael S. Tsirkin, aik, jasowang, linux-kernel,
virtualization, joe, david, linuxppc-dev, elfring
In-Reply-To: <20180415121157.GA17726@infradead.org>
On 04/15/2018 05:41 PM, Christoph Hellwig wrote:
> On Fri, Apr 06, 2018 at 06:37:18PM +1000, Benjamin Herrenschmidt wrote:
>>>> implemented as DMA API which the virtio core understands. There is no
>>>> need for an IOMMU to be involved for the device representation in this
>>>> case IMHO.
>>>
>>> This whole virtio translation issue is a mess. I think we need to
>>> switch it to the dma API, and then quirk the legacy case to always
>>> use the direct mapping inside the dma API.
>>
>> Fine with using a dma API always on the Linux side, but we do want to
>> special case virtio still at the arch and qemu side to have a "direct
>> mapping" mode. Not sure how (special flags on PCI devices) to avoid
>> actually going through an emulated IOMMU on the qemu side, because that
>> slows things down, esp. with vhost.
>>
>> IE, we can't I think just treat it the same as a physical device.
>
> We should have treated it like a physical device from the start, but
> that device has unfortunately sailed.
>
> But yes, we'll need a per-device quirk that says 'don't attach an
> iommu'.
How about doing it per platform basis as suggested in this RFC through
an arch specific callback. Because all the virtio devices in the given
platform would require and exercise this option (to avail bounce buffer
mechanism for secure guests as an example). So the flag basically is a
platform specific one not a device specific one.
^ permalink raw reply
* [PATCH v2 7/7] ocxl: Document new OCXL IOCTLs
From: Alastair D'Silva @ 2018-04-18 1:08 UTC (permalink / raw)
To: linuxppc-dev
Cc: linux-kernel, linux-doc, mikey, vaibhav, aneesh.kumar, malat,
felix, pombredanne, sukadev, npiggin, gregkh, arnd,
andrew.donnellan, fbarrat, corbet, Alastair D'Silva
In-Reply-To: <20180418010810.30937-1-alastair@au1.ibm.com>
From: Alastair D'Silva <alastair@d-silva.org>
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
---
Documentation/accelerators/ocxl.rst | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/Documentation/accelerators/ocxl.rst b/Documentation/accelerators/ocxl.rst
index 7904adcc07fd..3b8d3b99795c 100644
--- a/Documentation/accelerators/ocxl.rst
+++ b/Documentation/accelerators/ocxl.rst
@@ -157,6 +157,17 @@ OCXL_IOCTL_GET_METADATA:
Obtains configuration information from the card, such at the size of
MMIO areas, the AFU version, and the PASID for the current context.
+OCXL_IOCTL_ENABLE_P9_WAIT:
+
+ Allows the AFU to wake a userspace thread executing 'wait'. Returns
+ information to userspace to allow it to configure the AFU. Note that
+ this is only available on Power 9.
+
+OCXL_IOCTL_GET_FEATURES:
+
+ Reports on which CPU features that affect OpenCAPI are usable from
+ userspace.
+
mmap
----
--
2.14.3
^ permalink raw reply related
* [PATCH v2 1/7] powerpc: Add TIDR CPU feature for Power9
From: Alastair D'Silva @ 2018-04-18 1:08 UTC (permalink / raw)
To: linuxppc-dev
Cc: linux-kernel, linux-doc, mikey, vaibhav, aneesh.kumar, malat,
felix, pombredanne, sukadev, npiggin, gregkh, arnd,
andrew.donnellan, fbarrat, corbet, Alastair D'Silva
In-Reply-To: <20180418010810.30937-1-alastair@au1.ibm.com>
From: Alastair D'Silva <alastair@d-silva.org>
This patch adds a CPU feature bit to show whether the CPU has
the TIDR register available, enabling as_notify/wait in userspace.
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
---
arch/powerpc/include/asm/cputable.h | 3 ++-
arch/powerpc/kernel/dt_cpu_ftrs.c | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
index 4e332f3531c5..54c4cbbe57b4 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -215,6 +215,7 @@ static inline void cpu_feature_keys_init(void) { }
#define CPU_FTR_P9_TM_HV_ASSIST LONG_ASM_CONST(0x0000100000000000)
#define CPU_FTR_P9_TM_XER_SO_BUG LONG_ASM_CONST(0x0000200000000000)
#define CPU_FTR_P9_TLBIE_BUG LONG_ASM_CONST(0x0000400000000000)
+#define CPU_FTR_P9_TIDR LONG_ASM_CONST(0x0000800000000000)
#ifndef __ASSEMBLY__
@@ -462,7 +463,7 @@ static inline void cpu_feature_keys_init(void) { }
CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY | \
CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_ARCH_207S | \
CPU_FTR_TM_COMP | CPU_FTR_ARCH_300 | CPU_FTR_PKEY | \
- CPU_FTR_P9_TLBIE_BUG)
+ CPU_FTR_P9_TLBIE_BUG | CPU_FTR_P9_TIDR)
#define CPU_FTRS_POWER9_DD1 ((CPU_FTRS_POWER9 | CPU_FTR_POWER9_DD1) & \
(~CPU_FTR_SAO))
#define CPU_FTRS_POWER9_DD2_0 CPU_FTRS_POWER9
diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c b/arch/powerpc/kernel/dt_cpu_ftrs.c
index 11a3a4fed3fb..10f8b7f55637 100644
--- a/arch/powerpc/kernel/dt_cpu_ftrs.c
+++ b/arch/powerpc/kernel/dt_cpu_ftrs.c
@@ -722,6 +722,7 @@ static __init void cpufeatures_cpu_quirks(void)
if ((version & 0xffff0000) == 0x004e0000) {
cur_cpu_spec->cpu_features &= ~(CPU_FTR_DAWR);
cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_BUG;
+ cur_cpu_spec->cpu_features |= CPU_FTR_P9_TIDR;
}
}
--
2.14.3
^ 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