{"id":289,"url":"http://patchwork.ozlabs.org/api/1.0/patches/289/?format=json","project":{"id":2,"url":"http://patchwork.ozlabs.org/api/1.0/projects/2/?format=json","name":"Linux PPC development","link_name":"linuxppc-dev","list_id":"linuxppc-dev.lists.ozlabs.org","list_email":"linuxppc-dev@lists.ozlabs.org","web_url":"https://github.com/linuxppc/wiki/wiki","scm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git","webscm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/"},"msgid":"<1221546450-15761-3-git-send-email-ehrhardt@linux.vnet.ibm.com>","date":"2008-09-16T06:27:29","name":"kvmppc: add hypercall infrastructure - guest part v3","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":true,"hash":"65d7f722929e6dbf2125d1e61783629b0124cc6a","submitter":{"id":151,"url":"http://patchwork.ozlabs.org/api/1.0/people/151/?format=json","name":null,"email":"ehrhardt@linux.vnet.ibm.com"},"delegate":{"id":47,"url":"http://patchwork.ozlabs.org/api/1.0/users/47/?format=json","username":"hollisb","first_name":"Hollis","last_name":"Blanchard","email":"hollis@penguinppc.org"},"mbox":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1221546450-15761-3-git-send-email-ehrhardt@linux.vnet.ibm.com/mbox/","series":[],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/289/checks/","tags":{},"headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork=ozlabs.org@ozlabs.org>","X-Original-To":["patchwork@ozlabs.org","linuxppc-dev@ozlabs.org"],"Delivered-To":["patchwork@ozlabs.org","linuxppc-dev@ozlabs.org"],"Received":["from ozlabs.org (localhost [127.0.0.1])\n\tby ozlabs.org (Postfix) with ESMTP id 384F0DE379\n\tfor <patchwork@ozlabs.org>; Tue, 16 Sep 2008 16:29:26 +1000 (EST)","from mtagate5.de.ibm.com (mtagate5.de.ibm.com [195.212.29.154])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(Client CN \"mtagate5.de.ibm.com\", Issuer \"Equifax\" (verified OK))\n\tby ozlabs.org (Postfix) with ESMTPS id 9810DDDEEC\n\tfor <linuxppc-dev@ozlabs.org>; Tue, 16 Sep 2008 16:29:04 +1000 (EST)","from d12nrmr1607.megacenter.de.ibm.com\n\t(d12nrmr1607.megacenter.de.ibm.com [9.149.167.49])\n\tby mtagate5.de.ibm.com (8.13.8/8.13.8) with ESMTP id m8G6RwWI675246\n\tfor <linuxppc-dev@ozlabs.org>; Tue, 16 Sep 2008 06:27:58 GMT","from d12av01.megacenter.de.ibm.com (d12av01.megacenter.de.ibm.com\n\t[9.149.165.212])\n\tby d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.1) with\n\tESMTP id m8G6RwVP1786038\n\tfor <linuxppc-dev@ozlabs.org>; Tue, 16 Sep 2008 08:27:58 +0200","from d12av01.megacenter.de.ibm.com (loopback [127.0.0.1])\n\tby d12av01.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP\n\tid m8G6Rt1a025226\n\tfor <linuxppc-dev@ozlabs.org>; Tue, 16 Sep 2008 08:27:55 +0200","from localhost.localdomain (dyn-9-152-198-109.boeblingen.de.ibm.com\n\t[9.152.198.109])\n\tby d12av01.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with\n\tESMTP id m8G6Rsbu024799; Tue, 16 Sep 2008 08:27:54 +0200"],"From":"ehrhardt@linux.vnet.ibm.com","To":"linuxppc-dev@ozlabs.org, kvm-ppc@vger.kernel.org","Subject":"[PATCH 2/3] kvmppc: add hypercall infrastructure - guest part v3","Date":"Tue, 16 Sep 2008 08:27:29 +0200","Message-Id":"<1221546450-15761-3-git-send-email-ehrhardt@linux.vnet.ibm.com>","X-Mailer":"git-send-email 1.5.4.3","In-Reply-To":"<1221546450-15761-1-git-send-email-ehrhardt@linux.vnet.ibm.com>","References":"<1221546450-15761-1-git-send-email-ehrhardt@linux.vnet.ibm.com>","Cc":"hollisb@us.ibm.com","X-BeenThere":"linuxppc-dev@ozlabs.org","X-Mailman-Version":"2.1.11","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List <linuxppc-dev.ozlabs.org>","List-Unsubscribe":"<https://ozlabs.org/mailman/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=unsubscribe>","List-Archive":"<http://ozlabs.org/pipermail/linuxppc-dev>","List-Post":"<mailto:linuxppc-dev@ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@ozlabs.org?subject=help>","List-Subscribe":"<https://ozlabs.org/mailman/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"linuxppc-dev-bounces+patchwork=ozlabs.org@ozlabs.org","Errors-To":"linuxppc-dev-bounces+patchwork=ozlabs.org@ozlabs.org"},"content":"From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>\n\nThis adds the guest portion of the hypercall infrastructure.\n\nVersion 3 now follows the beat ABI, but proposes a new implementation style as\nstatic inline asm functions instead of pure assembler code. That should allow\nthe compiler to be more flexible and therefore a better optimization.\n\nIf people agree on that new implementation style we might merge this code.\nThe current implementation of beat style hypercalls can be found in\narch/powerpc/platforms/cell/beat_hvCall.S\n\nSigned-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>","diff":"diff --git a/include/asm-powerpc/epapr_hcalls.h b/include/asm-powerpc/epapr_hcalls.h\nnew file mode 100644\n--- /dev/null\n+++ b/include/asm-powerpc/epapr_hcalls.h\n@@ -0,0 +1,59 @@\n+/*\n+ * This program is free software; you can redistribute it and/or modify\n+ * it under the terms of the GNU General Public License, version 2, as\n+ * published by the Free Software Foundation.\n+ *\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU General Public License\n+ * along with this program; if not, write to the Free Software\n+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n+ *\n+ * Copyright IBM Corp. 2008\n+ *\n+ * Authors:\n+ * \tChristian Ehrhardt <ehrhardt@de.ibm.com>\n+ */\n+\n+#ifndef __POWERPC_EPAPR_HCALLS_H__\n+#define __POWERPC_EPAPR_HCALLS_H__\n+\n+#ifdef __KERNEL__\n+\n+/* Hypercalls use the beat ABI */\n+#define KVM_HYPERCALL_BIN 0x44000022\n+\n+static inline long epapr_hypercall_1in_1out(unsigned int nr, unsigned long p1)\n+{\n+\tregister unsigned long hcall asm (\"r11\") = nr;\n+\tregister unsigned long arg1_ret asm (\"r3\") = p1;\n+\n+\tasm volatile(\".long %1\"\n+\t\t\t: \"+r\"(arg1_ret)\n+\t\t\t: \"i\"(KVM_HYPERCALL_BIN), \"r\"(hcall)\n+\t\t\t: \"r4\", \"r5\", \"r6\", \"r7\", \"r8\",\n+\t\t\t  \"r9\", \"r10\", \"r12\", \"cc\");\n+\treturn arg1_ret;\n+}\n+\n+static inline long epapr_hypercall_2in_1out(unsigned int nr,\n+\t\t\t\t\tunsigned long p1, unsigned long p2)\n+{\n+\tregister unsigned long hcall asm (\"r11\") = nr;\n+\tregister unsigned long arg1_ret asm (\"r3\") = p1;\n+\tregister unsigned long arg2 asm (\"r4\") = p2;\n+\n+\tasm volatile(\".long %1\"\n+\t\t\t: \"+r\"(arg1_ret)\n+\t\t\t: \"i\"(KVM_HYPERCALL_BIN), \"r\"(hcall), \"r\"(arg2)\n+\t\t\t: \"r5\", \"r6\", \"r7\", \"r8\",\n+\t\t\t  \"r9\", \"r10\", \"r12\", \"cc\");\n+\treturn arg1_ret;\n+}\n+\n+#endif /* __KERNEL__ */\n+\n+#endif /* __POWERPC_EPAPR_HCALLS_H__ */\n","prefixes":[]}