Re: [RFC PATCH 2/3] firmware: Add support for PSA FF-A transport for VM partitions

2020-07-09 Thread Arve Hjønnevåg
int ret; > + enum arm_smccc_conduit conduit; > + > + if (arm_smccc_get_version() < ARM_SMCCC_VERSION_1_2) > + return 0; > + > + conduit = arm_smccc_1_1_get_conduit(); If you make this device a child device of the conduit, then you don't need this here. Other conduits can be added to for instance support other architectures without adding entries to this enum and modifying this driver. -- Arve Hjønnevåg

Re: [PATCH v2] ANDROID: binder: change down_write to down_read

2018-03-28 Thread Arve Hjønnevåg
binder_alloc > *alloc, int allocate, > } > err_no_vma: > if (mm) { > - up_write(>mmap_sem); > + up_read(>mmap_sem); > mmput(mm); > } > return vma ? -ENOMEM : -ESRCH; > -- > 2.17.0.rc1.321.gba9d0f2565-goog > -- Arve Hjønnevåg

Re: [PATCH v2] ANDROID: binder: change down_write to down_read

2018-03-28 Thread Arve Hjønnevåg
up_read(>mmap_sem); > mmput(mm); > } > return 0; > @@ -321,7 +321,7 @@ static int binder_update_page_range(struct binder_alloc > *alloc, int allocate, > } > err_no_vma: > if (mm) { > - up_write(>mmap_sem); > + up_read(>mmap_sem); > mmput(mm); > } > return vma ? -ENOMEM : -ESRCH; > -- > 2.17.0.rc1.321.gba9d0f2565-goog > -- Arve Hjønnevåg

Re: [PATCH v3] android: binder: use VM_ALLOC to get vm area

2018-01-22 Thread Arve Hjønnevåg
>>> V2: update comments >>> --- >>> drivers/android/binder_alloc.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> Martijn and Todd, any objections to this patch? > > Looks fine to me. Arve, do you remember the rationale for using VM_IOREMAP? > I don't remember for sure, but I think it used alloc_vm_area at some point, and that uses VM_IOREMAP. -- Arve Hjønnevåg

Re: [PATCH v3] android: binder: use VM_ALLOC to get vm area

2018-01-22 Thread Arve Hjønnevåg
binder_alloc: binder_alloc_mmap_handler: 15745 >>> 8ce67000-8cf65000 get_vm_area failed -12 >>> >>> Signed-off-by: Ganesh Mahendran >>> >>> V3: update comments >>> V2: update comments >>> --- >>> drivers/android/binder_allo

Re: [PATCH v2 1/4] android: binder: Don't get mm from task

2017-10-24 Thread Arve Hjønnevåg
On Tue, Oct 24, 2017 at 12:28 AM, Greg Kroah-Hartman <gre...@linuxfoundation.org> wrote: > On Mon, Oct 23, 2017 at 11:18:52AM -0700, Arve Hjønnevåg wrote: >> On Sat, Oct 21, 2017 at 1:15 AM, Greg Kroah-Hartman >> <gre...@linuxfoundation.org> wrote: >> > On F

Re: [PATCH v2 1/4] android: binder: Don't get mm from task

2017-10-24 Thread Arve Hjønnevåg
On Tue, Oct 24, 2017 at 12:28 AM, Greg Kroah-Hartman wrote: > On Mon, Oct 23, 2017 at 11:18:52AM -0700, Arve Hjønnevåg wrote: >> On Sat, Oct 21, 2017 at 1:15 AM, Greg Kroah-Hartman >> wrote: >> > On Fri, Oct 20, 2017 at 08:58:58PM -0400, Sherry Yang wrote: >>

Re: [PATCH v2 1/4] android: binder: Don't get mm from task

2017-10-23 Thread Arve Hjønnevåg
avoid a potential deadlock between lru lock, task lock and >> dentry lock, since a thread can be holding the task lock >> and the dentry lock while trying to acquire the lru lock. >> >> Acked-by: Arve Hjønnevåg <a...@android.com> >> Signed-off-by: Sherry Yang <s

Re: [PATCH v2 1/4] android: binder: Don't get mm from task

2017-10-23 Thread Arve Hjønnevåg
n lru lock, task lock and >> dentry lock, since a thread can be holding the task lock >> and the dentry lock while trying to acquire the lru lock. >> >> Acked-by: Arve Hjønnevåg >> Signed-off-by: Sherry Yang >> --- >> drivers/android/binder_alloc.c | 22

Re: [PATCH] mm: Restore mmput_async

2017-09-13 Thread Arve Hjønnevåg
o. > > (Top-posting repaired. Please don't!) > > Is it necessary for binder_alloc_free_page() to take a ref on the mm? > As long as alloc->tsk doesn't exit during binder_alloc_free_page()'s > execution, that task's reference on the mm should be sufficient to keep > the mm alive? > alloc->tsk can exit during binder_alloc_free_page. We don't hold a reference to the task's mm struct while we don't actively use it, as this would prevent the driver from getting closed when a process dies. -- Arve Hjønnevåg

Re: [PATCH] mm: Restore mmput_async

2017-09-13 Thread Arve Hjønnevåg
f on the mm? > As long as alloc->tsk doesn't exit during binder_alloc_free_page()'s > execution, that task's reference on the mm should be sufficient to keep > the mm alive? > alloc->tsk can exit during binder_alloc_free_page. We don't hold a reference to the task's mm struct while we don't actively use it, as this would prevent the driver from getting closed when a process dies. -- Arve Hjønnevåg

Re: [PATCH v3 3/6] android: binder: Move buffer out of area shared with user space

2017-08-30 Thread Arve Hjønnevåg
to > kernel space? > The buffer headers have never been used by user-space. They are readable by user-space because the content after the header has to be readable from user-space (and only whole pages can be mapped). It was simpler to have the header in the same shared region as wel

Re: [PATCH v3 3/6] android: binder: Move buffer out of area shared with user space

2017-08-30 Thread Arve Hjønnevåg
ever been used by user-space. They are readable by user-space because the content after the header has to be readable from user-space (and only whole pages can be mapped). It was simpler to have the header in the same shared region as well. At the time this code was written the content of kernel pointers where not considered secret and available elsewhere anyway (e.g. kernel log, /proc/kallsyms). -- Arve Hjønnevåg

Re: [PATCH] android: binder: Disable preemption while holding the global binder lock

2016-09-13 Thread Arve Hjønnevåg
On Tue, Sep 13, 2016 at 12:32 AM, Peter Zijlstra <pet...@infradead.org> wrote: > On Mon, Sep 12, 2016 at 08:44:09PM -0700, Arve Hjønnevåg wrote: > >> A previous attempt to fix this problem, changed the lock to use >> rt_mutex instead of mutex, but this apparen

Re: [PATCH] android: binder: Disable preemption while holding the global binder lock

2016-09-13 Thread Arve Hjønnevåg
On Tue, Sep 13, 2016 at 12:32 AM, Peter Zijlstra wrote: > On Mon, Sep 12, 2016 at 08:44:09PM -0700, Arve Hjønnevåg wrote: > >> A previous attempt to fix this problem, changed the lock to use >> rt_mutex instead of mutex, but this apparently did not work as well as >&g

Re: [PATCH] android: binder: Disable preemption while holding the global binder lock

2016-09-13 Thread Arve Hjønnevåg
On Mon, Sep 12, 2016 at 11:42 PM, Greg Kroah-Hartman <gre...@linuxfoundation.org> wrote: > On Mon, Sep 12, 2016 at 08:44:09PM -0700, Arve Hjønnevåg wrote: >> On Sat, Sep 10, 2016 at 10:28 AM, Greg Kroah-Hartman >> <gre...@linuxfoundation.org> wrote: >> > On S

Re: [PATCH] android: binder: Disable preemption while holding the global binder lock

2016-09-13 Thread Arve Hjønnevåg
On Mon, Sep 12, 2016 at 11:42 PM, Greg Kroah-Hartman wrote: > On Mon, Sep 12, 2016 at 08:44:09PM -0700, Arve Hjønnevåg wrote: >> On Sat, Sep 10, 2016 at 10:28 AM, Greg Kroah-Hartman >> wrote: >> > On Sat, Sep 10, 2016 at 06:37:29PM +0200, Thomas Gleixner wrote: >>

Re: [PATCH] android: binder: Disable preemption while holding the global binder lock

2016-09-12 Thread Arve Hjønnevåg
trigger this problem, but there are processes that receive work from both high and low priority threads and could still end up in the same situation. A previous attempt to fix this problem, changed the lock to use rt_mutex instead of mutex, but this apparently did not work as well as this patch. I believe the added overhead was noticeable, and it did not work when the preempted thread was in a different cgroup (I don't know if this is still the case). It would be useful to generic solution to this problem. > So don't worry, I'm not taking this change :) > > thanks, > > greg k-h -- Arve Hjønnevåg

Re: [PATCH] android: binder: Disable preemption while holding the global binder lock

2016-09-12 Thread Arve Hjønnevåg
ority threads and could still end up in the same situation. A previous attempt to fix this problem, changed the lock to use rt_mutex instead of mutex, but this apparently did not work as well as this patch. I believe the added overhead was noticeable, and it did not work when the preempted thread was in a different cgroup (I don't know if this is still the case). It would be useful to generic solution to this problem. > So don't worry, I'm not taking this change :) > > thanks, > > greg k-h -- Arve Hjønnevåg

Re: [PATCH] staging: android: lowmemorykiller.c: Fix checkpatch warning

2016-09-01 Thread Arve Hjønnevåg
total_swapcache_pages(); >> > + unsigned long nr_free = global_page_state(NR_FREE_PAGES); >> > + unsigned long nr_file = global_node_page_state(NR_FILE_PAGES); >> > + unsigned long nr_shmem = global_node_page_state(NR_SHMEM); >> > + int other_free = nr_free - totalreserve_pages; >> > + int other_file = nr_file - nr_shmem - total_swapcache_pages(); >> > >> > if (lowmem_adj_size < array_size) >> > array_size = lowmem_adj_size; >> I like it, much easier to follow. Care to resend it in a patch form I >> can apply it in? > > I think the android folk should figure out what the right thing > to do with the int/unsigned long calculation is first. > > Arve? Riley? > I think the end result is the same if you store it in an int. If you store the result in a long it will work better, but I don't know of anyone using lowmemorykilller on a system with more than 8TB of memory. -- Arve Hjønnevåg

Re: [PATCH] staging: android: lowmemorykiller.c: Fix checkpatch warning

2016-09-01 Thread Arve Hjønnevåg
global_page_state(NR_FREE_PAGES) - totalreserve_pages; >> > - int other_file = global_node_page_state(NR_FILE_PAGES) - >> > - >> > global_node_page_state(NR_SHMEM) - >> > - t

Re: [PATCH] android: binder: use VM_ALLOC to get vm area.

2016-09-01 Thread Arve Hjønnevåg
out loads of > testing having happened... > > thanks, > > greg k-h There is no alignment requirement on this area unless cache_is_vipt_aliasing returns true. In that case the area needs to be aligned with vma->vm_start which is done manually in the code right after this allocation. If there are no other side effects of changing this flag this change should be safe, but please run all the tests at https://android.googlesource.com/platform/frameworks/native/+/master/libs/binder/tests/ to test it. -- Arve Hjønnevåg

Re: [PATCH] android: binder: use VM_ALLOC to get vm area.

2016-09-01 Thread Arve Hjønnevåg
; > greg k-h There is no alignment requirement on this area unless cache_is_vipt_aliasing returns true. In that case the area needs to be aligned with vma->vm_start which is done manually in the code right after this allocation. If there are no other side effects of changing this flag this change should be safe, but please run all the tests at https://android.googlesource.com/platform/frameworks/native/+/master/libs/binder/tests/ to test it. -- Arve Hjønnevåg

Re: [PATCH v4 0/8] Replay Protected Memory Block (RPMB) subsystem

2016-06-14 Thread Arve Hjønnevåg
col and new linux clients use your rpmb protocol. > > Second if it won’t be possible to use the current implementation if the > storage type change UFS or NVMe anyhow and on the othernad > I’m not suggesting to kill MMC ioctl, so this won’t be breackages of the > existing software. I don't think you need to be compatible with existing Linux user-space code, but it would be possible by emulating the MMC_IOC_MULTI_CMD command. You should try to be compatible with existing secure os interfaces though, as there is no reason for this to be different for ufs and emmc. > > In bottom line I will try to add raw read/write access to RPMB to support > fine grained access and see if you can work with that. > Why not change your code to be compatible with code written against the existing specs instead? I don't see a need for an interface where the client has to prepare all the packets defined by the spec except for one special packet that the kernel will inject. > > I really appreciate your feedback. > Thanks > Tomas > > > > -- Arve Hjønnevåg

Re: [PATCH v4 0/8] Replay Protected Memory Block (RPMB) subsystem

2016-06-14 Thread Arve Hjønnevåg
r rpmb protocol. > > Second if it won’t be possible to use the current implementation if the > storage type change UFS or NVMe anyhow and on the othernad > I’m not suggesting to kill MMC ioctl, so this won’t be breackages of the > existing software. I don't think you need to be compatible with existing Linux user-space code, but it would be possible by emulating the MMC_IOC_MULTI_CMD command. You should try to be compatible with existing secure os interfaces though, as there is no reason for this to be different for ufs and emmc. > > In bottom line I will try to add raw read/write access to RPMB to support > fine grained access and see if you can work with that. > Why not change your code to be compatible with code written against the existing specs instead? I don't see a need for an interface where the client has to prepare all the packets defined by the spec except for one special packet that the kernel will inject. > > I really appreciate your feedback. > Thanks > Tomas > > > > -- Arve Hjønnevåg

Re: [PATCH v4 0/8] Replay Protected Memory Block (RPMB) subsystem

2016-06-02 Thread Arve Hjønnevåg
emoving one set of buffer size. I will try to make that > modification if it helps? > No I don't want you to modify the code that runs in the secure OS. This would require additional code in boot loaders and proxy servers using the existing MMC_IOC_MULTI_CMD command as they too would have to interpret the packets to inject RESULT_READ packets. > Thanks for interest and your review. > Tomas > > -- Arve Hjønnevåg

Re: [PATCH v4 0/8] Replay Protected Memory Block (RPMB) subsystem

2016-06-02 Thread Arve Hjønnevåg
t; modification if it helps? > No I don't want you to modify the code that runs in the secure OS. This would require additional code in boot loaders and proxy servers using the existing MMC_IOC_MULTI_CMD command as they too would have to interpret the packets to inject RESULT_READ packets. > Thanks for interest and your review. > Tomas > > -- Arve Hjønnevåg

Re: [PATCH v4 0/8] Replay Protected Memory Block (RPMB) subsystem

2016-06-01 Thread Arve Hjønnevåg
et the data it currently passes through and remove all RESULT_READ packets. -- Arve Hjønnevåg

Re: [PATCH v4 0/8] Replay Protected Memory Block (RPMB) subsystem

2016-06-01 Thread Arve Hjønnevåg
tly passes through and remove all RESULT_READ packets. -- Arve Hjønnevåg

Re: Regression in v4.0.0-rc1 with Android Binder

2015-02-26 Thread Arve Hjønnevåg
t at all. > tmp_area.size = PAGE_SIZE + PAGE_SIZE /* guard page? */; > ret = map_vm_area(_area, PAGE_KERNEL, page); > if (ret) { > -->8-- > > > Regards, > Amit Pundir -- Arve Hjønnevåg -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: Regression in v4.0.0-rc1 with Android Binder

2015-02-26 Thread Arve Hjønnevåg
. tmp_area.size = PAGE_SIZE + PAGE_SIZE /* guard page? */; ret = map_vm_area(tmp_area, PAGE_KERNEL, page); if (ret) { --8-- Regards, Amit Pundir -- Arve Hjønnevåg -- To unsubscribe from this list: send the line unsubscribe linux-kernel

Re: [PATCH] staging: android: binder: move to the "real" part of the kernel

2014-10-20 Thread Arve Hjønnevåg
> I don't really understand when buffer->data has to be page aligned and > when not. This code has very few comments. > buffer->data never needs to be page aligned. The code above rounds to page boundaries to allocate new pages as needed. >730 >731

Re: [PATCH] staging: android: binder: move to the real part of the kernel

2014-10-20 Thread Arve Hjønnevåg
. Yes. regards, dan carpenter -- Arve Hjønnevåg -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] staging: binder: fix usage of uninit scalar in binder_transaction()

2014-05-06 Thread Arve Hjønnevåg
LED_REPLY; > goto err_binder_get_ref_for_node_failed; > } > ref = binder_get_ref_for_node(target_proc, node); > -- > 1.9.1 Acked-by: Arve Hjønnevåg -- To unsubscribe from this list: send the line "unsubscribe linux-kern

Re: [PATCH] staging: binder: fix usage of uninit scalar in binder_transaction()

2014-05-06 Thread Arve Hjønnevåg
; } ref = binder_get_ref_for_node(target_proc, node); -- 1.9.1 Acked-by: Arve Hjønnevåg a...@android.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: [PATCH 2/3] staging: binder: Support concurrent 32 bit and 64 bit processes.

2014-02-21 Thread Arve Hjønnevåg
On Fri, Feb 21, 2014 at 2:04 PM, John Stultz wrote: > On 02/21/2014 01:56 PM, Arve Hjønnevåg wrote: >> On Fri, Feb 21, 2014 at 1:29 PM, John Stultz wrote: >>> On 02/21/2014 12:59 PM, Arve Hjønnevåg wrote: >>>> On Fri, Feb 21, 2014 at 12:43 PM, John Stultz >>

Re: [PATCH 2/3] staging: binder: Support concurrent 32 bit and 64 bit processes.

2014-02-21 Thread Arve Hjønnevåg
On Fri, Feb 21, 2014 at 1:29 PM, John Stultz wrote: > On 02/21/2014 12:59 PM, Arve Hjønnevåg wrote: >> On Fri, Feb 21, 2014 at 12:43 PM, John Stultz wrote: >>> From: Arve Hjønnevåg >>> >>> For 64bit systems we want to use the same binder interface for

Re: [PATCH 2/3] staging: binder: Support concurrent 32 bit and 64 bit processes.

2014-02-21 Thread Arve Hjønnevåg
On Fri, Feb 21, 2014 at 12:43 PM, John Stultz wrote: > From: Arve Hjønnevåg > > For 64bit systems we want to use the same binder interface for 32bit and > 64bit processes. Thus the size and the layout of the structures passed > between the kernel and the userspace has to be the s

Re: [PATCH 2/3] staging: binder: Support concurrent 32 bit and 64 bit processes.

2014-02-21 Thread Arve Hjønnevåg
On Fri, Feb 21, 2014 at 12:43 PM, John Stultz john.stu...@linaro.org wrote: From: Arve Hjønnevåg a...@android.com For 64bit systems we want to use the same binder interface for 32bit and 64bit processes. Thus the size and the layout of the structures passed between the kernel

Re: [PATCH 2/3] staging: binder: Support concurrent 32 bit and 64 bit processes.

2014-02-21 Thread Arve Hjønnevåg
On Fri, Feb 21, 2014 at 1:29 PM, John Stultz john.stu...@linaro.org wrote: On 02/21/2014 12:59 PM, Arve Hjønnevåg wrote: On Fri, Feb 21, 2014 at 12:43 PM, John Stultz john.stu...@linaro.org wrote: From: Arve Hjønnevåg a...@android.com For 64bit systems we want to use the same binder interface

Re: [PATCH 2/3] staging: binder: Support concurrent 32 bit and 64 bit processes.

2014-02-21 Thread Arve Hjønnevåg
On Fri, Feb 21, 2014 at 2:04 PM, John Stultz john.stu...@linaro.org wrote: On 02/21/2014 01:56 PM, Arve Hjønnevåg wrote: On Fri, Feb 21, 2014 at 1:29 PM, John Stultz john.stu...@linaro.org wrote: On 02/21/2014 12:59 PM, Arve Hjønnevåg wrote: On Fri, Feb 21, 2014 at 12:43 PM, John Stultz

Re: [PATCH 14/14] staging: binder: Improve Kconfig entry for ANDROID_BINDER_IPC_32BIT

2014-02-18 Thread Arve Hjønnevåg
y. By the time this kernel is used, the user-space default may have switched to using the 64 bit interface by default. The android-3.10 kernel currently defaulting to y since it may get used with a 4.4 android user-space, and because the 32 bit arm kernel is missing the 8 byte get_user variant that it n

Re: [PATCH 12/14] staging: binder: Fix ABI for 64bit Android

2014-02-18 Thread Arve Hjønnevåg
users. > > But you added a field to the existing structure, right? I don't really > remember the patch, it was a few hundred back in my review of stuff > today, sorry... > > greg k-h The existing structure is not changed. These two commands were defined with wrong structure t

Re: [PATCH 12/14] staging: binder: Fix ABI for 64bit Android

2014-02-18 Thread Arve Hjønnevåg
the binder_handle_cookie struct so the service manager does not have to define its own version (libbinder writes one field at a time so it does not use the struct). -- Arve Hjønnevåg -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord

Re: [PATCH 14/14] staging: binder: Improve Kconfig entry for ANDROID_BINDER_IPC_32BIT

2014-02-18 Thread Arve Hjønnevåg
that it needs. -- Arve Hjønnevåg -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH v1 9/9] staging: android: binder: Add binder compat layer

2013-12-12 Thread Arve Hjønnevåg
On Thu, Dec 12, 2013 at 12:45 AM, Octavian Purdila wrote: > On Thu, Dec 12, 2013 at 1:00 AM, Arve Hjønnevåg wrote: >> On Wed, Dec 11, 2013 at 10:10 AM, Octavian Purdila >> wrote: >>> On Wed, Dec 11, 2013 at 5:21 AM, Arve Hjønnevåg wrote: >>>> >>>>

Re: [PATCH v1 9/9] staging: android: binder: Add binder compat layer

2013-12-12 Thread Arve Hjønnevåg
On Thu, Dec 12, 2013 at 12:45 AM, Octavian Purdila octavian.purd...@intel.com wrote: On Thu, Dec 12, 2013 at 1:00 AM, Arve Hjønnevåg a...@android.com wrote: On Wed, Dec 11, 2013 at 10:10 AM, Octavian Purdila octavian.purd...@intel.com wrote: On Wed, Dec 11, 2013 at 5:21 AM, Arve Hjønnevåg

Re: [PATCH v1 9/9] staging: android: binder: Add binder compat layer

2013-12-11 Thread Arve Hjønnevåg
On Wed, Dec 11, 2013 at 10:10 AM, Octavian Purdila wrote: > On Wed, Dec 11, 2013 at 5:21 AM, Arve Hjønnevåg wrote: >> >> Assuming you are talking about a kernel compat layer that translates >> the flat_binder_object structs as they pass between 32 bit an

Re: [PATCH v1 9/9] staging: android: binder: Add binder compat layer

2013-12-11 Thread Arve Hjønnevåg
On Wed, Dec 11, 2013 at 10:10 AM, Octavian Purdila octavian.purd...@intel.com wrote: On Wed, Dec 11, 2013 at 5:21 AM, Arve Hjønnevåg a...@android.com wrote: Assuming you are talking about a kernel compat layer that translates the flat_binder_object structs as they pass between 32 bit and 64

Re: [PATCH v1 9/9] staging: android: binder: Add binder compat layer

2013-12-10 Thread Arve Hjønnevåg
On Mon, Dec 9, 2013 at 7:01 PM, Octavian Purdila wrote: > On Thu, Dec 5, 2013 at 4:02 AM, Arve Hjønnevåg wrote: >> On Wed, Dec 4, 2013 at 2:02 PM, Greg KH wrote: >>> On Wed, Dec 04, 2013 at 01:55:34PM -0800, Colin Cross wrote: >>>> On Wed, Dec 4, 2013 at 1:43 PM,

Re: [PATCH v1 9/9] staging: android: binder: Add binder compat layer

2013-12-10 Thread Arve Hjønnevåg
On Mon, Dec 9, 2013 at 7:01 PM, Octavian Purdila tavi.purd...@gmail.com wrote: On Thu, Dec 5, 2013 at 4:02 AM, Arve Hjønnevåg a...@android.com wrote: On Wed, Dec 4, 2013 at 2:02 PM, Greg KH gre...@linuxfoundation.org wrote: On Wed, Dec 04, 2013 at 01:55:34PM -0800, Colin Cross wrote: On Wed

Re: [PATCH v1 9/9] staging: android: binder: Add binder compat layer

2013-12-04 Thread Arve Hjønnevåg
of the code added in this patchset becomes useless (and probably harmful as it appears to prevent 32 bit processes from communicating with 64 bit processes). > Or does this patch series mean that no userspace code is changed? Is > that a "requirement" here? > I don't think we

Re: [PATCH v1 9/9] staging: android: binder: Add binder compat layer

2013-12-04 Thread Arve Hjønnevåg
old 32 bit userspace framework code on a 64 bit system. I think it is more important to not prevent mixed mode systems. -- Arve Hjønnevåg -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: [PATCH v5 0/6] Android Binder IPC Fixes

2013-07-03 Thread Arve Hjønnevåg
gt;>staging: android: binder: fix binder interface for 64bit compat layer >> >> drivers/staging/android/binder.c | 32 - >> drivers/staging/android/binder.h | 48 >> +++--- >> 2 files changed, 40 insertions(+), 40 deletions(-) >> > > > -- > Best Regards, > > Serban Constantinescu > PDSW Engineer ARM Ltd. > -- Arve Hjønnevåg -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH v5 6/6] staging: android: binder: fix binder interface for 64bit compat layer

2013-07-03 Thread Arve Hjønnevåg
__u32 handle; /* remote object */ > }; > > /* extra data associated with local object */ > @@ -78,7 +78,7 @@ struct binder_write_read { > /* Use with BINDER_VERSION, driver fills in fields. */ > struct binder_version { > /*

Re: [PATCH v5 5/6] staging: android: binder: replace types with portable ones

2013-07-03 Thread Arve Hjønnevåg
gt; > We use "userspace" types since this header will be exported and used by > the Android filesystem. > > The patch does not change in any way the functionality of the binder driver. > > Signed-off-by: Serban Constantinescu > Acked-by: Arve Hjønnevåg >

Re: [PATCH v5 4/6] staging: android: binder: fix alignment issues

2013-07-03 Thread Arve Hjønnevåg
id *))) { > + !IS_ALIGNED(*offp, sizeof(u32))) { > binder_user_error("%d:%d got transaction with invalid > offset, %zd\n", > proc->pid, thread->pid, *offp); > return_error = BR_FAILED_REPLY; &g

Re: [PATCH v5 4/6] staging: android: binder: fix alignment issues

2013-07-03 Thread Arve Hjønnevåg
, proc-pid, thread-pid, *offp); return_error = BR_FAILED_REPLY; -- 1.7.9.5 Acked-by: Arve Hjønnevåg a...@android.com -- Arve Hjønnevåg -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org

Re: [PATCH v5 5/6] staging: android: binder: replace types with portable ones

2013-07-03 Thread Arve Hjønnevåg
interface. We use userspace types since this header will be exported and used by the Android filesystem. The patch does not change in any way the functionality of the binder driver. Signed-off-by: Serban Constantinescu serban.constantine...@arm.com Acked-by: Arve Hjønnevåg a...@android.com

Re: [PATCH v5 6/6] staging: android: binder: fix binder interface for 64bit compat layer

2013-07-03 Thread Arve Hjønnevåg
cookie */ -- 1.7.9.5 Acked-by: Arve Hjønnevåg a...@android.com -- Arve Hjønnevåg -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ

Re: [PATCH v5 0/6] Android Binder IPC Fixes

2013-07-03 Thread Arve Hjønnevåg
- drivers/staging/android/binder.h | 48 +++--- 2 files changed, 40 insertions(+), 40 deletions(-) -- Best Regards, Serban Constantinescu PDSW Engineer ARM Ltd. -- Arve Hjønnevåg -- To unsubscribe from this list: send the line unsubscribe

[RFC][PATCH] kconfig: Fix defconfig when one choice menu selects options that another choice menu depends on

2013-06-06 Thread Arve Hjønnevåg
select USB_LIBCOMPOSITE endchoice config CRC32 tristate "CRC32/CRC32c functions" default y choice prompt "CRC32 implementation" depends on CRC32 default CRC32_SLICEBY8 config CRC32_SLICEBY8 bool "Slice by 8 bytes" endch

[RFC][PATCH] kconfig: Fix defconfig when one choice menu selects options that another choice menu depends on

2013-06-06 Thread Arve Hjønnevåg
default y choice prompt CRC32 implementation depends on CRC32 default CRC32_SLICEBY8 config CRC32_SLICEBY8 bool Slice by 8 bytes endchoice --- Signed-off-by: Arve Hjønnevåg a...@android.com --- scripts/kconfig/confdata.c | 14 ++ scripts/kconfig/expr.h

Re: [PATCH v4 2/6] staging: android: binder: fix binder interface for 64bit compat layer

2013-06-04 Thread Arve Hjønnevåg
On Tue, Jun 4, 2013 at 1:54 AM, Serban Constantinescu wrote: > On 03/06/13 22:41, Arve Hjønnevåg wrote: >> >> On Wed, May 22, 2013 at 3:12 AM, Serban Constantinescu >> wrote: >>> >>> The changes in this patch will fix the binder interface for use on 6

Re: [PATCH v4 2/6] staging: android: binder: fix binder interface for 64bit compat layer

2013-06-04 Thread Arve Hjønnevåg
On Tue, Jun 4, 2013 at 1:54 AM, Serban Constantinescu serban.constantine...@arm.com wrote: On 03/06/13 22:41, Arve Hjønnevåg wrote: On Wed, May 22, 2013 at 3:12 AM, Serban Constantinescu serban.constantine...@arm.com wrote: The changes in this patch will fix the binder interface for use

Re: [PATCH v4 3/6] staging: android: binder: fix BINDER_SET_MAX_THREADS declaration

2013-06-03 Thread Arve Hjønnevåg
On Mon, Jun 3, 2013 at 8:02 AM, Greg KH wrote: > On Fri, May 31, 2013 at 04:17:34PM -0700, Arve Hjønnevåg wrote: >> On Wed, May 22, 2013 at 3:12 AM, Serban Constantinescu >> wrote: >> > This change will fix the BINDER_SET_MAX_THREADS ioctl to use __u32 >> > inst

Re: [PATCH v4 1/6] staging: android: binder: modify struct binder_write_read to use size_t

2013-06-03 Thread Arve Hjønnevåg
umed; /* bytes consumed by driver */ > + size_t write_size; /* bytes to write */ > + size_t write_consumed; /* bytes consumed by driver */ > unsigned long write_buffer; > - signed long read_size; /* bytes to read */ > - signed long rea

Re: [PATCH v4 2/6] staging: android: binder: fix binder interface for 64bit compat layer

2013-06-03 Thread Arve Hjønnevåg
*/ > + __s32 handle; /* remote object */ This should be unsigned to match the handle in binder_transaction_data and other uses in the driver, but it is currently also used to pass file descriptors. Perhaps this is better (if sou also change size of the handle in binder_transaction_dat

Re: [PATCH v4 2/6] staging: android: binder: fix binder interface for 64bit compat layer

2013-06-03 Thread Arve Hjønnevåg
. That way you don't have to change the protocol version later. -- Arve Hjønnevåg -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ

Re: [PATCH v4 1/6] staging: android: binder: modify struct binder_write_read to use size_t

2013-06-03 Thread Arve Hjønnevåg
consumed by driver */ + size_t read_size; /* bytes to read */ + size_t read_consumed; /* bytes consumed by driver */ unsigned long read_buffer; }; -- 1.7.9.5 Acked-by: Arve Hjønnevåg a...@android.com -- Arve Hjønnevåg -- To unsubscribe from this list: send the line

Re: [PATCH v4 3/6] staging: android: binder: fix BINDER_SET_MAX_THREADS declaration

2013-06-03 Thread Arve Hjønnevåg
On Mon, Jun 3, 2013 at 8:02 AM, Greg KH gre...@linuxfoundation.org wrote: On Fri, May 31, 2013 at 04:17:34PM -0700, Arve Hjønnevåg wrote: On Wed, May 22, 2013 at 3:12 AM, Serban Constantinescu serban.constantine...@arm.com wrote: This change will fix the BINDER_SET_MAX_THREADS ioctl to use

Re: [PATCH v4 5/6] staging: android: binder: fix alignment issues

2013-05-31 Thread Arve Hjønnevåg
t; @@ -2332,7 +2332,7 @@ retry: > proc->user_buffer_offset; > tr.data.ptr.offsets = tr.data.ptr.buffer + > ALIGN(t->buffer->data_size, > - sizeof(vo

Re: [PATCH v4 6/6] staging: android: binder: replace types with portable ones

2013-05-31 Thread Arve Hjønnevåg
er_driver_command_protocol { > * void *: ptr to transaction data received on a read > */ > > - BC_INCREFS = _IOW('c', 4, int), > - BC_ACQUIRE = _IOW('c', 5, int), > - BC_RELEASE = _IOW('c', 6, int), > - BC_DECREFS = _IOW('c', 7, int), &

Re: [PATCH v4 3/6] staging: android: binder: fix BINDER_SET_MAX_THREADS declaration

2013-05-31 Thread Arve Hjønnevåg
_IOW('b', 5, __u32) > #defineBINDER_SET_IDLE_PRIORITY_IOW('b', 6, __s32) > #defineBINDER_SET_CONTEXT_MGR _IOW('b', 7, __s32) > #define BINDER_THREAD_EXIT _IOW('b', 8, __s32) > -- > 1.7.9.5 > Acked-by: Arve Hjøn

Re: [PATCH v4 3/6] staging: android: binder: fix BINDER_SET_MAX_THREADS declaration

2013-05-31 Thread Arve Hjønnevåg
BINDER_SET_IDLE_PRIORITY_IOW('b', 6, __s32) #defineBINDER_SET_CONTEXT_MGR _IOW('b', 7, __s32) #defineBINDER_THREAD_EXIT _IOW('b', 8, __s32) -- 1.7.9.5 Acked-by: Arve Hjønnevåg a...@android.com -- Arve Hjønnevåg -- To unsubscribe from this list: send

Re: [PATCH v4 6/6] staging: android: binder: replace types with portable ones

2013-05-31 Thread Arve Hjønnevåg
= _IOW('c', 4, __u32), + BC_ACQUIRE = _IOW('c', 5, __u32), + BC_RELEASE = _IOW('c', 6, __u32), + BC_DECREFS = _IOW('c', 7, __u32), /* * int: descriptor */ -- 1.7.9.5 Acked-by: Arve Hjønnevåg a...@android.com -- Arve Hjønnevåg -- To unsubscribe

Re: [PATCH v4 5/6] staging: android: binder: fix alignment issues

2013-05-31 Thread Arve Hjønnevåg
, - sizeof(void *)); + sizeof(u32)); This change should also be removed. if (put_user(cmd, (uint32_t __user *)ptr)) return -EFAULT; -- 1.7.9.5 -- Arve Hjønnevåg -- To unsubscribe from

Re: [PATCH v3 0/6] Android Binder IPC Fixes

2013-04-30 Thread Arve Hjønnevåg
On Tue, Apr 30, 2013 at 1:36 AM, Serban Constantinescu wrote: > Hi Arve, > > > On 30/04/13 00:13, Arve Hjønnevåg wrote: >> >> On Mon, Apr 29, 2013 at 9:16 AM, Serban Constantinescu >> wrote: >>> >>> Hi all, >>> >>> Any feedba

Re: [PATCH v3 0/6] Android Binder IPC Fixes

2013-04-30 Thread Arve Hjønnevåg
On Tue, Apr 30, 2013 at 1:36 AM, Serban Constantinescu serban.constantine...@arm.com wrote: Hi Arve, On 30/04/13 00:13, Arve Hjønnevåg wrote: On Mon, Apr 29, 2013 at 9:16 AM, Serban Constantinescu serban.constantine...@arm.com wrote: Hi all, Any feedback or comments on this patch set

Re: [PATCH v3 0/6] Android Binder IPC Fixes

2013-04-29 Thread Arve Hjønnevåg
On Mon, Apr 29, 2013 at 9:16 AM, Serban Constantinescu wrote: > Hi all, > > Any feedback or comments on this patch set? > You don't seem to have addressed my feedback on the previous patch set. -- Arve Hjønnevåg -- To unsubscribe from this list: send the line "unsubsc

Re: [PATCH v3 0/6] Android Binder IPC Fixes

2013-04-29 Thread Arve Hjønnevåg
On Mon, Apr 29, 2013 at 9:16 AM, Serban Constantinescu serban.constantine...@arm.com wrote: Hi all, Any feedback or comments on this patch set? You don't seem to have addressed my feedback on the previous patch set. -- Arve Hjønnevåg -- To unsubscribe from this list: send the line

Re: [PATCH v2 6/7] staging: android: binder: fix alignment issues

2013-04-11 Thread Arve Hjønnevåg
On Thu, Apr 11, 2013 at 12:02 PM, Serban Constantinescu wrote: > On 10/04/13 23:30, Arve Hjønnevåg wrote: >> >> On Wed, Apr 10, 2013 at 9:39 AM, Serban Constantinescu >> wrote: >>> >>> On 10/04/13 00:58, Arve Hjønnevåg wrote: >>>> >>>

Re: [PATCH v2 3/7] staging: android: binder: fix binder interface for 64bit compat layer

2013-04-11 Thread Arve Hjønnevåg
n unsigned type if >> you do this), would be best. > > > I will think about the best way of getting the pointer size and add it to > the patch set for binder compat. For this patch set I will only modify the > protocol_version from long to __s32. > OK, but if you are using this change let a 64 bit user-space know that the driver has been fixed, then this patch needs to go after the patches that change the structures on 64 bit systems. -- Arve Hjønnevåg -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH v2 3/7] staging: android: binder: fix binder interface for 64bit compat layer

2013-04-11 Thread Arve Hjønnevåg
are using this change let a 64 bit user-space know that the driver has been fixed, then this patch needs to go after the patches that change the structures on 64 bit systems. -- Arve Hjønnevåg -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord

Re: [PATCH v2 6/7] staging: android: binder: fix alignment issues

2013-04-11 Thread Arve Hjønnevåg
On Thu, Apr 11, 2013 at 12:02 PM, Serban Constantinescu serban.constantine...@arm.com wrote: On 10/04/13 23:30, Arve Hjønnevåg wrote: On Wed, Apr 10, 2013 at 9:39 AM, Serban Constantinescu serban.constantine...@arm.com wrote: On 10/04/13 00:58, Arve Hjønnevåg wrote: On Tue, Apr 9, 2013

Re: [PATCH v2 6/7] staging: android: binder: fix alignment issues

2013-04-10 Thread Arve Hjønnevåg
On Wed, Apr 10, 2013 at 9:39 AM, Serban Constantinescu wrote: > On 10/04/13 00:58, Arve Hjønnevåg wrote: >> >> On Tue, Apr 9, 2013 at 3:00 AM, Serban Constantinescu >> wrote: >>> >>> The Android userspace aligns the data written to the binder buffers

Re: [PATCH v2 3/7] staging: android: binder: fix binder interface for 64bit compat layer

2013-04-10 Thread Arve Hjønnevåg
On Wed, Apr 10, 2013 at 6:01 AM, Serban Constantinescu wrote: > On 10/04/13 00:48, Arve Hjønnevåg wrote: >>> >>> diff --git a/drivers/staging/android/binder.c >>> b/drivers/staging/android/binder.c >>> index 5794cf6..a2cdd9e 100644 >>> --- a/dr

Re: [PATCH v2 4/7] staging: android: binder: fix BINDER_SET_MAX_THREADS declaration

2013-04-10 Thread Arve Hjønnevåg
On Wed, Apr 10, 2013 at 5:37 AM, Serban Constantinescu wrote: > On 10/04/13 00:53, Arve Hjønnevåg wrote: >> >> On Tue, Apr 9, 2013 at 3:00 AM, Serban Constantinescu >> wrote: >>> >>> This change will fix the BINDER_SET_MAX_THREADS ioctl to use __s32 &g

Re: [PATCH v2 4/7] staging: android: binder: fix BINDER_SET_MAX_THREADS declaration

2013-04-10 Thread Arve Hjønnevåg
On Wed, Apr 10, 2013 at 5:37 AM, Serban Constantinescu serban.constantine...@arm.com wrote: On 10/04/13 00:53, Arve Hjønnevåg wrote: On Tue, Apr 9, 2013 at 3:00 AM, Serban Constantinescu serban.constantine...@arm.com wrote: This change will fix the BINDER_SET_MAX_THREADS ioctl to use __s32

Re: [PATCH v2 3/7] staging: android: binder: fix binder interface for 64bit compat layer

2013-04-10 Thread Arve Hjønnevåg
On Wed, Apr 10, 2013 at 6:01 AM, Serban Constantinescu serban.constantine...@arm.com wrote: On 10/04/13 00:48, Arve Hjønnevåg wrote: diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c index 5794cf6..a2cdd9e 100644 --- a/drivers/staging/android/binder.c +++ b

Re: [PATCH v2 6/7] staging: android: binder: fix alignment issues

2013-04-10 Thread Arve Hjønnevåg
On Wed, Apr 10, 2013 at 9:39 AM, Serban Constantinescu serban.constantine...@arm.com wrote: On 10/04/13 00:58, Arve Hjønnevåg wrote: On Tue, Apr 9, 2013 at 3:00 AM, Serban Constantinescu serban.constantine...@arm.com wrote: The Android userspace aligns the data written to the binder buffers

Re: [PATCH v2 2/7] staging: android: binder: replace IOCTL types with user-exportable types

2013-04-09 Thread Arve Hjønnevåg
. > > Signed-off-by: Serban Constantinescu Acked-by: Arve Hjønnevåg > --- > drivers/staging/android/binder.h |8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/android/binder.h > b/drivers/staging/android/bind

Re: [PATCH v2 1/7] staging: android: binder: clean-up uint32_t types

2013-04-09 Thread Arve Hjønnevåg
On Tue, Apr 9, 2013 at 3:00 AM, Serban Constantinescu wrote: > uint32_t types are used inconsistently throughout the driver. This patch > replaces "uint32_t" types with "unsigned int" ones. > I don't like this change. You fix the header in a later patch to use explicit sizes, so it does not make

Re: [PATCH v2 7/7] staging: android: binder: replace types with portable ones

2013-04-09 Thread Arve Hjønnevåg
IOW('c', 7, int), > + BC_INCREFS = _IOW('c', 4, __s32), > + BC_ACQUIRE = _IOW('c', 5, __s32), > + BC_RELEASE = _IOW('c', 6, __s32), > + BC_DECREFS = _IOW('c', 7, __s32), These four are actually read as unsigned values, so it would be better to use __u32 here. > /* >

Re: [PATCH v2 6/7] staging: android: binder: fix alignment issues

2013-04-09 Thread Arve Hjønnevåg
t to (void *) that will be 8bytes on 64bit machines. > > The change does not affect existing 32bit ABI. > Do we not want the pointers to be 8 byte aligned on 64bit platforms? -- Arve Hjønnevåg -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a

Re: [PATCH v2 5/7] staging: android: binder: fix BC_FREE_BUFFER ioctl declaration

2013-04-09 Thread Arve Hjønnevåg
((size) << _IOC_SIZESHIFT)) > > and for a 32bit compiler BC_FREE_BUFFER will have the same computed > value. This change will also ease our work in differentiating > BC_FREE_BUFFER from COMPAT_BC_FREE_BUFFER. > > The change does not affect existing 32bit ABI. > > Signed

Re: [PATCH v2 4/7] staging: android: binder: fix BINDER_SET_MAX_THREADS declaration

2013-04-09 Thread Arve Hjønnevåg
On Tue, Apr 9, 2013 at 3:00 AM, Serban Constantinescu wrote: > This change will fix the BINDER_SET_MAX_THREADS ioctl to use __s32 > instead of size_t for setting the max threads. Thus using the same > handler for 32 and 64bit kernels. > > This value is stored internally in struct binder_proc as

Re: [PATCH v2 3/7] staging: android: binder: fix binder interface for 64bit compat layer

2013-04-09 Thread Arve Hjønnevåg
d_buffer; > }; > > /* Use with BINDER_VERSION, driver fills in fields. */ > struct binder_version { > /* driver protocol version -- increment with incompatible change */ > - signed long protocol_version; > + __s32 protocol_version; How does user-space know if it should use 32 bit or 64 bit

Re: [PATCH v2 3/7] staging: android: binder: fix binder interface for 64bit compat layer

2013-04-09 Thread Arve Hjønnevåg
-space know if it should use 32 bit or 64 bit pointers. Without this change, the BINDER_VERSION ioctl would only match when the size of long matches. }; /* This is the current protocol version. */ -- 1.7.9.5 -- Arve Hjønnevåg -- To unsubscribe from this list: send the line unsubscribe linux

Re: [PATCH v2 4/7] staging: android: binder: fix BINDER_SET_MAX_THREADS declaration

2013-04-09 Thread Arve Hjønnevåg
On Tue, Apr 9, 2013 at 3:00 AM, Serban Constantinescu serban.constantine...@arm.com wrote: This change will fix the BINDER_SET_MAX_THREADS ioctl to use __s32 instead of size_t for setting the max threads. Thus using the same handler for 32 and 64bit kernels. This value is stored internally in

  1   2   >