question about nopage sample code

2017-02-22 Thread Ali Aminian
in ldd3 no page is implemented as the code posted below (page 428).
can someone explain why should we subtract vma->vm_start?

struct page *simple_vma_nopage(struct vm_area_struct *vma,
unsigned long address, int *type)
{
struct page *pageptr;
unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
unsigned long physaddr = address - vma->vm_start + offset;  // why
should we subtract vma->vm_start ?
unsigned long pageframe = physaddr >> PAGE_SHIFT;

if (!pfn_valid(pageframe))
return NOPAGE_SIGBUS;
pageptr = pfn_to_page(pageframe);
get_page(pageptr);
if (type)
*type = VM_FAULT_MINOR;
return pageptr;

}

thank you
Ali Aminian.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to dump user space stack from kernel space

2017-02-22 Thread Greg KH
On Tue, Feb 21, 2017 at 03:09:30PM +, Abhay Koralli wrote:
> Hi, 
> 
> We want to get the user space stack trace from the kernel space. Is there any
> easy way to dump the same ?

What exact problem are you trying to solve that getting a random
userspace callstack is needed from within the kernel?

thanks,

greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Cannot activate multiple CPUs.

2017-02-22 Thread chris warth
Is there a trick to bringing up multiple CPUs on an SOC?
My kernel is not bringing up secondary CPUs.

Running a kernel compiled from v4.10 sources on an LS1046A reference board.
Support for this platform only arrived in the mainline sources in
v4.10, so it is pretty new, and
there are clearly differences from the vendor supplied SDK sources.

Configured with generic arm64 defconfig.
Loading the kernel via `booti` in u-boot.  Provided
fsl-ls1046a-rdb.dtb as the device tree.
Console log indicates only a single CPU is available.

[0.083735] EFI services will not be available.
[0.096301] smp: Bringing up secondary CPUs ...
[1.141306] CPU1: failed to come online
[1.145159] CPU1: failed in unknown state : 0x0
[2.202164] CPU2: failed to come online
[2.206016] CPU2: failed in unknown state : 0x0
[3.263021] CPU3: failed to come online
[3.266873] CPU3: failed in unknown state : 0x0
[3.271449] smp: Brought up 1 node, 1 CPU

Is it possible that multiple cores are not supported in the mainline code?
Or am I missing some piece of configuration that would bring up multiple cores?

Thanks in advance,

- Chris

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies