From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=pbonzini@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1558A203555E5 for ; Thu, 16 Nov 2017 02:43:12 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A7049C047B6B; Thu, 16 Nov 2017 10:47:21 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-117-65.ams2.redhat.com [10.36.117.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6DACD60602; Thu, 16 Nov 2017 10:47:20 +0000 (UTC) From: Paolo Bonzini To: edk2-devel@lists.01.org Cc: Laszlo Ersek , Ard Biesheuvel , Jordan Justen Date: Thu, 16 Nov 2017 11:47:14 +0100 Message-Id: <20171116104716.15144-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 16 Nov 2017 10:47:21 +0000 (UTC) Subject: [PATCH v2 0/2] OvmfPkg: save on I/O port accesses when the debug port is not in use X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Nov 2017 10:43:13 -0000 This is version 2 of the patch I sent yesterday, now with proper SEC support. The series makes OvmfPkg's PlatformDebugLibIoPort library skip I/O port writes when the debug port device wasn't added to the virtual machine. Patch 1 creates a separate PlatformDebugLibIoPort instance for SEC, so that the non-SEC version will be able to use a writable global variable. Patch 2 then adds the detection machinery to both library instances. The commit messages in both patches liberally pillage Laszlo's v1 review. Thanks, Paolo Paolo Bonzini (2): OvmfPkg: create a separate PlatformDebugLibIoPort instance for SEC OvmfPkg: save on I/O port accesses when the debug port is not in use OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c | 41 ++++++++-------- .../PlatformDebugLibIoPort/DebugLibDetect.c | 55 +++++++++++++++++++++ .../PlatformDebugLibIoPort/DebugLibDetect.h | 56 ++++++++++++++++++++++ .../PlatformDebugLibIoPort/DebugLibDetectRom.c | 48 +++++++++++++++++++ .../PlatformDebugLibIoPort.inf | 1 + .../PlatformRomDebugLibIoPort.inf | 52 ++++++++++++++++++++ OvmfPkg/OvmfPkgIa32.dsc | 2 +- OvmfPkg/OvmfPkgIa32X64.dsc | 2 +- OvmfPkg/OvmfPkgX64.dsc | 2 +- 9 files changed, 237 insertions(+), 22 deletions(-) create mode 100644 OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.c create mode 100644 OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.h create mode 100644 OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetectRom.c create mode 100644 OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf -- 2.14.3