Received: by 10.192.165.156 with SMTP id m28csp2057806imm; Thu, 12 Apr 2018 07:58:50 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+dvQd6RA1F9F2wWdFfHz/vpTxpjDdrJEqBZtn7roCntEmbZNniwaSjiBtOiui7nxIi5RxB X-Received: by 10.99.123.25 with SMTP id w25mr964733pgc.233.1523545130012; Thu, 12 Apr 2018 07:58:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523545129; cv=none; d=google.com; s=arc-20160816; b=ev1o5QhKT0BraSPi+xMVW6CUoRR7HUyCQDKRrzQsuGkAN6DTR+69dYQTs/5yKh0uWQ fCpTIxGXOr5hAoJs6E4WPWPUGScjMJkqI9awaxBIwyxbTfczRFBKTg3/SnofIN8d8S/J 332Qf0mYMfrl5BpICOdpLN+V3hAUnKqrtCmE69DmVKjnn5af2MMLCzP6WtYAxHsn+rJh busSZjGZy3xivJT6+Gj+hAF96JmAygYrJE251oXzSN5aoNq8d5+qdMwI90E1+nk1JTWV HY/zRMCghb1od4z9OzfNEXMwhpp0WmC2TJivjWBKnIfDQ9s1G/3mUUyiPwIWc8r4U9v4 H3wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=a0AppqhL3RUpfLLvFHr+BeVibsuf7wNGgipw+ep+6JU=; b=b+ewX1MakuQQf8naEsBdW5ayEHpnSsKhT+LyhUUmDV5V273nHqWdDT13+7rgi3xKxy rYy6+CoG2eeXxIGuZj0RDKVmGeYIHZFgBVCaSEMpF3tFDnRrNrx5pztUASPvgqRE5W6O 8HS27rQFNeWWPEDOUrBQP4E9xft4EAjzBH2Ro/8rMsSubKPRMzSXDpAzZYyc/STsNgdr ldHqpd3I+gF8uCuAMMEMy6RF9wMbK8LYDmauRmWaAQp6zdjvq4zqfkEeewwBHPb39boD mKJoeGKEEoJjg15KZelV8kADCYdmIr+4xScr6VbGfQfkKJdYqmoKJRShszItwx5wwAJh FGmg== 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 x10-v6si3392945plv.563.2018.04.12.07.58.12; Thu, 12 Apr 2018 07:58:49 -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 S1753107AbeDLOyg (ORCPT + 99 others); Thu, 12 Apr 2018 10:54:36 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40888 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753060AbeDLOye (ORCPT ); Thu, 12 Apr 2018 10:54:34 -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 28C48EB706; Thu, 12 Apr 2018 14:54:34 +0000 (UTC) Received: from jlaw-desktop.bos.com (dhcp-17-208.bos.redhat.com [10.18.17.208]) by smtp.corp.redhat.com (Postfix) with ESMTP id D202E2024CA4; Thu, 12 Apr 2018 14:54:33 +0000 (UTC) From: Joe Lawrence To: live-patching@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jiri Kosina , Josh Poimboeuf , Petr Mladek , Miroslav Benes , =?UTF-8?q?Libor=20Pech=C3=A1=C4=8Dek?= , Nicolai Stange , Artem Savkov Subject: [PATCH v3] Add livepatch kselftests Date: Thu, 12 Apr 2018 10:54:30 -0400 Message-Id: <1523544871-29444-1-git-send-email-joe.lawrence@redhat.com> 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.1]); Thu, 12 Apr 2018 14:54:34 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 12 Apr 2018 14:54:34 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.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 Tests run on top of Petr's v11 atomic replace feature and v2 of the shadow variable enhancement patchsets: [PATCH 0/8] livepatch: Atomic replace feature https://lkml.kernel.org/r/20180323120028.31451-1-pmladek@suse.com [PATCH v2 0/2] livepatch: Allocate and free shadow variables more safely https://lkml.kernel.org/r/20180405122315.29065-1-pmladek@suse.com which have been combined into a git tree, then branched: https://github.com/joe-lawrence/linux/tree/klp_kselftest_base https://github.com/joe-lawrence/linux/tree/klp_kselftest_v3 so that the kbuild test robot could verify: Subject: [joe-lawrence:klp_kselftest_v3] BUILD SUCCESS 73f12d67f681e3517a8cdc12ceec07b05543d269 From: kbuild test robot To: Joe Lawrence tree/branch: https://github.com/joe-lawrence/linux klp_kselftest_v3 branch HEAD: 73f12d67f681e3517a8cdc12ceec07b05543d269 selftests/livepatch: introduce tests elapsed time: 95m configs tested: 202 [ ... snip ... ] If anyone knows how to indicate an external git tree base to the bot in the commit message or header letter, let me know. Otherwise I'll have to keep pushing up to github and ignoring its misfires as reported to the list :( changes from v2: - fix module_exit(test_klp_shadow_vars_exit) in test_klp_shadow_vars.c - silence kbuild test robot's "XXX can be static" and "Using plain integer as NULL pointer" complaints - re-run tests with CONFIG_LOCKDEP=y and CONFIG_PROVE_LOCKING=y - use GFP_ATOMIC in test_klp_shadow_vars.c constructor code changes from v1: - Only add $(CC_FLAGS_FTRACE) for target modules - Remove between test delay - Reduce RETRY_INTERVAL to .1 sec - Reduce test_callback_mod's busymod_work_func delay from 60 to 10 sec - s/PASS/ok and s/FAIL/not ok for test output - Move test descriptions from Documentation/livepatch/callbacks.txt into tools/testing/selftests/livepatch/test-callbacks.sh - Add a shadow variable test script and module - Add a short tools/testing/selftests/livepatch/README - to += linux-kselftest@vger.kernel.org - cc += Libor, Nicolai, Artem change from rfc: - SPDX-License-Identifiers - Moved livepatch test modules into lib/livepatch - Renamed livepatch.sh (filename suffix) - Reduced between-test delay time - Split off common functions.sh file - Split into separate livepatch, callbacks, and shadow-vars scrips - Gave the tests short descriptions instead of TEST1, TEST2, etc. Joe Lawrence (1): selftests/livepatch: introduce tests Documentation/livepatch/callbacks.txt | 487 ----------------- lib/Kconfig.debug | 12 + lib/Makefile | 2 + lib/livepatch/Makefile | 15 + lib/livepatch/test_klp_atomic_replace.c | 69 +++ lib/livepatch/test_klp_callbacks_busy.c | 43 ++ lib/livepatch/test_klp_callbacks_demo.c | 132 +++++ lib/livepatch/test_klp_callbacks_demo2.c | 104 ++++ lib/livepatch/test_klp_callbacks_mod.c | 24 + lib/livepatch/test_klp_livepatch.c | 62 +++ lib/livepatch/test_klp_shadow_vars.c | 236 ++++++++ tools/testing/selftests/Makefile | 1 + tools/testing/selftests/livepatch/Makefile | 8 + tools/testing/selftests/livepatch/README | 43 ++ tools/testing/selftests/livepatch/config | 1 + tools/testing/selftests/livepatch/functions.sh | 196 +++++++ .../testing/selftests/livepatch/test-callbacks.sh | 607 +++++++++++++++++++++ .../testing/selftests/livepatch/test-livepatch.sh | 173 ++++++ .../selftests/livepatch/test-shadow-vars.sh | 60 ++ 19 files changed, 1788 insertions(+), 487 deletions(-) create mode 100644 lib/livepatch/Makefile create mode 100644 lib/livepatch/test_klp_atomic_replace.c create mode 100644 lib/livepatch/test_klp_callbacks_busy.c create mode 100644 lib/livepatch/test_klp_callbacks_demo.c create mode 100644 lib/livepatch/test_klp_callbacks_demo2.c create mode 100644 lib/livepatch/test_klp_callbacks_mod.c create mode 100644 lib/livepatch/test_klp_livepatch.c create mode 100644 lib/livepatch/test_klp_shadow_vars.c create mode 100644 tools/testing/selftests/livepatch/Makefile create mode 100644 tools/testing/selftests/livepatch/README create mode 100644 tools/testing/selftests/livepatch/config create mode 100644 tools/testing/selftests/livepatch/functions.sh create mode 100755 tools/testing/selftests/livepatch/test-callbacks.sh create mode 100755 tools/testing/selftests/livepatch/test-livepatch.sh create mode 100755 tools/testing/selftests/livepatch/test-shadow-vars.sh -- 1.8.3.1