From patchwork Tue Feb 3 19:20:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 44309 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ABD332034D for ; Tue, 3 Feb 2015 19:23:25 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id ge10sf22244051lab.1 for ; Tue, 03 Feb 2015 11:23:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=pglyaD6hZJ37BO6z7fb1DF73k4B93P0V3vnCUCq32mc=; b=F5QYqomiseERPLX6uPev7hsGOgSmuSwZbuFURRd+7OpSs6OMEjWfzVGWt/Algc3xOj 80DQyRP2eB+1rSJv0/2y8ifUaI3BsCOgD7ah5ZWm28DuIfHzeSkv/mtimSLmtVsZhKt1 DRAwYdahKZSYN1z747o7wwz2E0GSlueoVzW9ZvXjsHMG7tbmuS0mu//GA79u2uR7m9mN 4yGVox8jZy0BhEiVpVuh9EGLbVAnR0fbybtWqt8cV65W6qQ3tDlKA/CFGQVdyrYjeBBe iC5CPFhozNguAm0gnrzDt4JAny2klFiEaPOHb9D6TI3h8+W/IKWXfVM5TQ8q2KgRPVB4 hcnQ== X-Gm-Message-State: ALoCoQnXEcTwm5LrAq+0/WCdGqrqsAO/p14CTeriTAfCAlJEJhVT7heouEQy0qX8PuVrpuJQN5hK X-Received: by 10.180.108.197 with SMTP id hm5mr2202711wib.4.1422991404659; Tue, 03 Feb 2015 11:23:24 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.232 with SMTP id t8ls765466laj.100.gmail; Tue, 03 Feb 2015 11:23:24 -0800 (PST) X-Received: by 10.112.110.103 with SMTP id hz7mr26851075lbb.62.1422991404499; Tue, 03 Feb 2015 11:23:24 -0800 (PST) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id t2si20089028lal.88.2015.02.03.11.23.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Feb 2015 11:23:24 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by mail-lb0-f176.google.com with SMTP id z12so40436315lbi.7 for ; Tue, 03 Feb 2015 11:23:24 -0800 (PST) X-Received: by 10.112.176.236 with SMTP id cl12mr7460826lbc.3.1422991404381; Tue, 03 Feb 2015 11:23:24 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp34941lbj; Tue, 3 Feb 2015 11:23:23 -0800 (PST) X-Received: by 10.194.185.68 with SMTP id fa4mr56396908wjc.111.1422991390325; Tue, 03 Feb 2015 11:23:10 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id d8si12796301wjf.115.2015.02.03.11.23.09 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 03 Feb 2015 11:23:10 -0800 (PST) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YIj2g-000591-3K; Tue, 03 Feb 2015 19:21:46 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YIj2e-00055m-0d for xen-devel@lists.xen.org; Tue, 03 Feb 2015 19:21:44 +0000 Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id D3/D9-03170-7CF11D45; Tue, 03 Feb 2015 19:21:43 +0000 X-Env-Sender: ard.biesheuvel@linaro.org X-Msg-Ref: server-5.tower-27.messagelabs.com!1422991302!7961499!1 X-Originating-IP: [74.125.82.45] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.13.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 27579 invoked from network); 3 Feb 2015 19:21:42 -0000 Received: from mail-wg0-f45.google.com (HELO mail-wg0-f45.google.com) (74.125.82.45) by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 3 Feb 2015 19:21:42 -0000 Received: by mail-wg0-f45.google.com with SMTP id x12so46425521wgg.4 for ; Tue, 03 Feb 2015 11:21:42 -0800 (PST) X-Received: by 10.180.80.163 with SMTP id s3mr37023280wix.59.1422991294251; Tue, 03 Feb 2015 11:21:34 -0800 (PST) Received: from ards-macbook-pro.local (73.233.28.37.rev.vodafone.pt. [37.28.233.73]) by mx.google.com with ESMTPSA id eb7sm25860139wic.11.2015.02.03.11.21.31 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Feb 2015 11:21:33 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.sourceforge.net, lersek@redhat.com, olivier.martin@arm.com, roy.franz@linaro.org, leif.lindholm@linaro.org, stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, anthony.perard@citrix.com, christoffer.dall@linaro.org, xen-devel@lists.xen.org, ilias.biris@linaro.org, julien.grall@linaro.org Date: Tue, 3 Feb 2015 19:20:02 +0000 Message-Id: <1422991212-9257-18-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1422991212-9257-1-git-send-email-ard.biesheuvel@linaro.org> References: <1422991212-9257-1-git-send-email-ard.biesheuvel@linaro.org> Cc: Ard Biesheuvel Subject: [Xen-devel] [PATCH v3 17/27] Ovmf/Xen: introduce XENIO_PROTOCOL X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: This introduces the abstract XENIO_PROTOCOL that will be used to communicate the Xen grant table address to drivers supporting this protocol. Primary purpose is allowing us to change the XenBusDxe implementation so that it can support non-PCI Xen implementations such as Xen on ARM. Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Laszlo Ersek Signed-off-by: Ard Biesheuvel --- OvmfPkg/Include/Protocol/XenIo.h | 48 ++++++++++++++++++++++++++++++++++++++++ OvmfPkg/OvmfPkg.dec | 1 + 2 files changed, 49 insertions(+) create mode 100644 OvmfPkg/Include/Protocol/XenIo.h diff --git a/OvmfPkg/Include/Protocol/XenIo.h b/OvmfPkg/Include/Protocol/XenIo.h new file mode 100644 index 000000000000..510391f3b3e8 --- /dev/null +++ b/OvmfPkg/Include/Protocol/XenIo.h @@ -0,0 +1,48 @@ +/** @file + XenIo protocol to abstract arch specific details + + The Xen implementations for the Intel and ARM archictures differ in the way + the base address of the grant table is communicated to the guest. The former + uses a virtual PCI device, while the latter uses a device tree node. + In order to allow the XenBusDxe UEFI driver to be reused for the non-PCI + Xen implementation, this abstract protocol can be installed on a handle + with the appropriate base address. + + Copyright (C) 2014, Linaro Ltd. + + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __PROTOCOL_XENIO_H__ +#define __PROTOCOL_XENIO_H__ + +#include + +#define XENIO_PROTOCOL_GUID \ + {0x6efac84f, 0x0ab0, 0x4747, {0x81, 0xbe, 0x85, 0x55, 0x62, 0x59, 0x04, 0x49}} + +/// +/// Forward declaration +/// +typedef struct _XENIO_PROTOCOL XENIO_PROTOCOL; + +/// +/// Protocol structure +/// +struct _XENIO_PROTOCOL { + // + // Protocol data fields + // + EFI_PHYSICAL_ADDRESS GrantTableAddress; +}; + +extern EFI_GUID gXenIoProtocolGuid; + +#endif diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec index 30a9fb1e9b42..3711fa922311 100644 --- a/OvmfPkg/OvmfPkg.dec +++ b/OvmfPkg/OvmfPkg.dec @@ -58,6 +58,7 @@ gVirtioDeviceProtocolGuid = {0xfa920010, 0x6785, 0x4941, {0xb6, 0xec, 0x49, 0x8c, 0x57, 0x9f, 0x16, 0x0a}} gBlockMmioProtocolGuid = {0x6b558ce3, 0x69e5, 0x4c67, {0xa6, 0x34, 0xf7, 0xfe, 0x72, 0xad, 0xbe, 0x84}} gXenBusProtocolGuid = {0x3d3ca290, 0xb9a5, 0x11e3, {0xb7, 0x5d, 0xb8, 0xac, 0x6f, 0x7d, 0x65, 0xe6}} + gXenIoProtocolGuid = {0x6efac84f, 0x0ab0, 0x4747, {0x81, 0xbe, 0x85, 0x55, 0x62, 0x59, 0x04, 0x49}} [PcdsFixedAtBuild] gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|0x0|UINT32|0