/* SPDX-License-Identifier: GPL-2.0 OR MIT */ /********************************************************** * Copyright 2015-2021 VMware, Inc. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * **********************************************************/ #ifndef VM_BASIC_TYPES_H #define VM_BASIC_TYPES_H #include <linux/kernel.h> #include <linux/mm.h> #include <asm/page.h> uint32; int32; uint64; uint16; int16; uint8; int8; PA; PPN; PPN32; PPN64; Bool; #define MAX_UINT64 … #define MAX_UINT32 … #define MAX_UINT16 … #define CONST64U(x) … #ifndef MBYTES_SHIFT #define MBYTES_SHIFT … #endif #ifndef MBYTES_2_BYTES #define MBYTES_2_BYTES(_nbytes) … #endif /* * MKS Guest Stats types */ MKSGuestStatCounter; MKSGuestStatCounterTime; /* * Flags for MKSGuestStatInfoEntry::flags below */ #define MKS_GUEST_STAT_FLAG_NONE … #define MKS_GUEST_STAT_FLAG_TIME … MKSGuestStatInfoEntry; #define INVALID_PPN64 … #define MKS_GUEST_STAT_INSTANCE_DESC_LENGTH … #define MKS_GUEST_STAT_INSTANCE_MAX_STATS … #define MKS_GUEST_STAT_INSTANCE_MAX_STAT_PPNS … #define MKS_GUEST_STAT_INSTANCE_MAX_INFO_PPNS … #define MKS_GUEST_STAT_AVERAGE_NAME_LENGTH … #define MKS_GUEST_STAT_INSTANCE_MAX_STRS_PPNS … /* * The MKSGuestStatInstanceDescriptor is used as main interface to * communicate guest stats back to the host code. The guest must * allocate an instance of this structure at the start of a page and * provide the physical address to the host. From there the host code * can walk this structure to find other (pinned) pages containing the * stats data. * * Since the MKSGuestStatInfoEntry structures contain userlevel * pointers, the InstanceDescriptor also contains pointers to the * beginning of these sections allowing the host side code to correctly * interpret the pointers. * * Because the host side code never acknowledges anything back to the * guest there is no strict requirement to maintain compatability * across releases. If the interface changes the host might not be * able to log stats, but the guest will continue to run normally. */ MKSGuestStatInstanceDescriptor; #endif