From patchwork Thu Feb 12 11:19:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 44620 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0575C2151D for ; Thu, 12 Feb 2015 11:21:10 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id z11sf6116680lbi.2 for ; Thu, 12 Feb 2015 03:21: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: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=99MoZ/GeRJWyIgnsojt0eBU8DSJPYj/S9U4Iqnm96eI=; b=VrHA8hctOtfU6BBBQ4NKkUOMcRlm3e/aOUm3Ac8WMRQ00tSqt+m9eyLGhd4Q5yUm0G aDCCWV+yk9eDVCDHhvHf2QeZfEhGwSHJvZ4A5rpRJd44eQqrkEl+0zaT+bLHoZRlS5nI L6S2o8D7xX9yCOZAMYTEolqHa8QJz4Ndq+OhrlbYUlLA7WCfe30stHpx3tADsWwz0fww yroQad+CSDcfHYJlw0DlHX8YzUZo1ZjRfA1w6/lrG2a1Da+1RNQS7VtFTMAjyKIpsEaL eS4oNNBTZYHSmtpHiiwkmhW9xJLY+UeOStLrHnva81GPEPkumHgqHPOmV4ic8BlDTCZI uR+A== X-Gm-Message-State: ALoCoQnZR4sQu6s8Ifjzm/6TCD6MSZTfpapvNiV5bTv4BGvAHJ4wt/3juiqVWY6VW0jewQ1z0cRr X-Received: by 10.180.80.7 with SMTP id n7mr405467wix.0.1423740069014; Thu, 12 Feb 2015 03:21:09 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.232 with SMTP id t8ls178433laj.100.gmail; Thu, 12 Feb 2015 03:21:08 -0800 (PST) X-Received: by 10.112.138.233 with SMTP id qt9mr2847326lbb.44.1423740068777; Thu, 12 Feb 2015 03:21:08 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id ji10si2727866lbc.54.2015.02.12.03.21.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Feb 2015 03:21:08 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id z11so8845209lbi.8 for ; Thu, 12 Feb 2015 03:21:08 -0800 (PST) X-Received: by 10.112.56.139 with SMTP id a11mr2685480lbq.36.1423740068662; Thu, 12 Feb 2015 03:21:08 -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 h5csp378609lbj; Thu, 12 Feb 2015 03:21:07 -0800 (PST) X-Received: by 10.50.79.230 with SMTP id m6mr3020658igx.33.1423740066714; Thu, 12 Feb 2015 03:21:06 -0800 (PST) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id u3si3895654icx.93.2015.02.12.03.21.06 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 12 Feb 2015 03:21: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-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YLrpI-0000sA-PO; Thu, 12 Feb 2015 11:20:56 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YLrpH-0000rr-40 for edk2-devel@lists.sourceforge.net; Thu, 12 Feb 2015 11:20:55 +0000 Received-SPF: pass (sog-mx-4.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.220.46 as permitted sender) client-ip=209.85.220.46; envelope-from=ard.biesheuvel@linaro.org; helo=mail-pa0-f46.google.com; Received: from mail-pa0-f46.google.com ([209.85.220.46]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YLrpF-0002Xf-K9 for edk2-devel@lists.sourceforge.net; Thu, 12 Feb 2015 11:20:55 +0000 Received: by mail-pa0-f46.google.com with SMTP id bj1so10858624pad.5 for ; Thu, 12 Feb 2015 03:20:48 -0800 (PST) X-Received: by 10.66.219.233 with SMTP id pr9mr3314611pac.8.1423740047945; Thu, 12 Feb 2015 03:20:47 -0800 (PST) Received: from ards-macbook-pro.local ([210.177.145.249]) by mx.google.com with ESMTPSA id n4sm3554887pdl.12.2015.02.12.03.20.44 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Feb 2015 03:20:47 -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, feng.tian@intel.com Date: Thu, 12 Feb 2015 19:19:09 +0800 Message-Id: <1423739961-5945-18-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1423739961-5945-1-git-send-email-ard.biesheuvel@linaro.org> References: <1423739961-5945-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: 1YLrpF-0002Xf-K9 Subject: [edk2] [PATCH v4 17/29] Ovmf/Xen: refactor XenBusDxe hypercall implementation 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.177 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 refactors the Xen hypercall implementation that is part of the XenBusDxe driver, in preparation of splitting it off entirely into a XenHypercallLib library. This involves: - removing the dependency on XENBUS_DEVICE* pointers in the XenHypercall() prototypes - moving the discovered hyperpage address to a global variable - moving XenGetSharedInfoPage() to its only user XenBusDxe.c (the shared info page is not strictly part of the Xen hypercall interface, and is not used by other expected users of XenHypercallLib such as the Xen console version of SerialPortLib - reimplement XenHypercall2() in C and move the indexing of the hyperpage there; the existing asm implementations are renamed to __XenHypercall2() and invoked from the new C implementation. Contributed-under: TianoCore Contribution Agreement 1.0 Acked-by: Laszlo Ersek Signed-off-by: Ard Biesheuvel --- OvmfPkg/XenBusDxe/EventChannel.c | 11 +++-------- OvmfPkg/XenBusDxe/GrantTable.c | 4 ++-- OvmfPkg/XenBusDxe/Ia32/hypercall.nasm | 6 +++--- OvmfPkg/XenBusDxe/X64/hypercall.nasm | 6 +++--- OvmfPkg/XenBusDxe/XenBusDxe.c | 44 +++++++++++++++++++++++++++++++++++++++++++- OvmfPkg/XenBusDxe/XenBusDxe.h | 1 - OvmfPkg/XenBusDxe/XenHypercall.c | 61 +++++++++++++++++++++++++------------------------------------ OvmfPkg/XenBusDxe/XenHypercall.h | 28 +++------------------------- OvmfPkg/XenBusDxe/XenStore.c | 4 ++-- 9 files changed, 84 insertions(+), 81 deletions(-) diff --git a/OvmfPkg/XenBusDxe/EventChannel.c b/OvmfPkg/XenBusDxe/EventChannel.c index 03efaf9cb904..a86323e6adfd 100644 --- a/OvmfPkg/XenBusDxe/EventChannel.c +++ b/OvmfPkg/XenBusDxe/EventChannel.c @@ -28,7 +28,7 @@ XenEventChannelNotify ( evtchn_send_t Send; Send.port = Port; - ReturnCode = XenHypercallEventChannelOp (Dev, EVTCHNOP_send, &Send); + ReturnCode = XenHypercallEventChannelOp (EVTCHNOP_send, &Send); return (UINT32)ReturnCode; } @@ -40,15 +40,12 @@ XenBusEventChannelAllocate ( OUT evtchn_port_t *Port ) { - XENBUS_PRIVATE_DATA *Private; evtchn_alloc_unbound_t Parameter; UINT32 ReturnCode; - Private = XENBUS_PRIVATE_DATA_FROM_THIS (This); - Parameter.dom = DOMID_SELF; Parameter.remote_dom = DomainId; - ReturnCode = (UINT32)XenHypercallEventChannelOp (Private->Dev, + ReturnCode = (UINT32)XenHypercallEventChannelOp ( EVTCHNOP_alloc_unbound, &Parameter); if (ReturnCode != 0) { @@ -79,10 +76,8 @@ XenBusEventChannelClose ( IN evtchn_port_t Port ) { - XENBUS_PRIVATE_DATA *Private; evtchn_close_t Close; - Private = XENBUS_PRIVATE_DATA_FROM_THIS (This); Close.port = Port; - return (UINT32)XenHypercallEventChannelOp (Private->Dev, EVTCHNOP_close, &Close); + return (UINT32)XenHypercallEventChannelOp (EVTCHNOP_close, &Close); } diff --git a/OvmfPkg/XenBusDxe/GrantTable.c b/OvmfPkg/XenBusDxe/GrantTable.c index 8405edc51bc4..53cb99f0e004 100644 --- a/OvmfPkg/XenBusDxe/GrantTable.c +++ b/OvmfPkg/XenBusDxe/GrantTable.c @@ -161,7 +161,7 @@ XenGrantTableInit ( Parameters.idx = Index; Parameters.space = XENMAPSPACE_grant_table; Parameters.gpfn = (xen_pfn_t) ((UINTN) GrantTable >> EFI_PAGE_SHIFT) + Index; - ReturnCode = XenHypercallMemoryOp (Dev, XENMEM_add_to_physmap, &Parameters); + ReturnCode = XenHypercallMemoryOp (XENMEM_add_to_physmap, &Parameters); if (ReturnCode != 0) { DEBUG ((EFI_D_ERROR, "Xen GrantTable, add_to_physmap hypercall error: %d\n", ReturnCode)); } @@ -184,7 +184,7 @@ XenGrantTableDeinit ( Parameters.domid = DOMID_SELF; Parameters.gpfn = (xen_pfn_t) ((UINTN) GrantTable >> EFI_PAGE_SHIFT) + Index; DEBUG ((EFI_D_INFO, "Xen GrantTable, removing %X\n", Parameters.gpfn)); - ReturnCode = XenHypercallMemoryOp (Dev, XENMEM_remove_from_physmap, &Parameters); + ReturnCode = XenHypercallMemoryOp (XENMEM_remove_from_physmap, &Parameters); if (ReturnCode != 0) { DEBUG ((EFI_D_ERROR, "Xen GrantTable, remove_from_physmap hypercall error: %d\n", ReturnCode)); } diff --git a/OvmfPkg/XenBusDxe/Ia32/hypercall.nasm b/OvmfPkg/XenBusDxe/Ia32/hypercall.nasm index 8547c30b81ee..e0fa71bb5ba8 100644 --- a/OvmfPkg/XenBusDxe/Ia32/hypercall.nasm +++ b/OvmfPkg/XenBusDxe/Ia32/hypercall.nasm @@ -2,13 +2,13 @@ SECTION .text ; INTN ; EFIAPI -; XenHypercall2 ( +; __XenHypercall2 ( ; IN VOID *HypercallAddr, ; IN OUT INTN Arg1, ; IN OUT INTN Arg2 ; ); -global ASM_PFX(XenHypercall2) -ASM_PFX(XenHypercall2): +global ASM_PFX(__XenHypercall2) +ASM_PFX(__XenHypercall2): ; Save only ebx, ecx is supposed to be a scratch register and needs to be ; saved by the caller push ebx diff --git a/OvmfPkg/XenBusDxe/X64/hypercall.nasm b/OvmfPkg/XenBusDxe/X64/hypercall.nasm index 177f271ef094..5e6a0c05c5c4 100644 --- a/OvmfPkg/XenBusDxe/X64/hypercall.nasm +++ b/OvmfPkg/XenBusDxe/X64/hypercall.nasm @@ -3,13 +3,13 @@ SECTION .text ; INTN ; EFIAPI -; XenHypercall2 ( +; __XenHypercall2 ( ; IN VOID *HypercallAddr, ; IN OUT INTN Arg1, ; IN OUT INTN Arg2 ; ); -global ASM_PFX(XenHypercall2) -ASM_PFX(XenHypercall2): +global ASM_PFX(__XenHypercall2) +ASM_PFX(__XenHypercall2): push rdi push rsi ; Copy HypercallAddr to rax diff --git a/OvmfPkg/XenBusDxe/XenBusDxe.c b/OvmfPkg/XenBusDxe/XenBusDxe.c index 7a7fd82d559d..d333b331b6db 100644 --- a/OvmfPkg/XenBusDxe/XenBusDxe.c +++ b/OvmfPkg/XenBusDxe/XenBusDxe.c @@ -34,6 +34,8 @@ #include "XenStore.h" #include "XenBus.h" +#include +#include /// /// Driver Binding Protocol instance @@ -52,6 +54,46 @@ STATIC EFI_LOCK mMyDeviceLock = EFI_INITIALIZE_LOCK_VARIABLE (TPL_CALLBACK STATIC XENBUS_DEVICE *mMyDevice = NULL; /** + Map the shared_info_t page into memory. + + @param Dev A XENBUS_DEVICE instance. + + @retval EFI_SUCCESS Dev->SharedInfo whill contain a pointer to + the shared info page + @retval EFI_LOAD_ERROR The shared info page could not be mapped. The + hypercall returned an error. +**/ +STATIC +EFI_STATUS +XenGetSharedInfoPage ( + IN OUT XENBUS_DEVICE *Dev + ) +{ + xen_add_to_physmap_t Parameter; + + ASSERT (Dev->SharedInfo == NULL); + + Parameter.domid = DOMID_SELF; + Parameter.space = XENMAPSPACE_shared_info; + Parameter.idx = 0; + + // + // using reserved page because the page is not released when Linux is + // starting because of the add_to_physmap. QEMU might try to access the + // page, and fail because it have no right to do so (segv). + // + Dev->SharedInfo = AllocateReservedPages (1); + Parameter.gpfn = (UINTN) Dev->SharedInfo >> EFI_PAGE_SHIFT; + if (XenHypercallMemoryOp (XENMEM_add_to_physmap, &Parameter) != 0) { + FreePages (Dev->SharedInfo, 1); + Dev->SharedInfo = NULL; + return EFI_LOAD_ERROR; + } + + return EFI_SUCCESS; +} + +/** Unloads an image. @param ImageHandle Handle that identifies the image to be unloaded. @@ -348,7 +390,7 @@ XenBusDxeDriverBindingStart ( MmioAddr = BarDesc->AddrRangeMin; FreePool (BarDesc); - Status = XenHyperpageInit (Dev); + Status = XenHyperpageInit (); if (EFI_ERROR (Status)) { DEBUG ((EFI_D_ERROR, "XenBus: Unable to retrieve the hyperpage.\n")); Status = EFI_UNSUPPORTED; diff --git a/OvmfPkg/XenBusDxe/XenBusDxe.h b/OvmfPkg/XenBusDxe/XenBusDxe.h index 80253b7d1ca9..9b7219906a69 100644 --- a/OvmfPkg/XenBusDxe/XenBusDxe.h +++ b/OvmfPkg/XenBusDxe/XenBusDxe.h @@ -91,7 +91,6 @@ struct _XENBUS_DEVICE { EFI_DEVICE_PATH_PROTOCOL *DevicePath; LIST_ENTRY ChildList; - VOID *Hyperpage; shared_info_t *SharedInfo; }; diff --git a/OvmfPkg/XenBusDxe/XenHypercall.c b/OvmfPkg/XenBusDxe/XenHypercall.c index 34d92e76b7e3..19c34bdd0cec 100644 --- a/OvmfPkg/XenBusDxe/XenHypercall.c +++ b/OvmfPkg/XenBusDxe/XenHypercall.c @@ -23,9 +23,21 @@ #include #include +STATIC VOID *HyperPage; + +// +// Interface exposed by the ASM implementation of the core hypercall +// +INTN +EFIAPI +__XenHypercall2 ( + IN VOID *HypercallAddr, + IN OUT INTN Arg1, + IN OUT INTN Arg2 + ); + EFI_STATUS XenHyperpageInit ( - IN OUT XENBUS_DEVICE *Dev ) { EFI_HOB_GUID_TYPE *GuidHob; @@ -36,24 +48,21 @@ XenHyperpageInit ( return EFI_NOT_FOUND; } XenInfo = (EFI_XEN_INFO *) GET_GUID_HOB_DATA (GuidHob); - Dev->Hyperpage = XenInfo->HyperPages; + HyperPage = XenInfo->HyperPages; return EFI_SUCCESS; } UINT64 XenHypercallHvmGetParam ( - IN XENBUS_DEVICE *Dev, IN UINT32 Index ) { xen_hvm_param_t Parameter; INTN Error; - ASSERT (Dev->Hyperpage != NULL); - Parameter.domid = DOMID_SELF; Parameter.index = Index; - Error = XenHypercall2 ((UINT8*)Dev->Hyperpage + __HYPERVISOR_hvm_op * 32, + Error = XenHypercall2 (__HYPERVISOR_hvm_op, HVMOP_get_param, (INTN) &Parameter); if (Error != 0) { DEBUG ((EFI_D_ERROR, @@ -66,53 +75,33 @@ XenHypercallHvmGetParam ( INTN XenHypercallMemoryOp ( - IN XENBUS_DEVICE *Dev, IN UINTN Operation, IN OUT VOID *Arguments ) { - ASSERT (Dev->Hyperpage != NULL); - return XenHypercall2 ((UINT8*)Dev->Hyperpage + __HYPERVISOR_memory_op * 32, + return XenHypercall2 (__HYPERVISOR_memory_op, Operation, (INTN) Arguments); } INTN XenHypercallEventChannelOp ( - IN XENBUS_DEVICE *Dev, IN INTN Operation, IN OUT VOID *Arguments ) { - ASSERT (Dev->Hyperpage != NULL); - return XenHypercall2 ((UINT8*)Dev->Hyperpage + __HYPERVISOR_event_channel_op * 32, + return XenHypercall2 (__HYPERVISOR_event_channel_op, Operation, (INTN) Arguments); } -EFI_STATUS -XenGetSharedInfoPage ( - IN OUT XENBUS_DEVICE *Dev +INTN +EFIAPI +XenHypercall2 ( + IN INTN HypercallID, + IN OUT INTN Arg1, + IN OUT INTN Arg2 ) { - xen_add_to_physmap_t Parameter; + ASSERT (HyperPage != NULL); - ASSERT (Dev->SharedInfo == NULL); - - Parameter.domid = DOMID_SELF; - Parameter.space = XENMAPSPACE_shared_info; - Parameter.idx = 0; - - // - // using reserved page because the page is not released when Linux is - // starting because of the add_to_physmap. QEMU might try to access the - // page, and fail because it have no right to do so (segv). - // - Dev->SharedInfo = AllocateReservedPages (1); - Parameter.gpfn = (UINTN) Dev->SharedInfo >> EFI_PAGE_SHIFT; - if (XenHypercallMemoryOp (Dev, XENMEM_add_to_physmap, &Parameter) != 0) { - FreePages (Dev->SharedInfo, 1); - Dev->SharedInfo = NULL; - return EFI_LOAD_ERROR; - } - - return EFI_SUCCESS; + return __XenHypercall2 ((UINT8*)HyperPage + HypercallID * 32, Arg1, Arg2); } diff --git a/OvmfPkg/XenBusDxe/XenHypercall.h b/OvmfPkg/XenBusDxe/XenHypercall.h index 06693830e16e..9d49e33eb5af 100644 --- a/OvmfPkg/XenBusDxe/XenHypercall.h +++ b/OvmfPkg/XenBusDxe/XenHypercall.h @@ -18,9 +18,9 @@ /** This function will put the two arguments in the right place (registers) and - call HypercallAddr, which correspond to an entry in the hypercall pages. + invoke the hypercall identified by HypercallID. - @param HypercallAddr A memory address where the hypercall to call is. + @param HypercallID The symbolic ID of the hypercall to be invoked @param Arg1 First argument. @param Arg2 Second argument. @@ -29,7 +29,7 @@ INTN EFIAPI XenHypercall2 ( - IN VOID *HypercallAddr, + IN INTN HypercallID, IN OUT INTN Arg1, IN OUT INTN Arg2 ); @@ -44,27 +44,23 @@ XenHypercall2 ( **/ EFI_STATUS XenHyperpageInit ( - XENBUS_DEVICE *Dev ); /** Return the value of the HVM parameter Index. - @param Dev A XENBUS_DEVICE instance. @param Index The parameter to get, e.g. HVM_PARAM_STORE_EVTCHN. @return The value of the asked parameter or 0 in case of error. **/ UINT64 XenHypercallHvmGetParam ( - XENBUS_DEVICE *Dev, UINT32 Index ); /** Hypercall to do different operation on the memory. - @param Dev A XENBUS_DEVICE instance. @param Operation The operation number, e.g. XENMEM_add_to_physmap. @param Arguments The arguments associated to the operation. @@ -73,7 +69,6 @@ XenHypercallHvmGetParam ( **/ INTN XenHypercallMemoryOp ( - IN XENBUS_DEVICE *Dev, IN UINTN Operation, IN OUT VOID *Arguments ); @@ -81,7 +76,6 @@ XenHypercallMemoryOp ( /** Do an operation on the event channels. - @param Dev A XENBUS_DEVICE instance. @param Operation The operation number, e.g. EVTCHNOP_send. @param Arguments The argument associated to the operation. @@ -90,24 +84,8 @@ XenHypercallMemoryOp ( **/ INTN XenHypercallEventChannelOp ( - IN XENBUS_DEVICE *Dev, IN INTN Operation, IN OUT VOID *Arguments ); -/** - Map the shared_info_t page into memory. - - @param Dev A XENBUS_DEVICE instance. - - @retval EFI_SUCCESS Dev->SharedInfo whill contain a pointer to - the shared info page - @retval EFI_LOAD_ERROR The shared info page could not be mapped. The - hypercall returned an error. -**/ -EFI_STATUS -XenGetSharedInfoPage ( - IN OUT XENBUS_DEVICE *Dev - ); - #endif diff --git a/OvmfPkg/XenBusDxe/XenStore.c b/OvmfPkg/XenBusDxe/XenStore.c index 2df8f5348585..7ec1e634bc5c 100644 --- a/OvmfPkg/XenBusDxe/XenStore.c +++ b/OvmfPkg/XenBusDxe/XenStore.c @@ -1057,8 +1057,8 @@ XenStoreInit ( xs.Dev = Dev; - xs.EventChannel = (evtchn_port_t)XenHypercallHvmGetParam (Dev, HVM_PARAM_STORE_EVTCHN); - XenStoreGpfn = (UINTN)XenHypercallHvmGetParam (Dev, HVM_PARAM_STORE_PFN); + xs.EventChannel = (evtchn_port_t)XenHypercallHvmGetParam (HVM_PARAM_STORE_EVTCHN); + XenStoreGpfn = (UINTN)XenHypercallHvmGetParam (HVM_PARAM_STORE_PFN); xs.XenStore = (VOID *) (XenStoreGpfn << EFI_PAGE_SHIFT); DEBUG ((EFI_D_INFO, "XenBusInit: XenBus rings @%p, event channel %x\n", xs.XenStore, xs.EventChannel));