Skip to content
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

KMSAN doesn't support paravirtualization #90

Open
ramosian-glider opened this issue Nov 14, 2022 · 0 comments
Open

KMSAN doesn't support paravirtualization #90

ramosian-glider opened this issue Nov 14, 2022 · 0 comments
Labels
bug linux-6.1 Issue present in the Linux 6.1 release

Comments

@ramosian-glider
Copy link
Member

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.

@ramosian-glider ramosian-glider added linux-6.1 Issue present in the Linux 6.1 release bug labels Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug linux-6.1 Issue present in the Linux 6.1 release
Projects
None yet
Development

No branches or pull requests

1 participant