Received: by 10.192.165.156 with SMTP id m28csp1130360imm; Fri, 13 Apr 2018 13:53:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx49om9ZN7mfFCxAcIsZGcTtd7fGH0DAW2LLLqeGJvKZlIzOFVJZxTfdvAfAu3GmDrSEipL9y X-Received: by 10.98.31.216 with SMTP id l85mr12857870pfj.80.1523652828227; Fri, 13 Apr 2018 13:53:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523652828; cv=none; d=google.com; s=arc-20160816; b=EIfErwYzJSDySNlVs8SSyyOxPdEoxqi7OmPlOdNY4UgYLfgZ2sxN8CTjend+bJJ0fc cQM33P6dYsldR8wbMYUaGWlZJ9+ITtWXX3Zi7g4zCLhG5JVDtoirPbsFre4TpGQ9hW3f oB4A6FRlS7PZs+K/JhYzMcCH2hJnJIv7MAo4UDpb6FQfoRNsbVOto4OGwh6ObHyFknA8 GUzxFjyddlFYtd0vNEEuM4UpdDWJT1XYjbL3UUJjnnCaVsL4mughUSinUnLg9A9ocORc zBggU8+TroAlQTzqL4pC1Z4Gr7aGVy13UAfN/fIaQ9+um9vLvmskmR9jK4ohFTuH4yC6 1IZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=CJMhJT5w5v+KBG520tUiE1mmF1Ns4mREcL2AVHLKOvE=; b=f/9Kbva9NRdgfX7Lm0GZb5Ys5WTK00qQ0+382vamdjxm3TYxtIVx+eOsUEFNMLZSLE ReWQ2JhaZt8Cs2NjTN0P17zctEH41tjcvyQrq3VjykRhXDz9tq/J8U8YXPbbuespqqzI KNLojcpy2ibSTI+SA82ijMTSi2t5MBRZg58NPlrEqSxscnULIsahep0Fkilve1K5jyp0 /F39wSmI424igoAFrD2TX0QTR85sa4pFnNSgQ4dKo0Y+9WUXE0XW0Y7tnikD4qpSrdPb M/agEyvC8RlTGRJwxc6W8wfs1RSgXHO1pVV7gafdFC9FmkreMva7cafLfRnhV1Ue7qWt bt/g== 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 j22-v6si6617075pll.223.2018.04.13.13.53.34; Fri, 13 Apr 2018 13:53:48 -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 S1751111AbeDMUwa (ORCPT + 99 others); Fri, 13 Apr 2018 16:52:30 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38960 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750980AbeDMUw2 (ORCPT ); Fri, 13 Apr 2018 16:52:28 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BC0614072CF7; Fri, 13 Apr 2018 20:52:27 +0000 (UTC) Received: from jlaw-desktop.bos.csb (dhcp-17-208.bos.redhat.com [10.18.17.208]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1DB0A215CDCB; Fri, 13 Apr 2018 20:52:26 +0000 (UTC) Subject: Re: [PATCH v3] selftests/livepatch: introduce tests To: Miroslav Benes Cc: live-patching@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Kosina , Josh Poimboeuf , Petr Mladek , =?UTF-8?Q?Libor_Pech=c3=a1=c4=8dek?= , Nicolai Stange , Artem Savkov References: <1523544871-29444-1-git-send-email-joe.lawrence@redhat.com> <1523544871-29444-2-git-send-email-joe.lawrence@redhat.com> From: Joe Lawrence Organization: Red Hat Message-ID: Date: Fri, 13 Apr 2018 16:52:25 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 13 Apr 2018 20:52:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 13 Apr 2018 20:52:27 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'joe.lawrence@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/13/2018 07:20 AM, Miroslav Benes wrote: > Hi, > > On Thu, 12 Apr 2018, Joe Lawrence wrote: > >> Add a few livepatch modules and simple target modules that the included >> regression suite can run tests against. > > Could you include a brief description which features are tested? I can add this to the commit msg: - basic livepatching (multiple patches, atomic replace) - pre/post (un)patch callbacks - shadow variable API Or do you prefer a little more detail? > >> Signed-off-by: Joe Lawrence >> --- > >> diff --git a/lib/livepatch/test_klp_shadow_vars.c b/lib/livepatch/test_klp_shadow_vars.c >> new file mode 100644 >> index 000000000000..18c75b21cb9e >> --- /dev/null >> +++ b/lib/livepatch/test_klp_shadow_vars.c >> >> +/* >> + * Shadow variable wrapper functions that echo the function and arguments >> + * to the kernel log for testing verification. Don't display raw pointers, >> + * but use the ptr_id() value instead. >> + */ >> +void *shadow_get(void *obj, unsigned long id) >> +{ >> + void *ret = klp_shadow_get(obj, id); >> + >> + pr_info("klp_%s(obj=PTR%d, id=0x%lx) = PTR%d\n", >> + __func__, ptr_id(obj), id, ptr_id(ret)); >> + >> + return ret; >> +} > >> +void shadow_free(void *obj, unsigned long id, klp_shadow_dtor_t dtor) >> +{ >> + klp_shadow_free(obj, id, dtor); >> + pr_info("klp_%s(obj=PTR%d, id=0x%lx, dtor=PTR%d)\n", >> + __func__, ptr_id(obj), id, ptr_id(dtor)); >> +} > > Sparse (make C=1) would be happier with those two being static. Ah right. I wonder why the kbuild test robot didn't complain about those, too. Easy enough to fix up, thanks. > Otherwise it works as expected. Good job! Thanks for reviewing. I'll hold off on posting v4 until Petr (and others) get a chance to comment. Perhaps there are other tests that would be helpful? -- Joe