From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09F00C432BE for ; Thu, 26 Aug 2021 22:34:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C866260FF2 for ; Thu, 26 Aug 2021 22:34:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233866AbhHZWfW convert rfc822-to-8bit (ORCPT ); Thu, 26 Aug 2021 18:35:22 -0400 Received: from mail-yb1-f173.google.com ([209.85.219.173]:36851 "EHLO mail-yb1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231159AbhHZWfW (ORCPT ); Thu, 26 Aug 2021 18:35:22 -0400 Received: by mail-yb1-f173.google.com with SMTP id f15so8878145ybg.3 for ; Thu, 26 Aug 2021 15:34:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=X/STzz3xbXrNWtIX6dH3xgqdevdigA3hDWCRpqHOAxc=; b=mtzOg9A1SXSb/8lNeplWcQPQsJehmCJsPGp92SPoFrVj7QzyGvc9S/+jqh8ECCOuqW yWmLX961kiwj8wAamtAFlX7HuYgraqdIAajIhvIQrogsM0XY+jMObH/Ayww5/XRTJlEz TPVfu3H9fjuBMVqruLLjbe5i5ozTjmhBpKYwmVoLNazHTE3u/BZBT+sZYFQmpzZwSu9Z tzJxbMwFY+pnUNucO8RmM3sbplk7gCCOe4kfl5KzUxqo7izb46kpMSWNoCCCx2dgTGyQ Y2/5JKrApDpPrb/iWoY6QkFbQWuG9SXzcccNkdcAoiwd5ivVxicODbgotl8dZC3IFmDZ 6EgA== X-Gm-Message-State: AOAM530swVpvqi4OJN8SEMtjBjDg+ExKrZ+Ne8iXHk1o8XXHZ6EIKioX UP8auASixOAfm9AK2ga48rvnuzQmsoYI+48SWrjuE0Hj+Qg= X-Google-Smtp-Source: ABdhPJzSudQWUnA367Hvs5oSVHSU+mozx0we2Ietm7jpfsz7ySaOpbhrIvJABtYRdmVJ/TUI+dVpMmUXdBh3M4CSIFs= X-Received: by 2002:a25:1244:: with SMTP id 65mr1413110ybs.46.1630017273945; Thu, 26 Aug 2021 15:34:33 -0700 (PDT) MIME-Version: 1.0 From: Peter Swain Date: Thu, 26 Aug 2021 15:34:23 -0700 Message-ID: Subject: announcing LLpatch: arch-independent live-patch creation To: live-patching@vger.kernel.org, madvenka@linux.microsoft.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: live-patching@vger.kernel.org We have a new userspace live-patch creation tool, LLpatch, paralleling kpatch-build, but without requiring its arch-specific code for ELF analysis and manipulation. We considered extending kpatch-build to a new target architecture (arm64), cluttering its code with details of another architecture’s quirky instruction sequences & relocation modes, and suspected there might be a better way. The LLVM suite already knows these details, and offers llvm-diff, for comparing generated code at the LLVM-IR (internal representation) level, which has access to much more of the code’s _intent_ than kpatch’s create-diff-object is able to infer from ELF-level differences. Building on this, LLpatch adds namespace analysis, further dead/duplicate code elimination, and creation of patch modules compatible with kernel’s livepatch API. Arm64 is supported - testing against a livepatch-capable v5.12 arm64 kernel, using the preliminary reliable-stacktrace work from madvenka@linux.microsoft.com, LLpatch modules for x86 and arm64 behave identically to the x86 kpatch-build modules, without requiring any additional arch-specific code. On x86, where both tools are available, LLpatch produces smaller patch modules than kpatch, and already correctly handles most of the kpatch test cases, without any arch-specific code. This suggests it can work with any clang-supported kernel architecture. Work is ongoing, collaboration is welcome. See https://github.com/google/LLpatch for further details on the technology and its benefits. Yonghyun Hwang (yonghyun@google.com freeaion@gmail.com) Bill Wendling (morbo@google.com isanbard@gmail.com) Pete Swain (swine@google.com swine@pobox.com)