From patchwork Mon Jan 26 19:03:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 43799 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9E9F820D5D for ; Mon, 26 Jan 2015 19:05:42 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id b13sf5289003wgh.1 for ; Mon, 26 Jan 2015 11:05:41 -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=/hkMyefrJWxNcfG4YnD+lBQGzXSM+Qe924VtcgD9xQ0=; b=Cfkakd2xlcJbTvQ0Vq4AXc6ZATJb4LcO3DoOI3GmTBeWvDSg9Yperbz0hwOhPUuuas I+ZoPDuS3J/6OuumpzKmjOhW4VGlsdQkqkTuBIGt8nt8PkG2Np86AFxmLc8pLviJGEDP Su2RE9eBVDuGRqMroE9/qsTPiYs11MJ+AsuzqiP0fDvA18CYRzt/QeN9QFQ+1KCqxQdd 0sqK75MWSGeoWb0l4AsSW+xGY9VzBXFC8omvCb+XqwalIvToRvjZSmTnljgPPV/Ltyh+ 6G6Qc1B1N499Cnf8uYtVl1oWjokgsv7LCQm1X8VX4uZq4ChZgBrD/05Il3jQPu8wTpSw SrgA== X-Gm-Message-State: ALoCoQn2LoRcmNjvS5YkEZXdOHLA9qkAKBmz8pNm0wzCGfhLWhYvFTDFF1W+7jIIP7jlkldKC2aQ X-Received: by 10.152.37.130 with SMTP id y2mr1508026laj.8.1422299141554; Mon, 26 Jan 2015 11:05:41 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.130 with SMTP id b2ls466627laa.27.gmail; Mon, 26 Jan 2015 11:05:41 -0800 (PST) X-Received: by 10.152.8.1 with SMTP id n1mr548860laa.47.1422299141412; Mon, 26 Jan 2015 11:05:41 -0800 (PST) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id zd4si9794274lbb.75.2015.01.26.11.05.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 26 Jan 2015 11:05:41 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by mail-la0-f46.google.com with SMTP id s18so9421515lam.5 for ; Mon, 26 Jan 2015 11:05:41 -0800 (PST) X-Received: by 10.112.170.36 with SMTP id aj4mr22778525lbc.3.1422299141331; Mon, 26 Jan 2015 11:05:41 -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 h5csp870671lbj; Mon, 26 Jan 2015 11:05:40 -0800 (PST) X-Received: by 10.107.130.209 with SMTP id m78mr19811953ioi.19.1422299135040; Mon, 26 Jan 2015 11:05:35 -0800 (PST) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id vv2si7782527igc.48.2015.01.26.11.05.34 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 26 Jan 2015 11:05:35 -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-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YFoyT-0006VD-Kj; Mon, 26 Jan 2015 19:05:25 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YFoyS-0006Ur-5i for edk2-devel@lists.sourceforge.net; Mon, 26 Jan 2015 19:05:24 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of linaro.org designates 74.125.82.181 as permitted sender) client-ip=74.125.82.181; envelope-from=ard.biesheuvel@linaro.org; helo=mail-we0-f181.google.com; Received: from mail-we0-f181.google.com ([74.125.82.181]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YFoyR-0005gQ-5F for edk2-devel@lists.sourceforge.net; Mon, 26 Jan 2015 19:05:24 +0000 Received: by mail-we0-f181.google.com with SMTP id k48so10868441wev.12 for ; Mon, 26 Jan 2015 11:05:18 -0800 (PST) X-Received: by 10.180.74.205 with SMTP id w13mr22840120wiv.1.1422299118218; Mon, 26 Jan 2015 11:05:18 -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.05.15 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 26 Jan 2015 11:05:17 -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:30 +0000 Message-Id: <1422299011-2409-29-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: 1YFoyR-0005gQ-5F Subject: [edk2] [PATCH v2 28/29] 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.46 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 Signed-off-by: Ard Biesheuvel --- ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c | 23 +++++++++++++++++++++++ ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf | 1 + 2 files changed, 24 insertions(+) diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c b/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c index 34fac40fa803..1ceb85146430 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, "" } }; @@ -332,6 +335,26 @@ InitializeVirtFdtDxe ( } break; + case PropertyTypeXen: + ASSERT (Len == 16); + + // + // Retrieve the reg base from this node and add it to a + // XENIO_PROTOCOL instance installed on a new handle. + // + RegBase = fdt64_to_cpu (((UINT64 *)RegProp)[0]); + Handle = NULL; + Status = XenIoMmioInstall (&Handle, RegBase); + if (EFI_ERROR (Status)) { + DEBUG ((EFI_D_ERROR, "%a: Failed to install XENIO_PROTOCOL on a new handle " + "(Status == %r)\n", __FUNCTION__, Status)); + break; + } + + DEBUG ((EFI_D_INFO, "Found Xen node with Grant table @ 0x%p\n", RegBase)); + + break; + default: break; } diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf b/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf index 1392c7c3fa45..f8a58238c37b 100644 --- a/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf +++ b/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf @@ -41,6 +41,7 @@ FdtLib VirtioMmioDeviceLib HobLib + XenIoMmioLib [Guids] gFdtTableGuid