Received: by 10.192.165.148 with SMTP id m20csp1035769imm; Wed, 25 Apr 2018 11:30:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx49DWqdLqbZpyBvhUOYyg0FRJ3/uFiw9cIg98qM0qbTwe1JDgPWKq9QkQRB1XiN8vSmzEQ6L X-Received: by 2002:a17:902:6709:: with SMTP id f9-v6mr29872969plk.159.1524681035980; Wed, 25 Apr 2018 11:30:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524681035; cv=none; d=google.com; s=arc-20160816; b=xSBM1kmUZ0zXBIYAguR0XSjNvGj+Fm9Ph3rxsommW9MpYkGSHzwcrOpdM/K/z0FRxO eVh47zBhE7yhmD9e0rK87Zx93k4fJKOw+UuUKY2JpYTk5CR/FW76caaMWmL/kCumZCnQ /ZHKInqRjN4uGZtY9aZrRIJhTydTKvrrcPTK64CVAyZjTcLAlkqyj3d7Oy6cRBGniNcp zXW4p1SZ1NTXaPecjmXd/C46PQz+DitzTHCZEkSxMUOfFKfDCWgM2TFclA7T9wHGn6Nv Em49yrrw+f/sQ4RDWjnBxyjVQu3PJOw4YePQUVNeetLacZy+v6AMjYHbr9NWjLYu1LK3 O7lg== 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=z7xNTqlm7oWNjpw3Q3w1YXCNMlF3QWMko9yksny1y1Y=; b=cjvCjI3yFgVBmJUMM7rh2H6vF4aksSg8g5SpRoA2Hzd/VShkJL7kOKNGeoRX/T1rP9 I8urXz0DoVWwPybNY8qXHlzaYafmU44i0gJ5sMafogtLK7euCSDjaRJ8GKlzA7zp8/gp Z0zKkITtIuNuNl95O8hTfbBaemhWKcCGSjYmbzOCHAu3UDD0BKrBh5pMlNZq5oaSz0ba kWCcp0kvMgygNGxX2jRigROPYmHQ+/muZEjTC7SbNsL+kyHGX+AC08M4dfE9KPkoORoW S8xjzAfS+fQVkGF5nywaHNQt27eyDAqascJ2JN9wiz4uY9CaDg/73Ci74nrks/MKHisj yc2w== 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 x25si13356346pfj.347.2018.04.25.11.30.22; Wed, 25 Apr 2018 11:30:35 -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 S1756527AbeDYS26 (ORCPT + 99 others); Wed, 25 Apr 2018 14:28:58 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56716 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756023AbeDYS2y (ORCPT ); Wed, 25 Apr 2018 14:28:54 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7AC1E40711B2; Wed, 25 Apr 2018 18:28:53 +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 20C2963537; Wed, 25 Apr 2018 18:28:53 +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 v4 0/1] Add livepatch kselftests Date: Wed, 25 Apr 2018 14:28:49 -0400 Message-Id: <1524680930-28168-1-git-send-email-joe.lawrence@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 25 Apr 2018 18:28:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 25 Apr 2018 18:28:53 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.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 This round incorporates feedback from SUSE folks, Miroslav, Petr and Libor. Thanks for the reviews and feedback! Like the previous version, this applies on top of Petr's shadow variable changes and the atomic replace patchset. -- Joe changes from v3: - add MAINTAINERS entry for tools/testing/selftests/livepatch/ - make more test_klp_shadow_vars.c functions static (Miroslav) - use git format-patch --base to generate base-commit and prerequisite patch info (kbuild test robot) - tweak TEST_LIVEPATCH help text (Petr) - add note in callbacks.txt pointing to sample/test examples (Petr) - add a kmsg log() function (Libor) - various whitespace and comment cleanups (Libor) - add "$(dirname $0)/" directory prefix to functions.sh sourcing (Libor) - add loop_until() function instead of redundant inline retry/loops (Libor) - wait_for_transition() looks for any transition (Libor) 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 changes 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 | 489 +------------- MAINTAINERS | 1 + lib/Kconfig.debug | 21 + 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 + .../testing/selftests/livepatch/functions.sh | 164 +++++ .../selftests/livepatch/test-callbacks.sh | 607 ++++++++++++++++++ .../selftests/livepatch/test-livepatch.sh | 173 +++++ .../selftests/livepatch/test-shadow-vars.sh | 60 ++ 20 files changed, 1771 insertions(+), 484 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 base-commit: 0adb32858b0bddf4ada5f364a84ed60b196dbcda prerequisite-patch-id: 5ed747c1a89a5dc4bba08186e21f927d7f3bf049 prerequisite-patch-id: e9800288b71a9f339ea066e58d9ef70dece67083 prerequisite-patch-id: 415f2e190b1b50142c78f2940c7b8dd39b5321a0 prerequisite-patch-id: d229d9cf08af087e0a758d9df1da467103c2c200 prerequisite-patch-id: b8c7ef99b13c6b321cba5e8919ed0b3e29f213e9 prerequisite-patch-id: 4e10c0d08f151b18310fe0b1e5013d62db94cfeb prerequisite-patch-id: 33046b190c114d202f3a52e0e274dbb2b1907a4c prerequisite-patch-id: 6978944a725756317dd4e005d479b6101784aaf0 prerequisite-patch-id: cce9d3c7e1ae8887f387ca9e072552dc63479749 prerequisite-patch-id: c44ccc5dd7b1be6fe2b1f32ca6abde1da73fae79 -- 2.17.0.252.gfe0a9eaf31dd