From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E4142D7DEA for ; Mon, 17 Nov 2025 15:06:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763392020; cv=none; b=aCDc87opBr3yG8qJFpEuiXpKIwGK0rtMvFDMS8+sXK0F7CzvBWkjNVRli96Eaqh8/c2CCrYUJh+yI+60CKzECrmrb8vDBh+pf2ngbmol19fxR74TQQ26KlG16k4h6dR1HNcyd1PNvOl69q+676o0prYDHbIgtoOcHgRvLvWtMlk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763392020; c=relaxed/simple; bh=ZVCe+1ZisPI9dqGUCn3xqHobEuFAysrEV1InQvFbmIs=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=WXD7qtzun2jVFbDmsnd4492er/NaXd0uXNGlZOk/FiiTORIjBPOOfTUAYy16lj7iznjG6GNf8B0i9s0oBn0zwnVYxdp+UdwCZpxGlrvKpt/iw9OTTdOUAlrib/XAikvanlr8tESWebikuqpZM8+vcrYpnkdr/WNuImq6RP4pZH4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=wq0D2B6f; arc=none smtp.client-ip=209.85.216.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="wq0D2B6f" Received: by mail-pj1-f73.google.com with SMTP id 98e67ed59e1d1-340c0604e3dso5389544a91.2 for ; Mon, 17 Nov 2025 07:06:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1763392018; x=1763996818; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=aKWMjY1G5dJf/3LgpKl/NETW+FjIuUMvWMw9eVSgzUo=; b=wq0D2B6f1V51nU4oHfitWHu7jnwBFngossWWGk4P5zhV4Islx91MODW4B3oC04qsKm RT+Ec800shpB/jh1FGa2c/agkG9+aRuBMnCQ4UscOMmZm132/Ih5bx5UyHo5HMoA/Qoz KpG/ROZe5sgubBF/smsw+NJ9Uj7wOoDa6++VseXJNqWQ4z8OlSwyNA0PafjScRxF61uv q2AKSbZke7Kn0ecU6WKFqhUg5+aEmVRYRjzQ2UD4OvhUQ0xKx4o55yyGf0VVWzAZy7gj B6pOnzChBwgAv+wuNCGWdZ9RqlLr53Yns1CJcIF2Ym6otvoqf65WeROVxGNwGaGdbZzC XuRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763392018; x=1763996818; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aKWMjY1G5dJf/3LgpKl/NETW+FjIuUMvWMw9eVSgzUo=; b=SlQw71Qs75+QY1QkXn7lbspyEBjex3OKRYq7BYpYCG2iV3VX+Tg6ldvojzDvLvdLTJ Qcm6gNeywSE9iVJfG+Tm25xqBioWQQgWpdte2dHngfyVr5JSC7ErLiDyQDfUW31inSQn s4TPP3GHbu0KnEZevDG8ExLWdsrxToUyHIFR/IdiKvyJ4jvfnfnRlv6RzEiCIvd8IOS7 VvnRjSiogqeki8sRKr7oOJf/Pc/IClDIwS6zCJUY3MdNAOmhnJxZp/0k5hfQfLHCI8S0 ndCGInGuJqLMrBYT6qG58MRS3qLov8Q7WEEBw63WJTuv/0Pr55To8tb0/BdBvzDm8Zag vqXg== X-Forwarded-Encrypted: i=1; AJvYcCUzLTHa8Meqqti0UE1lDM/YA7x68S5C7jcqOs6YAic6oh9pnWKDebN4yNhORwHBgEmaUA2WvEHsht0dfGw=@vger.kernel.org X-Gm-Message-State: AOJu0YylPDLz3j0ylVXfvLzCHPzwo/9LrRxZXz0UI1JRkqV/bUiY45Ht 0e/Mqa4/g+Zr+/tXfQ12KDYWSzuAf6C88VSMDdPDKm2H9EnCcstlNh1/54bZeTXcDP/RZthofWT sNDzu5A== X-Google-Smtp-Source: AGHT+IFOxUuzIgKh1JwbIAjKu49ctjZJknsV5hB6eqARol3NYY+tbG9o+hSzpMZk0suFg7lO7U0MuSnvVVA= X-Received: from pjbbg15.prod.google.com ([2002:a17:90b:d8f:b0:340:9a17:4b10]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:1c06:b0:32e:64ca:e84e with SMTP id 98e67ed59e1d1-343f9ea0b0dmr14224737a91.15.1763392018493; Mon, 17 Nov 2025 07:06:58 -0800 (PST) Date: Mon, 17 Nov 2025 07:06:57 -0800 In-Reply-To: <20251115110830.26792-1-ankitkhushwaha.linux@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251115110830.26792-1-ankitkhushwaha.linux@gmail.com> Message-ID: Subject: Re: [PATCH] KVM: selftests: Include missing uapi header for *_VECTOR definitions From: Sean Christopherson To: Ankit Khushwaha Cc: Paolo Bonzini , Shuah Khan , kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Sat, Nov 15, 2025, Ankit Khushwaha wrote: > The exception vector constants CP_VECTOR, HV_VECTOR, VC_VECTOR, and > SX_VECTOR are used in ex_str(), but the header that defines > them is not included. Other exception vectors are picked up through > indirect includes, but these four are not, which leads to unresolved That means your build is picking up stale kernel headers (likely the ones installed system-wide). The "#include " in kvm_util.h is what pulls in the kernel uAPI headers. Selftests uapi headers are a bit of a mess. In the past, selftests would automatically do "make headers_install" as part of the build, but commit 3bb267a36185 ("selftests: drop khdr make target") yanked that out because there are scenarios where it broke the build. So the "right" way to build selftest is to first do "make headers_install", and then build selftests. Note, if you build KVM selftests directly, tools/testing/selftests/lib.mk will define the includes to be relative to the source directory, i.e. expects the headers to be installed in the source. ifeq ($(KHDR_INCLUDES),) KHDR_INCLUDES := -isystem $(top_srcdir)/usr/include endif You can explicitly set KHDR_INCLUDES when building if you install headers somewhere else. E.g. my build invocation looks something like this, where "$output" is an out-of-tree directory. KHDR_INCLUDES="-isystem $output/usr/include" EXTRA_CFLAGS="-static -Werror -gdwarf-4" make \ INSTALL_HDR_PATH="$output/usr" OUTPUT=$output