linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Christoffer Dall <cdall@cs.columbia.edu>, Marc Zyngier <maz@kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	David Matlack <dmatlack@google.com>,
	Ricardo Koller <ricarkol@google.com>,
	Sean Christopherson <seanjc@google.com>
Subject: linux-next: manual merge of the kvm-arm tree with the kvm tree
Date: Thu, 1 Dec 2022 11:36:26 +1100	[thread overview]
Message-ID: <20221201113626.438f13c5@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 4690 bytes --]

Hi all,

Today's linux-next merge of the kvm-arm tree got conflicts in:

  tools/testing/selftests/kvm/Makefile
  tools/testing/selftests/kvm/demand_paging_test.c

between commit:

  7812d80c0f89 ("KVM: selftests: Rename perf_test_util symbols to memstress")
  7046638192d5 ("KVM: selftests: Consolidate common code for populating ucall struct")

from the kvm tree and commit:

  a93871d0ea9f ("KVM: selftests: Add a userfaultfd library")

from the kvm-arm tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc tools/testing/selftests/kvm/Makefile
index 2275ba861e0e,1d85b8e218a0..000000000000
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@@ -47,7 -47,7 +47,8 @@@ LIBKVM += lib/memstress.
  LIBKVM += lib/rbtree.c
  LIBKVM += lib/sparsebit.c
  LIBKVM += lib/test_util.c
 +LIBKVM += lib/ucall_common.c
+ LIBKVM += lib/userfaultfd_util.c
  
  LIBKVM_STRING += lib/string_override.c
  
diff --cc tools/testing/selftests/kvm/demand_paging_test.c
index 3a977ddf07b2,8e1fe4ffcccd..000000000000
--- a/tools/testing/selftests/kvm/demand_paging_test.c
+++ b/tools/testing/selftests/kvm/demand_paging_test.c
@@@ -20,8 -20,9 +20,9 @@@
  
  #include "kvm_util.h"
  #include "test_util.h"
 -#include "perf_test_util.h"
 +#include "memstress.h"
  #include "guest_modes.h"
+ #include "userfaultfd_util.h"
  
  #ifdef __NR_userfaultfd
  
@@@ -270,22 -129,13 +129,13 @@@ static void prefault_mem(void *alias, u
  static void run_test(enum vm_guest_mode mode, void *arg)
  {
  	struct test_params *p = arg;
- 	pthread_t *uffd_handler_threads = NULL;
- 	struct uffd_handler_args *uffd_args = NULL;
+ 	struct uffd_desc **uffd_descs = NULL;
  	struct timespec start;
  	struct timespec ts_diff;
- 	int *pipefds = NULL;
  	struct kvm_vm *vm;
- 	int r, i;
+ 	int i;
  
 -	vm = perf_test_create_vm(mode, nr_vcpus, guest_percpu_mem_size, 1,
 +	vm = memstress_create_vm(mode, nr_vcpus, guest_percpu_mem_size, 1,
  				 p->src_type, p->partition_vcpu_memory_access);
  
  	demand_paging_size = get_backing_src_pagesz(p->src_type);
@@@ -296,18 -146,11 +146,11 @@@
  	memset(guest_data_prototype, 0xAB, demand_paging_size);
  
  	if (p->uffd_mode) {
- 		uffd_handler_threads =
- 			malloc(nr_vcpus * sizeof(*uffd_handler_threads));
- 		TEST_ASSERT(uffd_handler_threads, "Memory allocation failed");
- 
- 		uffd_args = malloc(nr_vcpus * sizeof(*uffd_args));
- 		TEST_ASSERT(uffd_args, "Memory allocation failed");
- 
- 		pipefds = malloc(sizeof(int) * nr_vcpus * 2);
- 		TEST_ASSERT(pipefds, "Unable to allocate memory for pipefd");
+ 		uffd_descs = malloc(nr_vcpus * sizeof(struct uffd_desc *));
+ 		TEST_ASSERT(uffd_descs, "Memory allocation failed");
  
  		for (i = 0; i < nr_vcpus; i++) {
 -			struct perf_test_vcpu_args *vcpu_args;
 +			struct memstress_vcpu_args *vcpu_args;
  			void *vcpu_hva;
  			void *vcpu_alias;
  
@@@ -321,15 -167,10 +167,10 @@@
  			 * Set up user fault fd to handle demand paging
  			 * requests.
  			 */
- 			r = pipe2(&pipefds[i * 2],
- 				  O_CLOEXEC | O_NONBLOCK);
- 			TEST_ASSERT(!r, "Failed to set up pipefd");
- 
- 			setup_demand_paging(vm, &uffd_handler_threads[i],
- 					    pipefds[i * 2], p->uffd_mode,
- 					    p->uffd_delay, &uffd_args[i],
- 					    vcpu_hva, vcpu_alias,
- 					    vcpu_args->pages * memstress_args.guest_page_size);
+ 			uffd_descs[i] = uffd_setup_demand_paging(
+ 				p->uffd_mode, p->uffd_delay, vcpu_hva,
 -				vcpu_args->pages * perf_test_args.guest_page_size,
++				vcpu_args->pages * memstress_args.guest_page_size,
+ 				&handle_uffd_page_request);
  		}
  	}
  
@@@ -358,17 -193,14 +193,14 @@@
  	pr_info("Total guest execution time: %ld.%.9lds\n",
  		ts_diff.tv_sec, ts_diff.tv_nsec);
  	pr_info("Overall demand paging rate: %f pgs/sec\n",
 -		perf_test_args.vcpu_args[0].pages * nr_vcpus /
 +		memstress_args.vcpu_args[0].pages * nr_vcpus /
  		((double)ts_diff.tv_sec + (double)ts_diff.tv_nsec / 100000000.0));
  
 -	perf_test_destroy_vm(vm);
 +	memstress_destroy_vm(vm);
  
  	free(guest_data_prototype);
- 	if (p->uffd_mode) {
- 		free(uffd_handler_threads);
- 		free(uffd_args);
- 		free(pipefds);
- 	}
+ 	if (p->uffd_mode)
+ 		free(uffd_descs);
  }
  
  static void help(char *name)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2022-12-01  0:36 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01  0:36 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-04-06  3:06 linux-next: manual merge of the kvm-arm tree with the kvm tree Stephen Rothwell
2023-03-31  2:26 Stephen Rothwell
2022-12-01  2:16 Stephen Rothwell
2022-12-01 15:23 ` Marc Zyngier
2022-12-01  1:09 Stephen Rothwell
2022-12-01  0:57 Stephen Rothwell
2022-12-01  0:24 Stephen Rothwell
2022-07-18  5:19 Stephen Rothwell
2022-05-05  4:47 Stephen Rothwell
2021-12-17  4:19 Stephen Rothwell
2021-12-09 22:01 broonie
2021-06-25  5:24 Stephen Rothwell
2021-06-25  5:20 Stephen Rothwell
2021-06-25  5:15 Stephen Rothwell
2021-06-23  5:53 Stephen Rothwell
2021-06-22  5:31 Stephen Rothwell
2021-04-22  4:43 Stephen Rothwell
2021-04-22  4:39 Stephen Rothwell
2020-07-13  4:40 Stephen Rothwell
2020-08-09  8:55 ` Stephen Rothwell
2020-07-13  4:39 Stephen Rothwell
2020-08-09  8:54 ` Stephen Rothwell
2020-03-25  3:23 Stephen Rothwell
2018-10-18  2:46 Stephen Rothwell
2017-04-10  3:52 Stephen Rothwell
2017-04-10  6:26 ` Christoffer Dall
2016-07-24  6:04 Stephen Rothwell
2016-07-24  5:59 Stephen Rothwell
2016-07-20  5:27 Stephen Rothwell
2015-10-16  3:53 Stephen Rothwell
2015-10-16  4:20 ` Wu, Feng
2014-11-26  6:19 Stephen Rothwell
2014-11-26 11:39 ` Christoffer Dall
2014-09-25  5:32 Stephen Rothwell
2014-09-18  3:52 Stephen Rothwell
2014-09-18 15:13 ` Marc Zyngier
2014-09-08  6:04 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221201113626.438f13c5@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=cdall@cs.columbia.edu \
    --cc=dmatlack@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=ricarkol@google.com \
    --cc=seanjc@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).