Received: by 10.213.65.68 with SMTP id h4csp4413830imn; Tue, 10 Apr 2018 14:39:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx48hcuuA7uohgHauXQuUD1802ZSyd94dnCWl7D3nzGhmg0vuFM9Wv2rMilzTlKlzFRwYAyl0 X-Received: by 2002:a17:902:8305:: with SMTP id bd5-v6mr2102483plb.322.1523396350619; Tue, 10 Apr 2018 14:39:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523396350; cv=none; d=google.com; s=arc-20160816; b=MXqtYuqcJZM+0z98uQDq+oTXY90viZsvu5LitGkrCZL5zF+ODxyutDaMOINOl8w1Bt SveKc1s+LhIs+VaWeJkf7RsncadcE9WYAMZFoPUVk3FiLTL8eT4yq4X0I/wdaPb8kuna w7Ou4Nf8ogDgT0/B6DqzTgVVpvl6eVs0TcTWUkhUgqclvxcBv9jA4dUThni895MSwD37 vgdxdt6dS2ZsfMirw4vJD8iRw+KYm6PPQkRNMqXcRuF8tEATz+IldxJNc3zmwxLdLZ/0 f8kLsVE7Zv08uotRiNEo84StUrqplQJLXlVfl5+XPqh4I8l8cuM8l8+AeVQs7qzhaX3G 8IFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=YOk+3G407+xDDhQbpP58zp1oFG8KJ9fuxDLyDrC73Pc=; b=bLKC7qXwsnw/gUh5tZZAOhWChOW7lk22IgxVUEwrZIG5zMT/wGc8Mn5Qqchn3pDmn2 T0vDNOgC7L1WvcTUVNt3keNoWN8+L7pOGU2fBEhFflojUvH0Gmgu4CEQnKIguB+ZNsai yyzfm2nhcDMUw3SxCowOUQ0rHnzBy052QEn6vhGljkyhA/ZqRLraCiibhWHZzUWQQzMX RXtlfjfWuvfeWC6511GaFpfP9G9BCMza4eudftvkTe/pucV1tUAhHboXgAlQgiE56ly5 VyZ+8wX2k6WCvgi25PEOKJobRSI9jOIY/YCy29AXKgTh7YKJ5gkmYCyUQLc7aTGW7RTY o2KQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k62si4237pgc.453.2018.04.10.14.38.32; Tue, 10 Apr 2018 14:39:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752713AbeDJVd5 (ORCPT + 99 others); Tue, 10 Apr 2018 17:33:57 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40950 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751770AbeDJVdz (ORCPT ); Tue, 10 Apr 2018 17:33:55 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1C80E406F969; Tue, 10 Apr 2018 21:33:55 +0000 (UTC) Received: from treble (ovpn-120-110.rdu2.redhat.com [10.10.120.110]) by smtp.corp.redhat.com (Postfix) with SMTP id 869382026DFD; Tue, 10 Apr 2018 21:33:54 +0000 (UTC) Date: Tue, 10 Apr 2018 16:33:54 -0500 From: Josh Poimboeuf To: Joe Lawrence Cc: live-patching@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Kosina , Petr Mladek , Miroslav Benes , Libor =?utf-8?B?UGVjaMOhxI1law==?= , Nicolai Stange , Artem Savkov Subject: Re: [PATCH v2] selftests/livepatch: introduce tests Message-ID: <20180410213354.ma5wfe3jc23pzmw4@treble> References: <1523373354-10801-1-git-send-email-joe.lawrence@redhat.com> <1523373354-10801-2-git-send-email-joe.lawrence@redhat.com> <20180410200059.loy3hw6tcwdi4m5z@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 10 Apr 2018 21:33:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 10 Apr 2018 21:33:55 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jpoimboe@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 10, 2018 at 04:50:51PM -0400, Joe Lawrence wrote: > On 04/10/2018 04:00 PM, Josh Poimboeuf wrote: > > On Tue, Apr 10, 2018 at 11:15:54AM -0400, Joe Lawrence wrote: > >> +static void test_klp_shadow_vars_exit(void) > >> +{ > >> +} > >> + > >> +module_init(test_klp_shadow_vars_init); > >> +module_init(test_klp_shadow_vars_exit); > > > > For this last line, s/module_init/module_exit/, though I think the exit > > function can just be removed altogether? > > D'oh workspace / git user error, I posted an older version :( > > But the exit function seems to be required if an init function is > provided. Here I omitted the exit function: > > % modprobe test_klp_shadow_vars > % lsmod | grep test_klp_shadow_vars > test_klp_shadow_vars 16384 0 > % rmmod test_klp_shadow_vars > rmmod: ERROR: could not remove 'test_klp_shadow_vars': Device or > resource busy > rmmod: ERROR: could not remove module test_klp_shadow_vars: Device or > resource busy > > and from kernel/module.c > > SYSCALL_DEFINE2(delete_module, const char __user *, name_user, > unsigned int, flags) > ... > /* If it has an init func, it must have an exit func to unload*/ > if (mod->init && !mod->exit) { > forced = try_force_unload(flags); > if (!forced) { > /* This module can't be removed */ > ret = -EBUSY; > goto out; > } > } > ... Hm, ok, though that seems like a weird limitation... > I missed Petr's commit msg note "that the constructor is called under > klp_shadow_lock." I'll convert the test to use GFP_ATOMIC for this > allocation. > > I'll also add CONFIG_PM_SLEEP_DEBUG=y to my test VM kernel .config. Any > other debug option suggestions? I think CONFIG_LOCKDEP is always a good idea. Otherwise, I dunno... Here's my .config: https://paste.fedoraproject.org/paste/cnM-J18uVWJrxz2DAdSchg -- Josh