mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Miroslav Benes <mbenes@suse.cz>
To: Joe Lawrence <joe.lawrence@redhat.com>
Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Jessica Yu <jeyu@redhat.com>, Jiri Kosina <jikos@kernel.org>,
	Petr Mladek <pmladek@suse.com>
Subject: Re: [PATCH v3] livepatch: introduce shadow variable API
Date: Fri, 11 Aug 2017 08:27:41 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LSU.2.20.1708110825510.13979@pobox.suse.cz> (raw)
In-Reply-To: <20170810160432.3vccq4clvg7pi7m4@redhat.com>


> > > +/*
> > > + * klp_shadow_set() - initialize a shadow variable
> > > + * @shadow:	shadow variable to initialize
> > > + * @obj:	pointer to parent object
> > > + * @id:		data identifier
> > > + * @data:	pointer to data to attach to parent
> > > + * @size:	size of attached data
> > > + */
> > > +static inline void klp_shadow_set(struct klp_shadow *shadow, void *obj,
> > > +				  unsigned long id, void *data, size_t size)
> > > +{
> > > +	shadow->obj = obj;
> > > +	shadow->id = id;
> > > +
> > > +	if (data)
> > > +		memcpy(shadow->data, data, size);
> > > +}
> > > +
> > > +/**
> > > + * klp_shadow_add() - add a shadow variable to the hashtable
> > > + * @shadow:	shadow variable to add
> > > + */
> > > +static inline void klp_shadow_add(struct klp_shadow *shadow)
> > > +{
> > > +	hash_add_rcu(klp_shadow_hash, &shadow->node,
> > > +		     (unsigned long)shadow->obj);
> > > +}
> > 
> > It would be nice to add a comment that a caller must hold klp_shadow_lock 
> > spinlock.
> 
> Since shadow_match(), klp_shadow_set(), and klp_shadow_add() are all in
> the same boat, I can mention the lock for those functions as well. 

Yes, please.

> BTW,
> is there a convention to drop the "klp_" for static, local routines?  I
> should be consistent here.

Oh, I didn't notice missing "klp_" in shadow_match. We have a prefix 
everywhere, so add it, please.

Thanks,
Miroslav

  reply	other threads:[~2017-08-11  6:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-28 17:25 [PATCH v3] livepatch: shadow variables Joe Lawrence
2017-07-28 17:25 ` [PATCH v3] livepatch: introduce shadow variable API Joe Lawrence
2017-08-10 14:40   ` Miroslav Benes
2017-08-10 16:04     ` Joe Lawrence
2017-08-11  6:27       ` Miroslav Benes [this message]
2017-08-11 16:35   ` Josh Poimboeuf
2017-08-14 13:56     ` Joe Lawrence

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LSU.2.20.1708110825510.13979@pobox.suse.cz \
    --to=mbenes@suse.cz \
    --cc=jeyu@redhat.com \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=pmladek@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®