Re: [PATCH 2/3] resource: Add release_mem_region_adjustable()

2013-04-02 Thread Ram Pai
res->flags; > + new->parent = res->parent; > + new->sibling = res->sibling; > + new->child = NULL; > + > + ret = __adjust_resource(res, res->start, > +

Re: [PATCH 2/3] resource: Add release_mem_region_adjustable()

2013-04-03 Thread Ram Pai
On Wed, Apr 03, 2013 at 01:55:05PM -0600, Toshi Kani wrote: > On Wed, 2013-04-03 at 13:37 +0800, Ram Pai wrote: > > On Tue, Apr 02, 2013 at 10:17:29AM -0600, Toshi Kani wrote: > > > + while ((res = *p)) { ...snip... > > > + if (res->start > start || res-

Re: [PATCH] kernel/resource.c: fix stack overflow in __reserve_region_with_split

2012-08-27 Thread Ram Pai
On Mon, Aug 27, 2012 at 06:47:54PM -0600, T Makphaibulchoke wrote: > Using recurvise call to try adding a non-conflicting region in the function > __reserve_region_with_split() could result in a stack overflow in the case > that the recursive calls are too deep. Convert the recursive calls to > an

Re: [PATCH -v12 02/15] resources: Add probe_resource()

2012-08-29 Thread Ram Pai
On Tue, Aug 28, 2012 at 05:10:43PM -0700, Linus Torvalds wrote: > On Tue, Aug 28, 2012 at 10:05 AM, Linus Torvalds > wrote: > > > > Ugh. Ok, looking closer at this, > > Btw, looking at that code, I also found what looks like a potential > locking bug in allocate_resource(). > > The code does >

Re: [PATCH v2] kernel/resource.c: fix stack overflow in __reserve_region_with_split

2012-09-02 Thread Ram Pai
On Fri, Aug 31, 2012 at 03:04:25PM -0600, T Makphaibulchoke wrote: > Using recurvise call to try adding a non-conflicting region in the function > __reserve_region_with_split() could result in a stack overflow in the case > that the recursive calls are too deep. Convert the recursive calls to > an

Re: [patch] vfs: create /proc//mountinfo

2008-01-31 Thread Ram Pai
On Thu, 2008-01-31 at 10:17 +0100, Miklos Szeredi wrote: > > > From: Ram Pai <[EMAIL PROTECTED]> ...snipped... > IDR ids are 'int' but they are always positive (AFAICT), but yeah, > maybe this is confusing. > > > The new exported-to-everyone dentry_path

[RFC PATCH] vfs: optimization to /proc//mountinfo patch

2008-02-04 Thread Ram Pai
CONFIG_PROC_FS=n, since it was impossible to disable CONFIG_PROC_FS. Looking for ideas on how to disable CONFIG_PROC_FS. Signed-off-by: Ram Pai <[EMAIL PROTECTED]> --- fs/dcache.c | 59 +++ fs/namespace.c |2

Re: [RFC PATCH] vfs: optimization to /proc//mountinfo patch

2008-02-10 Thread Ram Pai
On Mon, 2008-02-04 at 01:28 -0800, Andrew Morton wrote: > On Mon, 04 Feb 2008 01:15:05 -0800 Ram Pai <[EMAIL PROTECTED]> wrote: > > > 1) reports deleted inode in dentry_path() consistent with that in __d_path() > > 2) modified __d_path() to use prepend(), reducing the

Re: [RFC v2 05/10] vfs: introduce one hash table

2012-09-25 Thread Ram Pai
On Sun, Sep 23, 2012 at 08:56:30PM +0800, zwu.ker...@gmail.com wrote: > From: Zhi Yong Wu > > Adds a hash table structure which contains > a lot of hash list and is used to efficiently > look up the data temperature of a file or its > ranges. > In each hash list of hash table, the hash node >

Re: [RFC v2 01/10] vfs: introduce private rb structures

2012-09-25 Thread Ram Pai
On Sun, Sep 23, 2012 at 08:56:26PM +0800, zwu.ker...@gmail.com wrote: > From: Zhi Yong Wu > > One root structure hot_info is defined, is hooked > up in super_block, and will be used to hold rb trees > root, hash list root and some other information, etc. > Adds hot_inode_tree struct to keep t

Re: [PATCH v3] kernel/resource.c: fix stack overflow in __reserve_region_with_split

2012-09-09 Thread Ram Pai
xt_res->start = conflict->end + 1; > + next_res->end = end; > + next_res->flags = IORESOURCE_BUSY; > + } > + } else { > + res->start = conflict->end + 1; > +

Re: [PATCH 33/58] kernel/resource.c: Make internal function reallocate_resource static

2012-11-18 Thread Ram Pai
t; -int reallocate_resource(struct resource *root, struct resource *old, > +static int reallocate_resource(struct resource *root, struct resource *old, > resource_size_t newsize, > struct resource_constraint *constraint) > { Acked-by: Ram Pai

Re: [PATCH 2/3] resource: Add release_mem_region_adjustable()

2013-04-06 Thread Ram Pai
On Thu, Apr 04, 2013 at 08:07:44AM -0600, Toshi Kani wrote: > On Thu, 2013-04-04 at 14:48 +0800, Ram Pai wrote: > > On Wed, Apr 03, 2013 at 01:55:05PM -0600, Toshi Kani wrote: > > > On Wed, 2013-04-03 at 13:37 +0800, Ram Pai wrote: > > > > On Tue, Apr 02, 2013 at 10:1

Re: [PATCH v3 03/27] PCI: pci resource iterator

2013-04-08 Thread Ram Pai
On Thu, Apr 04, 2013 at 04:18:01PM -0600, Bjorn Helgaas wrote: > On Wed, Mar 13, 2013 at 5:27 PM, Yinghai Lu wrote: > > From: Ram Pai > > > > Currently pci_dev structure holds an array of 17 PCI resources; six base > > BARs, one ROM BAR, four BRIDGE BARs, six sriov BAR

Re: [UPDATE][PATCH v2 2/3] resource: Add release_mem_region_adjustable()

2013-04-08 Thread Ram Pai
= &parent->child; > + write_lock(&resource_lock); > + > + while ((res = *p)) { > + if (res->start >= end) > + break; > + > + /* look for the next resource if it does not fit into */ > + if (res-&g

Re: [PATCH v3 2/3] resource: Add release_mem_region_adjustable()

2013-04-24 Thread Ram Pai
e(new); > > + kfree(new_res); > > break; > > } > > The kfree() in the if-statement above is not necessary since kfree() is > called before the return at the end. That is, the if-statement needs to >

Re: [PATCH v3 03/27] PCI: pci resource iterator

2013-04-24 Thread Ram Pai
On Wed, Apr 10, 2013 at 09:22:48AM -0600, Bjorn Helgaas wrote: > On Mon, Apr 8, 2013 at 10:51 PM, Ram Pai wrote: > > On Thu, Apr 04, 2013 at 04:18:01PM -0600, Bjorn Helgaas wrote: > >> On Wed, Mar 13, 2013 at 5:27 PM, Yinghai Lu wrote: > >> > From: Ram Pai &

Re: [PATCH v3 03/27] PCI: pci resource iterator

2013-04-27 Thread Ram Pai
On Thu, Apr 25, 2013 at 11:22:59AM -0600, Bjorn Helgaas wrote: > On Wed, Apr 24, 2013 at 9:55 PM, Ram Pai wrote: > > On Wed, Apr 10, 2013 at 09:22:48AM -0600, Bjorn Helgaas wrote: > >> On Mon, Apr 8, 2013 at 10:51 PM, Ram Pai wrote: > >> > On Thu, Apr 04, 2013 at 0

Re: [PATCH] resource: make sure requested range intersects root range

2012-07-10 Thread Ram Pai
else > + dump_stack(); > + } else { > __reserve_region_with_split(root, start, end, name); > + } Wait.. I am not sure this will fix the problem entirely. The above check will handle the case where the range requested is entirey out of the root's

Re: [PATCH] resource: make sure requested range intersects root range

2012-07-11 Thread Ram Pai
On Wed, Jul 11, 2012 at 02:06:10PM +0300, Purdila, Octavian wrote: > On Wed, Jul 11, 2012 at 5:09 AM, Ram Pai wrote: > > > > > Wait.. I am not sure this will fix the problem entirely. The above check > > will handle the case where the range requested is entirey out of th

Re: [PATCH] resource: make sure requested range intersects root range

2012-07-11 Thread Ram Pai
On Wed, Jul 11, 2012 at 06:26:49PM +0300, Purdila, Octavian wrote: > On Wed, Jul 11, 2012 at 5:54 PM, Ram Pai wrote: > > On Wed, Jul 11, 2012 at 02:06:10PM +0300, Purdila, Octavian wrote: > >> On Wed, Jul 11, 2012 at 5:09 AM, Ram Pai wrote: > >> > >> > &g

Re: [PATCH] resource: make sure requested range intersects root range

2012-07-12 Thread Ram Pai
On Thu, Jul 12, 2012 at 10:02:06AM +0800, Ram Pai wrote: > On Wed, Jul 11, 2012 at 06:26:49PM +0300, Purdila, Octavian wrote: > > On Wed, Jul 11, 2012 at 5:54 PM, Ram Pai wrote: > > > On Wed, Jul 11, 2012 at 02:06:10PM +0300, Purdila, Octavian wrote: > > >> On Wed

[RFC-2 PATCH 2/8] shared subtree

2005-07-18 Thread Ram Pai
Adds the ability to unclone a vfs tree. A uncloned vfs tree will not be clonnable, and hence cannot be bind/rbind to any other mountpoint. RP fs/namespace.c| 15 ++- include/linux/fs.h|1 + include/linux/mount.h | 15 +++ 3 files changed, 30 insert

[RFC-2 PATCH 0/8] shared subtree

2005-07-18 Thread Ram Pai
Enclosed 8 patches that implement shared subtree functionality as detailed in Al Viro's RFC found at http://lwn.net/Articles/119232/ I have incorporated all the comments received earlier in first round. Thanks to Miklos and Pekka for the valuable comments. Also I have optimized lots of code, esp

[RFC-2 PATCH 7/8] shared subtree

2005-07-18 Thread Ram Pai
adds support for mount/umount propogation for autofs initiated operations, RP fs/namespace.c| 151 +- fs/pnode.c| 13 ++-- include/linux/pnode.h |3 3 files changed, 61 insertions(+), 106 deletions(-) Index: 2.6.12.work

[RFC-2 PATCH 8/8] shared subtree

2005-07-18 Thread Ram Pai
code Optimization for pnode.c fs/pnode.c | 478 - 1 files changed, 224 insertions(+), 254 deletions(-) Index: 2.6.12.work1/fs/pnode.c === --- 2.6.12.work1.orig/fs/pnode.

[RFC-2 PATCH 3/8] shared subtree

2005-07-18 Thread Ram Pai
Adds the ability to bind/rbind a shared/private/slave subtree and set up propogation wherever needed. RP Signed by Ram Pai ([EMAIL PROTECTED]) fs/namespace.c| 559 -- fs/pnode.c| 416

[RFC-2 PATCH 1/8] shared subtree

2005-07-18 Thread Ram Pai
This patch adds the shared/private/slave support for VFS trees. Signed by Ram Pai ([EMAIL PROTECTED]) fs/Makefile |2 fs/dcache.c |2 fs/namespace.c| 98 +++ fs/pnode.c| 158

[RFC-2 PATCH 4/8] shared subtree

2005-07-18 Thread Ram Pai
Adds ability to move a shared/private/slave/unclone tree to any other shared/private/slave/unclone tree. Also incorporates the same behavior for pivot_root() RP Signed by Ram Pai ([EMAIL PROTECTED]) fs/namespace.c | 150 +++-- 1 files

[RFC-2 PATCH 5/8] shared subtree

2005-07-18 Thread Ram Pai
Adds ability to unmount a shared/slave/unclone/private tree RP Signed by Ram Pai ([EMAIL PROTECTED]) fs/namespace.c| 68 +- fs/pnode.c| 112 ++ include/linux/fs.h|3 + include/linux

[RFC-2 PATCH 6/8] shared subtree

2005-07-18 Thread Ram Pai
Adds ability to clone a namespace that has shared/private/slave/unclone subtrees in it. RP Signed by Ram Pai ([EMAIL PROTECTED]) fs/namespace.c |9 + 1 files changed, 9 insertions(+) Index: 2.6.12.work1/fs/namespace.c

Re: shared subtrees implementation writeup

2005-07-18 Thread Ram Pai
On Mon, 2005-07-18 at 04:06, Miklos Szeredi wrote: > Thanks for the writeup, it helps to understand things a bit better. > However I still don't understand a few things: > > > > Section 1. mount: > > > > to begin with we have a the following mount tree > > > > root > >

[no subject]

2005-07-25 Thread Ram Pai
nclone tree to any other shared/private/slave/unclone tree. Also incorporates the same behavior for pivot_root() RP Signed by Ram Pai ([EMAIL PROTECTED]) fs/namespace.c| 196 +++--- include/linux/mount.h |2 2 files changed, 173 inse

[no subject]

2005-07-25 Thread Ram Pai
rivate/slave subtree and set up propogation wherever needed. RP Signed by Ram Pai ([EMAIL PROTECTED]) fs/namespace.c| 660 -- fs/pnode.c| 235 include/linux/dcache.h|2 include/linux/fs.h

[no subject]

2005-07-25 Thread Ram Pai
nclone/private tree RP Signed by Ram Pai ([EMAIL PROTECTED]) fs/namespace.c| 76 -- fs/pnode.c| 66 +++ include/linux/fs.h|3 + include/linux/pnode.h |9 - 4 files change

[no subject]

2005-07-25 Thread Ram Pai
gation for autofs initiated operations, RP Signed by Ram Pai ([EMAIL PROTECTED]) fs/namespace.c| 176 +++--- fs/pnode.c| 12 +-- include/linux/pnode.h |3 3 files changed, 76 insertions(+), 115 deletions(-) Index: 2.6.12.wo

[no subject]

2005-07-25 Thread Ram Pai
ds the shared/private/slave support for VFS trees. Signed by Ram Pai ([EMAIL PROTECTED]) fs/Makefile |2 fs/dcache.c |2 fs/namespace.c| 93 ++ fs/pnode.c| 441 ++ include/linux/fs.h

[no subject]

2005-07-25 Thread Ram Pai
at has shared/private/slave/unclone subtrees in it. RP Signed by Ram Pai ([EMAIL PROTECTED]) fs/namespace.c |9 + 1 files changed, 9 insertions(+) Index: 2.6.12-rc6.work1/fs/namespace.c === --- 2.6.12-rc6.work1.o

[no subject]

2005-07-25 Thread Ram Pai
ree. A uncloned vfs tree will not be clonnable, and hence cannot be bind/rbind to any other mountpoint. RP Signed by Ram Pai ([EMAIL PROTECTED]) fs/namespace.c| 15 ++- include/linux/fs.h|1 + include/linux/mount.h | 15 +++ 3 files changed, 30 insertions

[no subject]

2005-07-25 Thread Ram Pai
, [EMAIL PROTECTED], Janak Desai <[EMAIL PROTECTED]>, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/7] shared subtree Hi Andrew/Al Viro, Enclosing a final set of well tested patches that implement Al Viro's shared subtree proposal. These p

Re: supposed to be shared subtree patches.

2005-07-25 Thread Ram Pai
On Mon, 2005-07-25 at 15:44, Ram Pai wrote: > , [EMAIL PROTECTED], Janak Desai <[EMAIL PROTECTED]>, > linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org > Subject: [PATCH 0/7] shared subtree > > Hi Andrew/Al Viro, > > Enclosing a final set of well te

Re: [PATCH 3/7] shared subtree

2005-07-27 Thread Ram Pai
On Wed, 2005-07-27 at 12:13, Miklos Szeredi wrote: > > @@ -54,7 +55,7 @@ static inline unsigned long hash(struct > > > > struct vfsmount *alloc_vfsmnt(const char *name) > > { > > - struct vfsmount *mnt = kmem_cache_alloc(mnt_cache, GFP_KERNEL); > > + struct vfsmount *mnt = kmem_cache_allo

Re: [PATCH 1/7] shared subtree

2005-07-27 Thread Ram Pai
On Wed, 2005-07-27 at 12:54, Miklos Szeredi wrote: > > +static int do_make_shared(struct vfsmount *mnt) > > +{ > > + int err=0; > > + struct vfspnode *old_pnode = NULL; > > + /* > > +* if the mount is already a slave mount, > > +* allocate a new pnode and make it > > +* a slave pn

Re: [PATCH 1/7] shared subtree

2005-07-29 Thread Ram Pai
On Thu, 2005-07-28 at 02:57, Miklos Szeredi wrote: > > > This is an example, where having struct pnode just complicates things. > > > If there was no struct pnode, this function would be just one line: > > > setting the shared flag. > > So your comment is mostly about getting rid of pnode and distr

Re: [PATCH 1/7] shared subtree

2005-07-30 Thread Ram Pai
On Fri, 2005-07-29 at 22:39, Miklos Szeredi wrote: > > > static struct vfsmount *propagation_next(struct vfsmount *p, > > >struct vfsmount *base) > > > { > > > /* first iterate over the slaves */ > > > if (!list_empty(&p->mnt_slave_list)) > > > retu

Re: [RFC][PATCH] VFS: create /proc//mountinfo

2008-01-21 Thread Ram Pai
most people would be happier with a new file, instead of > extending /proc/mounts. > > This patch is the first attempt at doing that, as well as fixing the > issues found in the previous submission. > > Thanks, > Miklos > > --- > From: Ram Pai <[EMAIL PROTECTED]

Re: [RFC][PATCH] VFS: create /proc//mountinfo

2008-01-21 Thread Ram Pai
On Mon, 2008-01-21 at 22:25 +0100, Miklos Szeredi wrote: > > You have removed the code that checked if the peer or > > master mount was in the same namespace before reporting their > > corresponding mount-ids. One downside of that approach is the > > user will see an mount_id in the

Re: [PATCH -mm] readahead: partial sendfile fix

2007-02-12 Thread Ram Pai
On Sat, 2007-02-10 at 09:40 +0800, Fengguang Wu wrote: > Enable readahead to handle partially done read requests, e.g. > > sendfile(188, 1921, [1478592], 19553028) = 37440 > sendfile(188, 1921, [1516032], 19515588) = 28800 > sendfile(188, 1921, [1544832], 19486788) = 37440

Re: Adding subroot information to /proc/mounts, or obtaining that through other means

2007-06-21 Thread Ram Pai
ny) is sitting among the options... > > Okay, I see there has been some discussion on this earlier, based on a > proposal by Ram Pai, so it pretty much comes down to redesigning this > right. I see some issues with his proposal (device numbers exported to > userspace in text form should b

Re: Adding subroot information to /proc/mounts, or obtaining that through other means

2007-06-21 Thread Ram Pai
On Thu, 2007-06-21 at 09:29 -0700, H. Peter Anvin wrote: > Ram Pai wrote: > > > > Peter, I am not working on it currently. But i am interested in getting > > it done. I have the seed set of patches which had Al Viro's ideas > > incorporated. Infact those patches

Re: Adding subroot information to /proc/mounts, or obtaining that through other means

2007-06-21 Thread Ram Pai
On Thu, 2007-06-21 at 10:31 -0700, H. Peter Anvin wrote: > Ram Pai wrote: > > > > Peter, I am not working on it currently. But i am interested in getting > > it done. I have the seed set of patches which had Al Viro's ideas > > incorporated. Infact those patches

Re: Adding subroot information to /proc/mounts, or obtaining that through other means

2007-06-22 Thread Ram Pai
On Fri, 2007-06-22 at 00:06 -0700, H. Peter Anvin wrote: > Ram Pai wrote: > > > > the second patch made a /proc/propagation interface which had almost the > > same fields, but also added fields to show the propagation type of the > > mount as well as pointers to its pe

[RFC PATCH 1/1] VFS: Augment /proc/mount with subroot and shared-subtree

2007-06-25 Thread Ram Pai
ectory of this mount. And finally the mount with id c1208c08 is its parent. Signed-off-by: Ram Pai <[EMAIL PROTECTED]> --- fs/dcache.c | 53 +++ fs/namespace.c | 25 ++ fs/pnode.c | 22

Re: [RFC PATCH 1/1] VFS: Augment /proc/mount with subroot and shared-subtree

2007-07-11 Thread Ram Pai
On Wed, 2007-07-11 at 11:24 +0100, Christoph Hellwig wrote: > On Sat, Jun 30, 2007 at 08:56:02AM -0400, H. Peter Anvin wrote: > > Is that conjecture, or do you have evidence to that effect? Most users > > of this file are using it via the glibc interfaces, and there probably > > aren't all that

[RFC2 PATCH 1/1] VFS: Augment /proc/mount with subroot and shared-subtree

2007-07-16 Thread Ram Pai
And finally the mount with id 16 is its parent. Testing: symlinked /etc/mtab to /proc/mounts and did some mount and df commands. They worked normally. Signed-off-by: Ram Pai <[EMAIL PROTECTED]> --- fs/dcache.c | 53 +++ fs/namespace.c

Re: [patch 0/8] unprivileged mount syscall

2007-04-16 Thread Ram Pai
On Fri, 2007-04-13 at 13:58 +0200, Miklos Szeredi wrote: > > On Wed, 2007-04-11 at 12:44 +0200, Miklos Szeredi wrote: > > > > 1. clone the master namespace. > > > > > > > > 2. in the new namespace > > > > > > > > move the tree under /share/$me to / > > > > for each ($user, $what,

Re: [patch 0/8] unprivileged mount syscall

2007-04-16 Thread Ram Pai
On Fri, 2007-04-13 at 16:05 +0200, Miklos Szeredi wrote: > > > Thinking a bit more about this, I'm quite sure most users wouldn't > > > even want private namespaces. It would be enough to > > > > > > chroot /share/$USER > > > > > > and be done with it. > > > > > > Private namespaces are only

Re: [Devel] Re: [patch 05/10] add "permit user mounts in new namespace" clone flag

2007-04-16 Thread Ram Pai
> > "Serge E. Hallyn" <[EMAIL PROTECTED]> writes: > > > Quoting Miklos Szeredi ([EMAIL PROTECTED]): > >> From: Miklos Szeredi <[EMAIL PROTECTED]> > >> > >> If CLONE_NEWNS and CLONE_NEWNS_USERMNT are given to clone(2) or > >> unshare(2), then allow user mounts within the new namespace. > >> > >

Re: [Devel] Re: [patch 05/10] add "permit user mounts in new namespace" clone flag

2007-04-16 Thread Ram Pai
On Mon, 2007-04-16 at 11:32 +0200, Miklos Szeredi wrote: > > > Given the existence of shared subtrees allowing/denying this at the > > > mount > > > namespace level is silly and wrong. > > > > > > If we need more than just the filesystem permission checks can we > > > make it a mount flag settable

Re: [Devel] Re: [patch 05/10] add "permit user mounts in new namespace" clone flag

2007-04-16 Thread Ram Pai
On Mon, 2007-04-16 at 11:56 +0200, Miklos Szeredi wrote: > > > > Also for bind-mount and remount operations the flag has to be propagated > > > > down its propagation tree. Otherwise a unpriviledged mount in a shared > > > > mount wont get reflected in its peers and slaves, leading to unidentical

Re: [Devel] Re: [patch 05/10] add "permit user mounts in new namespace" clone flag

2007-04-17 Thread Ram Pai
On Tue, 2007-04-17 at 19:44 +0200, Miklos Szeredi wrote: > > I'm a bit lost about what is currently done and who advocates for what. > > > > It seems to me the MNT_ALLOWUSERMNT (or whatever :) flag should be > > propagated. In the /share rbind+chroot example, I assume the admin > > would start by

Re: [Devel] Re: [patch 05/10] add "permit user mounts in new namespace" clone flag

2007-04-17 Thread Ram Pai
On Tue, 2007-04-17 at 21:43 +0200, Miklos Szeredi wrote: > > > > I'm a bit lost about what is currently done and who advocates for what. > > > > > > > > It seems to me the MNT_ALLOWUSERMNT (or whatever :) flag should be > > > > propagated. In the /share rbind+chroot example, I assume the admin >

Re: [Devel] Re: [patch 05/10] add "permit user mounts in new namespace" clone flag

2007-04-18 Thread Ram Pai
On Wed, 2007-04-18 at 11:19 +0200, Miklos Szeredi wrote: > > > Allowing this and other flags to NOT be propagated just makes it > > > possible to have a set of shared mounts with asymmetric properties, > > > which may actually be desirable. > > > > The shared mount feature was designed to ensure t

Re: [Devel] Re: [patch 05/10] add "permit user mounts in new namespace" clone flag

2007-04-18 Thread Ram Pai
On Wed, 2007-04-18 at 21:14 +0200, Miklos Szeredi wrote: > > As I said earlier, I see a case where two mounts that are peers of each > > other can become un-identical if we dont propagate the "allowusermnt". > > > > As a practical example. > > > > /tmp and /mnt are peers of each other. > > /tmp h

Re: [patch 0/8] unprivileged mount syscall

2007-04-09 Thread Ram Pai
On Mon, 2007-04-09 at 12:07 -0500, Serge E. Hallyn wrote: > Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > - need to set up mount propagation from global namespace to private > >ones, mount(8) does not yet have options to configure propagation > > Hmm, I guess I get lost using my own little

Re: [patch 0/8] unprivileged mount syscall

2007-04-10 Thread Ram Pai
On Mon, 2007-04-09 at 22:10 +0200, Miklos Szeredi wrote: > > > The one in pam-0.99.6.3-29.1 in opensuse-10.2 is totally broken. Are > > > you interested in the details? I can reproduce it, but forgot to note > > > down the details of the brokenness. > > > > I don't know how far removed that is f

Re: [patch 0/8] unprivileged mount syscall

2007-04-11 Thread Ram Pai
On Wed, 2007-04-11 at 12:44 +0200, Miklos Szeredi wrote: > > 1. clone the master namespace. > > > > 2. in the new namespace > > > > move the tree under /share/$me to / > > for each ($user, $what, $how) { > > move /share/$user/$what to /$what > > if ($how == slave)

Re: [RFC v6 21/62] powerpc: introduce execute-only pkey

2017-08-17 Thread Ram Pai
On Thu, Aug 17, 2017 at 04:35:55PM -0700, Ram Pai wrote: > On Wed, Aug 02, 2017 at 07:40:46PM +1000, Michael Ellerman wrote: > > Thiago Jung Bauermann writes: > > > > > Michael Ellerman writes: > > > > > >> Thiago Ju

Re: [RFC v2 03/12] powerpc: Implement sys_pkey_alloc and sys_pkey_free system call.

2017-06-20 Thread Ram Pai
On Mon, Jun 19, 2017 at 10:18:01PM +1000, Michael Ellerman wrote: > Hi Ram, > > Ram Pai writes: > > Sys_pkey_alloc() allocates and returns available pkey > > Sys_pkey_free() frees up the pkey. > > > > Total 32 keys are supported on powerpc. However pke

Re: [RFC v2 01/12] powerpc: Free up four 64K PTE bits in 4K backed hpte pages.

2017-06-20 Thread Ram Pai
On Tue, Jun 20, 2017 at 03:50:25PM +0530, Anshuman Khandual wrote: > On 06/17/2017 09:22 AM, Ram Pai wrote: > > Rearrange 64K PTE bits to free up bits 3, 4, 5 and 6 > > in the 4K backed hpte pages. These bits continue to be used > > for 64K backed hpte pages in this pat

Re: [RFC v2 02/12] powerpc: Free up four 64K PTE bits in 64K backed hpte pages.

2017-06-20 Thread Ram Pai
On Tue, Jun 20, 2017 at 04:21:45PM +0530, Anshuman Khandual wrote: > On 06/17/2017 09:22 AM, Ram Pai wrote: > > Rearrange 64K PTE bits to free up bits 3, 4, 5 and 6 > > in the 64K backed hpte pages. This along with the earlier > > patch will entirely free up the f

Re: [RFC v2 06/12] powerpc: Program HPTE key protection bits.

2017-06-20 Thread Ram Pai
On Tue, Jun 20, 2017 at 01:51:45PM +0530, Anshuman Khandual wrote: > On 06/17/2017 09:22 AM, Ram Pai wrote: > > Map the PTE protection key bits to the HPTE key protection bits, > > while creatiing HPTE entries. > > > > Signed-off-by: Ram Pai > > --- > >

Re: [RFC v2 07/12] powerpc: Macro the mask used for checking DSI exception

2017-06-20 Thread Ram Pai
On Tue, Jun 20, 2017 at 01:44:25PM +0530, Anshuman Khandual wrote: > On 06/17/2017 09:22 AM, Ram Pai wrote: > > Replace the magic number used to check for DSI exception > > with a meaningful value. > > > > Signed-off-by: Ram Pai > > --- > > a

Re: [RFC v2 08/12] powerpc: Handle exceptions caused by violation of pkey protection.

2017-06-20 Thread Ram Pai
On Tue, Jun 20, 2017 at 12:54:45PM +0530, Anshuman Khandual wrote: > On 06/17/2017 09:22 AM, Ram Pai wrote: > > Handle Data and Instruction exceptions caused by memory > > protection-key. > > > > Signed-off-by: Ram Pai > > (cherry picked from commit a5e5217

Re: [RFC v2 09/12] powerpc: Deliver SEGV signal on pkey violation.

2017-06-20 Thread Ram Pai
On Tue, Jun 20, 2017 at 12:24:53PM +0530, Anshuman Khandual wrote: > On 06/17/2017 09:22 AM, Ram Pai wrote: > > The value of the AMR register at the time of exception > > is made available in gp_regs[PT_AMR] of the siginfo. > > > > This field can be used to repro

Re: [RFC v2 10/12] powerpc: Read AMR only if pkey-violation caused the exception.

2017-06-20 Thread Ram Pai
On Mon, Jun 19, 2017 at 09:06:13PM +1000, Michael Ellerman wrote: > Ram Pai writes: > > > Signed-off-by: Ram Pai > > --- > > arch/powerpc/kernel/exceptions-64s.S | 16 ++-- > > 1 file changed, 10 insertions(+), 6 deletions(-) > > > > d

Re: [RFC v2 10/12] powerpc: Read AMR only if pkey-violation caused the exception.

2017-06-20 Thread Ram Pai
On Tue, Jun 20, 2017 at 12:16:40PM +0530, Anshuman Khandual wrote: > On 06/19/2017 11:29 PM, Ram Pai wrote: > > On Mon, Jun 19, 2017 at 09:06:13PM +1000, Michael Ellerman wrote: > >> Ram Pai writes: > >> > >>> Signed-off-by: Ram Pai > >>> -

Re: [RFC v2 11/12]Documentation: Documentation updates.

2017-06-20 Thread Ram Pai
On Tue, Jun 20, 2017 at 11:48:23AM +0530, Anshuman Khandual wrote: > On 06/17/2017 09:22 AM, Ram Pai wrote: > > The Documentaton file is moved from x86 into the generic area, > > since this feature is now supported by more than one archs. > > > > Signed-off-by: Ram Pai

Re: [RFC v2 12/12]selftest: Updated protection key selftest

2017-06-20 Thread Ram Pai
On Tue, Jun 20, 2017 at 11:56:04AM +0530, Anshuman Khandual wrote: > On 06/17/2017 09:22 AM, Ram Pai wrote: > > Added test support for PowerPC implementation off protection keys. > > > > Signed-off-by: Ram Pai > > First of all, there are a lot of instances where we u

Re: [RFC v2 09/12] powerpc: Deliver SEGV signal on pkey violation.

2017-06-20 Thread Ram Pai
On Wed, Jun 21, 2017 at 08:48:20AM +0530, Anshuman Khandual wrote: > On 06/21/2017 05:26 AM, Ram Pai wrote: > > On Tue, Jun 20, 2017 at 12:24:53PM +0530, Anshuman Khandual wrote: > >> On 06/17/2017 09:22 AM, Ram Pai wrote: > >>> The value of the AMR register at the t

Re: [RFC v2 08/12] powerpc: Handle exceptions caused by violation of pkey protection.

2017-06-20 Thread Ram Pai
On Wed, Jun 21, 2017 at 09:24:36AM +0530, Anshuman Khandual wrote: > On 06/21/2017 05:13 AM, Ram Pai wrote: > > On Tue, Jun 20, 2017 at 12:54:45PM +0530, Anshuman Khandual wrote: > >> On 06/17/2017 09:22 AM, Ram Pai wrote: > >>> Handle Data and Instructi

Re: [RFC v2 01/12] powerpc: Free up four 64K PTE bits in 4K backed hpte pages.

2017-06-20 Thread Ram Pai
On Wed, Jun 21, 2017 at 11:05:33AM +0530, Anshuman Khandual wrote: > On 06/21/2017 04:53 AM, Ram Pai wrote: > > On Tue, Jun 20, 2017 at 03:50:25PM +0530, Anshuman Khandual wrote: > >> On 06/17/2017 09:22 AM, Ram Pai wrote: > >>> Rearrange 64K PTE bits to free up

Re: [RFC v2 07/12] powerpc: Macro the mask used for checking DSI exception

2017-06-21 Thread Ram Pai
On Wed, Jun 21, 2017 at 12:55:42PM +0530, Aneesh Kumar K.V wrote: > Ram Pai writes: > > > Replace the magic number used to check for DSI exception > > with a meaningful value. > > > > Signed-off-by: Ram Pai > > --- > > arch/powerpc/include/asm/reg.h

Re: [RFC v2 01/12] powerpc: Free up four 64K PTE bits in 4K backed hpte pages.

2017-06-21 Thread Ram Pai
On Wed, Jun 21, 2017 at 12:11:32PM +0530, Aneesh Kumar K.V wrote: > Ram Pai writes: > > > Rearrange 64K PTE bits to free up bits 3, 4, 5 and 6 > > in the 4K backed hpte pages. These bits continue to be used > > for 64K backed hpte pages in this patch, but will be

Re: [RFC v2 02/12] powerpc: Free up four 64K PTE bits in 64K backed hpte pages.

2017-06-21 Thread Ram Pai
On Wed, Jun 21, 2017 at 12:24:34PM +0530, Aneesh Kumar K.V wrote: > Ram Pai writes: > > > > > diff --git a/arch/powerpc/mm/hugetlbpage-hash64.c > > b/arch/powerpc/mm/hugetlbpage-hash64.c > > index a84bb44..239ca86 100644 > > --- a/arch/powerpc/mm

[RFC v3 03/23] powerpc: introduce get_hidx_gslot helper

2017-06-21 Thread Ram Pai
Introduce get_hidx_gslot() which returns the slot number of the HPTE in the global hash table. This function will come in handy as we work towards re-arranging the PTE bits in the later patches. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/hash.h | 3 +++ arch/powerpc/mm

[RFC v3 01/23] powerpc: Free up four 64K PTE bits in 4K backed HPTE pages

2017-06-21 Thread Ram Pai
updates significantly and has the added advantage of releasing four valuable PTE bits for other purpose. This idea was jointly developed by Paul Mackerras, Aneesh, Michael Ellermen and myself. 4K PTE format remain unchanged currently. Signed-off-by: Ram Pai Conflicts: arch

[RFC v3 15/23] powerpc: Program HPTE key protection bits

2017-06-21 Thread Ram Pai
Map the PTE protection key bits to the HPTE key protection bits, while creating HPTE entries. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/mmu-hash.h | 5 + arch/powerpc/include/asm/pkeys.h | 7 +++ arch/powerpc/mm/hash_utils_64.c | 5

[RFC v3 12/23] powerpc: Implement sys_pkey_alloc and sys_pkey_free system call

2017-06-21 Thread Ram Pai
key can be initialize to disable execute. Signed-off-by: Ram Pai --- arch/powerpc/Kconfig | 15 arch/powerpc/include/asm/book3s/64/mmu.h | 10 +++ arch/powerpc/include/asm/book3s/64/pgtable.h | 62 ++ arch/powerpc/include/asm/pkeys.h | 124

[RFC v3 06/23] powerpc: use helper functions in __hash_page_4K() for 64K PTE

2017-06-21 Thread Ram Pai
replace redundant code in __hash_page_4K() with helper functions get_hidx_gslot() and set_hidx_slot() Signed-off-by: Ram Pai --- arch/powerpc/mm/hash64_64k.c | 24 ++-- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/arch/powerpc/mm/hash64_64k.c b/arch/powerpc

[RFC v3 13/23] powerpc: store and restore the pkey state across context switches

2017-06-21 Thread Ram Pai
Store and restore the AMR, IAMR and UMOR register state of the task before scheduling out and after scheduling in, respectively. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/processor.h | 5 + arch/powerpc/kernel/process.c| 18 ++ 2 files changed, 23

[RFC v3 11/23] x86: key creation with PKEY_DISABLE_EXECUTE is disallowed

2017-06-21 Thread Ram Pai
x86 does not support disabling execute permissions on a pkey. Signed-off-by: Ram Pai --- arch/x86/kernel/fpu/xstate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c index c24ac1e..d582631 100644 --- a/arch/x86/kernel/fpu

[RFC v3 04/23] powerpc: Free up four 64K PTE bits in 64K backed HPTE pages

2017-06-21 Thread Ram Pai
bits can be allocated if needed in the future. The second part of the PTE will hold (H_PAGE_F_SECOND|H_PAGE_F_GIX) at bit 60,61,62,63. The above PTE changes is applicable to hugetlbpages aswell. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/hash-64k.h | 28

[RFC v3 17/23] powerpc: Handle exceptions caused by violation of pkey protection

2017-06-21 Thread Ram Pai
Handle Data and Instruction exceptions caused by memory protection-key. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/mmu_context.h | 12 + arch/powerpc/include/asm/pkeys.h | 9 arch/powerpc/include/asm/reg.h | 2 +- arch/powerpc/mm/fault.c| 20

[RFC v3 23/23] procfs: display the protection-key number associated with a vma

2017-06-21 Thread Ram Pai
Display the pkey number associated with the vma in smaps of a task. The key will be seen as below: VmFlags: rd wr mr mw me dw ac key=0 Signed-off-by: Ram Pai --- Documentation/filesystems/proc.txt | 3 ++- fs/proc/task_mmu.c | 22 +++--- 2 files changed, 13

[RFC v3 22/23] Documentation: PowerPC specific updates to memory protection keys

2017-06-21 Thread Ram Pai
Add documentation updates that capture PowerPC specific changes. Signed-off-by: Ram Pai --- Documentation/vm/protection-keys.txt | 65 +--- 1 file changed, 45 insertions(+), 20 deletions(-) diff --git a/Documentation/vm/protection-keys.txt b/Documentation/vm

[RFC v3 19/23] selftest: Move protecton key selftest to arch neutral directory

2017-06-21 Thread Ram Pai
Signed-off-by: Ram Pai --- tools/testing/selftests/vm/Makefile |1 + tools/testing/selftests/vm/pkey-helpers.h | 219 tools/testing/selftests/vm/protection_keys.c | 1395 + tools/testing/selftests/x86/Makefile |2 +- tools/testing

[RFC v3 21/23] Documentation: Move protecton key documentation to arch neutral directory

2017-06-21 Thread Ram Pai
Since PowerPC and Intel both support memory protection keys, moving the documenation to arch-neutral directory. Signed-off-by: Ram Pai --- Documentation/vm/protection-keys.txt | 85 +++ Documentation/x86/protection-keys.txt | 85

[RFC v3 16/23] powerpc: Macro the mask used for checking DSI exception

2017-06-21 Thread Ram Pai
Replace the magic number used to check for DSI exception with a meaningful value. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/reg.h | 7 ++- arch/powerpc/kernel/exceptions-64s.S | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm

[RFC v3 20/23] selftest: PowerPC specific test updates to memory protection keys

2017-06-21 Thread Ram Pai
checkpatch.pl happy Signed-off-by: Ram Pai --- tools/testing/selftests/vm/pkey-helpers.h| 230 +-- tools/testing/selftests/vm/protection_keys.c | 562 --- 2 files changed, 513 insertions(+), 279 deletions(-) diff --git a/tools/testing/selftests/vm/pkey-helpers.h

  1   2   3   4   5   6   >