Skip to content

General project updates; rebase onto upstream v6.11; add notes about CONFIG_WERROR #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: llvm-trunk-next
Choose a base branch
from
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/xlab-uiuc/linux-mcdc/llvm-trunk-linux-v5.15.153.yml?label=LLVM%20trunk%2BLinux%20v5.15.153)](https://github.com/xlab-uiuc/linux-mcdc/actions/workflows/llvm-trunk-linux-v5.15.153.yml)

This repository demonstrates [KUnit](https://docs.kernel.org/dev-tools/kunit/index.html)'s
modified condition/decision coverage (MC/DC) of 5.15.y Linux kernel using
[Clang source-based code coverage](https://clang.llvm.org/docs/SourceBasedCodeCoverage.html)
and [`llvm-cov`](https://llvm.org/docs/CommandGuide/llvm-cov.html). A patch set
for mainline kernel is also being prepared.
modified condition/decision coverage (MC/DC) of 5.15.y and mainline Linux kernel
using [Clang source-based code coverage](https://clang.llvm.org/docs/SourceBasedCodeCoverage.html)
and [`llvm-cov`](https://llvm.org/docs/CommandGuide/llvm-cov.html).

<!--
Primary
development of the kernel patch set is being performed in the [xlab-uiuc/llvm-cov](https://github.com/xlab-uiuc/linux-cov)
project.
-->

**LKML discussions: [link](https://lore.kernel.org/lkml/[email protected]/)**

Follow the instructions [here](docs/measure-kernel-mcdc.md) to get started.

Example text coverage report: [link](https://github.com/xlab-uiuc/linux-mcdc/actions/runs/10013137034/job/27681036852#step:8:7) (login with any GitHub account required)
Expand All @@ -29,7 +30,7 @@ Tentative repository structure:
```text
linux-mcdc
|
├── ci/{linux-v5.15.153}
├── ci/linux-{v5.15.153,mainline}
│   ├── 1_install_deps.sh
│   ├── 2_pull_source.sh
│   ├── 3_get_llvm.sh
Expand All @@ -42,7 +43,7 @@ linux-mcdc
|
├── patches
│   ├── README.md
│   └── {v0.4,v0.5,v0.6}
│   └── {v0.4,v0.5,v0.6,v1.0,v2.0,latest}
|
├── README.md
|
Expand All @@ -53,6 +54,12 @@ linux-mcdc
└── q
```

We are going to give three talks in [LPC 2024](https://lpc.events/event/18/page/224-lpc-2024-overview):

- [Making Linux Fly: Towards a Certified Linux Kernel](https://lpc.events/event/18/contributions/1718/) (Refereed Track)
- [Measuring and Understanding Linux Kernel Tests](https://lpc.events/event/18/contributions/1793/) (Kernel Testing & Dependability MC)
- [Source-based code coverage of Linux kernel](https://lpc.events/event/18/contributions/1895/) (Safe Systems with Linux MC)

We gave an [ELISA](https://elisa.tech/) seminar titled "Making Linux Fly: Towards Certified Linux
Kernel".
[[recording](https://elisa.tech/blog/2024/05/28/making-linux-fly-towards-certified-linux-kernel/)]
Expand Down
2 changes: 1 addition & 1 deletion patches/v2.0/0000-cover-letter.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 7c60851daae39815fa696fc2265e838b1913f7ac Mon Sep 17 00:00:00 2001
From: Wentao Zhang <[email protected]>
Copy link
Member Author

@whentojump whentojump Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the sent version 2 I accidentally included my personal email here in the cover letter. I dry-run with myself a few times, checked a few places but somehow ignored this one..

I suppose it should not create a "Signed-off-by chain" issue as it's not a patch? I will pay attention in future updates.

Date: Wed, 4 Sep 2024 18:13:07 -0500
Subject: [RFC PATCH 0/4] Enable measuring the kernel's Source-based Code Coverage and MC/DC with Clang
Subject: [PATCH v2 0/4] Enable measuring the kernel's Source-based Code Coverage and MC/DC with Clang

This series adds support for building x86-64 kernels with Clang's Source-
based Code Coverage[1] in order to facilitate Modified Condition/Decision
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 13c86fc7877aec4892832554845968d7415f2960 Mon Sep 17 00:00:00 2001
From: Wentao Zhang <[email protected]>
Date: Fri, 30 Aug 2024 14:48:03 -0500
Subject: [RFC PATCH 1/4] llvm-cov: add Clang's Source-based Code Coverage
Subject: [PATCH v2 1/4] llvm-cov: add Clang's Source-based Code Coverage
support

Add infrastructure to support Clang's source-based code coverage [1]. This
Expand Down
2 changes: 1 addition & 1 deletion patches/v2.0/0002-llvm-cov-add-Clang-s-MC-DC-support.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From e7d38a2115b9c1041dcda404f102888c9894da10 Mon Sep 17 00:00:00 2001
From: Wentao Zhang <[email protected]>
Date: Fri, 30 Aug 2024 14:49:24 -0500
Subject: [RFC PATCH 2/4] llvm-cov: add Clang's MC/DC support
Subject: [PATCH v2 2/4] llvm-cov: add Clang's MC/DC support

Add infrastructure to enable Clang's Modified Condition/Decision Coverage
(MC/DC) [1].
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From f4cc26b9d49b7c34671c04a8b62485a311530298 Mon Sep 17 00:00:00 2001
From: Wentao Zhang <[email protected]>
Date: Fri, 30 Aug 2024 14:48:53 -0500
Subject: [RFC PATCH 3/4] x86: disable llvm-cov instrumentation
Subject: [PATCH v2 3/4] x86: disable llvm-cov instrumentation

Disable instrumentation for arch/x86/crypto/curve25519-x86_64.c. Otherwise
compilation would fail with "error: inline assembly requires more registers
Expand Down
2 changes: 1 addition & 1 deletion patches/v2.0/0004-x86-enable-llvm-cov-support.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 7c60851daae39815fa696fc2265e838b1913f7ac Mon Sep 17 00:00:00 2001
From: Wentao Zhang <[email protected]>
Date: Fri, 30 Aug 2024 14:49:06 -0500
Subject: [RFC PATCH 4/4] x86: enable llvm-cov support
Subject: [PATCH v2 4/4] x86: enable llvm-cov support

Set ARCH_HAS_* options to "y" in kconfig and include section description in
linker script.
Expand Down