From patchwork Tue Feb 24 18:03:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 44985 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4694C2029F for ; Tue, 24 Feb 2015 18:07:10 +0000 (UTC) Received: by wghk14 with SMTP id k14sf5293704wgh.0 for ; Tue, 24 Feb 2015 10:07:09 -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=lcZL17auzGrKwGV84Acyry5fa+/JlAs3kTb7u2WJWtg=; b=lJdnNYQQZZPei89TMEupi98PnetrIuYPT/Ea7+8Vq3+nc8B4hEcMxmBeCNFmeZuJ9I m9iZYXElcn9KDEXS5esAnr5H2AMe2PkDdC0/J3Cow+tNKSDthX0xVy/EdYYng+UpOZO8 S9e9XRvgHvDTa4PzFYEjic1g1vJ3OF3YI8GypKpeBt5cikuxNkuc7ajIuEACKAny01cd 1mzQElE1ebwSJgOWSA/aZ7O82+SDGvXQLhzMa3t2GREslMF7SURbEQuAmyp6jWwvR/ew F++mnYEVqV0qRsjeWEAznrkXHllJCNFyL4+y0voiK8wCnC7g6lbE7CWfYMfcuPOmeqni qV8w== X-Gm-Message-State: ALoCoQkDm9KBoCfBRuFJT101zLx2o0DU2cBM6QC4yCSy7fkziEjqjKM91JxKRMiJ+j7FUCEp5qDR X-Received: by 10.180.80.35 with SMTP id o3mr2325416wix.0.1424801229582; Tue, 24 Feb 2015 10:07:09 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.115.207 with SMTP id jq15ls713761lab.107.gmail; Tue, 24 Feb 2015 10:07:09 -0800 (PST) X-Received: by 10.153.8.135 with SMTP id dk7mr15166020lad.93.1424801229420; Tue, 24 Feb 2015 10:07:09 -0800 (PST) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id e3si24480641lab.136.2015.02.24.10.07.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Feb 2015 10:07:09 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by labhv19 with SMTP id hv19so4886763lab.10 for ; Tue, 24 Feb 2015 10:07:09 -0800 (PST) X-Received: by 10.152.21.201 with SMTP id x9mr4685111lae.72.1424801229324; Tue, 24 Feb 2015 10:07:09 -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 h5csp2079701lbj; Tue, 24 Feb 2015 10:07:08 -0800 (PST) X-Received: by 10.52.178.201 with SMTP id da9mr17070052vdc.90.1424801227418; Tue, 24 Feb 2015 10:07:07 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id cy8si12415024vdc.45.2015.02.24.10.07.06 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 24 Feb 2015 10:07:07 -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 1YQJrI-0002ss-NB; Tue, 24 Feb 2015 18:05:24 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YQJrG-0002pM-Ia for xen-devel@lists.xen.org; Tue, 24 Feb 2015 18:05:23 +0000 Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id F7/95-02991-16DBCE45; Tue, 24 Feb 2015 18:05:21 +0000 X-Env-Sender: ard.biesheuvel@linaro.org X-Msg-Ref: server-8.tower-206.messagelabs.com!1424801121!11074700!1 X-Originating-IP: [209.85.212.180] 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 26974 invoked from network); 24 Feb 2015 18:05:21 -0000 Received: from mail-wi0-f180.google.com (HELO mail-wi0-f180.google.com) (209.85.212.180) by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 24 Feb 2015 18:05:21 -0000 Received: by mail-wi0-f180.google.com with SMTP id h11so27163361wiw.1 for ; Tue, 24 Feb 2015 10:05:21 -0800 (PST) X-Received: by 10.180.208.74 with SMTP id mc10mr32993464wic.38.1424801121073; Tue, 24 Feb 2015 10:05:21 -0800 (PST) Received: from ards-macbook-pro.lan (bl11-65-113.dsl.telepac.pt. [85.244.65.113]) by mx.google.com with ESMTPSA id w8sm12792521wja.4.2015.02.24.10.05.16 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 24 Feb 2015 10:05:19 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.sourceforge.net, olivier.martin@arm.com, lersek@redhat.com, roy.franz@linaro.org, leif.lindholm@linaro.org, stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, anthony.perard@citrix.com, xen-devel@lists.xen.org, julien.grall@linaro.org, jordan.l.justen@intel.com, michael.d.kinney@intel.com Date: Tue, 24 Feb 2015 18:03:00 +0000 Message-Id: <1424800990-15777-20-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1424800990-15777-1-git-send-email-ard.biesheuvel@linaro.org> References: <1424800990-15777-1-git-send-email-ard.biesheuvel@linaro.org> Cc: wei.liu2@citrix.com, Ard Biesheuvel Subject: [Xen-devel] [PATCH v5 19/29] 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.215.44 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 Reviewed-by: Anthony PERARD 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