From patchwork Mon Jan 26 19:03:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 43790 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f200.google.com (mail-we0-f200.google.com [74.125.82.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C05E620D5D for ; Mon, 26 Jan 2015 19:05:08 +0000 (UTC) Received: by mail-we0-f200.google.com with SMTP id m14sf5285216wev.3 for ; Mon, 26 Jan 2015 11:05:08 -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:subject:precedence:reply-to:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=RpNJTdQe9Q5hjxbZh0wzcnUFQmSCmNEbRVQKYTRgBNc=; b=fp9t9nK0+8bKpMjUTUylKzaolbErO3twU+YeZS2Yt2SYt/q9/9nUyr1fTONUPyonxo mYsTJMqT7xkC4I50iyux/8E3LTioM5qQaIx+F+1aERfe1WtUrMnEjsZaQCryZM43ofxk sCGD9U8MSeiH4Qqhv26TXVrpH0WG+2EYNlQi+rgO6oMbp2+tNUx4NUNqxIMZdZ7a3U+T FvHh7qfmqM0vURXR2AIUXpIyLPHSRQBW7PavTnF0yiFXUAud7AWwvoX5/DvJtp/UOYfk Y3Dy2HXBk4czsRbIO95Xkm1thT0yR1iFm5kLr22gdJ8IXQZlWomEgpkQSwNnL7k5qOS6 yOIA== X-Gm-Message-State: ALoCoQnDxjbuqOC1/7rwujTumWKcnrv88nm/chJpEg/0H5vzOeU8nqaAwd62f1kKoW1DCyK4thGA X-Received: by 10.112.140.65 with SMTP id re1mr2309040lbb.4.1422299108047; Mon, 26 Jan 2015 11:05:08 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.239.165 with SMTP id vt5ls514075lac.0.gmail; Mon, 26 Jan 2015 11:05:07 -0800 (PST) X-Received: by 10.152.45.4 with SMTP id i4mr23188990lam.74.1422299107918; Mon, 26 Jan 2015 11:05:07 -0800 (PST) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id v6si554158laj.52.2015.01.26.11.05.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 26 Jan 2015 11:05:07 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id w7so9276531lbi.1 for ; Mon, 26 Jan 2015 11:05:07 -0800 (PST) X-Received: by 10.112.181.41 with SMTP id dt9mr204070lbc.56.1422299107821; Mon, 26 Jan 2015 11:05:07 -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 h5csp870482lbj; Mon, 26 Jan 2015 11:05:06 -0800 (PST) X-Received: by 10.42.94.79 with SMTP id a15mr22159759icn.30.1422299106224; Mon, 26 Jan 2015 11:05:06 -0800 (PST) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id be4si8487527icc.95.2015.01.26.11.05.05 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 26 Jan 2015 11:05:06 -0800 (PST) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YFoy0-00032U-4o; Mon, 26 Jan 2015 19:04:56 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YFoxz-00032G-2Z for edk2-devel@lists.sourceforge.net; Mon, 26 Jan 2015 19:04:55 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of linaro.org designates 74.125.82.50 as permitted sender) client-ip=74.125.82.50; envelope-from=ard.biesheuvel@linaro.org; helo=mail-wg0-f50.google.com; Received: from mail-wg0-f50.google.com ([74.125.82.50]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YFoxy-0007Cl-SQ for edk2-devel@lists.sourceforge.net; Mon, 26 Jan 2015 19:04:56 +0000 Received: by mail-wg0-f50.google.com with SMTP id b13so10732157wgh.9 for ; Mon, 26 Jan 2015 11:04:50 -0800 (PST) X-Received: by 10.180.79.65 with SMTP id h1mr15748870wix.59.1422299088515; Mon, 26 Jan 2015 11:04:48 -0800 (PST) Received: from ards-macbook-pro.local ([197.129.8.190]) by mx.google.com with ESMTPSA id fo17sm15471007wjc.19.2015.01.26.11.04.44 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 26 Jan 2015 11:04:47 -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 Date: Mon, 26 Jan 2015 19:03:21 +0000 Message-Id: <1422299011-2409-20-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1422299011-2409-1-git-send-email-ard.biesheuvel@linaro.org> References: <1422299011-2409-1-git-send-email-ard.biesheuvel@linaro.org> X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1YFoxy-0007Cl-SQ Subject: [edk2] [PATCH v2 19/29] Ovmf/Xen: introduce XENIO_PROTOCOL X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net 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.170 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 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 Signed-off-by: Ard Biesheuvel --- OvmfPkg/Include/Protocol/XenIo.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ OvmfPkg/OvmfPkg.dec | 1 + 2 files changed, 49 insertions(+) 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