1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

Uhyve side cleanup.

This commit is contained in:
Annika Wierichs 2018-02-13 20:37:59 +01:00
parent 974d41d28f
commit b5d34b24ff
4 changed files with 245 additions and 228 deletions

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2010, Stefan Lankes, RWTH Aachen University
* Copyright (c) 2010, Stefan Lankes, RWTH Aachen University
* Copyright (c) 2018, Annika Wierichs, RWTH Aachen University
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -66,103 +67,101 @@ extern const size_t image_size;
#define UHYVE_PORT_EXIT 0x503
#define UHYVE_PORT_LSEEK 0x504
// InfiniBand uhyve port IDs
#define UHYVE_PORT_SET_IB_POOL_ADDR 0x60F
#define UHYVE_PORT_IBV_WC_STATUS_STR 0x610
#define UHYVE_PORT_IBV_RATE_TO_MULT 0x611
#define UHYVE_PORT_MULT_TO_IBV_RATE 0x612
#define UHYVE_PORT_IBV_RATE_TO_MBPS 0x613
#define UHYVE_PORT_MBPS_TO_IBV_RATE 0x614
#define UHYVE_PORT_IBV_CQ_EX_TO_CQ 0x615
#define UHYVE_PORT_IBV_START_POLL 0x616
#define UHYVE_PORT_IBV_NEXT_POLL 0x617
#define UHYVE_PORT_IBV_END_POLL 0x618
#define UHYVE_PORT_IBV_WC_READ_OPCODE 0x619
#define UHYVE_PORT_IBV_WC_READ_VENDOR_ERR 0x61A
#define UHYVE_PORT_IBV_WC_READ_BYTE_LEN 0x61B
#define UHYVE_PORT_IBV_WC_READ_IMM_DATA 0x61C
#define UHYVE_PORT_IBV_WC_READ_INVALIDATED_RKEY 0x61D
#define UHYVE_PORT_IBV_WC_READ_QP_NUM 0x61E
#define UHYVE_PORT_IBV_WC_READ_SRC_QP 0x61F
#define UHYVE_PORT_IBV_WC_READ_WC_FLAGS 0x620
#define UHYVE_PORT_IBV_WC_READ_SLID 0x621
#define UHYVE_PORT_IBV_WC_READ_SL 0x622
#define UHYVE_PORT_IBV_WC_READ_DLID_PATH_BITS 0x623
#define UHYVE_PORT_IBV_WC_READ_COMPLETION_TS 0x624
#define UHYVE_PORT_IBV_WC_READ_CVLAN 0x625
#define UHYVE_PORT_IBV_WC_READ_FLOW_TAG 0x626
#define UHYVE_PORT_IBV_POST_WQ_RECV 0x627
#define UHYVE_PORT_IBV_GET_DEVICE_LIST 0x628
#define UHYVE_PORT_IBV_FREE_DEVICE_LIST 0x629
#define UHYVE_PORT_IBV_GET_DEVICE_NAME 0x62A
#define UHYVE_PORT_IBV_GET_DEVICE_GUID 0x62B
#define UHYVE_PORT_IBV_OPEN_DEVICE 0x62C
#define UHYVE_PORT_IBV_CLOSE_DEVICE 0x62D
#define UHYVE_PORT_IBV_GET_ASYNC_EVENT 0x62E
#define UHYVE_PORT_IBV_ACK_ASYNC_EVENT 0x62F
#define UHYVE_PORT_IBV_QUERY_DEVICE 0x630
#define UHYVE_PORT_IBV_QUERY_PORT 0x631
#define UHYVE_PORT_IBV_QUERY_GID 0x632
#define UHYVE_PORT_IBV_QUERY_PKEY 0x633
#define UHYVE_PORT_IBV_ALLOC_PD 0x634
#define UHYVE_PORT_IBV_DEALLOC_PD 0x635
#define UHYVE_PORT_IBV_CREATE_FLOW 0x636
#define UHYVE_PORT_IBV_DESTROY_FLOW 0x637
#define UHYVE_PORT_IBV_OPEN_XRCD 0x638
#define UHYVE_PORT_IBV_CLOSE_XRCD 0x639
#define UHYVE_PORT_IBV_REG_MR 0x63A
#define UHYVE_PORT_IBV_REREG_MR 0x63B
#define UHYVE_PORT_IBV_DEREG_MR 0x63C
#define UHYVE_PORT_IBV_ALLOC_MW 0x63D
#define UHYVE_PORT_IBV_DEALLOC_MW 0x63E
#define UHYVE_PORT_IBV_INC_RKEY 0x63F
#define UHYVE_PORT_IBV_BIND_MW 0x640
#define UHYVE_PORT_IBV_CREATE_COMP_CHANNEL 0x641
#define UHYVE_PORT_IBV_DESTROY_COMP_CHANNEL 0x642
#define UHYVE_PORT_IBV_CREATE_CQ 0x643
#define UHYVE_PORT_IBV_CREATE_CQ_EX 0x644
#define UHYVE_PORT_IBV_RESIZE_CQ 0x645
#define UHYVE_PORT_IBV_DESTROY_CQ 0x646
#define UHYVE_PORT_IBV_GET_CQ_EVENT 0x647
#define UHYVE_PORT_IBV_ACK_CQ_EVENTS 0x648
#define UHYVE_PORT_IBV_POLL_CQ 0x649
#define UHYVE_PORT_IBV_REQ_NOTIFY_CQ 0x64A
#define UHYVE_PORT_IBV_CREATE_SRQ 0x64B
#define UHYVE_PORT_IBV_CREATE_SRQ_EX 0x64C
#define UHYVE_PORT_IBV_MODIFY_SRQ 0x64D
#define UHYVE_PORT_IBV_QUERY_SRQ 0x64E
#define UHYVE_PORT_IBV_GET_SRQ_NUM 0x64F
#define UHYVE_PORT_IBV_DESTROY_SRQ 0x650
#define UHYVE_PORT_IBV_POST_SRQ_RECV 0x651
#define UHYVE_PORT_IBV_CREATE_QP 0x652
#define UHYVE_PORT_IBV_CREATE_QP_EX 0x653
#define UHYVE_PORT_IBV_QUERY_RT_VALUES_EX 0x654
#define UHYVE_PORT_IBV_QUERY_DEVICE_EX 0x655
#define UHYVE_PORT_IBV_OPEN_QP 0x656
#define UHYVE_PORT_IBV_MODIFY_QP 0x657
#define UHYVE_PORT_IBV_QUERY_QP 0x658
#define UHYVE_PORT_IBV_DESTROY_QP 0x659
#define UHYVE_PORT_IBV_CREATE_WQ 0x65A
#define UHYVE_PORT_IBV_MODIFY_WQ 0x65B
#define UHYVE_PORT_IBV_DESTROY_WQ 0x65C
#define UHYVE_PORT_IBV_CREATE_RWQ_IND_TABLE 0x65D
#define UHYVE_PORT_IBV_DESTROY_RWQ_IND_TABLE 0x65E
#define UHYVE_PORT_IBV_POST_SEND 0x65F
#define UHYVE_PORT_IBV_POST_RECV 0x660
#define UHYVE_PORT_IBV_CREATE_AH 0x661
#define UHYVE_PORT_IBV_INIT_AH_FROM_WC 0x662
#define UHYVE_PORT_IBV_CREATE_AH_FROM_WC 0x663
#define UHYVE_PORT_IBV_DESTROY_AH 0x664
#define UHYVE_PORT_IBV_ATTACH_MCAST 0x665
#define UHYVE_PORT_IBV_DETACH_MCAST 0x666
#define UHYVE_PORT_IBV_FORK_INIT 0x667
#define UHYVE_PORT_IBV_NODE_TYPE_STR 0x668
#define UHYVE_PORT_IBV_PORT_STATE_STR 0x669
#define UHYVE_PORT_IBV_EVENT_TYPE_STR 0x66A
// #define UHYVE_PORT_IBV_RESOLVE_ETH_L2_FROM_GID 0x66B
#define UHYVE_PORT_IBV_IS_QPT_SUPPORTED 0x66C
#define UHYVE_PORT_KERNEL_IBV_LOG 0x66F
// KVM I/O ports corresponding to verbs API functions
#define UHYVE_PORT_SET_IB_POOL_ADDR 0x610
#define UHYVE_PORT_IBV_WC_STATUS_STR 0x611
#define UHYVE_PORT_IBV_RATE_TO_MULT 0x612
#define UHYVE_PORT_MULT_TO_IBV_RATE 0x613
#define UHYVE_PORT_IBV_RATE_TO_MBPS 0x614
#define UHYVE_PORT_MBPS_TO_IBV_RATE 0x615
#define UHYVE_PORT_IBV_CQ_EX_TO_CQ 0x616
#define UHYVE_PORT_IBV_START_POLL 0x617
#define UHYVE_PORT_IBV_NEXT_POLL 0x618
#define UHYVE_PORT_IBV_END_POLL 0x619
#define UHYVE_PORT_IBV_WC_READ_OPCODE 0x61A
#define UHYVE_PORT_IBV_WC_READ_VENDOR_ERR 0x61B
#define UHYVE_PORT_IBV_WC_READ_BYTE_LEN 0x61C
#define UHYVE_PORT_IBV_WC_READ_IMM_DATA 0x61D
#define UHYVE_PORT_IBV_WC_READ_INVALIDATED_RKEY 0x61E
#define UHYVE_PORT_IBV_WC_READ_QP_NUM 0x61F
#define UHYVE_PORT_IBV_WC_READ_SRC_QP 0x620
#define UHYVE_PORT_IBV_WC_READ_WC_FLAGS 0x621
#define UHYVE_PORT_IBV_WC_READ_SLID 0x622
#define UHYVE_PORT_IBV_WC_READ_SL 0x623
#define UHYVE_PORT_IBV_WC_READ_DLID_PATH_BITS 0x624
#define UHYVE_PORT_IBV_WC_READ_COMPLETION_TS 0x625
#define UHYVE_PORT_IBV_WC_READ_CVLAN 0x626
#define UHYVE_PORT_IBV_WC_READ_FLOW_TAG 0x627
#define UHYVE_PORT_IBV_POST_WQ_RECV 0x628
#define UHYVE_PORT_IBV_GET_DEVICE_LIST 0x629
#define UHYVE_PORT_IBV_FREE_DEVICE_LIST 0x62A
#define UHYVE_PORT_IBV_GET_DEVICE_NAME 0x62B
#define UHYVE_PORT_IBV_GET_DEVICE_GUID 0x62C
#define UHYVE_PORT_IBV_OPEN_DEVICE 0x62D
#define UHYVE_PORT_IBV_CLOSE_DEVICE 0x62E
#define UHYVE_PORT_IBV_GET_ASYNC_EVENT 0x62F
#define UHYVE_PORT_IBV_ACK_ASYNC_EVENT 0x630
#define UHYVE_PORT_IBV_QUERY_DEVICE 0x631
#define UHYVE_PORT_IBV_QUERY_PORT 0x632
#define UHYVE_PORT_IBV_QUERY_GID 0x633
#define UHYVE_PORT_IBV_QUERY_PKEY 0x634
#define UHYVE_PORT_IBV_ALLOC_PD 0x635
#define UHYVE_PORT_IBV_DEALLOC_PD 0x636
#define UHYVE_PORT_IBV_CREATE_FLOW 0x637
#define UHYVE_PORT_IBV_DESTROY_FLOW 0x638
#define UHYVE_PORT_IBV_OPEN_XRCD 0x639
#define UHYVE_PORT_IBV_CLOSE_XRCD 0x63A
#define UHYVE_PORT_IBV_REG_MR 0x63B
#define UHYVE_PORT_IBV_REREG_MR 0x63C
#define UHYVE_PORT_IBV_DEREG_MR 0x63D
#define UHYVE_PORT_IBV_ALLOC_MW 0x63E
#define UHYVE_PORT_IBV_DEALLOC_MW 0x63F
#define UHYVE_PORT_IBV_INC_RKEY 0x640
#define UHYVE_PORT_IBV_BIND_MW 0x641
#define UHYVE_PORT_IBV_CREATE_COMP_CHANNEL 0x642
#define UHYVE_PORT_IBV_DESTROY_COMP_CHANNEL 0x643
#define UHYVE_PORT_IBV_CREATE_CQ 0x644
#define UHYVE_PORT_IBV_CREATE_CQ_EX 0x645
#define UHYVE_PORT_IBV_RESIZE_CQ 0x646
#define UHYVE_PORT_IBV_DESTROY_CQ 0x647
#define UHYVE_PORT_IBV_GET_CQ_EVENT 0x648
#define UHYVE_PORT_IBV_ACK_CQ_EVENTS 0x649
#define UHYVE_PORT_IBV_POLL_CQ 0x64A
#define UHYVE_PORT_IBV_REQ_NOTIFY_CQ 0x64B
#define UHYVE_PORT_IBV_CREATE_SRQ 0x64C
#define UHYVE_PORT_IBV_CREATE_SRQ_EX 0x64D
#define UHYVE_PORT_IBV_MODIFY_SRQ 0x64E
#define UHYVE_PORT_IBV_QUERY_SRQ 0x64F
#define UHYVE_PORT_IBV_GET_SRQ_NUM 0x650
#define UHYVE_PORT_IBV_DESTROY_SRQ 0x651
#define UHYVE_PORT_IBV_POST_SRQ_RECV 0x652
#define UHYVE_PORT_IBV_CREATE_QP 0x653
#define UHYVE_PORT_IBV_CREATE_QP_EX 0x654
#define UHYVE_PORT_IBV_QUERY_RT_VALUES_EX 0x655
#define UHYVE_PORT_IBV_QUERY_DEVICE_EX 0x656
#define UHYVE_PORT_IBV_OPEN_QP 0x657
#define UHYVE_PORT_IBV_MODIFY_QP 0x658
#define UHYVE_PORT_IBV_QUERY_QP 0x659
#define UHYVE_PORT_IBV_DESTROY_QP 0x65A
#define UHYVE_PORT_IBV_CREATE_WQ 0x65B
#define UHYVE_PORT_IBV_MODIFY_WQ 0x65C
#define UHYVE_PORT_IBV_DESTROY_WQ 0x65D
#define UHYVE_PORT_IBV_CREATE_RWQ_IND_TABLE 0x65E
#define UHYVE_PORT_IBV_DESTROY_RWQ_IND_TABLE 0x65F
#define UHYVE_PORT_IBV_POST_SEND 0x660
#define UHYVE_PORT_IBV_POST_RECV 0x661
#define UHYVE_PORT_IBV_CREATE_AH 0x662
#define UHYVE_PORT_IBV_INIT_AH_FROM_WC 0x663
#define UHYVE_PORT_IBV_CREATE_AH_FROM_WC 0x664
#define UHYVE_PORT_IBV_DESTROY_AH 0x665
#define UHYVE_PORT_IBV_ATTACH_MCAST 0x666
#define UHYVE_PORT_IBV_DETACH_MCAST 0x667
#define UHYVE_PORT_IBV_FORK_INIT 0x668
#define UHYVE_PORT_IBV_NODE_TYPE_STR 0x669
#define UHYVE_PORT_IBV_PORT_STATE_STR 0x66A
#define UHYVE_PORT_IBV_EVENT_TYPE_STR 0x66B
// #define UHYVE_PORT_IBV_RESOLVE_ETH_L2_FROM_GID 0x66C
#define UHYVE_PORT_IBV_IS_QPT_SUPPORTED 0x66D
#define BUILTIN_EXPECT(exp, b) __builtin_expect((exp), (b))
//#define BUILTIN_EXPECT(exp, b) (exp)

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Annika Wierichs, RWTH Aachen University
* Copyright (c) 2018, Annika Wierichs, RWTH Aachen University
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -23,14 +23,20 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* TODO: Documentation
*
*/
/*
* This is the host side verbs interface for HermitCore. Each function calls its
* native verbs API counterpart. These functions may be called when their
* respective KVM I/O port has been addressed by HermitCore. The guest physical
* address of an arguments struct holding function parameters and the return value
* may be retrieved from the port.
*/
#include "uhyve-ibv.h"
#include <infiniband/verbs.h> // Linux include
#include <infiniband/verbs.h> // Linux native verbs header.
#include <stdio.h>
@ -1024,7 +1030,7 @@ void call_ibv_destroy_srq(struct kvm_run * run, uint8_t * guest_mem) {
*/
void call_ibv_post_srq_recv(struct kvm_run * run, uint8_t * guest_mem) {
printf("LOG: UHYVE - call_ibv_post_srq_recv\n");
printf("sh_r");
unsigned data = *((unsigned*) ((size_t) run + run->io.data_offset));
uhyve_ibv_post_srq_recv_t * args = (uhyve_ibv_post_srq_recv_t *) (guest_mem + data);
@ -1233,12 +1239,13 @@ void call_ibv_destroy_rwq_ind_table(struct kvm_run * run, uint8_t * guest_mem) {
* ibv_post_send
*/
// TODO: Cleanup
void call_ibv_post_send(struct kvm_run * run, uint8_t * guest_mem) {
/* printf("LOG: UHYVE - call_ibv_post_send\n"); */
/* printf("s"); */
printf("s");
unsigned data = *((unsigned*) ((size_t) run + run->io.data_offset));
uhyve_ibv_post_send_t * args = (uhyve_ibv_post_send_t *) (guest_mem + data);
// TODO: Leaving this for debugging purposes.
/* printf("\tqp->context: %p\n", args->qp->context); */
/* printf("\tqp->state: %d\n", args->qp->state); */
/* printf("\twr->id: %lu\n", args->wr->wr_id); */
@ -1264,7 +1271,7 @@ void call_ibv_post_send(struct kvm_run * run, uint8_t * guest_mem) {
*/
void call_ibv_post_recv(struct kvm_run * run, uint8_t * guest_mem) {
printf("LOG: UHYVE - call_ibv_post_recv\n");
printf("r");
unsigned data = *((unsigned*) ((size_t) run + run->io.data_offset));
uhyve_ibv_post_recv_t * args = (uhyve_ibv_post_recv_t *) (guest_mem + data);

View file

@ -1,23 +1,40 @@
/* Copyright (c) 2017, RWTH Aachen University
* Author(s): Annika Wierichs <annika.wierichs@rwth-aachen.de>
/*
* Copyright (c) 2018, Annika Wierichs, RWTH Aachen University
* All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software
* for any purpose with or without fee is hereby granted, provided
* that the above copyright notice and this permission notice appear
* in all copies.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef UHYVE_IBV_H
#define UHYVE_IBV_H
/*
* This header defines an enum corresponding to the KVM I/O port IDs, arguments
* structs for all verbs API functions and it declarares all functions that call
* the native verbs API functions (refer to uhyve-ibv.c) and may be called from
* uhyve's VCPU loop.
*/
#ifndef __UHYVE_IBV_H__
#define __UHYVE_IBV_H__
#include <infiniband/verbs.h>
#include <linux/kvm.h>
@ -26,102 +43,100 @@
extern bool use_ib_mem_pool;
typedef enum {
UHYVE_PORT_SET_IB_POOL_ADDR = 0x60F,
UHYVE_PORT_IBV_WC_STATUS_STR = 0x610,
UHYVE_PORT_IBV_RATE_TO_MULT = 0x611,
UHYVE_PORT_MULT_TO_IBV_RATE = 0x612,
UHYVE_PORT_IBV_RATE_TO_MBPS = 0x613,
UHYVE_PORT_MBPS_TO_IBV_RATE = 0x614,
UHYVE_PORT_IBV_CQ_EX_TO_CQ = 0x615,
UHYVE_PORT_IBV_START_POLL = 0x616,
UHYVE_PORT_IBV_NEXT_POLL = 0x617,
UHYVE_PORT_IBV_END_POLL = 0x618,
UHYVE_PORT_IBV_WC_READ_OPCODE = 0x619,
UHYVE_PORT_IBV_WC_READ_VENDOR_ERR = 0x61A,
UHYVE_PORT_IBV_WC_READ_BYTE_LEN = 0x61B,
UHYVE_PORT_IBV_WC_READ_IMM_DATA = 0x61C,
UHYVE_PORT_IBV_WC_READ_INVALIDATED_RKEY = 0x61D,
UHYVE_PORT_IBV_WC_READ_QP_NUM = 0x61E,
UHYVE_PORT_IBV_WC_READ_SRC_QP = 0x61F,
UHYVE_PORT_IBV_WC_READ_WC_FLAGS = 0x620,
UHYVE_PORT_IBV_WC_READ_SLID = 0x621,
UHYVE_PORT_IBV_WC_READ_SL = 0x622,
UHYVE_PORT_IBV_WC_READ_DLID_PATH_BITS = 0x623,
UHYVE_PORT_IBV_WC_READ_COMPLETION_TS = 0x624,
UHYVE_PORT_IBV_WC_READ_CVLAN = 0x625,
UHYVE_PORT_IBV_WC_READ_FLOW_TAG = 0x626,
UHYVE_PORT_IBV_POST_WQ_RECV = 0x627,
UHYVE_PORT_IBV_GET_DEVICE_LIST = 0x628,
UHYVE_PORT_IBV_FREE_DEVICE_LIST = 0x629,
UHYVE_PORT_IBV_GET_DEVICE_NAME = 0x62A,
UHYVE_PORT_IBV_GET_DEVICE_GUID = 0x62B,
UHYVE_PORT_IBV_OPEN_DEVICE = 0x62C,
UHYVE_PORT_IBV_CLOSE_DEVICE = 0x62D,
UHYVE_PORT_IBV_GET_ASYNC_EVENT = 0x62E,
UHYVE_PORT_IBV_ACK_ASYNC_EVENT = 0x62F,
UHYVE_PORT_IBV_QUERY_DEVICE = 0x630,
UHYVE_PORT_IBV_QUERY_PORT = 0x631,
UHYVE_PORT_IBV_QUERY_GID = 0x632,
UHYVE_PORT_IBV_QUERY_PKEY = 0x633,
UHYVE_PORT_IBV_ALLOC_PD = 0x634,
UHYVE_PORT_IBV_DEALLOC_PD = 0x635,
UHYVE_PORT_IBV_CREATE_FLOW = 0x636,
UHYVE_PORT_IBV_DESTROY_FLOW = 0x637,
UHYVE_PORT_IBV_OPEN_XRCD = 0x638,
UHYVE_PORT_IBV_CLOSE_XRCD = 0x639,
UHYVE_PORT_IBV_REG_MR = 0x63A,
UHYVE_PORT_IBV_REREG_MR = 0x63B,
UHYVE_PORT_IBV_DEREG_MR = 0x63C,
UHYVE_PORT_IBV_ALLOC_MW = 0x63D,
UHYVE_PORT_IBV_DEALLOC_MW = 0x63E,
UHYVE_PORT_IBV_INC_RKEY = 0x63F,
UHYVE_PORT_IBV_BIND_MW = 0x640,
UHYVE_PORT_IBV_CREATE_COMP_CHANNEL = 0x641,
UHYVE_PORT_IBV_DESTROY_COMP_CHANNEL = 0x642,
UHYVE_PORT_IBV_CREATE_CQ = 0x643,
UHYVE_PORT_IBV_CREATE_CQ_EX = 0x644,
UHYVE_PORT_IBV_RESIZE_CQ = 0x645,
UHYVE_PORT_IBV_DESTROY_CQ = 0x646,
UHYVE_PORT_IBV_GET_CQ_EVENT = 0x647,
UHYVE_PORT_IBV_ACK_CQ_EVENTS = 0x648,
UHYVE_PORT_IBV_POLL_CQ = 0x649,
UHYVE_PORT_IBV_REQ_NOTIFY_CQ = 0x64A,
UHYVE_PORT_IBV_CREATE_SRQ = 0x64B,
UHYVE_PORT_IBV_CREATE_SRQ_EX = 0x64C,
UHYVE_PORT_IBV_MODIFY_SRQ = 0x64D,
UHYVE_PORT_IBV_QUERY_SRQ = 0x64E,
UHYVE_PORT_IBV_GET_SRQ_NUM = 0x64F,
UHYVE_PORT_IBV_DESTROY_SRQ = 0x650,
UHYVE_PORT_IBV_POST_SRQ_RECV = 0x651,
UHYVE_PORT_IBV_CREATE_QP = 0x652,
UHYVE_PORT_IBV_CREATE_QP_EX = 0x653,
UHYVE_PORT_IBV_QUERY_RT_VALUES_EX = 0x654,
UHYVE_PORT_IBV_QUERY_DEVICE_EX = 0x655,
UHYVE_PORT_IBV_OPEN_QP = 0x656,
UHYVE_PORT_IBV_MODIFY_QP = 0x657,
UHYVE_PORT_IBV_QUERY_QP = 0x658,
UHYVE_PORT_IBV_DESTROY_QP = 0x659,
UHYVE_PORT_IBV_CREATE_WQ = 0x65A,
UHYVE_PORT_IBV_MODIFY_WQ = 0x65B,
UHYVE_PORT_IBV_DESTROY_WQ = 0x65C,
UHYVE_PORT_IBV_CREATE_RWQ_IND_TABLE = 0x65D,
UHYVE_PORT_IBV_DESTROY_RWQ_IND_TABLE = 0x65E,
UHYVE_PORT_IBV_POST_SEND = 0x65F,
UHYVE_PORT_IBV_POST_RECV = 0x660,
UHYVE_PORT_IBV_CREATE_AH = 0x661,
UHYVE_PORT_IBV_INIT_AH_FROM_WC = 0x662,
UHYVE_PORT_IBV_CREATE_AH_FROM_WC = 0x663,
UHYVE_PORT_IBV_DESTROY_AH = 0x664,
UHYVE_PORT_IBV_ATTACH_MCAST = 0x665,
UHYVE_PORT_IBV_DETACH_MCAST = 0x666,
UHYVE_PORT_IBV_FORK_INIT = 0x667,
UHYVE_PORT_IBV_NODE_TYPE_STR = 0x668,
UHYVE_PORT_IBV_PORT_STATE_STR = 0x669,
UHYVE_PORT_IBV_EVENT_TYPE_STR = 0x66A,
// UHYVE_PORT_IBV_RESOLVE_ETH_L2_FROM_GID = 0x66B,
UHYVE_PORT_IBV_IS_QPT_SUPPORTED = 0x66C,
// UHYVE_PORT_KERNEL_IBV_LOG = 0x66F,
UHYVE_PORT_SET_IB_POOL_ADDR = 0x610,
UHYVE_PORT_IBV_WC_STATUS_STR = 0x611,
UHYVE_PORT_IBV_RATE_TO_MULT = 0x612,
UHYVE_PORT_MULT_TO_IBV_RATE = 0x613,
UHYVE_PORT_IBV_RATE_TO_MBPS = 0x614,
UHYVE_PORT_MBPS_TO_IBV_RATE = 0x615,
UHYVE_PORT_IBV_CQ_EX_TO_CQ = 0x616,
UHYVE_PORT_IBV_START_POLL = 0x617,
UHYVE_PORT_IBV_NEXT_POLL = 0x618,
UHYVE_PORT_IBV_END_POLL = 0x619,
UHYVE_PORT_IBV_WC_READ_OPCODE = 0x61A,
UHYVE_PORT_IBV_WC_READ_VENDOR_ERR = 0x61B,
UHYVE_PORT_IBV_WC_READ_BYTE_LEN = 0x61C,
UHYVE_PORT_IBV_WC_READ_IMM_DATA = 0x61D,
UHYVE_PORT_IBV_WC_READ_INVALIDATED_RKEY = 0x61E,
UHYVE_PORT_IBV_WC_READ_QP_NUM = 0x61F,
UHYVE_PORT_IBV_WC_READ_SRC_QP = 0x620,
UHYVE_PORT_IBV_WC_READ_WC_FLAGS = 0x621,
UHYVE_PORT_IBV_WC_READ_SLID = 0x622,
UHYVE_PORT_IBV_WC_READ_SL = 0x623,
UHYVE_PORT_IBV_WC_READ_DLID_PATH_BITS = 0x624,
UHYVE_PORT_IBV_WC_READ_COMPLETION_TS = 0x625,
UHYVE_PORT_IBV_WC_READ_CVLAN = 0x626,
UHYVE_PORT_IBV_WC_READ_FLOW_TAG = 0x627,
UHYVE_PORT_IBV_POST_WQ_RECV = 0x628,
UHYVE_PORT_IBV_GET_DEVICE_LIST = 0x629,
UHYVE_PORT_IBV_FREE_DEVICE_LIST = 0x62A,
UHYVE_PORT_IBV_GET_DEVICE_NAME = 0x62B,
UHYVE_PORT_IBV_GET_DEVICE_GUID = 0x62C,
UHYVE_PORT_IBV_OPEN_DEVICE = 0x62D,
UHYVE_PORT_IBV_CLOSE_DEVICE = 0x62E,
UHYVE_PORT_IBV_GET_ASYNC_EVENT = 0x62F,
UHYVE_PORT_IBV_ACK_ASYNC_EVENT = 0x630,
UHYVE_PORT_IBV_QUERY_DEVICE = 0x631,
UHYVE_PORT_IBV_QUERY_PORT = 0x632,
UHYVE_PORT_IBV_QUERY_GID = 0x633,
UHYVE_PORT_IBV_QUERY_PKEY = 0x634,
UHYVE_PORT_IBV_ALLOC_PD = 0x635,
UHYVE_PORT_IBV_DEALLOC_PD = 0x636,
UHYVE_PORT_IBV_CREATE_FLOW = 0x637,
UHYVE_PORT_IBV_DESTROY_FLOW = 0x638,
UHYVE_PORT_IBV_OPEN_XRCD = 0x639,
UHYVE_PORT_IBV_CLOSE_XRCD = 0x63A,
UHYVE_PORT_IBV_REG_MR = 0x63B,
UHYVE_PORT_IBV_REREG_MR = 0x63C,
UHYVE_PORT_IBV_DEREG_MR = 0x63D,
UHYVE_PORT_IBV_ALLOC_MW = 0x63E,
UHYVE_PORT_IBV_DEALLOC_MW = 0x63F,
UHYVE_PORT_IBV_INC_RKEY = 0x640,
UHYVE_PORT_IBV_BIND_MW = 0x641,
UHYVE_PORT_IBV_CREATE_COMP_CHANNEL = 0x642,
UHYVE_PORT_IBV_DESTROY_COMP_CHANNEL = 0x643,
UHYVE_PORT_IBV_CREATE_CQ = 0x644,
UHYVE_PORT_IBV_CREATE_CQ_EX = 0x645,
UHYVE_PORT_IBV_RESIZE_CQ = 0x646,
UHYVE_PORT_IBV_DESTROY_CQ = 0x647,
UHYVE_PORT_IBV_GET_CQ_EVENT = 0x648,
UHYVE_PORT_IBV_ACK_CQ_EVENTS = 0x649,
UHYVE_PORT_IBV_POLL_CQ = 0x64A,
UHYVE_PORT_IBV_REQ_NOTIFY_CQ = 0x64B,
UHYVE_PORT_IBV_CREATE_SRQ = 0x64C,
UHYVE_PORT_IBV_CREATE_SRQ_EX = 0x64D,
UHYVE_PORT_IBV_MODIFY_SRQ = 0x64E,
UHYVE_PORT_IBV_QUERY_SRQ = 0x64F,
UHYVE_PORT_IBV_GET_SRQ_NUM = 0x650,
UHYVE_PORT_IBV_DESTROY_SRQ = 0x651,
UHYVE_PORT_IBV_POST_SRQ_RECV = 0x652,
UHYVE_PORT_IBV_CREATE_QP = 0x653,
UHYVE_PORT_IBV_CREATE_QP_EX = 0x654,
UHYVE_PORT_IBV_QUERY_RT_VALUES_EX = 0x655,
UHYVE_PORT_IBV_QUERY_DEVICE_EX = 0x656,
UHYVE_PORT_IBV_OPEN_QP = 0x657,
UHYVE_PORT_IBV_MODIFY_QP = 0x658,
UHYVE_PORT_IBV_QUERY_QP = 0x659,
UHYVE_PORT_IBV_DESTROY_QP = 0x65A,
UHYVE_PORT_IBV_CREATE_WQ = 0x65B,
UHYVE_PORT_IBV_MODIFY_WQ = 0x65C,
UHYVE_PORT_IBV_DESTROY_WQ = 0x65D,
UHYVE_PORT_IBV_CREATE_RWQ_IND_TABLE = 0x65E,
UHYVE_PORT_IBV_DESTROY_RWQ_IND_TABLE = 0x65F,
UHYVE_PORT_IBV_POST_SEND = 0x660,
UHYVE_PORT_IBV_POST_RECV = 0x661,
UHYVE_PORT_IBV_CREATE_AH = 0x662,
UHYVE_PORT_IBV_INIT_AH_FROM_WC = 0x663,
UHYVE_PORT_IBV_CREATE_AH_FROM_WC = 0x664,
UHYVE_PORT_IBV_DESTROY_AH = 0x665,
UHYVE_PORT_IBV_ATTACH_MCAST = 0x666,
UHYVE_PORT_IBV_DETACH_MCAST = 0x667,
UHYVE_PORT_IBV_FORK_INIT = 0x668,
UHYVE_PORT_IBV_NODE_TYPE_STR = 0x669,
UHYVE_PORT_IBV_PORT_STATE_STR = 0x66A,
UHYVE_PORT_IBV_EVENT_TYPE_STR = 0x66B,
// UHYVE_PORT_IBV_RESOLVE_ETH_L2_FROM_GID = 0x66C,
UHYVE_PORT_IBV_IS_QPT_SUPPORTED = 0x66D,
} uhyve_ibv_t;
@ -944,4 +959,4 @@ void call_ibv_event_type_str (struct kvm_run * run, uint8_t * guest_me
// void call_ibv_resolve_eth_l2_from_gid(struct kvm_run * run, uint8_t * guest_mem);
void call_ibv_is_qpt_supported (struct kvm_run * run, uint8_t * guest_mem);
#endif // UHYVE_IBV_H
#endif // __UHYVE_IBV_H__

View file

@ -1244,16 +1244,12 @@ static int vcpu_loop(void)
break;
}
// InfiniBand
/* case UHYVE_PORT_KERNEL_IBV_LOG: { */
/* unsigned data = *((unsigned*)((size_t)run+run->io.data_offset)); */
/* char* str = (char*) (guest_mem + data); */
/* printf("KERNEL IBV LOG: %s\n", str); */
/* break; */
/* } */
/*
* Verbs API KVM I/O ports
*/
case UHYVE_PORT_SET_IB_POOL_ADDR: {
// This I/O port is only used once at startup to synchronize the address of the IB memory pool.
unsigned data = *((unsigned*)((size_t)run+run->io.data_offset));
uint64_t * temp = (uint64_t*)(guest_mem + data);
ib_pool_addr = (uint8_t*) *temp;