From patchwork Fri Mar 3 23:06:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cabaj X-Patchwork-Id: 1751676 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=Bnx78D3v; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PT3Vv47t4z23j7 for ; Sat, 4 Mar 2023 10:06:15 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pYETZ-00073B-Cv; Fri, 03 Mar 2023 23:06:09 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pYETX-00071J-HF for kernel-team@lists.ubuntu.com; Fri, 03 Mar 2023 23:06:07 +0000 Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 0BB0D41301 for ; Fri, 3 Mar 2023 23:06:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1677884766; bh=3EPLIAGgj1EZFVVEKP+OqcU8mLPLGBX1btnQYOHLnfM=; h=Message-ID:Date:MIME-Version:To:From:Subject:Content-Type; b=Bnx78D3vapU0+xWa4MCZ6ZASsXDseSz/eKvu5nVvMTVgqX1RK86GtMNWmRr4BSHib lRnDrQh/q6EPfSTH8TTbdFvF7BKECcl4SjZw1BcUjQSTtS0M63xqgupGIsEPeQ42ya l+2VjwyoH5ZujWcuEHQ8G9qe8Nql6LHsxgWw2mhj5RuifTdF7F99xG7om0pIuYqXud cRS/F4AAoBlkaks25+moMQ5ZTtemqnBQ1TDZ/zWOYzxXCkioCFY7L4KTNm3UpfAB0k 2SmB+J6tqakwCc7vngsVBIEmpbV9sq6fdxOiS1Ue1brCkS2oD52SZWFxLdX/3EG1oN ++UCopwVHs1rg== Received: by mail-il1-f198.google.com with SMTP id a5-20020a92ce45000000b00318aa18d2fbso2169678ilr.23 for ; Fri, 03 Mar 2023 15:06:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:subject:from:content-language:to :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=3EPLIAGgj1EZFVVEKP+OqcU8mLPLGBX1btnQYOHLnfM=; b=PL6rh+r8CelBHSo0dqFAZ25+RIzDS6r02r8iN042981Ak9y31i2D14NqnwzynBaTqe bjEe4jnbjjpL8CAOcKxy6+e/Y7p9S7bM2/KZ6eIGp44rN8t2RJKQDIHrF5YtWp4adHyP GHt6iXkawrEpjqvfu7dWOhE0oabyLo/hwFNUZIu1VZfqPXt+/5j7nhDtpYfmtp57WCQb rVoA0o1LFMMlQ6YHwWuAT/b1+AZqjc1fbB9q39bXr6DkegxRGDHBPxwjYjyi+t5OzLW5 j93Ui1BOwE9rkvK7RpiY58fdWG7uyb86z/VxYMQMmSKyQNT1vOyrHrFEmlocfgnvGlH2 MsIg== X-Gm-Message-State: AO0yUKVk1E9nR5c/Srrkt5BnnqrIBWiccXCbHS5pwRkW0kYuAvgWwtVQ E+a8HAQtohXOgzYz3tGpJID2ygTOez1wXdpkIz2tvnduFJ3Z876pj+f3oQvM5nn3dwybhyOj6n8 0f3PCVfzNdBHIgr8CXSz7+jWwhqCYfnZS1NHLoXa/9mBzqGWPeA== X-Received: by 2002:a92:c546:0:b0:30f:3d9e:f80 with SMTP id a6-20020a92c546000000b0030f3d9e0f80mr3144558ilj.25.1677884764700; Fri, 03 Mar 2023 15:06:04 -0800 (PST) X-Google-Smtp-Source: AK7set/fd/wl83nTBj4LVUHeXCZTSNuihBVjpvrEKmkhfFNBAd6hR+TTMQeL51vZPZ5yt5GlIzW/1A== X-Received: by 2002:a92:c546:0:b0:30f:3d9e:f80 with SMTP id a6-20020a92c546000000b0030f3d9e0f80mr3144533ilj.25.1677884764299; Fri, 03 Mar 2023 15:06:04 -0800 (PST) Received: from [192.168.159.111] (h69-130-246-116.mdtnwi.broadband.dynamic.tds.net. [69.130.246.116]) by smtp.gmail.com with ESMTPSA id w2-20020a02cf82000000b003ec3b5225c3sm1031034jar.156.2023.03.03.15.06.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Mar 2023 15:06:04 -0800 (PST) Message-ID: Date: Fri, 3 Mar 2023 17:06:03 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.7.1 To: kernel-team@lists.ubuntu.com Content-Language: en-US From: John Cabaj Subject: [SRU][jammy][PULL] Kernel livepatch support for s390x X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1639924 (Kernel livepatch support for s390x) [Impact] * Enables Livepatch support for Jammy s390x generic kernel [Fix] b56340e565fd ("UBUNTU: [Config] s390x: Removing UBSAN from configuration") f0bd174678a9 ("UBUNTU: [Config] Enable EXPOLINE_EXTERN on s390x") 145dd7c7bfc6 ("s390/nospec: build expoline.o for modules_prepare target") ad24b243a0be ("bug: Use normal relative pointers in 'struct bug_entry'") 9c018ab00f18 ("s390/nospec: align and size extern thunks") 110252959a61 ("s390/nospec: add an option to use thunk-extern") 9183918aabab ("s390/nospec: generate single register thunks if possible") f08372d421dd ("s390: remove unused expoline to BC instructions") d1de041f86ad ("s390/entry: remove unused expoline thunk") 376e067eb888 ("sched: Improve wake_up_all_idle_cpus() take #2") 16fa7242e5b9 ("sched,livepatch: Use wake_up_if_idle()") 3a133e568eea ("sched: Simplify wake_up_*idle*()") 360b90e726cd ("sched,livepatch: Use task_call_func()") 3c01d492a326 ("sched,rcu: Rework try_invoke_on_locked_down_task()") 2a989b8ace35 ("sched: Improve try_invoke_on_locked_down_task()") [Test Case] * Boot test * Tested a Livepatch (patch to /proc/meminfo module) [Other Info] * Requires patch to GCC-11.3, removing gcc-ibmz-plt-revert.diff from debian/patches and debian/rules.patch (LP#2002429) * UBSAN (Undefined Behavior Santizer) configuration was removed from s390x as kpatch-build could not find symbols * kpatch update being considered for UBSAN issue (https://github.com/dynup/kpatch/issues/1328) [Where things could go wrong] * Functionality already exists upstream, kernel was boot and Livepatch tested - should have no regressions * s390x UBSAN functionality no longer included, may not catch previously caught undefined behavior ----- The following changes since commit ed81d4519af756cfde8c3c02b495c6006b6ee0e9: UBUNTU: Start new release (2023-03-02 21:29:10 -0600) are available in the git repository at: git+ssh://user@kathleen/home/john-cabaj/for-review/jammy-s390x-livepatch s390x-livepatch for you to fetch changes up to b56340e565fdae9b6fc53b573e01194435a65e3e: UBUNTU: [Config] s390x: Removing UBSAN from configuration (2023-03-02 21:36:26 -0600) ---------------------------------------------------------------- Dimitri John Ledkov (1): UBUNTU: [Config] Enable EXPOLINE_EXTERN on s390x John Cabaj (1): UBUNTU: [Config] s390x: Removing UBSAN from configuration Josh Poimboeuf (1): bug: Use normal relative pointers in 'struct bug_entry' Peter Zijlstra (6): sched: Improve try_invoke_on_locked_down_task() sched,rcu: Rework try_invoke_on_locked_down_task() sched,livepatch: Use task_call_func() sched: Simplify wake_up_*idle*() sched,livepatch: Use wake_up_if_idle() sched: Improve wake_up_all_idle_cpus() take #2 Vasily Gorbik (6): s390/entry: remove unused expoline thunk s390: remove unused expoline to BC instructions s390/nospec: generate single register thunks if possible s390/nospec: add an option to use thunk-extern s390/nospec: align and size extern thunks s390/nospec: build expoline.o for modules_prepare target arch/arm64/include/asm/asm-bug.h | 4 ++-- arch/powerpc/include/asm/bug.h | 14 ++++++++------ arch/riscv/include/asm/bug.h | 4 ++-- arch/s390/Kconfig | 15 +++++++++++++++ arch/s390/Makefile | 20 +++++++++++++++----- arch/s390/include/asm/bug.h | 5 +++-- arch/s390/include/asm/nospec-insn.h | 91 +++++++++++++++++++++++++++++++++++-------------------------------------------------------- arch/s390/kernel/entry.S | 1 - arch/s390/kernel/nospec-branch.c | 25 +++++-------------------- arch/s390/lib/Makefile | 2 ++ arch/s390/lib/expoline/Makefile | 3 +++ arch/s390/lib/expoline/expoline.S | 12 ++++++++++++ arch/s390/tools/gcc-thunk-extern.sh | 24 ++++++++++++++++++++++++ arch/x86/include/asm/bug.h | 2 +- debian.master/config/annotations | 5 +++-- debian.master/config/config.common.ubuntu | 2 +- debian/rules.d/2-binary-arch.mk | 4 ++++ include/linux/sched/idle.h | 4 ++++ include/linux/wait.h | 3 ++- kernel/livepatch/transition.c | 95 ++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------- kernel/rcu/tasks.h | 12 ++++++------ kernel/rcu/tree_stall.h | 8 ++++---- kernel/sched/core.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++------------------------------------ kernel/smp.c | 12 +++++------- lib/bug.c | 15 +++++++-------- scripts/mod/modpost.c | 5 +++++ 26 files changed, 263 insertions(+), 207 deletions(-) create mode 100644 arch/s390/lib/expoline/Makefile create mode 100644 arch/s390/lib/expoline/expoline.S create mode 100755 arch/s390/tools/gcc-thunk-extern.sh Acked-by: Stefan Bader Acked-by: Luke Nowakowski-Krijger