Commit fe7baebb authored by Sean Christopherson's avatar Sean Christopherson
Browse files

KVM: selftests: Use proper uAPI headers to pick up mempolicy.h definitions



Drop the KVM's re-definitions of MPOL_xxx flags in numaif.h as they are
defined by the already-included, kernel-provided mempolicy.h.  The only
reason the duplicate definitions don't cause compiler warnings is because
they are identical, but only on x86-64!  The syscall numbers in particular
are subtly x86_64-specific, i.e. will cause problems if/when numaif.h is
used outsize of x86.

Opportunistically clean up the file comment as the license information is
covered by the SPDX header, the path is superfluous, and as above the
comment about the contents is flat out wrong.

Fixes: 346b59f2 ("KVM: selftests: Add missing header file needed by xAPIC IPI tests")
Reviewed-by: default avatarShivank Garg <shivankg@amd.com>
Tested-by: default avatarShivank Garg <shivankg@amd.com>
Link: https://lore.kernel.org/r/20251016172853.52451-10-seanjc@google.com


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 2189d782
Loading
Loading
Loading
Loading
+1 −31
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * tools/testing/selftests/kvm/include/numaif.h
 *
 * Copyright (C) 2020, Google LLC.
 *
 * This work is licensed under the terms of the GNU GPL, version 2.
 *
 * Header file that provides access to NUMA API functions not explicitly
 * exported to user space.
 */
/* Copyright (C) 2020, Google LLC. */

#ifndef SELFTEST_KVM_NUMAIF_H
#define SELFTEST_KVM_NUMAIF_H
@@ -37,25 +28,4 @@ KVM_SYSCALL_DEFINE(mbind, 6, void *, addr, unsigned long, size, int, mode,
		   const unsigned long *, nodemask, unsigned long, maxnode,
		   unsigned int, flags);

/* Policies */
#define MPOL_DEFAULT	 0
#define MPOL_PREFERRED	 1
#define MPOL_BIND	 2
#define MPOL_INTERLEAVE	 3

#define MPOL_MAX MPOL_INTERLEAVE

/* Flags for get_mem_policy */
#define MPOL_F_NODE	    (1<<0)  /* return next il node or node of address */
				    /* Warning: MPOL_F_NODE is unsupported and
				     * subject to change. Don't use.
				     */
#define MPOL_F_ADDR	    (1<<1)  /* look up vma using address */
#define MPOL_F_MEMS_ALLOWED (1<<2)  /* query nodes allowed in cpuset */

/* Flags for mbind */
#define MPOL_MF_STRICT	     (1<<0) /* Verify existing pages in the mapping */
#define MPOL_MF_MOVE	     (1<<1) /* Move pages owned by this process to conform to mapping */
#define MPOL_MF_MOVE_ALL     (1<<2) /* Move every page to conform to mapping */

#endif /* SELFTEST_KVM_NUMAIF_H */