Re: [PATCH v9 11/14] KVM: selftests: aarch64: Add userfaultfd tests into page_fault_test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 11, 2022, Ricardo Koller wrote:
>  /* Returns true to continue the test, and false if it should be skipped. */
> +static int uffd_generic_handler(int uffd_mode, int uffd,
> +		struct uffd_msg *msg, struct uffd_args *args,
> +		bool expect_write)

Align.

static int uffd_generic_handler(int uffd_mode, int uffd,
				struct uffd_msg *msg, struct uffd_args *args,
				bool expect_write)

> +static void setup_uffd(struct kvm_vm *vm, struct test_params *p,
> +		struct uffd_desc **pt_uffd, struct uffd_desc **data_uffd)

static void setup_uffd(struct kvm_vm *vm, struct test_params *p,
		       struct uffd_desc **pt_uffd, struct uffd_desc **data_uffd)

> +{
> +	struct test_desc *test = p->test_desc;
> +
> +	setup_uffd_args(vm_get_mem_region(vm, MEM_REGION_PT), &pt_args);
> +	setup_uffd_args(vm_get_mem_region(vm, MEM_REGION_TEST_DATA), &data_args);
> +
> +	*pt_uffd = NULL;
> +	if (test->uffd_pt_handler)
> +		*pt_uffd = uffd_setup_demand_paging(
> +				UFFDIO_REGISTER_MODE_MISSING, 0,
> +				pt_args.hva, pt_args.paging_size,
> +				test->uffd_pt_handler);
> +
> +	*data_uffd = NULL;
> +	if (test->uffd_data_handler)
> +		*data_uffd = uffd_setup_demand_paging(
> +				UFFDIO_REGISTER_MODE_MISSING, 0,
> +				data_args.hva, data_args.paging_size,
> +				test->uffd_data_handler);
> +}
> +
> +static void free_uffd(struct test_desc *test, struct uffd_desc *pt_uffd,
> +			struct uffd_desc *data_uffd)

static void free_uffd(struct test_desc *test, struct uffd_desc *pt_uffd,
		      struct uffd_desc *data_uffd)

> +static void reset_event_counts(void)
> +{
> +	memset(&events, 0, sizeof(events));
> +}
> +
>  /*
>   * This function either succeeds, skips the test (after setting test->skip), or
>   * fails with a TEST_FAIL that aborts all tests.
>   */
>  static void vcpu_run_loop(struct kvm_vm *vm, struct kvm_vcpu *vcpu,
> -			  struct test_desc *test)
> +		struct test_desc *test)

Spurious change, and it introduces bad alignment.

static void vcpu_run_loop(struct kvm_vm *vm, struct kvm_vcpu *vcpu,
			  struct test_desc *test)

>  {
>  	struct ucall uc;
>  
> @@ -453,6 +575,7 @@ static void run_test(enum vm_guest_mode mode, void *arg)
>  	struct test_desc *test = p->test_desc;
>  	struct kvm_vm *vm;
>  	struct kvm_vcpu *vcpu;
> +	struct uffd_desc *pt_uffd, *data_uffd;
>  
>  	print_test_banner(mode, p);
>  




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux