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

[UNIKRAFT/BALLOON v2 5/7] plat/linuxu/balloon: Linuxu balloon stubs



From: Cezar Craciunoiu <cezar.craciunoiu@xxxxxxxxx>

The balloon is not implemented for linuxu, but as the original authors
suggested, it could be done with mmap/munmap.

The stubs were kept so the calls in bbuddy do not fail.

Signed-off-by: Cezar Craciunoiu <cezar.craciunoiu@xxxxxxxxx>
---
 plat/linuxu/Makefile.uk |  2 ++
 plat/linuxu/balloon.c   | 61 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+)
 create mode 100644 plat/linuxu/balloon.c

diff --git a/plat/linuxu/Makefile.uk b/plat/linuxu/Makefile.uk
index 94516ac..ce82c5c 100644
--- a/plat/linuxu/Makefile.uk
+++ b/plat/linuxu/Makefile.uk
@@ -36,12 +36,14 @@ LIBLINUXUPLAT_SRCS-y              += 
$(LIBLINUXUPLAT_BASE)/setup.c
 LIBLINUXUPLAT_SRCS-y              += $(LIBLINUXUPLAT_BASE)/console.c
 LIBLINUXUPLAT_SRCS-y              += $(LIBLINUXUPLAT_BASE)/shutdown.c
 LIBLINUXUPLAT_SRCS-y              += $(LIBLINUXUPLAT_BASE)/memory.c
+LIBLINUXUPLAT_SRCS-y              += $(LIBLINUXUPLAT_BASE)/balloon.c
 LIBLINUXUPLAT_SRCS-y              += $(LIBLINUXUPLAT_BASE)/lcpu.c
 LIBLINUXUPLAT_SRCS-y              += $(LIBLINUXUPLAT_BASE)/irq.c
 LIBLINUXUPLAT_SRCS-y              += $(LIBLINUXUPLAT_BASE)/time.c
 LIBLINUXUPLAT_SRCS-y              += $(UK_PLAT_COMMON_BASE)/lcpu.c|common
 LIBLINUXUPLAT_SRCS-y              += $(UK_PLAT_COMMON_BASE)/memory.c|common
 LIBLINUXUPLAT_SRCS-y              += $(LIBLINUXUPLAT_BASE)/io.c
+
 LIBLINUXUPLAT_SRCS-$(CONFIG_ARCH_X86_64) += \
                        $(LIBLINUXUPLAT_BASE)/x86/link64.lds.S
 LIBLINUXUPLAT_SRCS-$(CONFIG_ARCH_ARM_32) += \
diff --git a/plat/linuxu/balloon.c b/plat/linuxu/balloon.c
new file mode 100644
index 0000000..9377ee2
--- /dev/null
+++ b/plat/linuxu/balloon.c
@@ -0,0 +1,61 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * Authors: Cason Schindler & Jack Raney <cason.j.schindler@xxxxxxxxx>
+ *          Cezar Craciunoiu <cezar.craciunoiu@xxxxxxxxx>
+ *
+ * Copyright (c) 2019, The University of Texas at Austin. All rights reserved.
+ *               2020, 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 <errno.h>
+#include <errno.h>
+#include <stddef.h>
+
+#include <uk/plat/balloon.h>
+#include <uk/assert.h>
+
+/* Memory ballooning is not yet supported for linuxu */
+
+int ukplat_inflate(void *va __unused, int order __unused)
+{
+       return -ENOSYS;
+}
+
+int ukplat_deflate(void *va __unused, int order __unused)
+{
+       return -ENOSYS;
+}
+
+/**
+ * Sets behaviour for Linuxu.
+ */
+void ukplat_balloon_set(char *balloon_type)
+{
+       *balloon_type = 0;
+}
-- 
2.20.1




 


Rackspace

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