RE: [RFC v2] arm:extend the reserved mrmory for initrd to be page aligned

2014-12-04 Thread Wang, Yalin
 -Original Message-
 From: Catalin Marinas [mailto:catalin.mari...@arm.com]
 Sent: Thursday, December 04, 2014 8:03 PM
 To: Russell King - ARM Linux
 Cc: Wang, Yalin; 'linux...@kvack.org'; Will Deacon; 'linux-
 ker...@vger.kernel.org'; 'linux-arm-ker...@lists.infradead.org'; 'linux-
 arm-...@vger.kernel.org'; Peter Maydell
 Subject: Re: [RFC v2] arm:extend the reserved mrmory for initrd to be page
 aligned
 
 On Mon, Sep 15, 2014 at 12:33:25PM +0100, Russell King - ARM Linux wrote:
  On Mon, Sep 15, 2014 at 07:07:20PM +0800, Wang, Yalin wrote:
   @@ -636,6 +646,11 @@ static int keep_initrd;  void
   free_initrd_mem(unsigned long start, unsigned long end)  {
 if (!keep_initrd) {
   + if (start == initrd_start)
   + start = round_down(start, PAGE_SIZE);
   + if (end == initrd_end)
   + end = round_up(end, PAGE_SIZE);
   +
 poison_init_mem((void *)start, PAGE_ALIGN(end) - start);
 free_reserved_area((void *)start, (void *)end, -1, initrd);
 }
 
  is the only bit of code you likely need to achieve your goal.
 
  Thinking about this, I think that you are quite right to align these.
  The memory around the initrd is defined to be system memory, and we
  already free the pages around it, so it *is* wrong not to free the
  partial initrd pages.
 
 Actually, I think we have a problem, at least on arm64 (raised by Peter
 Maydell). There is no guarantee that the page around start/end of initrd is
 free, it may contain the dtb for example. This is even more obvious when we
 have a 64KB page kernel (the boot loader doesn't know the page size that
 the kernel is going to use).
 
 The bug was there before as we had poison_init_mem() already (not it
 disappeared since free_reserved_area does the poisoning).
 
 So as a quick fix I think we need the rounding the other way (and in the
 general case we probably lose a page at the end of initrd):
 
 diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index
 494297c698ca..39fd080683e7 100644
 --- a/arch/arm64/mm/init.c
 +++ b/arch/arm64/mm/init.c
 @@ -335,9 +335,9 @@ void free_initrd_mem(unsigned long start, unsigned long
 end)  {
   if (!keep_initrd) {
   if (start == initrd_start)
 - start = round_down(start, PAGE_SIZE);
 + start = round_up(start, PAGE_SIZE);
   if (end == initrd_end)
 - end = round_up(end, PAGE_SIZE);
 + end = round_down(end, PAGE_SIZE);
 
   free_reserved_area((void *)start, (void *)end, 0, initrd);
   }
 
 A better fix would be to check what else is around the start/end of initrd.
I think a better way is add some head info in Image header,
So that bootloader  can know the kernel CONFIG_PAGE_SIZE ,
For example we can add PAGE_SIZE in zImage header .
How about this way?



--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH resend] arm:extend the reserved memory for initrd to be page aligned

2014-10-09 Thread Wang, Yalin
 Who guarantees there's no valuable data in [start, initrd_start) and
 [initrd_end, end) being corrupted?
 
mm..
I am not sure if the memblock_reserve will reserve
Memory from page aligned address?
If not, do we need also make memblock_reserve the initrd memory
From page aligned start(round down) to page aligned end address(round up) ? 

Thanks
N�r��yb�X��ǧv�^�)޺{.n�+{�j���h����ܨ}���Ơz�j:+v���zZ+��+zf���h���~i���z��w���?��)ߢf

RE: [PATCH resend] arm:extend the reserved memory for initrd to be page aligned

2014-09-27 Thread Wang, Yalin
 -Original Message-
 On Thu, Sep 25, 2014 at 03:31:42PM +0100, Russell King - ARM Linux wrote:
  On Fri, Sep 19, 2014 at 11:00:02AM +0100, Catalin Marinas wrote:
   On Fri, Sep 19, 2014 at 08:09:47AM +0100, Wang, Yalin wrote:
this patch extend the start and end address of initrd to be page
aligned, so that we can free all memory including the un-page
aligned head or tail page of initrd, if the start or end address
of initrd are not page aligned, the page can't be freed by
 free_initrd_mem() function.
   
Signed-off-by: Yalin Wang yalin.w...@sonymobile.com
  
   Acked-by: Catalin Marinas catalin.mari...@arm.com
  
   (as I said, if Russell doesn't have any objections please send the
   patch to his patch system)
 
  I now have an objection.  The patches in the emails were properly
 formatted.
 
 They were so close ;)
 
 I can see three patches but none of them exactly right:
 
 8157/1 - wrong diff format
 8159/1 - correct format, does not have my ack (you can take this one if
you want)
 8162/1 - got my ack this time but with the wrong diff format again
 
 Maybe a pull request is a better idea.
 
I have resend the 2 patches:
http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=8167/1
http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=8168/1
 
please have a look.

Thanks



--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH resend] arm:extend the reserved memory for initrd to be page aligned

2014-09-25 Thread Wang, Yalin
 On Fri, Sep 19, 2014 at 11:00:02AM +0100, Catalin Marinas wrote:
  On Fri, Sep 19, 2014 at 08:09:47AM +0100, Wang, Yalin wrote:
   this patch extend the start and end address of initrd to be page
   aligned, so that we can free all memory including the un-page
   aligned head or tail page of initrd, if the start or end address of
   initrd are not page aligned, the page can't be freed by
 free_initrd_mem() function.
  
   Signed-off-by: Yalin Wang yalin.w...@sonymobile.com
 
  Acked-by: Catalin Marinas catalin.mari...@arm.com
 
  (as I said, if Russell doesn't have any objections please send the
  patch to his patch system)
 
 I now have an objection.  The patches in the emails were properly formatted.
 The patches which were submitted to the patch system (there's two of them
 doing the same thing...) are not:
 
 --- ../kernel.torvalds.git.origin/arch/arm/mm/init.c2014-09-24
 16:24:06.863759000 +0800
 +++ arch/arm/mm/init.c  2014-09-24 16:27:11.455456000 +0800
 
 This is totally broken.  Let's read the patch(1) man page:
 
First, patch takes an ordered list of candidate file names as
 follows:
 
 · If the header is that of a context diff, patch takes the old and
 new
   file  names  in  the  header.  A name is ignored if it does not
 have
   enough slashes to satisfy the -pnum or --strip=num option.  The
 name
   /dev/null is also ignored.
 
 · If  there is an Index: line in the leading garbage and if either
 the
   old and new names are both absent  or  if  patch  is  conforming
 to
   POSIX, patch takes the name in the Index: line.
 
 · For the purpose of the following rules, the candidate file names
 are
   considered to be in the order (old, new, index), regardless  of
 the
   order that they appear in the header.
 
Then patch selects a file name from the candidate list as follows:
 
 · If  some  of  the named files exist, patch selects the first name
 if
   conforming to POSIX, and the best name otherwise.
 ...
 · If no named files exist, no RCS, ClearCase, Perforce, or SCCS
 master
   was found, some names are given, patch is not conforming  to
 POSIX,
   and  the patch appears to create a file, patch selects the best
 name
   requiring the creation of the fewest directories.
 
 · If no file name results from the above heuristics, you are asked
 for
   the name of the file to patch, and patch selects that name.
 
 ...
 
 NOTES FOR PATCH SENDERS
There are several things you should bear in mind if you are going to
 be
sending out patches.
 ...
If the recipient is supposed to use the -pN option, do not send
 output
that looks like this:
 
   diff -Naur v2.0.29/prog/README prog/README
   --- v2.0.29/prog/README   Mon Mar 10 15:13:12 1997
   +++ prog/README   Mon Mar 17 14:58:22 1997
 
because  the two file names have different numbers of slashes, and
 dif-
ferent versions of patch interpret  the  file  names  differently.
 To
avoid confusion, send output that looks like this instead:
 
   diff -Naur v2.0.29/prog/README v2.0.30/prog/README
   --- v2.0.29/prog/README   Mon Mar 10 15:13:12 1997
   +++ v2.0.30/prog/README   Mon Mar 17 14:58:22 1997
 
Got it ,
I will resend the patch,
By the way, how to remove my wrong patch in the patch system ?

Thanks



--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH resend] arm:extend the reserved memory for initrd to be page aligned

2014-09-19 Thread Wang, Yalin
this patch extend the start and end address of initrd to be page aligned,
so that we can free all memory including the un-page aligned head or tail
page of initrd, if the start or end address of initrd are not page
aligned, the page can't be freed by free_initrd_mem() function.

Signed-off-by: Yalin Wang yalin.w...@sonymobile.com
---
 arch/arm/mm/init.c   | 5 +
 arch/arm64/mm/init.c | 8 +++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 659c75d..9221645 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -636,6 +636,11 @@ static int keep_initrd;
 void free_initrd_mem(unsigned long start, unsigned long end)
 {
if (!keep_initrd) {
+   if (start == initrd_start)
+   start = round_down(start, PAGE_SIZE);
+   if (end == initrd_end)
+   end = round_up(end, PAGE_SIZE);
+
poison_init_mem((void *)start, PAGE_ALIGN(end) - start);
free_reserved_area((void *)start, (void *)end, -1, initrd);
}
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 5472c24..c5512f6 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -334,8 +334,14 @@ static int keep_initrd;
 
 void free_initrd_mem(unsigned long start, unsigned long end)
 {
-   if (!keep_initrd)
+   if (!keep_initrd) {
+   if (start == initrd_start)
+   start = round_down(start, PAGE_SIZE);
+   if (end == initrd_end)
+   end = round_up(end, PAGE_SIZE);
+
free_reserved_area((void *)start, (void *)end, 0, initrd);
+   }
 }
 
 static int __init keepinitrd_setup(char *__unused)
-- 
2.1.0
--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH Resend] arm:extend the reserved mrmory for initrd to be page aligned

2014-09-18 Thread Wang, Yalin
This patch extends the start and end address of initrd to be page aligned,
so that we can free all memory including the un-page aligned head or tail
page of initrd, if the start or end address of initrd are not page
aligned, the page can't be freed by free_initrd_mem() function.

Signed-off-by: Yalin Wang yalin.w...@sonymobile.com
---
 arch/arm/mm/init.c   | 5 +
 arch/arm64/mm/init.c | 8 +++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 659c75d..9221645 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -636,6 +636,11 @@ static int keep_initrd;
 void free_initrd_mem(unsigned long start, unsigned long end)
 {
if (!keep_initrd) {
+   if (start == initrd_start)
+   start = round_down(start, PAGE_SIZE);
+   if (end == initrd_end)
+   end = round_up(end, PAGE_SIZE);
+
poison_init_mem((void *)start, PAGE_ALIGN(end) - start);
free_reserved_area((void *)start, (void *)end, -1, initrd);
}
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 5472c24..c5512f6 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -334,8 +334,14 @@ static int keep_initrd;
 
 void free_initrd_mem(unsigned long start, unsigned long end)
 {
-   if (!keep_initrd)
+   if (!keep_initrd) {
+   if (start == initrd_start)
+   start = round_down(start, PAGE_SIZE);
+   if (end == initrd_end)
+   end = round_up(end, PAGE_SIZE);
+
free_reserved_area((void *)start, (void *)end, 0, initrd);
+   }
 }
 
 static int __init keepinitrd_setup(char *__unused)
-- 
2.1.0
--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [RFC] msm:rpm-smd:change msm_rpm_smd_work method

2014-09-17 Thread Wang, Yalin
Hi Bjorn,

I see,
Thanks for your kind remind :)

-Original Message-
On Tue, Sep 16, 2014 at 7:05 PM, Wang, Yalin yalin.w...@sonymobile.com wrote:
[..]
 diff --git a/arch/arm/mach-msm/rpm-smd.c b/arch/arm/mach-msm/rpm-smd.c

Hi Yalin,

This file does not exist in mainline and this is not the forum for sending 
patches to codeaurora.
Also note that your commit messages may not include Change-id when sending to 
LKML.

Regards,
Bjorn


[RFC] msm:rpm-smd:change msm_rpm_smd_work method

2014-09-16 Thread Wang, Yalin
this change msm_rpm_smd_work method to let it
run not as a forever loop, this can improve some
performance, because if the work_struct callback run
forever, it will hold the work thread forever, and other
work_struct can use it, it is not suitable for performance.

Change-Id: Ic99b36f8a3720b2bdfe45e4263a69f3d58c47cd1
Signed-off-by: Yalin Wang yalin.w...@sonymobile.com
---
 arch/arm/mach-msm/rpm-smd.c | 30 --
 1 file changed, 12 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-msm/rpm-smd.c b/arch/arm/mach-msm/rpm-smd.c
index 2a01a36..243463d 100644
--- a/arch/arm/mach-msm/rpm-smd.c
+++ b/arch/arm/mach-msm/rpm-smd.c
@@ -464,8 +464,6 @@ struct msm_rpm_ack_msg {
 
 LIST_HEAD(msm_rpm_ack_list);
 
-static DECLARE_COMPLETION(data_ready);
-
 static void msm_rpm_notify_sleep_chain(struct rpm_message_header *hdr,
struct msm_rpm_kvp_data *kvp)
 {
@@ -654,7 +652,7 @@ static void msm_rpm_notify(void *data, unsigned event)
 
switch (event) {
case SMD_EVENT_DATA:
-   complete(data_ready);
+   queue_work(msm_rpm_smd_wq, msm_rpm_data.work);
break;
case SMD_EVENT_OPEN:
complete(pdata-smd_open);
@@ -849,19 +847,15 @@ static void msm_rpm_smd_work(struct work_struct *work)
int errno;
char buf[MAX_ERR_BUFFER_SIZE] = {0};
 
-   while (1) {
-   wait_for_completion(data_ready);
-
-   spin_lock(msm_rpm_data.smd_lock_read);
-   while (smd_is_pkt_avail(msm_rpm_data.ch_info)) {
-   if (msm_rpm_read_smd_data(buf))
-   break;
-   msg_id = msm_rpm_get_msg_id_from_ack(buf);
-   errno = msm_rpm_get_error_from_ack(buf);
-   msm_rpm_process_ack(msg_id, errno);
-   }
-   spin_unlock(msm_rpm_data.smd_lock_read);
+   spin_lock(msm_rpm_data.smd_lock_read);
+   while (smd_is_pkt_avail(msm_rpm_data.ch_info)) {
+   if (msm_rpm_read_smd_data(buf))
+   break;
+   msg_id = msm_rpm_get_msg_id_from_ack(buf);
+   errno = msm_rpm_get_error_from_ack(buf);
+   msm_rpm_process_ack(msg_id, errno);
}
+   spin_unlock(msm_rpm_data.smd_lock_read);
 }
 
 static void msm_rpm_log_request(struct msm_rpm_request *cdata)
@@ -1237,7 +1231,7 @@ wait_ack_cleanup:
spin_unlock_irqrestore(msm_rpm_data.smd_lock_read, flags);
 
if (smd_is_pkt_avail(msm_rpm_data.ch_info))
-   complete(data_ready);
+   queue_work(msm_rpm_smd_wq, msm_rpm_data.work);
return rc;
 }
 EXPORT_SYMBOL(msm_rpm_wait_for_ack_noirq);
@@ -1385,10 +1379,10 @@ static int __devinit msm_rpm_dev_probe(struct 
platform_device *pdev)
 
if (!standalone) {
msm_rpm_smd_wq = alloc_workqueue(rpm-smd,
-   WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_HIGHPRI, 1);
+   WQ_UNBOUND | WQ_MEM_RECLAIM |
+   WQ_HIGHPRI | WQ_NON_REENTRANT, 1);
if (!msm_rpm_smd_wq)
return -EINVAL;
-   queue_work(msm_rpm_smd_wq, msm_rpm_data.work);
}
 
of_platform_populate(pdev-dev.of_node, NULL, NULL, pdev-dev);
-- 
2.1.0
--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [RFC] arm:extend the reserved mrmory for initrd to be page aligned

2014-09-15 Thread Wang, Yalin
Hi

I tested it on my phone,
From log:
4[0.00] INITRD unalign phys address:0x0200+0x0022fb0e
4[0.00] INITRD aligned phys address:0x0200+0x0023

4[0.579474] free_initrd_mem: free pfn:8192---8752

The tail address is not aligned for most initrd image,
This page will not be freed and lost .

This patch have a limitation that the tail page's not used
Part should not be reserved by any other driver,
And must be memory .
This is true for most bootloaders ,
And we will print error if it is false .

Thanks


-Original Message-
From: Russell King - ARM Linux [mailto:li...@arm.linux.org.uk] 
Sent: Monday, September 15, 2014 4:46 PM
To: Wang, Yalin
Cc: 'Will Deacon'; 'linux-ker...@vger.kernel.org'; 
'linux-arm-ker...@lists.infradead.org'; 'linux...@kvack.org'; 
linux-arm-msm@vger.kernel.org
Subject: Re: [RFC] arm:extend the reserved mrmory for initrd to be page aligned

On Mon, Sep 15, 2014 at 01:11:14PM +0800, Wang, Yalin wrote:
 this patch extend the start and end address of initrd to be page 
 aligned, so that we can free all memory including the un-page aligned 
 head or tail page of initrd, if the start or end address of initrd are 
 not page aligned, the page can't be freed by free_initrd_mem() function.

Have you tested this patch?  If so, how thorough was your testing?

--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up according 
to speedtest.net.
--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [RFC] arm:extend the reserved mrmory for initrd to be page aligned

2014-09-15 Thread Wang, Yalin
Hi

Add more log:
4[0.00] INITRD unalign phys address:0x0200+0x0022fb0e
4[0.00] INITRD aligned phys address:0x0200+0x0023
4[0.574868] free_initrd: free initrd 0xc200+0xc222fb0e
4[0.579398] free_initrd_mem: free pfn:8192---8752

The inird used memory is still the same as the one passed by bootloads,
I don't change it. It should be safe.


-Original Message-
From: Russell King - ARM Linux [mailto:li...@arm.linux.org.uk] 
Sent: Monday, September 15, 2014 5:30 PM
To: Wang, Yalin
Cc: 'Will Deacon'; 'linux-ker...@vger.kernel.org'; 
'linux-arm-ker...@lists.infradead.org'; 'linux...@kvack.org'; 
linux-arm-msm@vger.kernel.org
Subject: Re: [RFC] arm:extend the reserved mrmory for initrd to be page aligned

On Mon, Sep 15, 2014 at 05:07:53PM +0800, Wang, Yalin wrote:
 Hi
 
 I tested it on my phone,
 From log:
 4[0.00] INITRD unalign phys address:0x0200+0x0022fb0e
 4[0.00] INITRD aligned phys address:0x0200+0x0023
 
 4[0.579474] free_initrd_mem: free pfn:8192---8752
 
 The tail address is not aligned for most initrd image, This page will 
 not be freed and lost .

Right, so from this I can assume that you only tested it by seeing what the 
addresses were, and the values used in free_initrd_mem().

What you haven't tested is whether the initrd actually gets used with your 
changes, which is more what I was interested in given what I found when reading 
your patch.

--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up according 
to speedtest.net.
--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [RFC] arm:extend the reserved mrmory for initrd to be page aligned

2014-09-15 Thread Wang, Yalin
Hi

Oh, I see your meaning,
Yeah , my initrd is a cpio image,
And it can still work after apply this patch.


-Original Message-
From: Russell King - ARM Linux [mailto:li...@arm.linux.org.uk] 
Sent: Monday, September 15, 2014 6:17 PM
To: Wang, Yalin
Cc: 'Will Deacon'; 'linux-ker...@vger.kernel.org'; 
'linux-arm-ker...@lists.infradead.org'; 'linux...@kvack.org'; 
linux-arm-msm@vger.kernel.org
Subject: Re: [RFC] arm:extend the reserved mrmory for initrd to be page aligned

On Mon, Sep 15, 2014 at 05:59:27PM +0800, Wang, Yalin wrote:
 Hi
 
 Add more log:
 4[0.00] INITRD unalign phys address:0x0200+0x0022fb0e
 4[0.00] INITRD aligned phys address:0x0200+0x0023
 4[0.574868] free_initrd: free initrd 0xc200+0xc222fb0e
 4[0.579398] free_initrd_mem: free pfn:8192---8752
 
 The inird used memory is still the same as the one passed by 
 bootloads, I don't change it. It should be safe.

This tells me nothing about whether the initrd is actually /used/.  What it 
tells me is that it's being freed.  The function of an initrd is not to be a 
chunk of memory which gets freed later on in the boot process.
It is there to provide an initial ramdisk (whether it be a filesystem image, 
or a CPIO compressed archive) for userspace to run.

So, have you checked that initrd is still functional after this patch?

--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up according 
to speedtest.net.
--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [RFC] arm:extend the reserved mrmory for initrd to be page aligned

2014-09-15 Thread Wang, Yalin
Oh, I see,
I don't consider non-of platform kernels,
I will send V2 patch for this .

Thanks

-Original Message-
From: Russell King - ARM Linux [mailto:li...@arm.linux.org.uk] 
Sent: Monday, September 15, 2014 6:30 PM
To: Wang, Yalin
Cc: 'Will Deacon'; 'linux-ker...@vger.kernel.org'; 
'linux-arm-ker...@lists.infradead.org'; 'linux...@kvack.org'; 
linux-arm-msm@vger.kernel.org
Subject: Re: [RFC] arm:extend the reserved mrmory for initrd to be page aligned

On Mon, Sep 15, 2014 at 06:22:12PM +0800, Wang, Yalin wrote:
 Oh, I see your meaning,
 Yeah , my initrd is a cpio image,
 And it can still work after apply this patch.

Okay, that's what I wanted to know.  However, I believe your patch to be 
incorrect.  You delete the assignments to initrd_start and initrd_end in 
arm_memblock_init(), which will result in non-OF platforms having no initrd.

The reason is that OF platforms set initrd_start and initrd_size from the OF 
code (drivers/of/fdt.c), but ATAG platforms only set our private
phys_* versions.

The reason I went with phys_* stuff was to permit better verification of the 
addresses passed - that the addresses were indeed memory locations before 
passing them through something like __va().

--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up according 
to speedtest.net.
--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC v2] arm:extend the reserved mrmory for initrd to be page aligned

2014-09-15 Thread Wang, Yalin
this patch extend the start and end address of initrd to be page aligned,
so that we can free all memory including the un-page aligned head or tail
page of initrd, if the start or end address of initrd are not page
aligned, the page can't be freed by free_initrd_mem() function.

Signed-off-by: Yalin Wang yalin.w...@sonymobile.com
---
 arch/arm/mm/init.c   | 19 +--
 arch/arm64/mm/init.c | 37 +
 2 files changed, 50 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 659c75d..8490b70 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -277,6 +277,8 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, 
phys_addr_t align)
 void __init arm_memblock_init(const struct machine_desc *mdesc)
 {
/* Register the kernel text, kernel data and initrd with memblock. */
+   phys_addr_t phys_initrd_start_orig __maybe_unused;
+   phys_addr_t phys_initrd_size_orig __maybe_unused;
 #ifdef CONFIG_XIP_KERNEL
memblock_reserve(__pa(_sdata), _end - _sdata);
 #else
@@ -289,6 +291,13 @@ void __init arm_memblock_init(const struct machine_desc 
*mdesc)
phys_initrd_size = initrd_end - initrd_start;
}
initrd_start = initrd_end = 0;
+   phys_initrd_start_orig = phys_initrd_start;
+   phys_initrd_size_orig = phys_initrd_size;
+   /* make sure the start and end address are page aligned */
+   phys_initrd_size = round_up(phys_initrd_start + phys_initrd_size, 
PAGE_SIZE);
+   phys_initrd_start = round_down(phys_initrd_start, PAGE_SIZE);
+   phys_initrd_size -= phys_initrd_start;
+
if (phys_initrd_size 
!memblock_is_region_memory(phys_initrd_start, phys_initrd_size)) {
pr_err(INITRD: 0x%08llx+0x%08lx is not a memory region - 
disabling initrd\n,
@@ -305,9 +314,10 @@ void __init arm_memblock_init(const struct machine_desc 
*mdesc)
memblock_reserve(phys_initrd_start, phys_initrd_size);
 
/* Now convert initrd to virtual addresses */
-   initrd_start = __phys_to_virt(phys_initrd_start);
-   initrd_end = initrd_start + phys_initrd_size;
+   initrd_start = __phys_to_virt(phys_initrd_start_orig);
+   initrd_end = initrd_start + phys_initrd_size_orig;
}
+
 #endif
 
arm_mm_memblock_reserve();
@@ -636,6 +646,11 @@ static int keep_initrd;
 void free_initrd_mem(unsigned long start, unsigned long end)
 {
if (!keep_initrd) {
+   if (start == initrd_start)
+   start = round_down(start, PAGE_SIZE);
+   if (end == initrd_end)
+   end = round_up(end, PAGE_SIZE);
+
poison_init_mem((void *)start, PAGE_ALIGN(end) - start);
free_reserved_area((void *)start, (void *)end, -1, initrd);
}
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 5472c24..9dfd9a6 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -138,15 +138,38 @@ static void arm64_memory_present(void)
 void __init arm64_memblock_init(void)
 {
phys_addr_t dma_phys_limit = 0;
-
+   phys_addr_t phys_initrd_start;
+   phys_addr_t phys_initrd_size;
/*
 * Register the kernel text, kernel data, initrd, and initial
 * pagetables with memblock.
 */
memblock_reserve(__pa(_text), _end - _text);
 #ifdef CONFIG_BLK_DEV_INITRD
-   if (initrd_start)
-   memblock_reserve(__virt_to_phys(initrd_start), initrd_end - 
initrd_start);
+   if (initrd_start) {
+   phys_initrd_start = __virt_to_phys(initrd_start);
+   phys_initrd_size = initrd_end - initrd_start;
+   /* make sure the start and end address are page aligned */
+   phys_initrd_size = round_up(phys_initrd_start + 
phys_initrd_size, PAGE_SIZE);
+   phys_initrd_start = round_down(phys_initrd_start, PAGE_SIZE);
+   phys_initrd_size -= phys_initrd_start;
+   if (phys_initrd_size 
+   !memblock_is_region_memory(phys_initrd_start, 
phys_initrd_size)) {
+   pr_err(INITRD: %pa+%pa is not a memory region - 
disabling initrd\n,
+   phys_initrd_start, phys_initrd_size);
+   phys_initrd_start = phys_initrd_size = 0;
+   }
+   if (phys_initrd_size 
+   memblock_is_region_reserved(phys_initrd_start, 
phys_initrd_size)) {
+   pr_err(INITRD: %pa+%pa overlaps in-use memory region - 
disabling initrd\n,
+   phys_initrd_start, phys_initrd_size);
+   phys_initrd_start = phys_initrd_size = 0;
+   }
+   if (phys_initrd_size)
+   memblock_reserve(phys_initrd_start, phys_initrd_size);
+   else
+   

RE: [RFC v2] arm:extend the reserved mrmory for initrd to be page aligned

2014-09-15 Thread Wang, Yalin
Great!
yeah, you are right,
just keep the change in free_initrd_mem( ) is ok.
we don't need keep reserved memory to be aligned ,

Thanks!


From: Russell King - ARM Linux [li...@arm.linux.org.uk]
Sent: Monday, September 15, 2014 7:33 PM
To: Wang, Yalin
Cc: 'Will Deacon'; 'linux-ker...@vger.kernel.org'; 
'linux-arm-ker...@lists.infradead.org'; 'linux...@kvack.org'; 
'linux-arm-msm@vger.kernel.org'
Subject: Re: [RFC v2] arm:extend the reserved mrmory for initrd to be page  
aligned

On Mon, Sep 15, 2014 at 07:07:20PM +0800, Wang, Yalin wrote:
 this patch extend the start and end address of initrd to be page aligned,
 so that we can free all memory including the un-page aligned head or tail
 page of initrd, if the start or end address of initrd are not page
 aligned, the page can't be freed by free_initrd_mem() function.

Better, but I think it's more complicated than it needs to be:

 Signed-off-by: Yalin Wang yalin.w...@sonymobile.com
 ---
  arch/arm/mm/init.c   | 19 +--
  arch/arm64/mm/init.c | 37 +
  2 files changed, 50 insertions(+), 6 deletions(-)

 diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
 index 659c75d..8490b70 100644
 --- a/arch/arm/mm/init.c
 +++ b/arch/arm/mm/init.c
 @@ -277,6 +277,8 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, 
 phys_addr_t align)
  void __init arm_memblock_init(const struct machine_desc *mdesc)
  {
   /* Register the kernel text, kernel data and initrd with memblock. */
 + phys_addr_t phys_initrd_start_orig __maybe_unused;
 + phys_addr_t phys_initrd_size_orig __maybe_unused;
  #ifdef CONFIG_XIP_KERNEL
   memblock_reserve(__pa(_sdata), _end - _sdata);
  #else
 @@ -289,6 +291,13 @@ void __init arm_memblock_init(const struct machine_desc 
 *mdesc)
   phys_initrd_size = initrd_end - initrd_start;
   }
   initrd_start = initrd_end = 0;
 + phys_initrd_start_orig = phys_initrd_start;
 + phys_initrd_size_orig = phys_initrd_size;
 + /* make sure the start and end address are page aligned */
 + phys_initrd_size = round_up(phys_initrd_start + phys_initrd_size, 
 PAGE_SIZE);
 + phys_initrd_start = round_down(phys_initrd_start, PAGE_SIZE);
 + phys_initrd_size -= phys_initrd_start;
 +
   if (phys_initrd_size 
   !memblock_is_region_memory(phys_initrd_start, phys_initrd_size)) {
   pr_err(INITRD: 0x%08llx+0x%08lx is not a memory region - 
 disabling initrd\n,
 @@ -305,9 +314,10 @@ void __init arm_memblock_init(const struct machine_desc 
 *mdesc)
   memblock_reserve(phys_initrd_start, phys_initrd_size);

   /* Now convert initrd to virtual addresses */
 - initrd_start = __phys_to_virt(phys_initrd_start);
 - initrd_end = initrd_start + phys_initrd_size;
 + initrd_start = __phys_to_virt(phys_initrd_start_orig);
 + initrd_end = initrd_start + phys_initrd_size_orig;
   }
 +

I think all the above is entirely unnecessary.  The memblock APIs
(especially memblock_reserve()) will mark the overlapped pages as reserved
- they round down the starting address, and round up the end address
(calculated from start + size).

Hence, this:

 @@ -636,6 +646,11 @@ static int keep_initrd;
  void free_initrd_mem(unsigned long start, unsigned long end)
  {
   if (!keep_initrd) {
 + if (start == initrd_start)
 + start = round_down(start, PAGE_SIZE);
 + if (end == initrd_end)
 + end = round_up(end, PAGE_SIZE);
 +
   poison_init_mem((void *)start, PAGE_ALIGN(end) - start);
   free_reserved_area((void *)start, (void *)end, -1, initrd);
   }

is the only bit of code you likely need to achieve your goal.

Thinking about this, I think that you are quite right to align these.
The memory around the initrd is defined to be system memory, and we
already free the pages around it, so it *is* wrong not to free the
partial initrd pages.

Good catch.

--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC v3] arm:extend the reserved mrmory for initrd to be page aligned

2014-09-15 Thread Wang, Yalin
this patch extend the start and end address of initrd to be page aligned,
so that we can free all memory including the un-page aligned head or tail
page of initrd, if the start or end address of initrd are not page
aligned, the page can't be freed by free_initrd_mem() function.

Signed-off-by: Yalin Wang yalin.w...@sonymobile.com
---
 arch/arm/mm/init.c   | 5 +
 arch/arm64/mm/init.c | 8 +++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 659c75d..9221645 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -636,6 +636,11 @@ static int keep_initrd;
 void free_initrd_mem(unsigned long start, unsigned long end)
 {
if (!keep_initrd) {
+   if (start == initrd_start)
+   start = round_down(start, PAGE_SIZE);
+   if (end == initrd_end)
+   end = round_up(end, PAGE_SIZE);
+
poison_init_mem((void *)start, PAGE_ALIGN(end) - start);
free_reserved_area((void *)start, (void *)end, -1, initrd);
}
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 5472c24..c5512f6 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -334,8 +334,14 @@ static int keep_initrd;
 
 void free_initrd_mem(unsigned long start, unsigned long end)
 {
-   if (!keep_initrd)
+   if (!keep_initrd) {
+   if (start == initrd_start)
+   start = round_down(start, PAGE_SIZE);
+   if (end == initrd_end)
+   end = round_up(end, PAGE_SIZE);
+
free_reserved_area((void *)start, (void *)end, 0, initrd);
+   }
 }
 
 static int __init keepinitrd_setup(char *__unused)
-- 
2.1.0
--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC] arm:extend the reserved mrmory for initrd to be page aligned

2014-09-14 Thread Wang, Yalin
this patch extend the start and end address of initrd to be page aligned,
so that we can free all memory including the un-page aligned head or tail
page of initrd, if the start or end address of initrd are not page
aligned, the page can't be freed by free_initrd_mem() function.

Signed-off-by: Yalin Wang yalin.w...@sonymobile.com
---
 arch/arm/mm/init.c   | 20 ++--
 arch/arm64/mm/init.c | 37 +
 2 files changed, 47 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 659c75d..6c1db07 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -288,7 +288,12 @@ void __init arm_memblock_init(const struct machine_desc 
*mdesc)
phys_initrd_start = __virt_to_phys(initrd_start);
phys_initrd_size = initrd_end - initrd_start;
}
-   initrd_start = initrd_end = 0;
+
+   /* make sure the start and end address are page aligned */
+   phys_initrd_size = round_up(phys_initrd_start + phys_initrd_size, 
PAGE_SIZE);
+   phys_initrd_start = round_down(phys_initrd_start, PAGE_SIZE);
+   phys_initrd_size -= phys_initrd_start;
+
if (phys_initrd_size 
!memblock_is_region_memory(phys_initrd_start, phys_initrd_size)) {
pr_err(INITRD: 0x%08llx+0x%08lx is not a memory region - 
disabling initrd\n,
@@ -301,13 +306,11 @@ void __init arm_memblock_init(const struct machine_desc 
*mdesc)
   (u64)phys_initrd_start, phys_initrd_size);
phys_initrd_start = phys_initrd_size = 0;
}
-   if (phys_initrd_size) {
+   if (phys_initrd_size)
memblock_reserve(phys_initrd_start, phys_initrd_size);
+   else
+   initrd_start = initrd_end = 0;
 
-   /* Now convert initrd to virtual addresses */
-   initrd_start = __phys_to_virt(phys_initrd_start);
-   initrd_end = initrd_start + phys_initrd_size;
-   }
 #endif
 
arm_mm_memblock_reserve();
@@ -636,6 +639,11 @@ static int keep_initrd;
 void free_initrd_mem(unsigned long start, unsigned long end)
 {
if (!keep_initrd) {
+   if (start == initrd_start)
+   start = round_down(start, PAGE_SIZE);
+   if (end == initrd_end)
+   end = round_up(end, PAGE_SIZE);
+
poison_init_mem((void *)start, PAGE_ALIGN(end) - start);
free_reserved_area((void *)start, (void *)end, -1, initrd);
}
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 5472c24..9dfd9a6 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -138,15 +138,38 @@ static void arm64_memory_present(void)
 void __init arm64_memblock_init(void)
 {
phys_addr_t dma_phys_limit = 0;
-
+   phys_addr_t phys_initrd_start;
+   phys_addr_t phys_initrd_size;
/*
 * Register the kernel text, kernel data, initrd, and initial
 * pagetables with memblock.
 */
memblock_reserve(__pa(_text), _end - _text);
 #ifdef CONFIG_BLK_DEV_INITRD
-   if (initrd_start)
-   memblock_reserve(__virt_to_phys(initrd_start), initrd_end - 
initrd_start);
+   if (initrd_start) {
+   phys_initrd_start = __virt_to_phys(initrd_start);
+   phys_initrd_size = initrd_end - initrd_start;
+   /* make sure the start and end address are page aligned */
+   phys_initrd_size = round_up(phys_initrd_start + 
phys_initrd_size, PAGE_SIZE);
+   phys_initrd_start = round_down(phys_initrd_start, PAGE_SIZE);
+   phys_initrd_size -= phys_initrd_start;
+   if (phys_initrd_size 
+   !memblock_is_region_memory(phys_initrd_start, 
phys_initrd_size)) {
+   pr_err(INITRD: %pa+%pa is not a memory region - 
disabling initrd\n,
+   phys_initrd_start, phys_initrd_size);
+   phys_initrd_start = phys_initrd_size = 0;
+   }
+   if (phys_initrd_size 
+   memblock_is_region_reserved(phys_initrd_start, 
phys_initrd_size)) {
+   pr_err(INITRD: %pa+%pa overlaps in-use memory region - 
disabling initrd\n,
+   phys_initrd_start, phys_initrd_size);
+   phys_initrd_start = phys_initrd_size = 0;
+   }
+   if (phys_initrd_size)
+   memblock_reserve(phys_initrd_start, phys_initrd_size);
+   else
+   initrd_start = initrd_end = 0;
+   }
 #endif
 
if (!efi_enabled(EFI_MEMMAP))
@@ -334,8 +357,14 @@ static int keep_initrd;
 
 void free_initrd_mem(unsigned long start, unsigned long end)
 {
-   if (!keep_initrd)
+   if (!keep_initrd) {
+   if (start == initrd_start)
+   start = round_down(start, 

回复: kexec on APQ8074

2014-09-12 Thread Wang, Yalin
Do you pass a initrd to kexec kernel?
i don't see it.

- 发送自我的Sony Xperia™智能手机

 Noé RUBINSTEIN编写 


2014-09-12 4:02 GMT+02:00 Wang, Yalin yalin.w...@sonymobile.com:
 What's your @memory parameters in your dtb file?
 And what's your PHYSICAL_OFFSET of your kexec kernel ?

TEXT_OFFSET is 0x8000;

Here's the content of the memory node:

memory {
#address-cells = 0x1;
#size-cells = 0x1;
device_type = memory;
reg = 0x0 0x4000 0x4000 0x4000;

secure_region {
linux,contiguous-region;
reg = 0x0 0xfc0;
label = secure_mem;
linux,phandle = 0x1b;
phandle = 0x1b;
};

adsp_region {
linux,contiguous-region;
reg = 0x0 0x2f0;
label = adsp_mem;
linux,phandle = 0x1c;
phandle = 0x1c;
};

qsecom_region {
linux,contiguous-region;
reg = 0x0 0x110;
label = qseecom_mem;
linux,phandle = 0x1d;
phandle = 0x1d;
};
};

Thanks a lot,
Noé


Don't use CMA pages for page cache

2014-06-23 Thread Wang, Yalin
Hi  Laura,

I notice this commit 

commit c1da80bfb0ce5f213b67e2aeeda885f63eb97d7d
mm: Don't use CMA pages for page cache

I  have a question about this change,
Why don't  use CMA page for page_cache alloc?
These pages are movable ,
So it can be replaced by other pages if system
Need reclaim cma pages ,
If we don't use cma pages for page_cache page,
Cma page will be not used if there is not enough 
Normal Free memory , but there are lots of cma pages.

Will have oom sometimes, especially in page reclaim
Call path .

Thanks



Wang Yalin
Engineer
OSDD

--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


bug fix for mmc queue.c

2014-01-21 Thread Wang, Yalin
Hi  

We encounter a problem when use sdcard ,
The driver probe will failed like this :

6[  121.644102] mmc0: mmc_start_bkops: Starting bkops
6[  133.039845] mmc0: mmc_start_bkops: raw_bkops_status=0x2, from_exception=0
6[  133.039888] mmc0: mmc_start_bkops: Starting bkops
6[  147.931642] mmc0: mmc_start_bkops: raw_bkops_status=0x2, from_exception=1
6[  148.634009] mmc0: mmc_start_bkops: Starting bkops
6[  164.279748] mmc1: slot status change detected (0 - 1), GPIO_ACTIVE_LOW
6[  164.612904] mmc1: new high speed SD card at address 1234
4[  164.620819] kworker/u:29: page allocation failure: order:5, mode:0x40d0
6[  164.629745] [c010c514] (unwind_backtrace+0x0/0x11c) from [c0217e78] 
(warn_alloc_failed+0x104/0x130)
6[  164.629789] [c0217e78] (warn_alloc_failed+0x104/0x130) from 
[c021b39c] (__alloc_pages_nodemask+0x7d4/0x8f4)
6[  164.629828] [c021b39c] (__alloc_pages_nodemask+0x7d4/0x8f4) from 
[c021b510] (__get_free_pages+0x10/0x24)
6[  164.629867] [c021b510] (__get_free_pages+0x10/0x24) from [c0246630] 
(kmalloc_order_trace+0x20/0xe0)
6[  164.629904] [c0246630] (kmalloc_order_trace+0x20/0xe0) from 
[c0249550] (__kmalloc+0x30/0x270)
6[  164.629939] [c0249550] (__kmalloc+0x30/0x270) from [c061cdbc] 
(mmc_alloc_sg+0x18/0x40)
6[  164.629974] [c061cdbc] (mmc_alloc_sg+0x18/0x40) from [c061d524] 
(mmc_init_queue+0x418/0x4fc)
6[  164.630008] [c061d524] (mmc_init_queue+0x418/0x4fc) from [c06195a0] 
(mmc_blk_alloc_req+0x18c/0x3d0)
6[  164.630043] [c06195a0] (mmc_blk_alloc_req+0x18c/0x3d0) from 
[c061b2a8] (mmc_blk_probe+0x74/0x2c0)
6[  164.630078] [c061b2a8] (mmc_blk_probe+0x74/0x2c0) from [c060d68c] 
(mmc_bus_probe+0x14/0x18)
6[  164.630115] [c060d68c] (mmc_bus_probe+0x14/0x18) from [c045a928] 
(driver_probe_device+0x134/0x334)
6[  164.630154] [c045a928] (driver_probe_device+0x134/0x334) from 
[c0458e0c] (bus_for_each_drv+0x48/0x8c)
6[  164.630190] [c0458e0c] (bus_for_each_drv+0x48/0x8c) from [c045a77c] 
(device_attach+0x7c/0xa0)
6[  164.630222] [c045a77c] (device_attach+0x7c/0xa0) from [c0459ca0] 
(bus_probe_device+0x28/0x98)
6[  164.630257] [c0459ca0] (bus_probe_device+0x28/0x98) from [c04583f0] 
(device_add+0x3f4/0x5a8)
6[  164.630292] [c04583f0] (device_add+0x3f4/0x5a8) from [c060dd7c] 
(mmc_add_card+0x1f0/0x2e8)
6[  164.630329] [c060dd7c] (mmc_add_card+0x1f0/0x2e8) from [c0613990] 
(mmc_attach_sd+0x234/0x278)
6[  164.630364] [c0613990] (mmc_attach_sd+0x234/0x278) from [c060cab8] 
(mmc_rescan+0x24c/0x2cc)
6[  164.630400] [c060cab8] (mmc_rescan+0x24c/0x2cc) from [c01a2a40] 
(process_one_work+0x200/0x400)
6[  164.630438] [c01a2a40] (process_one_work+0x200/0x400) from [c01a2df0] 
(worker_thread+0x184/0x2a4)
6[  164.630474] [c01a2df0] (worker_thread+0x184/0x2a4) from [c01a74ac] 
(kthread+0x80/0x90)
6[  164.630510] [c01a74ac] (kthread+0x80/0x90) from [c0106aec] 
(kernel_thread_exit+0x0/0x8)
6[  164.630529] Mem-info:
6[  164.630542] Normal per-cpu:
6[  164.630559] CPU0: hi:  186, btch:  31 usd:   0
6[  164.630573] HighMem per-cpu:
6[  164.630588] CPU0: hi:   90, btch:  15 usd:   0
6[  164.630624] active_anon:96301 inactive_anon:586 isolated_anon:4
6[  164.630633]  active_file:26021 inactive_file:25748 isolated_file:0
6[  164.630641]  unevictable:694 dirty:4 writeback:0 unstable:0
6[  164.630649]  free:5131 slab_reclaimable:3282 slab_unreclaimable:5632
6[  164.630658]  mapped:36273 shmem:649 pagetables:3794 bounce:0
6[  164.630666]  free_cma:139
6[  164.630716] Normal free:18660kB min:3136kB low:3920kB high:4704kB 
active_anon:183052kB inactive_anon:1980kB active_file:98188kB 
inactive_file:98364kB unevictable:0kB isolated(anon):0kB isolated(file):0kB 
present:616020kB mlocked:0kB dirty:8kB writeback:0kB mapped:134632kB 
shmem:1992kB slab_reclaimable:13128kB slab_unreclaimable:22528kB 
kernel_stack:10528kB pagetables:15176kB unstable:0kB bounce:0kB free_cma:112kB 
writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
6[  164.630769] lowmem_reserve[]: 0 1691 1691
6[  164.630831] HighMem free:1864kB min:208kB low:480kB high:756kB 
active_anon:202152kB inactive_anon:364kB active_file:5896kB 
inactive_file:4628kB unevictable:2776kB isolated(anon):16kB isolated(file):0kB 
present:216488kB mlocked:0kB dirty:8kB writeback:0kB mapped:10460kB shmem:604kB 
slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB 
unstable:0kB bounce:0kB free_cma:444kB writeback_tmp:0kB pages_scanned:0 
all_unreclaimable? no
6[  164.630883] lowmem_reserve[]: 0 0 0
6[  164.630913] Normal: 1215*4kB (UEMC) 421*8kB (UEMC) 396*16kB (UM) 114*32kB 
(UM) 7*64kB (UM) 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 18660kB
6[  164.631034] HighMem: 190*4kB (UMRC) 26*8kB (UMRC) 9*16kB (UMC) 1*32kB (C) 
0*64kB 1*128kB (C) 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 1272kB
6[  164.631154] 53112 total pagecache pages
6[  164.631167] 0 pages in swap cache
6[  164.631183] Swap cache stats: add 0, delete 0, find 0/0
6[  164.631197] Free swap  = 0kB
6[  164.631209] Total swap = 0kB
6[  164.648069] 230912 pages of RAM
6[  

question about Make CONFIG_STRICT_MEMORY_RWX even stricter patch

2013-10-29 Thread Wang, Yalin
Hi  ,

We will cherry-pick this patch :
http://cgit.sonyericsson.net/cgit.cgi/kernel/msm.git/commit/?id=2504e77ddedfa34dbd64e757a14e5b21a613c000

for security reason ,

but I have a question about this patch ,
this patch will make .text  section  permission become RX but not writable ,
so  some features like  kprobe / jump_label  may can't work correct,
these  features will change code during runtime ,
so it will result in page fault  if it write .text section .


Thanks 



Yalin.Wang
Software Engineer 
OS KernelGraphics
 
Sony Mobile Communications
Tel: +86 10 5966 9819
Phone: 18610323092
Address: No.16 Guangshun South Street, Chaoyang, Beijing, P.R.C.

sonymobile.com
  
 



--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: question about Make CONFIG_STRICT_MEMORY_RWX even stricter patch

2013-10-29 Thread Wang, Yalin
Hi  

I see ,

__patch_text( )   this function has been changed to make sure
The text section can be writable .


Thanks 

-Original Message-
From: Wang, Yalin 
Sent: Tuesday, October 29, 2013 1:50 PM
To: 'lbas...@codeaurora.org'
Cc: 'linux-arm-msm-ow...@vger.kernel.org'; linux-arm-msm@vger.kernel.org; 
linux-arm-ker...@lists.infradead.org; Peng, Arthur; Zhang, Bojie
Subject: question about Make CONFIG_STRICT_MEMORY_RWX even stricter patch 

Hi  ,

We will cherry-pick this patch :
http://cgit.sonyericsson.net/cgit.cgi/kernel/msm.git/commit/?id=2504e77ddedfa34dbd64e757a14e5b21a613c000

for security reason ,

but I have a question about this patch , this patch will make .text  section  
permission become RX but not writable , so  some features like  kprobe / 
jump_label  may can't work correct, these  features will change code during 
runtime , so it will result in page fault  if it write .text section .


Thanks 



Yalin.Wang
Software Engineer
OS KernelGraphics
 
Sony Mobile Communications
Tel: +86 10 5966 9819
Phone: 18610323092
Address: No.16 Guangshun South Street, Chaoyang, Beijing, P.R.C.

sonymobile.com
  
 



--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


FW: Arch/arm/msm/memory.c:reserve_memory_for_mempools( )

2013-06-28 Thread Wang, Yalin

Hi Sboy,

I don't know who should I send this mail to .
If you are not the right person, please forward To the right responsible person 
, Thank you !

I have a question about msm kernel code :

File: Arch/arm/msm/memory.c

reserve_memory_for_mempools()
it call memblock_remove() directly,
I think it's not safe sometimes ,
Should use arm_memblock_steal() function or some other similar Function to make 
sure the removed memory is not reserved by memblock driver, In case the removed 
memory is reserved by some other driver.


Thanks 


Yalin.Wang
Software Engineer
OS KernelGraphics
 
Sony Mobile Communications
Tel: +86 10 5966 9819
Phone: 18610323092
Address: No.16 Guangshun South Street, Chaoyang, Beijing, P.R.C.

sonymobile.com
  



--
To unsubscribe from this list: send the line unsubscribe linux-arm-msm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html