Revision 32ffa4f71e10009498ae6b54da65ab316db967bd authored by Axel Rasmussen on 19 May 2021, 20:03:33 UTC, committed by Paolo Bonzini on 27 May 2021, 11:45:55 UTC
This is a preparatory commit needed before we can use different kinds of
backing pages for guest memory.

Previously, we used perf_test_args.host_page_size, which is the host's
native page size (commonly 4K). For VM_MEM_SRC_ANONYMOUS this turns out
to be okay, but in a follow-up commit we want to allow using different
kinds of backing memory.

Take VM_MEM_SRC_ANONYMOUS_HUGETLB for example. Without this change, if
we used that backing page type, when we issued a UFFDIO_COPY ioctl we'd
only do so with 4K, rather than the full 2M of a backing hugepage. In
this case, UFFDIO_COPY returns -EINVAL (__mcopy_atomic_hugetlb checks
the size).

Signed-off-by: Axel Rasmussen <axelrasmussen@google.com>
Message-Id: <20210519200339.829146-5-axelrasmussen@google.com>
Reviewed-by: Ben Gardon <bgardon@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 25408e5
Raw File
rtl819x_BA.h
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
 *
 * Contact Information: wlanfae <wlanfae@realtek.com>
 */
#ifndef _BATYPE_H_
#define _BATYPE_H_

#define	BA_SETUP_TIMEOUT	200

#define	BA_POLICY_DELAYED		0
#define	BA_POLICY_IMMEDIATE	1

#define	ADDBA_STATUS_SUCCESS			0
#define	ADDBA_STATUS_REFUSED		37
#define	ADDBA_STATUS_INVALID_PARAM	38

#define	DELBA_REASON_END_BA			37
#define	DELBA_REASON_UNKNOWN_BA	38
#define	DELBA_REASON_TIMEOUT			39
union sequence_control {
	u16 short_data;
	struct {
		u16	frag_num:4;
		u16	seq_num:12;
	} field;
};

union ba_param_set {
	u8 char_data[2];
	u16 short_data;
	struct {
		u16 amsdu_support:1;
		u16 ba_policy:1;
		u16 tid:4;
		u16 buffer_size:10;
	} field;
};

union delba_param_set {
	u8 char_data[2];
	u16 short_data;
	struct {
		u16 reserved:11;
		u16 initiator:1;
		u16 tid:4;
	} field;
};

struct ba_record {
	struct timer_list timer;
	u8 b_valid;
	u8 dialog_token;
	union ba_param_set ba_param_set;
	u16 ba_timeout_value;
	union sequence_control ba_start_seq_ctrl;
};

#endif
back to top