<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Tianocore/edk2.git/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h, branch master</title>
<subtitle>EDK II (mirror)</subtitle>
<id>https://git.radix-linux.su/Tianocore/edk2.git/atom?h=master</id>
<link rel='self' href='https://git.radix-linux.su/Tianocore/edk2.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/'/>
<updated>2026-02-23T21:01:28+00:00</updated>
<entry>
<title>OvmfPkg: Replace include guards with #pragma once</title>
<updated>2026-02-23T21:01:28+00:00</updated>
<author>
<name>Michael Kubacki</name>
<email>michael.kubacki@microsoft.com</email>
</author>
<published>2026-02-03T19:10:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=a536e5d6991ebb18cdc0a29e224ce5bd50ca9bc0'/>
<id>urn:sha1:a536e5d6991ebb18cdc0a29e224ce5bd50ca9bc0</id>
<content type='text'>
Replace traditional `#ifndef`/`#define`/`#endif` include guards with
`#pragma` once.

`#pragma once` is a widely supported preprocessor directive that
prevents header files from being included multiple times. It is
supported by all toolchains used to build edk2: GCC, Clang/LLVM, and
MSVC.

Note: Headers taken directly from external projects, such as those
in OvmfPkg/Include/IndustryStandard/Xen/ were not modified since they
may be periodically re-synced and do not follow other edk2 coding
stadards.

Compared to macro-based include guards, `#pragma once`:

- Eliminates the risk of macro name collisions or copy/paste errors
  where two headers inadvertently use the same guard macro.
- Eliminate inconsistency in the way include guard macros are named
  (e.g., some files use `__FILE_H__`, others use `FILE_H_`, etc.).
- Reduces boilerplate (three lines replaced by one).
- Avoids polluting the macro namespace with guard symbols.
- Can improve build times as the preprocessor can skip re-opening the
  file entirely, rather than re-reading it to find the matching
  `#endif` ("multiple-include optimization").
  - Note that some compilers may already optimize traditional include
    guards, by recognzining the idiomatic pattern.

This change is made acknowledging that overall portability of the
code will technically be reduced, as `#pragma once` is not part of the
C/C++ standards.

However, this is considered acceptable given:

1. edk2 already defines a subset of supported compilers in
   BaseTools/Conf/tools_def.template, all of which have supported
   `#pragma once` for over two decades.
2. There have been concerns raised to the project about inconsistent
   include guard naming and potential macro collisions.

Approximate compiler support dates:

- MSVC: Supported since Visual C++ 4.2 (1996)
- GCC: Supported since 3.4 (2004)
  (http://gnu.ist.utl.pt/software/gcc/gcc-3.4/changes.html)
- Clang (LLVM based): Since initial release in 2007

Signed-off-by: Michael Kubacki &lt;michael.kubacki@microsoft.com&gt;
</content>
</entry>
<entry>
<title>OvmfPkg/MemEncryptSevLib: add support to validate &gt; 4GB memory in PEI phase</title>
<updated>2021-12-09T06:28:10+00:00</updated>
<author>
<name>Brijesh Singh via groups.io</name>
<email>brijesh.singh=amd.com@groups.io</email>
</author>
<published>2021-12-09T03:27:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=d39f8d88ecb31df46e2f95bcc5c20100d1f14681'/>
<id>urn:sha1:d39f8d88ecb31df46e2f95bcc5c20100d1f14681</id>
<content type='text'>
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3275

The initial page built during the SEC phase is used by the
MemEncryptSevSnpValidateSystemRam() for the system RAM validation. The
page validation process requires using the PVALIDATE instruction;  the
instruction accepts a virtual address of the memory region that needs
to be validated. If hardware encounters a page table walk failure (due
to page-not-present) then it raises #GP.

The initial page table built in SEC phase address up to 4GB. Add an
internal function to extend the page table to cover &gt; 4GB. The function
builds 1GB entries in the page table for access &gt; 4GB. This will provide
the support to call PVALIDATE instruction for the virtual address &gt;
4GB in PEI phase.

Cc: Michael Roth &lt;michael.roth@amd.com&gt;
Cc: James Bottomley &lt;jejb@linux.ibm.com&gt;
Cc: Min Xu &lt;min.m.xu@intel.com&gt;
Cc: Jiewen Yao &lt;jiewen.yao@intel.com&gt;
Cc: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Cc: Jordan Justen &lt;jordan.l.justen@intel.com&gt;
Cc: Ard Biesheuvel &lt;ardb+tianocore@kernel.org&gt;
Cc: Erdem Aktas &lt;erdemaktas@google.com&gt;
Cc: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Acked-by: Jiewen Yao &lt;Jiewen.yao@intel.com&gt;
Acked-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Signed-off-by: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
</content>
</entry>
<entry>
<title>OvmfPkg: Apply uncrustify changes</title>
<updated>2021-12-07T17:24:28+00:00</updated>
<author>
<name>Michael Kubacki</name>
<email>michael.kubacki@microsoft.com</email>
</author>
<published>2021-12-05T22:54:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=ac0a286f4d747a4c6c603a7b225917293cbe1e9f'/>
<id>urn:sha1:ac0a286f4d747a4c6c603a7b225917293cbe1e9f</id>
<content type='text'>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

Apply uncrustify changes to .c/.h files in the OvmfPkg package

Cc: Andrew Fish &lt;afish@apple.com&gt;
Cc: Leif Lindholm &lt;leif@nuviainc.com&gt;
Cc: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Signed-off-by: Michael Kubacki &lt;michael.kubacki@microsoft.com&gt;
Reviewed-by: Andrew Fish &lt;afish@apple.com&gt;
</content>
</entry>
<entry>
<title>OvmfPkg/BaseMemEncryptSevLib: remove Flush parameter</title>
<updated>2021-05-29T12:15:21+00:00</updated>
<author>
<name>Brijesh Singh</name>
<email>brijesh.singh@amd.com</email>
</author>
<published>2021-05-19T18:19:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=adfa3327d4fc25d5eff5fedcdb11ecde52a995cc'/>
<id>urn:sha1:adfa3327d4fc25d5eff5fedcdb11ecde52a995cc</id>
<content type='text'>
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3275

The Flush parameter is used to provide a hint whether the specified range
is Mmio address. Now that we have a dedicated helper to clear the
memory encryption mask for the Mmio address range, its safe to remove the
Flush parameter from MemEncryptSev{Set,Clear}PageEncMask().

Since the address specified in the MemEncryptSev{Set,Clear}PageEncMask()
points to a system RAM, thus a cache flush is required during the
encryption mask update.

Cc: James Bottomley &lt;jejb@linux.ibm.com&gt;
Cc: Min Xu &lt;min.m.xu@intel.com&gt;
Cc: Jiewen Yao &lt;jiewen.yao@intel.com&gt;
Cc: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Cc: Jordan Justen &lt;jordan.l.justen@intel.com&gt;
Cc: Ard Biesheuvel &lt;ardb+tianocore@kernel.org&gt;
Cc: Laszlo Ersek &lt;lersek@redhat.com&gt;
Cc: Erdem Aktas &lt;erdemaktas@google.com&gt;
Reviewed-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
Signed-off-by: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Message-Id: &lt;20210519181949.6574-14-brijesh.singh@amd.com&gt;
</content>
</entry>
<entry>
<title>OvmfPkg/BaseMemEncryptSevLib: introduce MemEncryptSevClearMmioPageEncMask()</title>
<updated>2021-05-29T12:15:21+00:00</updated>
<author>
<name>Brijesh Singh</name>
<email>brijesh.singh@amd.com</email>
</author>
<published>2021-05-19T18:19:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=901a9bfc3a24619fb3381e414a178f092f0d07d6'/>
<id>urn:sha1:901a9bfc3a24619fb3381e414a178f092f0d07d6</id>
<content type='text'>
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3275

The MemEncryptSevClearMmioPageEncMask() helper can be used for clearing
the memory encryption mask for the Mmio region.

The MemEncryptSevClearMmioPageEncMask() is a simplified version of
MemEncryptSevClearPageEncMask() -- it does not flush the caches after
clearing the page encryption mask.

Cc: James Bottomley &lt;jejb@linux.ibm.com&gt;
Cc: Min Xu &lt;min.m.xu@intel.com&gt;
Cc: Jiewen Yao &lt;jiewen.yao@intel.com&gt;
Cc: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Cc: Jordan Justen &lt;jordan.l.justen@intel.com&gt;
Cc: Ard Biesheuvel &lt;ardb+tianocore@kernel.org&gt;
Cc: Laszlo Ersek &lt;lersek@redhat.com&gt;
Cc: Erdem Aktas &lt;erdemaktas@google.com&gt;
Reviewed-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
Signed-off-by: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Message-Id: &lt;20210519181949.6574-10-brijesh.singh@amd.com&gt;
</content>
</entry>
<entry>
<title>OvmfPkg/IndustryStandard: Introduce PageTable.h</title>
<updated>2021-04-13T11:54:58+00:00</updated>
<author>
<name>Anthony PERARD</name>
<email>anthony.perard@citrix.com</email>
</author>
<published>2021-04-12T13:30:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=9d6861494aaa987fb728828801c84eb89be283c8'/>
<id>urn:sha1:9d6861494aaa987fb728828801c84eb89be283c8</id>
<content type='text'>
We are going to use the page table structure in yet another place,
collect the types and macro that can be used from another module
rather than making yet another copy.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2490
Signed-off-by: Anthony PERARD &lt;anthony.perard@citrix.com&gt;
Acked-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Message-Id: &lt;20210412133003.146438-5-anthony.perard@citrix.com&gt;
Reviewed-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
</content>
</entry>
<entry>
<title>OvmfPkg/MemEncryptSevLib: Address range encryption state interface</title>
<updated>2021-01-07T19:34:39+00:00</updated>
<author>
<name>Tom Lendacky</name>
<email>thomas.lendacky@amd.com</email>
</author>
<published>2021-01-07T18:48:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=c330af0246ac9b1c37d17fc79881fc2dd96ec80c'/>
<id>urn:sha1:c330af0246ac9b1c37d17fc79881fc2dd96ec80c</id>
<content type='text'>
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3108

Update the MemEncryptSevLib library to include an interface that can
report the encryption state on a range of memory. The values will
represent the range as being unencrypted, encrypted, a mix of unencrypted
and encrypted, and error (e.g. ranges that aren't mapped).

Cc: Jordan Justen &lt;jordan.l.justen@intel.com&gt;
Cc: Laszlo Ersek &lt;lersek@redhat.com&gt;
Cc: Ard Biesheuvel &lt;ard.biesheuvel@arm.com&gt;
Cc: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Acked-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
Signed-off-by: Tom Lendacky &lt;thomas.lendacky@amd.com&gt;
Message-Id: &lt;0d98f4d42a2b67310c29bac7bcdcf1eda6835847.1610045305.git.thomas.lendacky@amd.com&gt;
</content>
</entry>
<entry>
<title>OvmfPkg: Replace BSD License with BSD+Patent License</title>
<updated>2019-04-09T17:58:19+00:00</updated>
<author>
<name>Michael D Kinney</name>
<email>michael.d.kinney@intel.com</email>
</author>
<published>2019-04-03T23:06:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=b26f0cf9ee09a180c91a4beeeb1b149e7f92afed'/>
<id>urn:sha1:b26f0cf9ee09a180c91a4beeeb1b149e7f92afed</id>
<content type='text'>
https://bugzilla.tianocore.org/show_bug.cgi?id=1373

Replace BSD 2-Clause License with BSD+Patent License.  This change is
based on the following emails:

  https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html
  https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html

RFCs with detailed process for the license change:

  V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html
  V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html
  V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Reviewed-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
</content>
</entry>
<entry>
<title>OvmfPkg/MemEncryptSevLib: sort #includes, and entries in INF file sections</title>
<updated>2018-03-06T12:30:10+00:00</updated>
<author>
<name>Laszlo Ersek</name>
<email>lersek@redhat.com</email>
</author>
<published>2018-03-01T14:02:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=bd13ecf355bda1d6854514b5b3466ce58c346ead'/>
<id>urn:sha1:bd13ecf355bda1d6854514b5b3466ce58c346ead</id>
<content type='text'>
Cc: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Cc: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Cc: Jordan Justen &lt;jordan.l.justen@intel.com&gt;
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
Tested-by: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Reviewed-by: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
</content>
</entry>
<entry>
<title>OvmfPkg/MemEncryptSevLib: clean up InternalMemEncryptSevSetMemoryEncrypted() decl</title>
<updated>2018-03-06T12:30:09+00:00</updated>
<author>
<name>Laszlo Ersek</name>
<email>lersek@redhat.com</email>
</author>
<published>2018-03-01T14:15:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=68e60a388da60acac66d908eaa85615d66c52831'/>
<id>urn:sha1:68e60a388da60acac66d908eaa85615d66c52831</id>
<content type='text'>
The declaration and the definition(s) of the function should have
identical leading comments and/or identical parameter lists. Document the
"Cr3BaseAddress" parameter, and correct several parameter references.
Replace a "clear" reference to the C-bit with a "set" reference.

Cc: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Cc: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Cc: Jordan Justen &lt;jordan.l.justen@intel.com&gt;
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
Tested-by: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
Reviewed-by: Brijesh Singh &lt;brijesh.singh@amd.com&gt;
</content>
</entry>
</feed>
