Skip to content
This repository was archived by the owner on Mar 5, 2026. It is now read-only.
This repository was archived by the owner on Mar 5, 2026. It is now read-only.

KMSAN doesn't support paravirtualization #90

Description

@ramosian-glider

Right now KMSAN does not play well with CONFIG_XEN_PV=y

In particular, the kernel crashes at boot-time on the following code:

void load_percpu_segment(int cpu)
{
#ifdef CONFIG_X86_32
	loadsegment(fs, __KERNEL_PERCPU);
#else
	__loadsegment_simple(gs, 0);
	wrmsrl(MSR_GS_BASE, cpu_kernelmode_gs_base(cpu));
#endif
}

Here __loadsegment_simple() sets %gs=0, invalidating the following accesses to percpu data, including those happening inside __msan_get_context_state(), which KMSAN adds to every function call.

The behavior of load_percpu_segment() is being fixed upstream: https://lore.kernel.org/lkml/166601847113.401.13616810593513367893.tip-bot2@tip-bot2/, but CONFIG_XEN_PV still generates a bunch of KMSAN reports, so we'd better keep it disabled for now.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buglinux-6.1Issue present in the Linux 6.1 release

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions