All of lore.kernel.org
 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: Gavin Shan <gshan@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>, KVM <kvm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Sean Christopherson <seanjc@google.com>,
	Vipin Sharma <vipinsh@google.com>,
	Vishal Annapurve <vannapurve@google.com>
Subject: linux-next: manual merge of the kvm-arm tree with the kvm tree
Date: Thu, 1 Dec 2022 12:09:39 +1100	[thread overview]
Message-ID: <20221201120939.3c19f004@canb.auug.org.au> (raw)

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

Hi all,

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

  tools/testing/selftests/kvm/memslot_perf_test.c

between commits:

  018ea2d71a43 ("KVM: selftests: Add atoi_paranoid() to catch errors missed by atoi()")
  dc88244bf548 ("KVM: selftests: Automatically do init_ucall() for non-barebones VMs")
  197ebb713ad0 ("KVM: selftests: move common startup logic to kvm_util.c")

from the kvm tree and commits:

  34396437b11f ("KVM: selftests: memslot_perf_test: Probe memory slots for once")
  8675c6f22698 ("KVM: selftests: memslot_perf_test: Support variable guest page size")
  a69170c65acd ("KVM: selftests: memslot_perf_test: Report optimal memory slots")

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/memslot_perf_test.c
index 36b20abfb948,2ad40f7c9c08..000000000000
--- a/tools/testing/selftests/kvm/memslot_perf_test.c
+++ b/tools/testing/selftests/kvm/memslot_perf_test.c
@@@ -252,23 -284,22 +284,21 @@@ static bool prepare_vm(struct vm_data *
  	struct timespec tstart;
  	struct sync_area *sync;
  
- 	max_mem_slots = kvm_check_cap(KVM_CAP_NR_MEMSLOTS);
- 	TEST_ASSERT(max_mem_slots > 1,
- 		    "KVM_CAP_NR_MEMSLOTS should be greater than 1");
- 	TEST_ASSERT(nslots > 1 || nslots == -1,
- 		    "Slot count cap should be greater than 1");
- 	if (nslots != -1)
- 		max_mem_slots = min(max_mem_slots, (uint32_t)nslots);
- 	pr_info_v("Allowed number of memory slots: %"PRIu32"\n", max_mem_slots);
+ 	host_page_size = getpagesize();
+ 	guest_page_size = vm_guest_mode_params[VM_MODE_DEFAULT].page_size;
+ 	mempages = mem_size / guest_page_size;
  
- 	TEST_ASSERT(mempages > 1,
- 		    "Can't test without any memory");
+ 	data->vm = __vm_create_with_one_vcpu(&data->vcpu, mempages, guest_code);
 -	ucall_init(data->vm, NULL);
+ 	TEST_ASSERT(data->vm->page_size == guest_page_size, "Invalid VM page size");
  
  	data->npages = mempages;
- 	data->nslots = max_mem_slots - 1;
- 	data->pages_per_slot = mempages / data->nslots;
- 	if (!data->pages_per_slot) {
- 		*maxslots = mempages + 1;
+ 	TEST_ASSERT(data->npages > 1, "Can't test without any memory");
+ 	data->nslots = nslots;
+ 	data->pages_per_slot = data->npages / data->nslots;
+ 	rempages = data->npages % data->nslots;
+ 	if (!check_slot_pages(host_page_size, guest_page_size,
+ 			      data->pages_per_slot, rempages)) {
+ 		*maxslots = get_max_slots(data, host_page_size);
  		return false;
  	}
  
@@@ -884,9 -966,9 +965,9 @@@ static bool parse_args(int argc, char *
  			map_unmap_verify = true;
  			break;
  		case 's':
 -			targs->nslots = atoi(optarg);
 +			targs->nslots = atoi_paranoid(optarg);
- 			if (targs->nslots <= 0 && targs->nslots != -1) {
- 				pr_info("Slot count cap has to be positive or -1 for no cap\n");
+ 			if (targs->nslots <= 1 && targs->nslots != -1) {
+ 				pr_info("Slot count cap must be larger than 1 or -1 for no cap\n");
  				return false;
  			}
  			break;
@@@ -994,6 -1103,12 +1090,9 @@@ int main(int argc, char *argv[]
  	struct test_result rbestslottime;
  	int tctr;
  
 -	/* Tell stdout not to buffer its content */
 -	setbuf(stdout, NULL);
 -
+ 	if (!check_memory_sizes())
+ 		return -1;
+ 
  	if (!parse_args(argc, argv, &targs))
  		return -1;
  

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

             reply	other threads:[~2022-12-01  1:09 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01  1:09 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  0:57 Stephen Rothwell
2022-12-01  0:36 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  6:04 ` Stephen Rothwell
2016-07-24  5:59 Stephen Rothwell
2016-07-24  5:59 ` Stephen Rothwell
2016-07-20  5:27 Stephen Rothwell
2016-07-20  5:27 ` Stephen Rothwell
2015-10-16  3:53 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-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=20221201120939.3c19f004@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=cdall@cs.columbia.edu \
    --cc=gshan@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=vannapurve@google.com \
    --cc=vipinsh@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.