All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org, kamalesh@linux.vnet.ibm.com
Subject: Re: [PATCH] powerpc/modules: Use WARN_ON() in stub_for_addr()
Date: Wed, 11 Oct 2017 10:26:41 +0530	[thread overview]
Message-ID: <c2a00841-f514-ef8c-c1be-b053dd84d1b8@linux.vnet.ibm.com> (raw)
In-Reply-To: <87d15uz5j9.fsf@concordia.ellerman.id.au>

On Wednesday 11 October 2017 09:42 AM, Michael Ellerman wrote:
> Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> writes:
> 
>> Use WARN_ON(), while running out of stubs in stub_for_addr()
>> and abort loading of the module instead of BUG_ON().
> 
> Thanks. This looks good in principle. Have you actually tested it to
> make sure we do in fact gracefully fail the module load?
> 

Thanks for the review. I tested with little hackish version of this patch:

+       if (!strncmp(me->name, "live", 4))
+               j = 100;
+       for (i = 0; stub_func_addr(stubs[i].funcdata); i+=j) {
+               if (WARN_ON(i >= num_stubs))
+                       return 0;

and it fails gracefully.

# modprobe livepatch-sample
modprobe: ERROR: could not insert 'livepatch_sample': Unknown symbol in module, or unknown parameter (see dmesg)

# echo $?
1

# dmesg 
------------[ cut here ]------------
WARNING: CPU: 2 PID: 2836 at arch/powerpc/kernel/module_64.c:526 apply_relocate_add+0x71c/0xb00

-- 
cheers,
Kamalesh.

  reply	other threads:[~2017-10-11  4:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10 14:47 [PATCH] powerpc/modules: Use WARN_ON() in stub_for_addr() Kamalesh Babulal
2017-10-11  4:12 ` Michael Ellerman
2017-10-11  4:56   ` Kamalesh Babulal [this message]
2017-10-12  4:29     ` Michael Ellerman
2017-10-19  4:48 ` Michael Ellerman

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=c2a00841-f514-ef8c-c1be-b053dd84d1b8@linux.vnet.ibm.com \
    --to=kamalesh@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.