public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ardb@kernel.org>
To: devel@edk2.groups.io
Cc: Ard Biesheuvel <ardb@kernel.org>, Yuan Yu <yuanyu@google.com>,
	Laszlo Ersek <lersek@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Pawel Polawski <ppolawsk@redhat.com>,
	Oliver Steffen <osteffen@redhat.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	"Brian J . Johnson" <brian.johnson@hpe.com>
Subject: [PATCH v3 3/3] OvmfPkg: Allow runtime control of IPv4 and IPv6 support on QEMU
Date: Tue,  6 Sep 2022 13:59:26 +0200	[thread overview]
Message-ID: <20220906115926.115493-4-ardb@kernel.org> (raw)
In-Reply-To: <20220906115926.115493-1-ardb@kernel.org>

Wire up the newly added UefiDriverEntrypoint in a way that ties dispatch
of the Ip4Dxe and Ip6Dxe drivers to QEMU fw_cfg variables
'opt/org.tianocore/IPv4Support' and 'opt/org.tianocore/IPv6Support'
respectively.

Setting both variables to 'n' disables IP based networking entirely,
without the need for additional code changes at the NIC driver or
network boot protocol level.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 OvmfPkg/NetworkComponents.dsc.inc | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/OvmfPkg/NetworkComponents.dsc.inc b/OvmfPkg/NetworkComponents.dsc.inc
index 85a165391655..713eec7dd1ce 100644
--- a/OvmfPkg/NetworkComponents.dsc.inc
+++ b/OvmfPkg/NetworkComponents.dsc.inc
@@ -14,4 +14,22 @@
         NULL|OvmfPkg/Library/TlsAuthConfigLib/TlsAuthConfigLib.inf
     }
   !endif
+
+  !if $(NETWORK_IP4_ENABLE) == TRUE
+    NetworkPkg/Ip4Dxe/Ip4Dxe.inf {
+      <LibraryClasses>
+        UefiDriverEntryPoint|OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.inf
+      <PcdsFixedAtBuild>
+        gUefiOvmfPkgTokenSpaceGuid.PcdEntryPointOverrideFwCfgVarName|"opt/org.tianocore/IPv4Support"
+    }
+  !endif
+
+  !if $(NETWORK_IP6_ENABLE) == TRUE
+    NetworkPkg/Ip6Dxe/Ip6Dxe.inf {
+      <LibraryClasses>
+        UefiDriverEntryPoint|OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.inf
+      <PcdsFixedAtBuild>
+        gUefiOvmfPkgTokenSpaceGuid.PcdEntryPointOverrideFwCfgVarName|"opt/org.tianocore/IPv6Support"
+    }
+  !endif
 !endif
-- 
2.35.1


  parent reply	other threads:[~2022-09-06 11:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-06 11:59 [PATCH v3 0/3] Ovmf: Allow IPv4 and IPv6 to be disabled at runtime Ard Biesheuvel
2022-09-06 11:59 ` [PATCH v3 1/3] OvmfPkg: Introduce alternate UefiDriverEntrypoint to inhibit driver load Ard Biesheuvel
2022-09-06 11:59 ` [PATCH v3 2/3] OvmfPkg: gather common NetworkComponents overrides in .dsc.inc file Ard Biesheuvel
2022-09-06 11:59 ` Ard Biesheuvel [this message]
2022-09-07  5:46 ` [PATCH v3 0/3] Ovmf: Allow IPv4 and IPv6 to be disabled at runtime Gerd Hoffmann
2022-09-08 11:31   ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220906115926.115493-4-ardb@kernel.org \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox