From patchwork Fri Sep 13 14:50:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11144857 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 656AA14E5 for ; Fri, 13 Sep 2019 14:52:32 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4216020830 for ; Fri, 13 Sep 2019 14:52:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="bHzB/IvX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4216020830 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i8mug-0005RI-B1; Fri, 13 Sep 2019 14:51:06 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i8muf-0005RD-HB for xen-devel@lists.xenproject.org; Fri, 13 Sep 2019 14:51:05 +0000 X-Inumbo-ID: e8c3f0ca-d635-11e9-b299-bc764e2007e4 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id e8c3f0ca-d635-11e9-b299-bc764e2007e4; Fri, 13 Sep 2019 14:51:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1568386265; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=jwaPByNl+3cmYIWFTfO5OthOI0xIyl+/jErDyBAXvoQ=; b=bHzB/IvXqQkK9nTMUac6s1arStpsZlhIQl+8V+SuYyWG8TCzq7tUDSHC t9Y6vbHyjxbxq/7/QuUHIZght2uQvw1Z+bNvJcSXI+vLN46h8awKKdC59 8OAFKeToyKgFI5lNI9npFYwN+PQ44npVFnxCJppdvzKzukxf2rI7LI2G2 8=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: ThNnQbIDSW5YPKtu6HzYI4MuZrJD1QW4eEiPHXCmmGNZGFSKO3iba5itEjXIc2L7NJQ72Ljx3y LlcJNFSkFQIwMDWn1yDSB+nehHra5FC5IQrEG4lvzaUfVCaTTMz8jkP3BpE2fJCtAkx/KJtoQP wJg0DmF/pGvA47jB9pW+SgruDW2MBm/IojAgxiv8CUHo41J3Ltq7IGmsZx2XSHsdUrSAZiAkow NK7b07mFy3TfIK3cANrn0uG+HU8LVDw3YsBl9Hxr16WOESexh1E2RKL5OjR/VsofG/PAWJ8MzB fPc= X-SBRS: 2.7 X-MesageID: 5595137 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,501,1559534400"; d="scan'208";a="5595137" From: Anthony PERARD To: Date: Fri, 13 Sep 2019 15:50:49 +0100 Message-ID: <20190913145100.303433-1-anthony.perard@citrix.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 00/11] OvmfPkg/XenBusDxe: Fix ExitBootServices handler to avoid allocation X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel , Jordan Justen , Julien Grall , Anthony Perard , xen-devel@lists.xenproject.org, Laszlo Ersek Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2190 Patch series available in this git branch: https://xenbits.xen.org/git-http/people/aperard/ovmf.git br.xenbusdxe-fix-exitbootservices-v1 Hi, This patch series works toward removing usage of Memory Allocation Services in XenBusDxe when ExitBootServices() is called by the next operating system. Since that in order to reset a backend, communication needs to happened via xenstore, this series focus mostly on getting rid of allocation in the xenstore driver. There are still some left but that's in function that aren't needed after EBS is called. In some places (like XenStoreVSPrint), instead of allocating a buffer, the buffer (4k) is on the stack. Thanks, Anthony PERARD (11): OvmfPkg/XenBusDxe: Fix missing \n in DEBUG messages OvmfPkg/XenBusDxe: Have XenStoreFindWatch take a pointer OvmfPkg/XenBusDxe: Rework watch events reception OvmfPkg/XenBusDxe: Avoid Allocate in XenStoreVSPrint OvmfPkg/XenBusDxe: Construct paths without allocation OvmfPkg/XenBusDxe: Rework XenStoreProcessMessage to avoid allocating memory OvmfPkg/XenBusDxe: Use on stack buffer in internal functions OvmfPkg/XenBus: Change XENBUS_PROTOCOL to not return allocated memory OvmfPkg/XenBusDxe: Fix NotifyExitBoot to avoid Memory Allocation Services OvmfPkg/XenPvBlkDxe: Use XenBusIo->RegisterExitCallback OvmfPkg/XenBusDxe: Fix XenStoreWaitForEvent use during EBS OvmfPkg/Include/Protocol/XenBus.h | 67 +++- OvmfPkg/XenBusDxe/EventChannel.c | 3 +- OvmfPkg/XenBusDxe/XenBus.c | 58 ++- OvmfPkg/XenBusDxe/XenBusDxe.c | 29 +- OvmfPkg/XenBusDxe/XenBusDxe.h | 3 + OvmfPkg/XenBusDxe/XenStore.c | 577 +++++++++++++----------------- OvmfPkg/XenBusDxe/XenStore.h | 44 ++- OvmfPkg/XenPvBlkDxe/BlockFront.c | 82 +++-- OvmfPkg/XenPvBlkDxe/BlockFront.h | 12 +- OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.c | 4 +- 10 files changed, 483 insertions(+), 396 deletions(-)