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

[Minios-devel] [UNIKRAFT PATCH v2 1/5] plat/drivers: Virtio 9P driver skeleton


  • To: "minios-devel@xxxxxxxxxxxxx" <minios-devel@xxxxxxxxxxxxx>
  • From: Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
  • Date: Sat, 7 Sep 2019 09:45:28 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=stud.acs.upb.ro; dmarc=pass action=none header.from=stud.acs.upb.ro; dkim=pass header.d=stud.acs.upb.ro; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Gz9WhC63QL5I/dIJhCB+hPvyIz/dl8FtmmUdBEnzEjU=; b=WazXhKmefa7P293cm068cTYPsn7yxJgWxZiL+Y5QkhoXTfF0ZyXShiNlStovKOR6cIQLEdUZDtVgM3HcwxPmrSsVynwqLDBzNsDSyurmW7Kbkp4BHbG0ZuJScCHpqgmIuJ30o+GOPvvDpn1WagIj8fSvo48cfmOFj7lmBbg+vKJMaKP65c7Gs0a67DfHypT4ufYRh285NUG3t0wKH2d7eYtdH0oQPd1x3a/8eTUCyNRqw4W7kkWIqQM95lAHCD1YhFbw6bkN4rpw2eoH1jIvw8r+EovDFbATskevmaungIg89yLfRJV35IEpftKuL8zxshIQd0TnlFFCouSCkdaAdQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IiYGDkaK46fTJHU7ndat4Ue+n+G7XWq6y6cMGS6++xHQEbPgrTczVYPpNIA33MLqeYwGS+W7yxNvqYmPblUzPAB9ICw31GCFmwciuPvIENgn643QoRKXWlD+e2F6VxhWWMHX9L22I+Z0M5y6ZHQ4Z5XfMhmJYiOrajfDF373EZhFBi2pRStUy2boIv6ZRNV7kvNbZseLrKCXpVpU/70iemI3fROpKkigVNYHKcbXwK4lZVx6m6YrCJbcn8y7gqpL6tWBlWaHnYUQm0B9dwIPme7D5w6P8XXR4FRx5NQySHBsSNBANlcGMlTv3wNqwMRZahXQE7/W+OlqvXf8gcrkxw==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=vlad_andrei.badoiu@xxxxxxxxxxxxxxx;
  • Cc: "costin.lupu@xxxxxxxxx" <costin.lupu@xxxxxxxxx>, Cristian Banu <cristb@xxxxxxxxx>
  • Delivery-date: Sat, 07 Sep 2019 09:45:38 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Thread-index: AQHVZWD7Awi+Vh47RUigGoC3bvO8hg==
  • Thread-topic: [UNIKRAFT PATCH v2 1/5] plat/drivers: Virtio 9P driver skeleton

From: Cristian Banu <cristb@xxxxxxxxx>

This patch adds the virtio 9P driver skeleton.

Signed-off-by: Cristian Banu <cristb@xxxxxxxxx>
---
 plat/drivers/include/virtio/virtio_9p.h | 44 +++++++++++++++++++
 plat/drivers/virtio/virtio_9p.c         | 58 +++++++++++++++++++++++++
 plat/kvm/Config.uk                      |  9 ++++
 plat/kvm/Makefile.uk                    | 13 ++++++
 4 files changed, 124 insertions(+)
 create mode 100644 plat/drivers/include/virtio/virtio_9p.h
 create mode 100644 plat/drivers/virtio/virtio_9p.c

diff --git a/plat/drivers/include/virtio/virtio_9p.h 
b/plat/drivers/include/virtio/virtio_9p.h
new file mode 100644
index 00000000..5459a397
--- /dev/null
+++ b/plat/drivers/include/virtio/virtio_9p.h
@@ -0,0 +1,44 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * Authors: Cristian Banu <cristb@xxxxxxxxx>
+ *
+ * Copyright (c) 2019, University Politehnica of Bucharest. All rights 
reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the copyright holder nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * 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 COPYRIGHT HOLDER 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.
+ *
+ * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY.
+ */
+
+#ifndef __PLAT_DRV_VIRTIO_9P_H
+#define __PLAT_DRV_VIRTIO_9P_H
+#include <uk/config.h>
+#include <uk/arch/types.h>
+
+#include <virtio/virtio_ids.h>
+#include <virtio/virtio_config.h>
+#include <virtio/virtio_types.h>
+
+#endif /* __PLAT_DRV_VIRTIO_9P_H */
diff --git a/plat/drivers/virtio/virtio_9p.c b/plat/drivers/virtio/virtio_9p.c
new file mode 100644
index 00000000..855548fe
--- /dev/null
+++ b/plat/drivers/virtio/virtio_9p.c
@@ -0,0 +1,58 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * Authors: Cristian Banu <cristb@xxxxxxxxx>
+ *
+ * Copyright (c) 2019, University Politehnica of Bucharest. All rights 
reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the copyright holder nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * 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 COPYRIGHT HOLDER 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.
+ *
+ * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY.
+ */
+
+#include <virtio/virtio_bus.h>
+#include <virtio/virtio_9p.h>
+
+static int virtio_9p_add_dev(struct virtio_dev *vdev __unused)
+{
+       return 0;
+}
+
+static int virtio_9p_drv_init(struct uk_alloc *drv_allocator __unused)
+{
+       return 0;
+}
+
+static const struct virtio_dev_id v9p_dev_id[] = {
+       {VIRTIO_ID_9P},
+       {VIRTIO_ID_INVALID} /* List Terminator */
+};
+
+static struct virtio_driver v9p_drv = {
+       .dev_ids = v9p_dev_id,
+       .init    = virtio_9p_drv_init,
+       .add_dev = virtio_9p_add_dev
+};
+VIRTIO_BUS_REGISTER_DRIVER(&v9p_drv);
diff --git a/plat/kvm/Config.uk b/plat/kvm/Config.uk
index 28fb7b8b..c4ad65ec 100644
--- a/plat/kvm/Config.uk
+++ b/plat/kvm/Config.uk
@@ -79,6 +79,15 @@ config VIRTIO_NET
        select LIBUKSGLIST
        help
               Virtual network driver.
+
+config VIRTIO_9P
+       bool "Virtio 9P device"
+       default n
+       depends on LIBUK9P
+       select VIRTIO_BUS
+       select LIBUKSGLIST
+       help
+              Virtio 9P driver.
 endmenu
 
 config LIBGICV2
diff --git a/plat/kvm/Makefile.uk b/plat/kvm/Makefile.uk
index f6cc2d19..68bcfd95 100644
--- a/plat/kvm/Makefile.uk
+++ b/plat/kvm/Makefile.uk
@@ -10,6 +10,7 @@ $(eval $(call addplatlib,kvm,libkvmplat))
 $(eval $(call addplatlib_s,kvm,libkvmpci,$(CONFIG_KVM_PCI)))
 $(eval $(call addplatlib_s,kvm,libkvmvirtio,$(CONFIG_VIRTIO_BUS)))
 $(eval $(call addplatlib_s,kvm,libkvmvirtionet,$(CONFIG_VIRTIO_NET)))
+$(eval $(call addplatlib_s,kvm,libkvmvirtio9p,$(CONFIG_VIRTIO_9P)))
 $(eval $(call addplatlib_s,kvm,libkvmofw,$(CONFIG_LIBOFW)))
 $(eval $(call addplatlib_s,kvm,libkvmgicv2,$(CONFIG_LIBGICV2)))
 
@@ -129,6 +130,18 @@ LIBKVMVIRTIONET_CINCLUDES-y    += 
-I$(UK_PLAT_DRIVERS_BASE)/include
 LIBKVMVIRTIONET_SRCS-y +=\
                        $(UK_PLAT_DRIVERS_BASE)/virtio/virtio_net.c
 
+##
+## Virtio 9P library definition
+##
+LIBKVMVIRTIO9P_ASINCLUDES-y   += -I$(LIBKVMPLAT_BASE)/include
+LIBKVMVIRTIO9P_CINCLUDES-y    += -I$(LIBKVMPLAT_BASE)/include
+LIBKVMVIRTIO9P_ASINCLUDES-y   += -I$(UK_PLAT_COMMON_BASE)/include
+LIBKVMVIRTIO9P_CINCLUDES-y    += -I$(UK_PLAT_COMMON_BASE)/include
+LIBKVMVIRTIO9P_ASINCLUDES-y   += -I$(UK_PLAT_DRIVERS_BASE)/include
+LIBKVMVIRTIO9P_CINCLUDES-y    += -I$(UK_PLAT_DRIVERS_BASE)/include
+LIBKVMVIRTIO9P_SRCS-y +=\
+                       $(UK_PLAT_DRIVERS_BASE)/virtio/virtio_9p.c
+
 ##
 ## OFW library definitions
 ##
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.