From patchwork Tue Feb 3 19:20:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 44302 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 96F732034D for ; Tue, 3 Feb 2015 19:22:28 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id fb4sf26958842wid.3 for ; Tue, 03 Feb 2015 11:22:27 -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=u9h46UWFaBK+cCBIaQ2qmDFUDgv9mP7JwXl2Y/bXuiI=; b=YLS64rD1ApnNsT+SCrJO3ecaGu8T+hu2TLOgJyubl87fHqWrkff/AC4ZEljiYkTWRV hH2QyPYzcgabRiR0s8Vjk0XMUTrADRiDroy8hVP8f0P8rxENT1fQsB5gJqhmOcrO2YTx l9lUxti/uoI5Y80rtfbEUQbfrMCJFOQpsYyWkDaCrm4UZj7q4YNsN/Ej+E9jnMYTGeEk INMYbtjERfiyPdZw/xwfUw+4J4xQi7rZcf5ZRFBCK9bwIlBE4LGgl9vQdsbwmKplOB4c M9UvD0KFQuYll07qi0EZdeu4gtPIpVVMySJnrhTs01m8Rx6hpnqLLe1MFzsGbLrpVe2Z 06wQ== X-Gm-Message-State: ALoCoQmqjmO45WC14YDtD1QgrlXvHC0DskFGhRqfOGbdVSgtZu9E1YSMVBnZiV7GlHuelt/hGOlR X-Received: by 10.194.204.201 with SMTP id la9mr3356034wjc.6.1422991347920; Tue, 03 Feb 2015 11:22:27 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.2 with SMTP id bc2ls241162lab.13.gmail; Tue, 03 Feb 2015 11:22:27 -0800 (PST) X-Received: by 10.112.185.101 with SMTP id fb5mr26849564lbc.12.1422991347764; Tue, 03 Feb 2015 11:22:27 -0800 (PST) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id ai4si20156095lbc.10.2015.02.03.11.22.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Feb 2015 11:22:27 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id hz20so54116691lab.6 for ; Tue, 03 Feb 2015 11:22:27 -0800 (PST) X-Received: by 10.112.25.104 with SMTP id b8mr26628955lbg.69.1422991347645; Tue, 03 Feb 2015 11:22:27 -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 h5csp34454lbj; Tue, 3 Feb 2015 11:22:26 -0800 (PST) X-Received: by 10.50.78.131 with SMTP id b3mr19807499igx.0.1422991345906; Tue, 03 Feb 2015 11:22:25 -0800 (PST) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id u82si10399438iou.22.2015.02.03.11.22.25 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 03 Feb 2015 11:22:25 -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-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YIj3A-0000Kf-35; Tue, 03 Feb 2015 19:22:16 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YIj38-0000J2-Tx for edk2-devel@lists.sourceforge.net; Tue, 03 Feb 2015 19:22:14 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of linaro.org designates 74.125.82.174 as permitted sender) client-ip=74.125.82.174; envelope-from=ard.biesheuvel@linaro.org; helo=mail-we0-f174.google.com; Received: from mail-we0-f174.google.com ([74.125.82.174]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YIj37-0002Gi-UK for edk2-devel@lists.sourceforge.net; Tue, 03 Feb 2015 19:22:14 +0000 Received: by mail-we0-f174.google.com with SMTP id w55so41522264wes.5 for ; Tue, 03 Feb 2015 11:22:08 -0800 (PST) X-Received: by 10.194.236.200 with SMTP id uw8mr58584355wjc.10.1422991327956; Tue, 03 Feb 2015 11:22:07 -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.22.04 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Feb 2015 11:22:07 -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:11 +0000 Message-Id: <1422991212-9257-27-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> 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 -0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1YIj37-0002Gi-UK Subject: [edk2] [PATCH v3 26/27] ArmVirtualizationPkg/VirtFdtDxe: wire up XenBusDxe to "xen, xen" DT node 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.215.47 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 patchs adds support to VirtFdtDxe for the Xen DT node which contains the base address of the Grant Table. This data is communicated to XenBusDxe using a XENIO_PROTOCOL instance. Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Laszlo Ersek Signed-off-by: Ard Biesheuvel --- .../ArmVirtualizationPkg/ArmVirtualization.dsc.inc | 2 ++ .../ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c | 23 ++++++++++++++++++++++ .../ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf | 1 + 3 files changed, 26 insertions(+) diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualization.dsc.inc b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualization.dsc.inc index f17cd2f5d876..e7a03cd13d3a 100644 --- a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualization.dsc.inc +++ b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualization.dsc.inc @@ -100,6 +100,8 @@ BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf + XenIoMmioLib|OvmfPkg/Library/XenIoMmioLib/XenIoMmioLib.inf + [LibraryClasses.common.SEC] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf ArmPlatformSecExtraActionLib|ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.inf diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c b/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c index 3e8ca8da627e..0064b5e50171 100644 --- a/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c +++ b/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -49,6 +50,7 @@ typedef enum { PropertyTypePsci, PropertyTypeFwCfg, PropertyTypeGicV3, + PropertyTypeXen, } PROPERTY_TYPE; typedef struct { @@ -66,6 +68,7 @@ STATIC CONST PROPERTY CompatibleProperties[] = { { PropertyTypePsci, "arm,psci-0.2" }, { PropertyTypeFwCfg, "qemu,fw-cfg-mmio" }, { PropertyTypeGicV3, "arm,gic-v3" }, + { PropertyTypeXen, "xen,xen" }, { PropertyTypeUnknown, "" } }; @@ -342,6 +345,26 @@ InitializeVirtFdtDxe ( } break; + case PropertyTypeXen: + ASSERT (Len == 16); + + // + // Retrieve the reg base from this node and wire it up to the + // MMIO flavor of the XenBus root device I/O protocol + // + RegBase = fdt64_to_cpu (((UINT64 *)RegProp)[0]); + Handle = NULL; + Status = XenIoMmioInstall (&Handle, RegBase); + if (EFI_ERROR (Status)) { + DEBUG ((EFI_D_ERROR, "%a: XenIoMmioInstall () failed on a new handle " + "(Status == %r)\n", __FUNCTION__, Status)); + break; + } + + DEBUG ((EFI_D_INFO, "Found Xen node with Grant table @ 0x%Lx\n", RegBase)); + + break; + default: break; } diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf b/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf index 2768d7be8093..65eaef693d63 100644 --- a/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf +++ b/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf @@ -41,6 +41,7 @@ FdtLib VirtioMmioDeviceLib HobLib + XenIoMmioLib [Guids] gFdtTableGuid