forked from Minki/linux
6d6dfb4f4a
This patch adds support for virtual IOMMU to the vmci module. We switch to DMA consistent mappings for guest queuepair and doorbell pages that are passed to the device. We still allocate each page individually, since there's no guarantee that we'll get a contiguous block of physical for an entire queuepair (especially since we allow up to 128 MiB!). Also made the split between guest and host in the kernelIf struct much clearer. Now it's obvious which fields are which. Acked-by: George Zhang <georgezhang@vmware.com> Acked-by: Aditya Sarwade <asarwade@vmware.com> Signed-off-by: Andy King <acking@vmware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
58 lines
1.4 KiB
C
58 lines
1.4 KiB
C
/*
|
|
* VMware VMCI Driver
|
|
*
|
|
* Copyright (C) 2012 VMware, Inc. All rights reserved.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the
|
|
* Free Software Foundation version 2 and no later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
* for more details.
|
|
*/
|
|
|
|
#ifndef _VMCI_DRIVER_H_
|
|
#define _VMCI_DRIVER_H_
|
|
|
|
#include <linux/vmw_vmci_defs.h>
|
|
#include <linux/wait.h>
|
|
|
|
#include "vmci_queue_pair.h"
|
|
#include "vmci_context.h"
|
|
|
|
enum vmci_obj_type {
|
|
VMCIOBJ_VMX_VM = 10,
|
|
VMCIOBJ_CONTEXT,
|
|
VMCIOBJ_SOCKET,
|
|
VMCIOBJ_NOT_SET,
|
|
};
|
|
|
|
/* For storing VMCI structures in file handles. */
|
|
struct vmci_obj {
|
|
void *ptr;
|
|
enum vmci_obj_type type;
|
|
};
|
|
|
|
/*
|
|
* Needed by other components of this module. It's okay to have one global
|
|
* instance of this because there can only ever be one VMCI device. Our
|
|
* virtual hardware enforces this.
|
|
*/
|
|
extern struct pci_dev *vmci_pdev;
|
|
|
|
u32 vmci_get_context_id(void);
|
|
int vmci_send_datagram(struct vmci_datagram *dg);
|
|
|
|
int vmci_host_init(void);
|
|
void vmci_host_exit(void);
|
|
bool vmci_host_code_active(void);
|
|
|
|
int vmci_guest_init(void);
|
|
void vmci_guest_exit(void);
|
|
bool vmci_guest_code_active(void);
|
|
u32 vmci_get_vm_context_id(void);
|
|
|
|
#endif /* _VMCI_DRIVER_H_ */
|