* [PATCH] KVM: selftests: Add missing header file needed by xAPIC IPI tests
@ 2021-02-10 1:17 Sean Christopherson
2021-02-10 17:13 ` Paolo Bonzini
0 siblings, 1 reply; 2+ messages in thread
From: Sean Christopherson @ 2021-02-10 1:17 UTC (permalink / raw)
To: Paolo Bonzini
Cc: kvm, linux-kernel, Andrew Jones, Jim Mattson, Peter Shier,
Sean Christopherson
From: Peter Shier <pshier@google.com>
Fixes: 678e90a349a4 ("KVM: selftests: Test IPI to halted vCPU in xAPIC while backing page moves")
Cc: Andrew Jones <drjones@redhat.com>
Cc: Jim Mattson <jmattson@google.com>
Signed-off-by: Peter Shier <pshier@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
Delta patch taken verbatim from Peter's original submission. Applying the
original patch directly is mildly annoying due to conflicts with kvm/next
in other files.
tools/testing/selftests/kvm/include/numaif.h | 55 ++++++++++++++++++++
1 file changed, 55 insertions(+)
create mode 100644 tools/testing/selftests/kvm/include/numaif.h
diff --git a/tools/testing/selftests/kvm/include/numaif.h b/tools/testing/selftests/kvm/include/numaif.h
new file mode 100644
index 000000000000..b020547403fd
--- /dev/null
+++ b/tools/testing/selftests/kvm/include/numaif.h
@@ -0,0 +1,55 @@
+/* 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.
+ */
+
+#ifndef SELFTEST_KVM_NUMAIF_H
+#define SELFTEST_KVM_NUMAIF_H
+
+#define __NR_get_mempolicy 239
+#define __NR_migrate_pages 256
+
+/* System calls */
+long get_mempolicy(int *policy, const unsigned long *nmask,
+ unsigned long maxnode, void *addr, int flags)
+{
+ return syscall(__NR_get_mempolicy, policy, nmask,
+ maxnode, addr, flags);
+}
+
+long migrate_pages(int pid, unsigned long maxnode,
+ const unsigned long *frommask,
+ const unsigned long *tomask)
+{
+ return syscall(__NR_migrate_pages, pid, maxnode, frommask, tomask);
+}
+
+/* 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 */
--
2.30.0.478.g8a0d178c01-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] KVM: selftests: Add missing header file needed by xAPIC IPI tests
2021-02-10 1:17 [PATCH] KVM: selftests: Add missing header file needed by xAPIC IPI tests Sean Christopherson
@ 2021-02-10 17:13 ` Paolo Bonzini
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2021-02-10 17:13 UTC (permalink / raw)
To: Sean Christopherson
Cc: kvm, linux-kernel, Andrew Jones, Jim Mattson, Peter Shier
On 10/02/21 02:17, Sean Christopherson wrote:
> From: Peter Shier <pshier@google.com>
>
> Fixes: 678e90a349a4 ("KVM: selftests: Test IPI to halted vCPU in xAPIC while backing page moves")
> Cc: Andrew Jones <drjones@redhat.com>
> Cc: Jim Mattson <jmattson@google.com>
> Signed-off-by: Peter Shier <pshier@google.com>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
>
> Delta patch taken verbatim from Peter's original submission. Applying the
> original patch directly is mildly annoying due to conflicts with kvm/next
> in other files.
>
> tools/testing/selftests/kvm/include/numaif.h | 55 ++++++++++++++++++++
> 1 file changed, 55 insertions(+)
> create mode 100644 tools/testing/selftests/kvm/include/numaif.h
>
> diff --git a/tools/testing/selftests/kvm/include/numaif.h b/tools/testing/selftests/kvm/include/numaif.h
> new file mode 100644
> index 000000000000..b020547403fd
> --- /dev/null
> +++ b/tools/testing/selftests/kvm/include/numaif.h
> @@ -0,0 +1,55 @@
> +/* 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.
> + */
> +
> +#ifndef SELFTEST_KVM_NUMAIF_H
> +#define SELFTEST_KVM_NUMAIF_H
> +
> +#define __NR_get_mempolicy 239
> +#define __NR_migrate_pages 256
> +
> +/* System calls */
> +long get_mempolicy(int *policy, const unsigned long *nmask,
> + unsigned long maxnode, void *addr, int flags)
> +{
> + return syscall(__NR_get_mempolicy, policy, nmask,
> + maxnode, addr, flags);
> +}
> +
> +long migrate_pages(int pid, unsigned long maxnode,
> + const unsigned long *frommask,
> + const unsigned long *tomask)
> +{
> + return syscall(__NR_migrate_pages, pid, maxnode, frommask, tomask);
> +}
> +
> +/* 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 */
My fault. :( I had the file locally of course, but ended up not being
committed.
Paolo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-02-10 17:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-10 1:17 [PATCH] KVM: selftests: Add missing header file needed by xAPIC IPI tests Sean Christopherson
2021-02-10 17:13 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).