From patchwork Mon Jul 15 11:11:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Bhushan X-Patchwork-Id: 2827410 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3EA899F967 for ; Mon, 15 Jul 2013 11:18:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26B6E20155 for ; Mon, 15 Jul 2013 11:18:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3557C2010C for ; Mon, 15 Jul 2013 11:18:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755556Ab3GOLS0 (ORCPT ); Mon, 15 Jul 2013 07:18:26 -0400 Received: from va3ehsobe010.messaging.microsoft.com ([216.32.180.30]:32125 "EHLO va3outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755362Ab3GOLSZ (ORCPT ); Mon, 15 Jul 2013 07:18:25 -0400 Received: from mail101-va3-R.bigfish.com (10.7.14.229) by VA3EHSOBE001.bigfish.com (10.7.40.21) with Microsoft SMTP Server id 14.1.225.22; Mon, 15 Jul 2013 11:18:24 +0000 Received: from mail101-va3 (localhost [127.0.0.1]) by mail101-va3-R.bigfish.com (Postfix) with ESMTP id E02FE2C0083; Mon, 15 Jul 2013 11:18:24 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 3 X-BigFish: VS3(zzzz1f42h1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6h1082kzz18602eh8275bh8275dhz2dh2a8h668h839he5bhf0ah107ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1d0ch1d2eh1d3fh1dfeh1dffh1e1dh1e23h1155h) Received: from mail101-va3 (localhost.localdomain [127.0.0.1]) by mail101-va3 (MessageSwitch) id 1373887102224241_4736; Mon, 15 Jul 2013 11:18:22 +0000 (UTC) Received: from VA3EHSMHS006.bigfish.com (unknown [10.7.14.250]) by mail101-va3.bigfish.com (Postfix) with ESMTP id 2462B22005D; Mon, 15 Jul 2013 11:18:22 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS006.bigfish.com (10.7.99.16) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 15 Jul 2013 11:18:20 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server (TLS) id 14.3.136.1; Mon, 15 Jul 2013 11:20:35 +0000 Received: from freescale.com ([10.232.15.72]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with SMTP id r6FBIEJR020561; Mon, 15 Jul 2013 04:18:15 -0700 Received: by freescale.com (sSMTP sendmail emulation); Mon, 15 Jul 2013 16:41:27 +0530 From: Bharat Bhushan To: , , , , CC: Bharat Bhushan , Bharat Bhushan Subject: [PATCH 1/5] powerpc: define ePAPR hcall exit interface Date: Mon, 15 Jul 2013 16:41:15 +0530 Message-ID: <1373886679-19581-2-git-send-email-Bharat.Bhushan@freescale.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1373886679-19581-1-git-send-email-Bharat.Bhushan@freescale.com> References: <1373886679-19581-1-git-send-email-Bharat.Bhushan@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch defines the ePAPR hcall exit interface to guest user space. Signed-off-by: Bharat Bhushan --- Documentation/virtual/kvm/api.txt | 20 ++++++++++++++++++++ include/uapi/linux/kvm.h | 7 +++++++ 2 files changed, 27 insertions(+), 0 deletions(-) diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 66dd2aa..054f2f4 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -2597,6 +2597,26 @@ The possible hypercalls are defined in the Power Architecture Platform Requirements (PAPR) document available from www.power.org (free developer registration required to access it). + /* KVM_EXIT_EPAPR_HCALL */ + struct { + __u64 nr; + __u64 ret; + __u64 args[8]; + } epapr_hcall; + +This is used on PowerPC platforms that support ePAPR hcalls. +It occurs when a guest does a hypercall (as defined +in the ePAPR 1.1) and the hcall is not handled by the kernel. + +The 'nr' field contains the hypercall number (from the guest R11), +and 'args' contains the arguments (from the guest R3 - R10). +Userspace should put the return code in 'ret' and any extra returned +values in args[]. If the VM is not in 64-bit mode KVM zeros +the upper half of each field in the struct. + +As per the ePAPR hcall ABI, the return value is returned to +the guest in R3 and output return values in R4 - R10. + /* KVM_EXIT_S390_TSCH */ struct { __u16 subchannel_id; diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index acccd08..01ee50e 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -171,6 +171,7 @@ struct kvm_pit_config { #define KVM_EXIT_WATCHDOG 21 #define KVM_EXIT_S390_TSCH 22 #define KVM_EXIT_EPR 23 +#define KVM_EXIT_EPAPR_HCALL 24 /* For KVM_EXIT_INTERNAL_ERROR */ /* Emulate instruction failed. */ @@ -288,6 +289,12 @@ struct kvm_run { __u64 ret; __u64 args[9]; } papr_hcall; + /* KVM_EXIT_EPAPR_HCALL */ + struct { + __u64 nr; + __u64 ret; + __u64 args[8]; + } epapr_hcall; /* KVM_EXIT_S390_TSCH */ struct { __u16 subchannel_id;