From patchwork Fri May 20 09:58:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Po-Hsu Lin X-Patchwork-Id: 1633827 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=Q2r9Taov; dkim-atps=neutral Authentication-Results: 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=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4L4MdR1HJGz9sG3 for ; Fri, 20 May 2022 19:59:23 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nrzPh-0008IH-9b; Fri, 20 May 2022 09:59:17 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nrzPe-0008HT-Q1 for kernel-team@lists.ubuntu.com; Fri, 20 May 2022 09:59:14 +0000 Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) (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-1.canonical.com (Postfix) with ESMTPS id 8643B3F338 for ; Fri, 20 May 2022 09:59:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1653040754; bh=aaYRlDx0a3NDl4zdXrdecGIQRdt9vjLgw/e9G8QJ/+s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Q2r9TaovLxUD4NQvICXB8PrNAWCpw5FJUW0Cuj7uCzP47fBaLECTIDZLc+t9tnevB rSoI/xkgUUgBtrt2MtvFnAGtzP5PRTdijhwYSZWJfUtQlBB4j2BrBQcw0uHtKmgAri oXl2/g8jr9Pr8mj8G36YfYjOe5iXGj1NR1NBzkCu7UIMTliAGbmuFidNPZTmWxUzAt ZkhIvmxOdiDf0PK37PtcbSXo9TdR8smcK2XiU/SPAysC9KPyG9UrZIcABUNrsUBYuw 1CTtOWcitAdAkqSDP7THUpW6X76x2l4NbzVAr38Tr1BnoqOUJTOQeLZo5MxUFKvco0 rfsCXaRq1GgJw== Received: by mail-pg1-f197.google.com with SMTP id f15-20020a63380f000000b003c6c6e053beso3938087pga.18 for ; Fri, 20 May 2022 02:59:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aaYRlDx0a3NDl4zdXrdecGIQRdt9vjLgw/e9G8QJ/+s=; b=1GvQW+hgnsImB13RQqsEXDxoE/m0++yYP/IzLygUtt0NUsmxn54aoIih4bgrlQtVle OqSea4lLNMCWTKzwrmyIKwRyZd+gfOO+EwKOjLIs9ySB4L4HcPNO5pzPIFz32raqLaL9 NtvsIKApXfK0tNOOxwPvHkEfrx+qakk4NTdYrYLg+pnET68TsOi8Pczax29YTH5YUVOV mLq1jKF3mgM7Br8fFESggDcUThlJZu/1qQw1vH7Acf1wkvZed1DunQd+N2CEyPreOLhu o4IZtw6255MIoEV4Gd4mPOWwDyRBoSjWh4GRF3dJbuCsJ0PmoHuZf5JVeX7KmG1QmyEj 27mA== X-Gm-Message-State: AOAM531EX1TXOCxOx0RnH79ZooZ6fiTGYNok5SiYdD2TFtOsZz1IVylX a0pN1gh6ZcZfFtGjqzVTUldj64ya32taRbWbbXYRjKoE07O3iiWDCKInGtLIaT7cNFhY5W8VJyf q1piYfLl4bXvlV+ET2lnhcCo843yeWw2jbEH8CbML X-Received: by 2002:a17:90a:990c:b0:1df:fb1:bc2f with SMTP id b12-20020a17090a990c00b001df0fb1bc2fmr10247592pjp.79.1653040753262; Fri, 20 May 2022 02:59:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7gAolaICe9OWWJvo3oPvrW/Im1J1JzSNgWlgU0arFYak6k4rFMZXcW6rUP1bgePcSlgnEhA== X-Received: by 2002:a17:90a:990c:b0:1df:fb1:bc2f with SMTP id b12-20020a17090a990c00b001df0fb1bc2fmr10247569pjp.79.1653040752945; Fri, 20 May 2022 02:59:12 -0700 (PDT) Received: from localhost.localdomain (223-137-109-69.emome-ip.hinet.net. [223.137.109.69]) by smtp.gmail.com with ESMTPSA id bm18-20020a656e92000000b003db072fd9adsm5221123pgb.74.2022.05.20.02.59.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 02:59:12 -0700 (PDT) From: Po-Hsu Lin To: kernel-team@lists.ubuntu.com Subject: [autotest-client-tests][PATCH 1/2] UBUNTU: SAUCE: ubuntu_boot: use module taint flag to simplify code Date: Fri, 20 May 2022 17:58:14 +0800 Message-Id: <20220520095815.901356-2-po-hsu.lin@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220520095815.901356-1-po-hsu.lin@canonical.com> References: <20220520095815.901356-1-po-hsu.lin@canonical.com> MIME-Version: 1.0 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" Instead of having different functions to check for out-of-tree modules and unsigned modules, let's unify them by checking the taint flag file of a certain module directly in /sys/module/$MODULE_NAME/taint So that we can reuse this process_known_issues() for other issues. Signed-off-by: Po-Hsu Lin --- ubuntu_boot/kernel_taint_test.py | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/ubuntu_boot/kernel_taint_test.py b/ubuntu_boot/kernel_taint_test.py index ff938f25..fffb5aff 100755 --- a/ubuntu_boot/kernel_taint_test.py +++ b/ubuntu_boot/kernel_taint_test.py @@ -61,17 +61,6 @@ def get_modules(): return modules -def process_out_of_tree_modules(modules): - mod_list = [] - modules = remove_ignored_modules(modules) - for mod in modules: - cmd = 'modinfo -F intree %s' % mod - if not check_output(shlex.split(cmd), - universal_newlines=True): - mod_list.append(mod) - return(mod_list) - - def process_GPL_incompatible_modules(modules): mod_list = [] modules = remove_ignored_modules(modules) @@ -84,14 +73,16 @@ def process_GPL_incompatible_modules(modules): return(mod_list) -def process_unsigned_modules(modules): +def process_known_issues(issue, modules): mod_list = [] + issue_flags = {"externally-built ('out-of-tree') module was loaded": "O", + "unsigned module was loaded": "E"} modules = remove_ignored_modules(modules) for mod in modules: fn = '/sys/module/{}/taint'.format(mod) with open(fn, 'r') as f: status = f.read() - if 'E' in status: + if issue_flags[issue] in status: mod_list.append(mod) return(mod_list) @@ -185,7 +176,7 @@ def main(): elif i == 11: print("* Firmware workarounds are expected and OK") elif i == 12: # List out-of-tree modules - out_of_tree_modules = process_out_of_tree_modules(modules) + out_of_tree_modules = process_known_issues(taint_meanings[i], modules) if len(out_of_tree_modules) > 0: print("* Modules not in-tree:") for mod in out_of_tree_modules: @@ -195,7 +186,7 @@ def main(): print("* Out of Tree modules found, " "but they are expected and OK") elif i == 13: - unsigned_modules = process_unsigned_modules(modules) + unsigned_modules = process_known_issues(taint_meanings[i], modules) if len(unsigned_modules) > 0: print("* Module not signed / failed with verification") for mod in unsigned_modules: From patchwork Fri May 20 09:58:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Po-Hsu Lin X-Patchwork-Id: 1633828 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=rG9TX5aA; dkim-atps=neutral Authentication-Results: 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=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4L4MdT0W3Nz9sG2 for ; Fri, 20 May 2022 19:59:25 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nrzPj-0008ML-GZ; Fri, 20 May 2022 09:59:19 +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 1nrzPh-0008Iu-VX for kernel-team@lists.ubuntu.com; Fri, 20 May 2022 09:59:17 +0000 Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) (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 27DAB3F1B6 for ; Fri, 20 May 2022 09:59:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1653040757; bh=sIyHTizNhGE4rEubeUvvHScu8fJpV4bHtHTObQa7un4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rG9TX5aAKx40N6pju7TLKM9oIC9pBxkM7pFSxWcpJQofW5u/AzYndSR8Xa9B/QdhZ qe5kLKj6+I41bfBegPdZrV29bvqCr9BXvmILcAceUhvnHEkoxi07A4Ju86Xk5mKLGi nbjMcbGpWoJFYVN3tE2AGHZpW2/1TzsKXUpNnH/9kFsHMKyu8cwHRj1cFP+Kg3gvd+ OZA/5Bis6uKrAutCBjS7UHI6z339a7DekUmwlpbahaKDyRoWwVHiQKUhnxa7qUY+Zx 1/h0pQynk0jOzP7mao78ok85Zwewavf9WNTBBomgmcDvRXTrvccKsvve5JFCgwW3z5 7oMt6as3qPXUA== Received: by mail-pj1-f71.google.com with SMTP id me18-20020a17090b17d200b001dfa3d25c37so5322972pjb.8 for ; Fri, 20 May 2022 02:59:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sIyHTizNhGE4rEubeUvvHScu8fJpV4bHtHTObQa7un4=; b=pJEyx6hIyabxoxMbBN4EIDIlPo9lA5R47iq3ywrW/5JfRDVvDRs5xfYHFaeclogLMq cg6t3/iY8Mlqe7CdfWMBbdro6LA3tYpxvScGVekem2PRcx8GUFWiRFeRA2v/m/lozIaO lyMHv8ewgX9SPsCjJZoyCNmwRT0wuiHB5saCRZVTWC7V/UyK/+ndKMx+66xX8tuAuuK/ 32jIWdnKAIMagLoPwVSISTINoydvJr/4SRrsW7ycPRzlv47GJz/mrLtLx6CStOfQcN0f P9c0qFZq2dh5Oh5Z1xOkBD+oVw7bdgPpWvvE1QS4RL6isLH7sXtG1Sau3qZ/isisPwit myrg== X-Gm-Message-State: AOAM532EXvGyzQkgf/zRdy/ou7ug09Um99utAODJHhLMP08OWuRmvrRD vLqkNkL6UdqQxnpglZJNRPz32F2A5vx4AGkZZikEDWtt6dIFGVlWAon7i5jMB8EyG7ZS0dLA1Pn xRgTTMOwjg3FNIo4QoudQC7sk9+GuLSOl1aI9kaF+ X-Received: by 2002:a17:90b:4a4a:b0:1df:a250:e583 with SMTP id lb10-20020a17090b4a4a00b001dfa250e583mr9935535pjb.172.1653040755244; Fri, 20 May 2022 02:59:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgUXZX1zrjWZuC9wSnumKgdOJN/pVVlJL/PeaihYFfs0Rf/7s2q2L40DQJNbpiburweejSsQ== X-Received: by 2002:a17:90b:4a4a:b0:1df:a250:e583 with SMTP id lb10-20020a17090b4a4a00b001dfa250e583mr9935516pjb.172.1653040754982; Fri, 20 May 2022 02:59:14 -0700 (PDT) Received: from localhost.localdomain (223-137-109-69.emome-ip.hinet.net. [223.137.109.69]) by smtp.gmail.com with ESMTPSA id bm18-20020a656e92000000b003db072fd9adsm5221123pgb.74.2022.05.20.02.59.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 02:59:14 -0700 (PDT) From: Po-Hsu Lin To: kernel-team@lists.ubuntu.com Subject: [autotest-client-tests][PATCH 2/2] UBUNTU: SAUCE: ubuntu_boot: add exception for staging modules on RPI Date: Fri, 20 May 2022 17:58:15 +0800 Message-Id: <20220520095815.901356-3-po-hsu.lin@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220520095815.901356-1-po-hsu.lin@canonical.com> References: <20220520095815.901356-1-po-hsu.lin@canonical.com> MIME-Version: 1.0 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/1973579 Add exceptions to ignore known staging module we use on RPI kernel. This can speed up the boot testing process and make it more robust. Signed-off-by: Po-Hsu Lin --- ubuntu_boot/kernel_taint_test.py | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/ubuntu_boot/kernel_taint_test.py b/ubuntu_boot/kernel_taint_test.py index fffb5aff..93cccdd9 100755 --- a/ubuntu_boot/kernel_taint_test.py +++ b/ubuntu_boot/kernel_taint_test.py @@ -75,7 +75,8 @@ def process_GPL_incompatible_modules(modules): def process_known_issues(issue, modules): mod_list = [] - issue_flags = {"externally-built ('out-of-tree') module was loaded": "O", + issue_flags = {"staging driver was loaded": "C", + "externally-built ('out-of-tree') module was loaded": "O", "unsigned module was loaded": "E"} modules = remove_ignored_modules(modules) for mod in modules: @@ -108,6 +109,18 @@ def remove_ignored_modules(modules): 'mlxfw', 'mdev', 'mlx_compat']} + rpi_modules = {'jammy': ['bcm2835_codec', + 'bcm2835_isp', + 'bcm2835_v4l2', + 'bcm2835_mmal_vchiq', + 'snd_bcm2835', + 'vc_sm_cma'], + 'focal': ['bcm2835_codec', + 'bcm2835_isp', + 'bcm2835_v4l2', + 'bcm2835_mmal_vchiq', + 'snd_bcm2835', + 'vc_sm_cma']} try: series = platform.dist()[2] except AttributeError: @@ -126,6 +139,13 @@ def remove_ignored_modules(modules): modules.remove(ignore_mod) except ValueError: pass + elif series in ['focal', 'jammy'] and 'raspi' in platform.release(): + for ignore_mod in rpi_modules[series]: + try: + print('Exception made in test script: {}'.format(ignore_mod)) + modules.remove(ignore_mod) + except ValueError: + pass return(modules) @@ -173,6 +193,16 @@ def main(): else: print("* Proprietary modules found, " "but they are expected and OK") + elif i == 10: # List staging modules + staging_modules = process_known_issues(taint_meanings[i], modules) + if len(staging_modules) > 0: + print("* Staging driver in use:") + for mod in staging_modules: + print(" %s" % mod) + count += 1 + else: + print("* Staging modules found, " + "but they are expected and OK") elif i == 11: print("* Firmware workarounds are expected and OK") elif i == 12: # List out-of-tree modules