Date   

[Patch 3/4] MdePkg/BaseMemoryLibOptDxe: Apply BSD-2-Clause-Patent

Michael D Kinney
 

Change license to BSD-2-Clause-Patent using an
SPDX-License-Identifier statement.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
.../BaseMemoryLibOptDxe/AArch64/CompareGuid.S | 24 +--------
.../BaseMemoryLibOptDxe/AArch64/CompareMem.S | 24 +--------
.../BaseMemoryLibOptDxe/AArch64/CopyMem.S | 50 +------------------
.../BaseMemoryLibOptDxe/AArch64/ScanMem.S | 24 +--------
.../BaseMemoryLibOptDxe/AArch64/SetMem.S | 50 +------------------
.../BaseMemoryLibOptDxe/Arm/CompareGuid.S | 24 +--------
.../BaseMemoryLibOptDxe/Arm/CompareGuid.asm | 24 +--------
.../BaseMemoryLibOptDxe/Arm/CompareMem.S | 24 +--------
.../BaseMemoryLibOptDxe/Arm/CompareMem.asm | 24 +--------
.../Library/BaseMemoryLibOptDxe/Arm/ScanMem.S | 28 +----------
.../BaseMemoryLibOptDxe/Arm/ScanMem.asm | 28 +----------
11 files changed, 11 insertions(+), 313 deletions(-)

diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareGuid.S b/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareGuid.S
index 9e1b55cdf5..b7a566fdaf 100644
--- a/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareGuid.S
+++ b/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareGuid.S
@@ -1,29 +1,7 @@
//
// Copyright (c) 2016, Linaro Limited
// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// * Neither the name of the Linaro nor the
-// names of its contributors may be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// SPDX-License-Identifier: BSD-2-Clause-Patent
//

.text
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareMem.S b/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareMem.S
index a54de6948b..ffe4b7a0b0 100644
--- a/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareMem.S
+++ b/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CompareMem.S
@@ -1,29 +1,7 @@
//
// Copyright (c) 2013, Linaro Limited
// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// * Neither the name of the Linaro nor the
-// names of its contributors may be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// SPDX-License-Identifier: BSD-2-Clause-Patent
//

// Assumptions:
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CopyMem.S b/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CopyMem.S
index 56fe3b0956..9fad6d1f26 100644
--- a/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CopyMem.S
+++ b/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/CopyMem.S
@@ -1,57 +1,9 @@
//
// Copyright (c) 2012 - 2016, Linaro Limited
// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// * Neither the name of the Linaro nor the
-// names of its contributors may be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-
-//
// Copyright (c) 2015 ARM Ltd
// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// 3. The name of the company may not be used to endorse or promote
-// products derived from this software without specific prior written
-// permission.
-//
-// THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-// IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// SPDX-License-Identifier: BSD-2-Clause-Patent
//

// Assumptions:
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/ScanMem.S b/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/ScanMem.S
index 99db2aebcb..8673b76eca 100644
--- a/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/ScanMem.S
+++ b/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/ScanMem.S
@@ -1,29 +1,7 @@
//
// Copyright (c) 2014, ARM Limited
// All rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// * Neither the name of the company nor the names of its contributors
-// may be used to endorse or promote products derived from this
-// software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// SPDX-License-Identifier: BSD-2-Clause-Patent
//

// Assumptions:
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/SetMem.S b/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/SetMem.S
index ec58f759d7..f974840559 100644
--- a/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/SetMem.S
+++ b/MdePkg/Library/BaseMemoryLibOptDxe/AArch64/SetMem.S
@@ -1,57 +1,9 @@
//
// Copyright (c) 2012 - 2016, Linaro Limited
// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// * Neither the name of the Linaro nor the
-// names of its contributors may be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-
-//
// Copyright (c) 2015 ARM Ltd
// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// 1. Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// 3. The name of the company may not be used to endorse or promote
-// products derived from this software without specific prior written
-// permission.
-//
-// THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-// IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// SPDX-License-Identifier: BSD-2-Clause-Patent
//

// Assumptions:
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.S b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.S
index b74056fa1f..7de70ae34c 100644
--- a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.S
+++ b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.S
@@ -1,29 +1,7 @@
//
// Copyright (c) 2016, Linaro Limited
// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// * Neither the name of the Linaro nor the
-// names of its contributors may be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// SPDX-License-Identifier: BSD-2-Clause-Patent
//

.text
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.asm b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.asm
index 7ac576d161..3316b8dc6d 100644
--- a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.asm
+++ b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareGuid.asm
@@ -1,29 +1,7 @@
;
; Copyright (c) 2016, Linaro Limited
; All rights reserved.
-;
-; Redistribution and use in source and binary forms, with or without
-; modification, are permitted provided that the following conditions are met:
-; * Redistributions of source code must retain the above copyright
-; notice, this list of conditions and the following disclaimer.
-; * Redistributions in binary form must reproduce the above copyright
-; notice, this list of conditions and the following disclaimer in the
-; documentation and/or other materials provided with the distribution.
-; * Neither the name of the Linaro nor the
-; names of its contributors may be used to endorse or promote products
-; derived from this software without specific prior written permission.
-;
-; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-; HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+; SPDX-License-Identifier: BSD-2-Clause-Patent
;

EXPORT InternalMemCompareGuid
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.S b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.S
index 25a9a09945..d32816c7b0 100644
--- a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.S
+++ b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.S
@@ -1,29 +1,7 @@
//
// Copyright (c) 2013 - 2016, Linaro Limited
// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// * Neither the name of the Linaro nor the
-// names of its contributors may be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// SPDX-License-Identifier: BSD-2-Clause-Patent
//

// Parameters and result.
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.asm b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.asm
index 47b49ee164..27a1efc8ca 100644
--- a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.asm
+++ b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/CompareMem.asm
@@ -1,29 +1,7 @@
;
; Copyright (c) 2013 - 2016, Linaro Limited
; All rights reserved.
-;
-; Redistribution and use in source and binary forms, with or without
-; modification, are permitted provided that the following conditions are met:
-; * Redistributions of source code must retain the above copyright
-; notice, this list of conditions and the following disclaimer.
-; * Redistributions in binary form must reproduce the above copyright
-; notice, this list of conditions and the following disclaimer in the
-; documentation and/or other materials provided with the distribution.
-; * Neither the name of the Linaro nor the
-; names of its contributors may be used to endorse or promote products
-; derived from this software without specific prior written permission.
-;
-; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-; HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+; SPDX-License-Identifier: BSD-2-Clause-Patent
;

; Parameters and result.
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMem.S b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMem.S
index 5dcf153a61..c0b2dee5d8 100644
--- a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMem.S
+++ b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMem.S
@@ -1,32 +1,6 @@
// Copyright (c) 2010-2011, Linaro Limited
// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// * Neither the name of Linaro Limited nor the names of its
-// contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// SPDX-License-Identifier: BSD-2-Clause-Patent
//

//
diff --git a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMem.asm b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMem.asm
index abda87320e..00f4bff192 100644
--- a/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMem.asm
+++ b/MdePkg/Library/BaseMemoryLibOptDxe/Arm/ScanMem.asm
@@ -1,32 +1,6 @@
; Copyright (c) 2010-2011, Linaro Limited
; All rights reserved.
-;
-; Redistribution and use in source and binary forms, with or without
-; modification, are permitted provided that the following conditions
-; are met:
-;
-; * Redistributions of source code must retain the above copyright
-; notice, this list of conditions and the following disclaimer.
-;
-; * Redistributions in binary form must reproduce the above copyright
-; notice, this list of conditions and the following disclaimer in the
-; documentation and/or other materials provided with the distribution.
-;
-; * Neither the name of Linaro Limited nor the names of its
-; contributors may be used to endorse or promote products derived
-; from this software without specific prior written permission.
-;
-; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-; HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+; SPDX-License-Identifier: BSD-2-Clause-Patent
;

;
--
2.21.0.windows.1


[Patch 1/4] EmbeddedPkg/NonCoherentIoMmuDxe: Apply BSD-2-Clause-Patent

Michael D Kinney
 

Change license to BSD-2-Clause-Patent using an
SPDX-License-Identifier statement.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
.../Drivers/NonCoherentIoMmuDxe/NonCoherentIoMmuDxe.c | 9 +--------
.../NonCoherentIoMmuDxe/NonCoherentIoMmuDxe.inf | 10 +---------
2 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/EmbeddedPkg/Drivers/NonCoherentIoMmuDxe/NonCoherentIoMmuDxe.c b/EmbeddedPkg/Drivers/NonCoherentIoMmuDxe/NonCoherentIoMmuDxe.c
index 4b0afe47de..d7ed8c9ebc 100644
--- a/EmbeddedPkg/Drivers/NonCoherentIoMmuDxe/NonCoherentIoMmuDxe.c
+++ b/EmbeddedPkg/Drivers/NonCoherentIoMmuDxe/NonCoherentIoMmuDxe.c
@@ -1,14 +1,7 @@
/** @file

Copyright (c) 2019, Linaro, Ltd. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ SPDX-License-Identifier: BSD-2-Clause-Patent

**/

diff --git a/EmbeddedPkg/Drivers/NonCoherentIoMmuDxe/NonCoherentIoMmuDxe.inf b/EmbeddedPkg/Drivers/NonCoherentIoMmuDxe/NonCoherentIoMmuDxe.inf
index de70cfb4ca..ff4dcaaeca 100644
--- a/EmbeddedPkg/Drivers/NonCoherentIoMmuDxe/NonCoherentIoMmuDxe.inf
+++ b/EmbeddedPkg/Drivers/NonCoherentIoMmuDxe/NonCoherentIoMmuDxe.inf
@@ -1,15 +1,7 @@
#/** @file
#
# Copyright (c) 2019, Linaro, Ltd. All rights reserved.<BR>
-#
-# This program and the accompanying materials are licensed and made available
-# under the terms and conditions of the BSD License which accompanies this
-# distribution. The full text of the license may be found at
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
-# IMPLIED.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
#
#**/

--
2.21.0.windows.1


[Patch 2/4] MdeModulePkg/PeCoffImageEmulator.h: Apply BSD-2-Clause-Patent

Michael D Kinney
 

Change license to BSD-2-Clause-Patent using an
SPDX-License-Identifier statement.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
MdeModulePkg/Include/Protocol/PeCoffImageEmulator.h | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/MdeModulePkg/Include/Protocol/PeCoffImageEmulator.h b/MdeModulePkg/Include/Protocol/PeCoffImageEmulator.h
index 29633e9a8e..c7f287d776 100644
--- a/MdeModulePkg/Include/Protocol/PeCoffImageEmulator.h
+++ b/MdeModulePkg/Include/Protocol/PeCoffImageEmulator.h
@@ -1,13 +1,6 @@
/** @file
Copyright (c) 2019, Linaro, Ltd. All rights reserved.<BR>
-
- This program and the accompanying materials are licensed and made available
- under the terms and conditions of the BSD License which accompanies this
- distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ SPDX-License-Identifier: BSD-2-Clause-Patent

**/

--
2.21.0.windows.1


[Patch 0/4] Update licenses

Michael D Kinney
 

Update licenses that may have been missed in the conversion to the
BSD-2-Clause-Patent using SPDX identifiers.

Also update list of licenses in Readme.rst and list git submodule
license in their own list.

Cc: Andrew Fish <afish@apple.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>

Michael D Kinney (4):
EmbeddedPkg/NonCoherentIoMmuDxe: Apply BSD-2-Clause-Patent
MdeModulePkg/PeCoffImageEmulator.h: Apply BSD-2-Clause-Patent
MdePkg/BaseMemoryLibOptDxe: Apply BSD-2-Clause-Patent
Readme.rst: List submodules and links to licenses

.../NonCoherentIoMmuDxe/NonCoherentIoMmuDxe.c | 9 +---
.../NonCoherentIoMmuDxe.inf | 10 +---
.../Include/Protocol/PeCoffImageEmulator.h | 9 +---
.../BaseMemoryLibOptDxe/AArch64/CompareGuid.S | 24 +--------
.../BaseMemoryLibOptDxe/AArch64/CompareMem.S | 24 +--------
.../BaseMemoryLibOptDxe/AArch64/CopyMem.S | 50 +------------------
.../BaseMemoryLibOptDxe/AArch64/ScanMem.S | 24 +--------
.../BaseMemoryLibOptDxe/AArch64/SetMem.S | 50 +------------------
.../BaseMemoryLibOptDxe/Arm/CompareGuid.S | 24 +--------
.../BaseMemoryLibOptDxe/Arm/CompareGuid.asm | 24 +--------
.../BaseMemoryLibOptDxe/Arm/CompareMem.S | 24 +--------
.../BaseMemoryLibOptDxe/Arm/CompareMem.asm | 24 +--------
.../Library/BaseMemoryLibOptDxe/Arm/ScanMem.S | 28 +----------
.../BaseMemoryLibOptDxe/Arm/ScanMem.asm | 28 +----------
ReadMe.rst | 22 +++++---
15 files changed, 30 insertions(+), 344 deletions(-)

--
2.21.0.windows.1


Re: [PATCH] Check return status on calls to GetTime()

Grant Likely <grant.likely@...>
 

On 01/08/2020 14:54, Heinrich Schuchardt wrote:
On 7/31/20 7:19 PM, Grant Likely wrote:
[...]>> diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/MiscBootServices/BlackBoxTest/MiscBootServicesBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/MiscBootServices/BlackBoxTest/MiscBootServicesBBTestFunction.c
index 1d231d8c..3a530282 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/MiscBootServices/BlackBoxTest/MiscBootServicesBBTestFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/MiscBootServices/BlackBoxTest/MiscBootServicesBBTestFunction.c
@@ -27,6 +27,8 @@ Abstract:
#include "SctLib.h"
I tried to apply your patch with 'git am --keep-cr'. This chunk has a
problem.
While all other lines in the file have CR LF line endings this very line
has only LF in EDK2 master. But your patch has CR LF for the line.
Did you use Windows and not Linux to create the patch?
Hahaha! No, I did not use Windows. From what I can tell, that file already had inconsisten line endings. Most of the file is crlf, but the "#include "SctLib.h" line is lf only. This confuses vim which interprets it as a unix file and shows the ^M on every line, which in turn allowed me to add additional lines with unix line endings.

I could apply your patch after removing the extraneous CR.
With your patch applied if GetTime() returns EFI_UNSUPPORTED, the test
log is not garbled anymore:
SetVariable_Conf:
Test Finished: 01/01/70 12:00a
Elapsed Time: 00 Days 00:00:00
If GetTime() is available:
SetVariable_Conf:
Test Finished: 08/01/20 01:52p
Elapsed Time: 00 Days 00:00:04
Except for the line-endings:
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Ace! Thanks.

g.


Re: [PATCH v5 1/1] ShellPkg/DynamicCommand: add HttpDynamicCommand

Vladimir Olovyannikov
 

Hi Laszlo,

Thank you for the comments.
I agree with them, and as you suggest, I will address them along with
comments from maintainers.

Thank you,
Vladimir

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Laszlo
Ersek
Sent: Monday, July 27, 2020 3:08 PM
To: devel@edk2.groups.io; vladimir.olovyannikov@broadcom.com
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>; Zhichao
Gao <zhichao.gao@intel.com>; Maciej Rabeda
<maciej.rabeda@linux.intel.com>; Jiaxin Wu <jiaxin.wu@intel.com>; Siyuan
Fu <siyuan.fu@intel.com>; Ray Ni <ray.ni@intel.com>; Liming Gao
<liming.gao@intel.com>; Nd <nd@arm.com>
Subject: Re: [edk2-devel] [PATCH v5 1/1] ShellPkg/DynamicCommand: add
HttpDynamicCommand

Just some quick remarks after a comparison with v3:

On 07/27/20 18:48, Vladimir Olovyannikov via groups.io wrote:
Introduce an http client utilizing EDK2 HTTP protocol, to allow fast
image downloading from http/https servers.
HTTP download speed is usually faster than tftp.
The client is based on the same approach as tftp dynamic command, and
uses the same UEFI Shell command line parameters. This makes it easy
integrating http into existing UEFI Shell scripts.
Note that to enable HTTP download, feature Pcd
gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections must be set to
TRUE.
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2860

Signed-off-by: Vladimir Olovyannikov
<vladimir.olovyannikov@broadcom.com>
CC: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
CC: Laszlo Ersek <lersek@redhat.com>
(1) These "CC" lines are not formatted correctly -- they might do the job
as
far as git-send-email is concerned, but they don't satisfy
"PatchCheck.py":

ShellPkg/DynamicCommand: add HttpDynamicCommand The commit
message
format is not valid:
* 'CC' should be 'Cc'
* 'CC' should be 'Cc'
https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-F
ormat
The exit status is 255, so this would break the CI run again.

Please run "PatchCheck.py" locally before posting, and/or submit a
personal
CI build.

[...]

+ if (UserNicName != NULL) {
+ if (StrCmp (NicName, UserNicName) != 0) {
+ Status = EFI_NOT_FOUND;
Change is new since v4, but not documented in the v5 changelog.

(The code may be OK, but please help reviewers with the v(n) -> v(n+1)
changelogs.)

[...]

+ if (ShellCommandLineGetFlag (CheckPackage, L"-m")) {
+ Context.Flags |= DL_FLAG_TIME;
+ }
(2) The "-m" flag has not been removed from here

[...]

+// Download Flags
+#define DL_FLAG_TIME BIT0 // Show elapsed time.
(3) and here

+".SH SYNOPSIS\r\n"
+" \r\n"
+"HTTP [-i interface] [-l port] [-t timeout] [-s size] [-m] [-k]\r\n"
(4) and here

[...]

+" -m Measure and report download time (in seconds).
\r\n"
(5) and here.

I suggest waiting for ShellPkg owner feedback before posting v6.

Thanks!
Laszlo



Re: [PATCH edk2-test 1/1] SctPkg: fix page alignment calculations

G Edhaya Chandran
 

Reviewed-by: G Edhaya Chandran <edhaya.chandran@...>


Re: question about MSFT compiler/link option

Liming Gao
 

If this global variable is used by code, it will be linked into the final EFI image. You can check whether the generate map file includes it.

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Tiger Liu(BJ-RD)
Sent: Tuesday, August 4, 2020 5:34 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] question about MSFT compiler/link option

Hi, Experts:
I have a question about MSFT compiler/link option.

I wrote a PEIM, which had a large global data array definition in a C file.
Such as:
PRI_DATA_STRUCT PdataStructTable[] = {
{01, 0x75, 0xF0, 0x0, 0x0, 0x0 },
{02, 0x77, 0xF0, 0x0, 0x0, 0x0 },
{03, 0x79, 0xF0, 0x0, 0x0, 0x0 },
{04, 0x7B, 0xF0, 0x0, 0x0, 0x0 },
{05, 0x7D, 0xF0, 0x0, 0x0, 0x0 },
{06, 0x7F, 0xF0, 0x0, 0x0, 0x0 },
......
};

This global data array is very large, about 20KB.

But I found the PEIM's compiled size is about 5KB, it seems not include this global data array in the efi binary statically.
Even the release version PEIM's size is larger than debug version.

I found when compiling release version, the link option has : /MERGE:.rdata=.data
It seems release binary included the global data array in the final efi image.

So, my question is:
Will the global data array be in linked into the final efi binary image when compiling debug version?

Thanks


保密声明:
本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其内容做任何未经授权的查阅、使用、复制或转发。
CONFIDENTIAL NOTE:
This email contains confidential or legally privileged information and is for the sole use of its intended recipient. Any unauthorized
review, use, copying or forwarding of this email or the content of this email is strictly prohibited.


[edk2-test][PATCH v1 1/1] uefi-sct/SctPkg: Fix GUID of EfiCompliant test

Samer El-Haj-Mahmoud
 

The GUID of one of the EfiCompliant test cases is incorrect. The GUID
is defined in test case 5.22.1.2.12 in section 2.1.2 of
UEFI_SCTII_Case_Spec_2_6_A.pdf, which is available from UEFI Forum:
http://www.uefi.org/sites/default/files/resources/
UEFI2.6SCTII_Final_Release.zip

The GUID value is correct in the code
(gEfiCompliantBbTestPlatformAssertionGuid012), but not in Guid_uefi.h,
causing a disconnect between the data file and the code, which resulted
in the test case being omitted from SCT.

Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
Cc: Eric Jin <eric.jin@intel.com>
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
---
uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Guid_uefi.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Guid_uefi.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Guid_uefi.h
index 158231c46d37..7e3552bc99b1 100644
--- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Guid_uefi.h
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Guid_uefi.h
@@ -81,7 +81,7 @@ extern EFI_GUID gEfiCompliantBbTestPlatformAssertionGuid010;
extern EFI_GUID gEfiCompliantBbTestPlatformAssertionGuid011;

#define EFI_TEST_EFICOMPLIANTBBTESTPLATFORM_ASSERTION_012_GUID \
-{ 0x76A621B0, 0x8C53, 0x407d, {0x84, 0x86, 0x9a, 0x6e, 0x63, 0x32, 0xd3, 0xce }}
+{ 0x76A6A1B0, 0x8C53, 0x407d, {0x84, 0x86, 0x9a, 0x6e, 0x63, 0x32, 0xd3, 0xce }}

extern EFI_GUID gEfiCompliantBbTestPlatformAssertionGuid012;

--
2.17.1


Re: [PATCH edk2-test 1/1] SctPkg: fix page alignment calculations

Samer El-Haj-Mahmoud
 

I verified that this works on multiple platforms

Tested-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Samer
El-Haj-Mahmoud via groups.io
Sent: Thursday, July 23, 2020 10:33 PM
To: Pankaj Bansal <pankaj.bansal@oss.nxp.com>; devel@edk2.groups.io;
Eric Jin <eric.jin@intel.com>; G Edhaya Chandran
<Edhaya.Chandran@arm.com>
Cc: Pankaj Bansal <pankaj.bansal@nxp.com>; Paul Yang
<Paul.Yang@arm.com>; Gaurav Jain <gaurav.jain@nxp.com>; Samer El-Haj-
Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Subject: Re: [edk2-devel] [PATCH edk2-test 1/1] SctPkg: fix page alignment
calculations

Acked-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>

-----Original Message-----
From: Pankaj Bansal <pankaj.bansal@oss.nxp.com>
Sent: Saturday, July 4, 2020 11:52 AM
To: devel@edk2.groups.io; Eric Jin <eric.jin@intel.com>; G Edhaya
Chandran <Edhaya.Chandran@arm.com>
Cc: Pankaj Bansal <pankaj.bansal@nxp.com>; Paul Yang
<Paul.Yang@arm.com>; Samer El-Haj-Mahmoud <Samer.El-Haj-
Mahmoud@arm.com>; Gaurav Jain <gaurav.jain@nxp.com>
Subject: [PATCH edk2-test 1/1] SctPkg: fix page alignment calculations

From: Pankaj Bansal <pankaj.bansal@nxp.com>

The BBTestAllocatePagesInterfaceTest tries to allocate pages for
different memory types.
While doing so, it tries to fix up the Start and PageNum for 64K Page
size. There are multiple issues with this:

1. 64K alignment is being done regardless of Processor type and Memory
type. while this is correct for ARM64 Processor, it might not be so
for other Processor types. Also 64K alignment for ARM64 Processor
is needed for some Memory types not all.
2. The Start is being incremented by 64K, even if Start is already 64K
aligned.
3. PageNum is being decreased by 16 pages indiscriminately, which might
not be needed in all cases.

fix all these issues by correctly doing the alignment in all needed cases.

Cc: Paul Yang <Paul.Yang@arm.com>
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Cc: Gaurav Jain <gaurav.jain@nxp.com>
Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
---
.../MemoryAllocationServicesBBTestFunction.c | 148
+++++++++++++-----
1 file changed, 106 insertions(+), 42 deletions(-)

diff --git a/uefi-
sct/SctPkg/TestCase/UEFI/EFI/BootServices/MemoryAllocationServices/Bla
ckBo xTest/MemoryAllocationServicesBBTestFunction.c b/uefi-
sct/SctPkg/TestCase/UEFI/EFI/BootServices/MemoryAllocationServices/Bla
ckBo xTest/MemoryAllocationServicesBBTestFunction.c
index d18fe1fc2b94..9ed9e6e0de74 100644
--- a/uefi-
sct/SctPkg/TestCase/UEFI/EFI/BootServices/MemoryAllocationServices/Bla
ckBo xTest/MemoryAllocationServicesBBTestFunction.c
+++ b/uefi-
sct/SctPkg/TestCase/UEFI/EFI/BootServices/MemoryAllocationS
+++ er vices/BlackBoxTest/MemoryAllocationServicesBBTestFunction.c
@@ -354,6 +354,7 @@ BBTestAllocatePagesInterfaceTest (
EFI_TPL OldTpl;
EFI_MEMORY_DESCRIPTOR Descriptor;
UINTN PageNum;
+ UINTN Alignment;

//
// Get the Standard Library Interface @@ -700,14 +701,23 @@
BBTestAllocatePagesInterfaceTest (
PageNum = (UINTN)Descriptor.NumberOfPages;
Start = Descriptor.PhysicalStart;

- //
- // Some memory types need more alignment than 4K, so
- //
- if (PageNum <= 0x10) {
+ Alignment = DEFAULT_PAGE_ALLOCATION_GRANULARITY;
+
+ if (AllocatePagesMemoryType[TypeIndex] ==
EfiACPIReclaimMemory ||
+ AllocatePagesMemoryType[TypeIndex] == EfiACPIMemoryNVS
||
+ AllocatePagesMemoryType[TypeIndex] ==
EfiRuntimeServicesCode ||
+ AllocatePagesMemoryType[TypeIndex] ==
+ EfiRuntimeServicesData) {
+
+ Alignment = RUNTIME_PAGE_ALLOCATION_GRANULARITY;
+ }
+
+ Start = (Start + Alignment - 1) & ~(Alignment - 1);
+ PageNum -= EFI_SIZE_TO_PAGES (Start -
+ Descriptor.PhysicalStart);
+
+ PageNum &= ~(EFI_SIZE_TO_PAGES (Alignment) - 1);
+ if (PageNum <= EFI_SIZE_TO_PAGES (Alignment)) {
break;
}
- Start = (Start + 0x10000) & 0xFFFFFFFFFFFF0000;
- PageNum = PageNum - EFI_SIZE_TO_PAGES(0x10000);

Memory = Start;

@@ -830,14 +840,23 @@ BBTestAllocatePagesInterfaceTest (
PageNum = (UINTN)Descriptor.NumberOfPages;
Start = Descriptor.PhysicalStart;

- //
- // Some memory types need more alignment than 4K, so
- //
- if (PageNum <= 0x10) {
+ Alignment = DEFAULT_PAGE_ALLOCATION_GRANULARITY;
+
+ if (AllocatePagesMemoryType[TypeIndex] ==
EfiACPIReclaimMemory ||
+ AllocatePagesMemoryType[TypeIndex] == EfiACPIMemoryNVS
||
+ AllocatePagesMemoryType[TypeIndex] ==
EfiRuntimeServicesCode ||
+ AllocatePagesMemoryType[TypeIndex] ==
+ EfiRuntimeServicesData) {
+
+ Alignment = RUNTIME_PAGE_ALLOCATION_GRANULARITY;
+ }
+
+ Start = (Start + Alignment - 1) & ~(Alignment - 1);
+ PageNum -= EFI_SIZE_TO_PAGES (Start -
+ Descriptor.PhysicalStart);
+
+ PageNum &= ~(EFI_SIZE_TO_PAGES (Alignment) - 1);
+ if (PageNum <= EFI_SIZE_TO_PAGES (Alignment)) {
break;
}
- Start = (Start + 0x10000) & 0xFFFFFFFFFFFF0000;
- PageNum = PageNum - EFI_SIZE_TO_PAGES(0x10000);

Memory = Start;

@@ -953,14 +972,23 @@ BBTestAllocatePagesInterfaceTest (
PageNum = (UINTN)Descriptor.NumberOfPages;
Start = Descriptor.PhysicalStart;

- //
- // Some memory types need more alignment than 4K, so
- //
- if (PageNum <= 0x10) {
+ Alignment = DEFAULT_PAGE_ALLOCATION_GRANULARITY;
+
+ if (AllocatePagesMemoryType[TypeIndex] ==
EfiACPIReclaimMemory ||
+ AllocatePagesMemoryType[TypeIndex] == EfiACPIMemoryNVS
||
+ AllocatePagesMemoryType[TypeIndex] ==
EfiRuntimeServicesCode ||
+ AllocatePagesMemoryType[TypeIndex] ==
+ EfiRuntimeServicesData) {
+
+ Alignment = RUNTIME_PAGE_ALLOCATION_GRANULARITY;
+ }
+
+ Start = (Start + Alignment - 1) & ~(Alignment - 1);
+ PageNum -= EFI_SIZE_TO_PAGES (Start -
+ Descriptor.PhysicalStart);
+
+ PageNum &= ~(EFI_SIZE_TO_PAGES (Alignment) - 1);
+ if (PageNum <= EFI_SIZE_TO_PAGES (Alignment)) {
break;
}
- Start = (Start + 0x10000) & 0xFFFFFFFFFFFF0000;
- PageNum = PageNum - EFI_SIZE_TO_PAGES(0x10000);

Memory = Start + (SctLShiftU64 (PageNum/3, EFI_PAGE_SHIFT) &
0xFFFFFFFFFFFF0000);

@@ -1076,14 +1104,23 @@ BBTestAllocatePagesInterfaceTest (
PageNum = (UINTN)Descriptor.NumberOfPages;
Start = Descriptor.PhysicalStart;

- //
- // Some memory types need more alignment than 4K, so
- //
- if (PageNum <= 0x10) {
+ Alignment = DEFAULT_PAGE_ALLOCATION_GRANULARITY;
+
+ if (AllocatePagesMemoryType[TypeIndex] ==
EfiACPIReclaimMemory ||
+ AllocatePagesMemoryType[TypeIndex] == EfiACPIMemoryNVS
||
+ AllocatePagesMemoryType[TypeIndex] ==
EfiRuntimeServicesCode ||
+ AllocatePagesMemoryType[TypeIndex] ==
+ EfiRuntimeServicesData) {
+
+ Alignment = RUNTIME_PAGE_ALLOCATION_GRANULARITY;
+ }
+
+ Start = (Start + Alignment - 1) & ~(Alignment - 1);
+ PageNum -= EFI_SIZE_TO_PAGES (Start -
+ Descriptor.PhysicalStart);
+
+ PageNum &= ~(EFI_SIZE_TO_PAGES (Alignment) - 1);
+ if (PageNum <= EFI_SIZE_TO_PAGES (Alignment)) {
break;
}
- Start = (Start + 0x10000) & 0xFFFFFFFFFFFF0000;
- PageNum = PageNum - EFI_SIZE_TO_PAGES(0x10000);

Memory = Start + (SctLShiftU64 (PageNum * 2 / 3,
EFI_PAGE_SHIFT) & 0xFFFFFFFFFFFF0000);

@@ -1206,14 +1243,23 @@ BBTestAllocatePagesInterfaceTest (
PageNum = (UINTN)Descriptor.NumberOfPages;
Start = Descriptor.PhysicalStart;

- //
- // Some memory types need more alignment than 4K, so
- //
- if (PageNum <= 0x10) {
+ Alignment = DEFAULT_PAGE_ALLOCATION_GRANULARITY;
+
+ if (AllocatePagesMemoryType[TypeIndex] ==
EfiACPIReclaimMemory ||
+ AllocatePagesMemoryType[TypeIndex] == EfiACPIMemoryNVS
||
+ AllocatePagesMemoryType[TypeIndex] ==
EfiRuntimeServicesCode ||
+ AllocatePagesMemoryType[TypeIndex] ==
+ EfiRuntimeServicesData) {
+
+ Alignment = RUNTIME_PAGE_ALLOCATION_GRANULARITY;
+ }
+
+ Start = (Start + Alignment - 1) & ~(Alignment - 1);
+ PageNum -= EFI_SIZE_TO_PAGES (Start -
+ Descriptor.PhysicalStart);
+
+ PageNum &= ~(EFI_SIZE_TO_PAGES (Alignment) - 1);
+ if (PageNum <= EFI_SIZE_TO_PAGES (Alignment)) {
break;
}
- Start = (Start + 0x10000) & 0xFFFFFFFFFFFF0000;
- PageNum = PageNum - EFI_SIZE_TO_PAGES(0x10000);

Memory = Start;

@@ -1329,14 +1375,23 @@ BBTestAllocatePagesInterfaceTest (
PageNum = (UINTN)Descriptor.NumberOfPages;
Start = Descriptor.PhysicalStart;

- //
- // Some memory types need more alignment than 4K, so
- //
- if (PageNum <= 0x10) {
+ Alignment = DEFAULT_PAGE_ALLOCATION_GRANULARITY;
+
+ if (AllocatePagesMemoryType[TypeIndex] ==
EfiACPIReclaimMemory ||
+ AllocatePagesMemoryType[TypeIndex] == EfiACPIMemoryNVS
||
+ AllocatePagesMemoryType[TypeIndex] ==
EfiRuntimeServicesCode ||
+ AllocatePagesMemoryType[TypeIndex] ==
+ EfiRuntimeServicesData) {
+
+ Alignment = RUNTIME_PAGE_ALLOCATION_GRANULARITY;
+ }
+
+ Start = (Start + Alignment - 1) & ~(Alignment - 1);
+ PageNum -= EFI_SIZE_TO_PAGES (Start -
+ Descriptor.PhysicalStart);
+
+ PageNum &= ~(EFI_SIZE_TO_PAGES (Alignment) - 1);
+ if (PageNum <= EFI_SIZE_TO_PAGES (Alignment)) {
break;
}
- Start = (Start + 0x10000) & 0xFFFFFFFFFFFF0000;
- PageNum = PageNum - EFI_SIZE_TO_PAGES(0x10000);

Memory = Start;

@@ -1468,14 +1523,23 @@ BBTestAllocatePagesInterfaceTest (
PageNum = (UINTN)Descriptor.NumberOfPages;
Start = Descriptor.PhysicalStart;

- //
- // Some memory types need more alignment than 4K, so
- //
- if (PageNum <= 0x10) {
+ Alignment = DEFAULT_PAGE_ALLOCATION_GRANULARITY;
+
+ if (AllocatePagesMemoryType[TypeIndex] ==
EfiACPIReclaimMemory ||
+ AllocatePagesMemoryType[TypeIndex] == EfiACPIMemoryNVS
||
+ AllocatePagesMemoryType[TypeIndex] ==
EfiRuntimeServicesCode ||
+ AllocatePagesMemoryType[TypeIndex] ==
+ EfiRuntimeServicesData) {
+
+ Alignment = RUNTIME_PAGE_ALLOCATION_GRANULARITY;
+ }
+
+ Start = (Start + Alignment - 1) & ~(Alignment - 1);
+ PageNum -= EFI_SIZE_TO_PAGES (Start -
+ Descriptor.PhysicalStart);
+
+ PageNum &= ~(EFI_SIZE_TO_PAGES (Alignment) - 1);
+ if (PageNum <= EFI_SIZE_TO_PAGES (Alignment)) {
break;
}
- Start = (Start + 0x10000) & 0xFFFFFFFFFFFF0000;
- PageNum = PageNum - EFI_SIZE_TO_PAGES(0x10000);

Memory = Start;

--
2.17.1
IMPORTANT NOTICE: The contents of this email and any attachments are
confidential and may also be privileged. If you are not the intended recipient,
please notify the sender immediately and do not disclose the contents to any
other person, use it for any purpose, or store or copy the information in any
medium. Thank you.

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


Re: [PATCH] Check return status on calls to GetTime()

Samer El-Haj-Mahmoud
 

Reviewed-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>

-----Original Message-----
From: Grant Likely <Grant.Likely@arm.com>
Sent: Friday, July 31, 2020 1:20 PM
To: devel@edk2.groups.io
Cc: nd <nd@arm.com>; Grant Likely <Grant.Likely@arm.com>; G Edhaya
Chandran <Edhaya.Chandran@arm.com>; Heinrich Schuchardt
<xypron.glpk@gmx.de>; Samer El-Haj-Mahmoud <Samer.El-Haj-
Mahmoud@arm.com>
Subject: [PATCH] Check return status on calls to GetTime()

Not all platforms implement GetTime(), but the SCT just assumes calls to
GetTime will be successful. If GetTime() doesn't return EFI_SUCCESS, then
the EFI_TIME value will be uninitialized data.

Fix by checking the GetTime() return code. If it doesn't return EFI_SUCCESS,
then use the traditional 1/1/1970 epoch so that the test report at least looks
sane, but it is obvious that we don't have a valid timestamp.

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=2870

Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
Signed-off-by: Grant Likely <grant.likely@arm.com>
---
.../SimpleNetwork/SimpleNetworkENTSTestCase.c | 26 +++++++++++++----
--
.../MiscBootServicesBBTestFunction.c | 8 ++++--
.../DriverBindingBBTestFunction.c | 5 +++-
.../SCT/Drivers/StandardTest/StandardTest.c | 11 +++++---
.../Framework/ENTS/EasDispatcher/Core/Eas.c | 9 +++++--
.../ENTS/EasDispatcher/Exec/EasCmdDisp.c | 20 +++++++++-----
6 files changed, 57 insertions(+), 22 deletions(-)

diff --git a/uefi-
sct/SctPkg/TestCase/RIVL/Protocol/SimpleNetwork/SimpleNetworkENTSTes
tCase.c b/uefi-
sct/SctPkg/TestCase/RIVL/Protocol/SimpleNetwork/SimpleNetworkENTSTes
tCase.c
index 9c8d2a70..5579be7e 100644
--- a/uefi-
sct/SctPkg/TestCase/RIVL/Protocol/SimpleNetwork/SimpleNetworkENTSTes
tCase.c
+++ b/uefi-
sct/SctPkg/TestCase/RIVL/Protocol/SimpleNetwork/SimpleNetwork
+++ ENTSTestCase.c
@@ -24,6 +24,8 @@ Abstract:

#include "SimpleNetworkENTSTestCase.h"

+static EFI_TIME Epoch = { .Year = 1970, .Month = 1, .Day = 1 };
+
//
// SimpleNetwork.Start
//
@@ -928,7 +930,8 @@ Returns:
Status = EFI_SUCCESS;
tBS->Stall (5000);

- tRT->GetTime (&BeginTime, NULL);
+ if (tRT->GetTime (&BeginTime, NULL) != EFI_SUCCESS)
+ BeginTime = Epoch;
for (Index = 0; Index < 1;) {
Status = SimpleNetwork->Transmit (
SimpleNetwork, @@ -964,7 +967,8 @@ Returns:
}
}

- tRT->GetTime (&BeginTime, NULL);
+ if (tRT->GetTime (&BeginTime, NULL) != EFI_SUCCESS)
+ BeginTime = Epoch;

for (Index = 1; Index < TransmitPattern1Number;) {
Status = SimpleNetwork->Transmit (
@@ -1002,7 +1006,8 @@ Returns:
}

End:
- tRT->GetTime (&EndTime, NULL);
+ if (tRT->GetTime (&EndTime, NULL) != EFI_SUCCESS)
+ EndTime = Epoch;

*TransmitPattern1Status = Status;

@@ -1125,7 +1130,8 @@ Returns:
Status = EFI_SUCCESS;
tBS->Stall (5000);

- tRT->GetTime (&BeginTime, NULL);
+ if (tRT->GetTime (&BeginTime, NULL) != EFI_SUCCESS)
+ BeginTime = Epoch;
for (Index = 0; Index < 1;) {
Status = SimpleNetwork->Transmit (
SimpleNetwork, @@ -1161,7 +1167,8 @@ Returns:
}
}

- tRT->GetTime (&BeginTime, NULL);
+ if (tRT->GetTime (&BeginTime, NULL) != EFI_SUCCESS)
+ BeginTime = Epoch;

for (Index = 1; Index < TransmitPattern2Number;) {
Status = SimpleNetwork->Transmit (
@@ -1199,7 +1206,8 @@ Returns:
}

End:
- tRT->GetTime (&EndTime, NULL);
+ if (tRT->GetTime (&EndTime, NULL) != EFI_SUCCESS)
+ EndTime = Epoch;

*TransmitPattern1Status = Status;

@@ -1326,7 +1334,8 @@ Returns:
}
}

- tRT->GetTime (&BeginTime, NULL);
+ if (tRT->GetTime (&BeginTime, NULL) != EFI_SUCCESS)
+ BeginTime = Epoch;

for (Index = 1; Index < ReceivePattern1Number;) {
*ReceivePattern1BufferSize = BufferSizeOrg; @@ -1346,7 +1355,8 @@
Returns:
}
}

- tRT->GetTime (&EndTime, NULL);
+ if (tRT->GetTime (&EndTime, NULL) != EFI_SUCCESS)
+ EndTime = Epoch;

*ReceivePattern1Status = Status;

diff --git a/uefi-
sct/SctPkg/TestCase/UEFI/EFI/BootServices/MiscBootServices/BlackBoxTest
/MiscBootServicesBBTestFunction.c b/uefi-
sct/SctPkg/TestCase/UEFI/EFI/BootServices/MiscBootServices/BlackBoxTest
/MiscBootServicesBBTestFunction.c
index 1d231d8c..3a530282 100644
--- a/uefi-
sct/SctPkg/TestCase/UEFI/EFI/BootServices/MiscBootServices/BlackBoxTest
/MiscBootServicesBBTestFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/BootServices/MiscBootServices/Bl
+++ ackBoxTest/MiscBootServicesBBTestFunction.c
@@ -27,6 +27,8 @@ Abstract:
#include "SctLib.h"
#include "MiscBootServicesBBTestMain.h"

+static EFI_TIME Epoch = { .Year = 1970, .Month = 1, .Day = 1 };
+
/**
* Entrypoint for gtBS->SetWatchdogTimer() Interface Test.
* @param This a pointer of EFI_BB_TEST_PROTOCOL.
@@ -821,13 +823,15 @@ BBTestStallInterfaceTest (
//
// 4.2.2.1 Stall must succeed.
//
- gtRT->GetTime (&StartTime, NULL);
+ if (gtRT->GetTime (&StartTime, NULL) != EFI_SUCCESS)
+ StartTime = Epoch;
OldTpl = gtBS->RaiseTPL (TplArray[Index]);
Status = gtBS->Stall (
10000000
);
gtBS->RestoreTPL (OldTpl);
- gtRT->GetTime (&EndTime, NULL);
+ if (gtRT->GetTime (&EndTime, NULL) != EFI_SUCCESS)
+ EndTime = Epoch;
if (Status == EFI_SUCCESS) {
AssertionType = EFI_TEST_ASSERTION_PASSED;
} else {
diff --git a/uefi-
sct/SctPkg/TestCase/UEFI/IHV/Protocol/DriverBinding/BlackBoxTest/DriverB
indingBBTestFunction.c b/uefi-
sct/SctPkg/TestCase/UEFI/IHV/Protocol/DriverBinding/BlackBoxTest/DriverB
indingBBTestFunction.c
index bf675feb..4ab52dcd 100644
--- a/uefi-
sct/SctPkg/TestCase/UEFI/IHV/Protocol/DriverBinding/BlackBoxTest/DriverB
indingBBTestFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/DriverBinding/BlackBoxT
+++ est/DriverBindingBBTestFunction.c
@@ -36,6 +36,8 @@ static const UINTN MonthLengths[2][12] = {
{ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } };

+static EFI_TIME Epoch = { .Year = 1970, .Month = 1, .Day = 1 };
+
#define MINS_PER_HOUR 60
#define HOURS_PER_DAY 24
#define SECS_PER_MIN 60
@@ -1052,7 +1054,8 @@ EndLogging (
WriteLogFile (Private, DashLine, SYSTEMLOG);
WriteLogFile (Private, DashLine, CASELOG);

- gtRT->GetTime (&CurrentTime, NULL);
+ if (gtRT->GetTime (&CurrentTime, NULL) != EFI_SUCCESS)
+ CurrentTime = Epoch;
DBSPrint (Buffer, EFI_MAX_PRINT_BUFFER, L"Test Finished: %t\n",
&CurrentTime);

WriteLogFile (Private, Buffer, SYSTEMLOG); diff --git a/uefi-
sct/SctPkg/TestInfrastructure/SCT/Drivers/StandardTest/StandardTest.c
b/uefi-
sct/SctPkg/TestInfrastructure/SCT/Drivers/StandardTest/StandardTest.c
index 84025457..836f072a 100644
--- a/uefi-
sct/SctPkg/TestInfrastructure/SCT/Drivers/StandardTest/StandardTest.c
+++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Drivers/StandardTest/Standa
+++ rdTest.c
@@ -30,6 +30,8 @@ Abstract:
#include "StandardTest.h"
#include <Library/EntsLib.h>

+static EFI_TIME Epoch = { .Year = 1970, .Month = 1, .Day = 1 };
+
//
// Prototypes
//
@@ -1081,7 +1083,8 @@ Returns:
StslWriteLogFile (Private, Buffer);

CurrentTime = &Private->StartTime;
- tRT->GetTime (CurrentTime, NULL);
+ if (tRT->GetTime (CurrentTime, NULL) != EFI_SUCCESS)
+ *CurrentTime = Epoch;

} else {
StslWriteLogFile (Private, DashLine); @@ -1118,7 +1121,8 @@ Returns:

StslWriteLogFileName (Private);
CurrentTime = &Private->StartTime;
- tRT->GetTime (CurrentTime, NULL);
+ if (tRT->GetTime (CurrentTime, NULL) != EFI_SUCCESS)
+ *CurrentTime = Epoch;
SctSPrint (Buffer, EFI_MAX_PRINT_BUFFER, L"Test Started: %t\n",
CurrentTime);
StslWriteLogFile (Private, Buffer);

@@ -1238,7 +1242,8 @@ Returns:

StslWriteLogFileName (Private);

- tRT->GetTime (&CurrentTime, NULL);
+ if (tRT->GetTime (&CurrentTime, NULL) != EFI_SUCCESS)
+ CurrentTime = Epoch;

SecondsElapsed = SecondsElapsedFromBaseYear (
Private->StartTime.Year, diff --git a/uefi-
sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasDispatcher/Core/Ea
s.c b/uefi-
sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasDispatcher/Core/Ea
s.c
index 28f5ed4a..60b1c4dc 100644
--- a/uefi-
sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasDispatcher/Core/Ea
s.c
+++ b/uefi-
sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasDispatche
+++ r/Core/Eas.c
@@ -23,9 +23,12 @@ Abstract:
--*/


+#include "Sct.h"
#include "Sct.h"
#include EFI_TEST_PROTOCOL_DEFINITION (EntsMonitorProtocol)

+static EFI_TIME Epoch = { .Year = 1970, .Month = 1, .Day = 1 };
+
STATIC
EFI_STATUS
AgentTestMain (
@@ -310,7 +313,8 @@ DelaySctAgentCmdPost (
}
SctAgentCmdDelayedPost->CmdReturn = CmdReturn;
SctAgentCmdDelayedPost->Cmd.ComdResult = CmdResult;
- tRT->GetTime (&SctAgentCmdDelayedPost->StartTime, NULL);
+ if (tRT->GetTime (&SctAgentCmdDelayedPost->StartTime, NULL) !=
EFI_SUCCESS)
+ SctAgentCmdDelayedPost->StartTime = Epoch;

return Status;
}
@@ -327,7 +331,8 @@ PostSctAgentDelayedCmd (
return EFI_SUCCESS;
}

- tRT->GetTime (&SctAgentCmdDelayedPost->EndTime, NULL);
+ if (tRT->GetTime (&SctAgentCmdDelayedPost->EndTime, NULL) !=
EFI_SUCCESS)
+ SctAgentCmdDelayedPost->EndTime = Epoch;

Status = RecordMessage (
&SctAgentCmdDelayedPost->Cmd.ComdRuntimeInfo,
diff --git a/uefi-
sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasDispatcher/Exec/Ea
sCmdDisp.c b/uefi-
sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasDispatcher/Exec/Ea
sCmdDisp.c
index 1ff6d569..cb6f08cf 100644
--- a/uefi-
sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasDispatcher/Exec/Ea
sCmdDisp.c
+++ b/uefi-
sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasDispatche
+++ r/Exec/EasCmdDisp.c
@@ -50,6 +50,8 @@ Abstract:

EFI_CPU_ARCH_PROTOCOL *Cpu = NULL;

+static EFI_TIME Epoch = { .Year = 1970, .Month = 1, .Day = 1 };
+
//
// Local Function Definition
//
@@ -132,9 +134,11 @@ Returns:
//
// Perform EFTP operation.
//
- tRT->GetTime (&StartTime, NULL);
+ if (tRT->GetTime (&StartTime, NULL) != EFI_SUCCESS)
+ StartTime = Epoch;
Status = EftpDispatchFileTransferComd (FileCmdType);
- tRT->GetTime (&EndTime, NULL);
+ if (tRT->GetTime (&EndTime, NULL) != EFI_SUCCESS)
+ EndTime = Epoch;

if (Status == EFI_OUT_OF_RESOURCES) {
return EFI_OUT_OF_RESOURCES;
@@ -365,9 +369,11 @@ Returns:
//
// Execute Shell Command
//
- tRT->GetTime (&StartTime, NULL);
+ if (tRT->GetTime (&StartTime, NULL) != EFI_SUCCESS)
+ StartTime = Epoch;
Status = SctShellExecute (&mImageHandle, (gEasFT->Cmd)->ComdArg,
FALSE, NULL, NULL);;
- tRT->GetTime (&EndTime, NULL);
+ if (tRT->GetTime (&EndTime, NULL) != EFI_SUCCESS)
+ EndTime = Epoch;
EFI_ENTS_DEBUG ((EFI_ENTS_D_TRACE, L"dispatch:(%s)", (gEasFT->Cmd)-
ComdArg));
SctPrint (L"dispatch:(%s) - %r\n", (gEasFT->Cmd)->ComdArg, Status);
if (Status == EFI_OUT_OF_RESOURCES) { @@ -1483,9 +1489,11 @@
Returns:
//
// Resume SCT execution by executing "sct -c" in sct passive mode.
//
- tRT->GetTime (&StartTime, NULL);
+ if (tRT->GetTime (&StartTime, NULL) != EFI_SUCCESS)
+ StartTime = Epoch;
Status = SctShellExecute (&mImageHandle, (gEasFT->Cmd)->ComdArg,
FALSE, NULL, NULL);;
- tRT->GetTime (&EndTime, NULL);
+ if (tRT->GetTime (&EndTime, NULL) != EFI_SUCCESS)
+ EndTime = Epoch;
EFI_ENTS_DEBUG ((EFI_ENTS_D_TRACE, L"dispatch:(%s)", (gEasFT->Cmd)-
ComdArg));
SctPrint (L"dispatch:(%s) - %r\n", (gEasFT->Cmd)->ComdArg, Status);
if (Status == EFI_OUT_OF_RESOURCES) {
--
2.20.1


Re: [edk2-test] [PATCH 1/1] uefi-sct/SctPkg: typo Verity in TimeServicesBBTestFunction

Samer El-Haj-Mahmoud
 

Picking up old SCT patches that were missed

Reviewed-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Heinrich
Schuchardt via Groups.Io
Sent: Sunday, December 8, 2019 10:51 AM
To: EDK II Development <devel@edk2.groups.io>
Cc: Eric Jin <eric.jin@intel.com>; Supreeth Venkatesh
<Supreeth.Venkatesh@arm.com>; Stephano Cetola
<stephano.cetola@linux.intel.com>; Heinrich Schuchardt
<xypron.glpk@gmx.de>
Subject: [edk2-devel] [edk2-test] [PATCH 1/1] uefi-sct/SctPkg: typo Verity in
TimeServicesBBTestFunction

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2407

%s/Verity/Verify/g

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
.../BlackBoxTest/TimeServicesBBTestFunction.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/uefi-
sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TimeServices/BlackBoxTest/
TimeServicesBBTestFunction.c b/uefi-
sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TimeServices/BlackBoxTest/
TimeServicesBBTestFunction.c
index 0d139d3b..18e00a35 100644
--- a/uefi-
sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TimeServices/BlackBoxTest/
TimeServicesBBTestFunction.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/TimeServices/Bla
+++ ckBoxTest/TimeServicesBBTestFunction.c
@@ -379,7 +379,7 @@ step1:
(Index == 1? \
gTimeServicesBBTestFunctionAssertionGuid017: \
gTimeServicesBBTestFunctionAssertionGuid018),- L"RT.SetTime -
Verity year after change",+ L"RT.SetTime - Verify year after
change", L"%a:%d:Status - %r, TPL - %d", __FILE__,
(UINTN)__LINE__,@@ -491,7 +491,7 @@ step2:
(Index == 1? \
gTimeServicesBBTestFunctionAssertionGuid023: \
gTimeServicesBBTestFunctionAssertionGuid024),- L"RT.SetTime -
Verity month after change",+ L"RT.SetTime - Verify month after
change", L"%a:%d:Status - %r, TPL - %d", __FILE__,
(UINTN)__LINE__,@@ -600,7 +600,7 @@ step3:
(Index == 1? \
gTimeServicesBBTestFunctionAssertionGuid029: \
gTimeServicesBBTestFunctionAssertionGuid030),- L"RT.SetTime -
Verity daylight after change",+ L"RT.SetTime - Verify daylight after
change", L"%a:%d:Status - %r, TPL - %d", __FILE__,
(UINTN)__LINE__,@@ -708,7 +708,7 @@ step4:
(Index == 1? \
gTimeServicesBBTestFunctionAssertionGuid035: \
gTimeServicesBBTestFunctionAssertionGuid036),- L"RT.SetTime -
Verity time zone after change",+ L"RT.SetTime - Verify time zone
after change", L"%a:%d:Status - %r, TPL - %d", __FILE__,
(UINTN)__LINE__,--
2.24.0


-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#52030): https://edk2.groups.io/g/devel/message/52030
Mute This Topic: https://groups.io/mt/67740553/1945644
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [samer.el-haj-
mahmoud@arm.com] -=-=-=-=-=-=
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


Re: [edk2-test] [PATCH 1/1] uefi-sct/SctPkg: fix variable services conformance test

Samer El-Haj-Mahmoud
 

Reviewed-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Heinrich
Schuchardt via groups.io
Sent: Monday, July 27, 2020 1:53 PM
To: EDK II Development <devel@edk2.groups.io>
Cc: Eric Jin <eric.jin@intel.com>; G Edhaya Chandran
<Edhaya.Chandran@arm.com>; Heinrich Schuchardt <xypron.glpk@gmx.de>
Subject: [edk2-devel] [edk2-test] [PATCH 1/1] uefi-sct/SctPkg: fix variable
services conformance test

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2865

QueryVariableInfo() returning EFI_SUCCESS for a legal combination of
attributes is not an error.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
.../BlackBoxTest/AuthVariableServicesBBTestConformance.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/uefi-
sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxT
est/AuthVariableServicesBBTestConformance.c b/uefi-
sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxT
est/AuthVariableServicesBBTestConformance.c
index 23b00e35..f16560ff 100644
--- a/uefi-
sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBoxT
est/AuthVariableServicesBBTestConformance.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices
+++ /BlackBoxTest/AuthVariableServicesBBTestConformance.c
@@ -287,7 +287,7 @@ AuthVariableDERConfTest (
&MaximumVariableSize ); - if (Status ==
EFI_UNSUPPORTED) {+ if (Status == EFI_SUCCESS || Status ==
EFI_UNSUPPORTED) { Result = EFI_TEST_ASSERTION_PASSED; } else {
Result = EFI_TEST_ASSERTION_FAILED;--
2.27.0


-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#63354): https://edk2.groups.io/g/devel/message/63354
Mute This Topic: https://groups.io/mt/75828348/1945644
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [samer.el-haj-
mahmoud@arm.com] -=-=-=-=-=-=
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


Re: [edk2-test] [PATCH 1/1] uefi-sct/SctPkg: EFI_RNG_PROTOCOL.GetInfo check size != 0

Samer El-Haj-Mahmoud
 

Picking old SCT patches that were missed

Reviewed-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Heinrich
Schuchardt via Groups.Io
Sent: Saturday, December 28, 2019 10:37 AM
To: EDK II Development <devel@edk2.groups.io>
Cc: Eric Jin <eric.jin@intel.com>; Supreeth Venkatesh
<Supreeth.Venkatesh@arm.com>; Heinrich Schuchardt
<xypron.glpk@gmx.de>
Subject: [edk2-devel] [edk2-test] [PATCH 1/1] uefi-sct/SctPkg:
EFI_RNG_PROTOCOL.GetInfo check size != 0

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2438

The EFI_RNG_PROTOCOL conformance test checks that the size returned by
GetInfo() is a multiple of 16. This would be fulfilled by size == 0.

The UEFI specification requires that at least one algorithm is implemented.
So we should check that size is non-zero too.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
.../RandomNumber/BlackBoxTest/RandomNumberBBTestConformance.c |
3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/uefi-
sct/SctPkg/TestCase/UEFI/EFI/Protocol/RandomNumber/BlackBoxTest/Rand
omNumberBBTestConformance.c b/uefi-
sct/SctPkg/TestCase/UEFI/EFI/Protocol/RandomNumber/BlackBoxTest/Rand
omNumberBBTestConformance.c
index f0a7c030..cd419d68 100644
--- a/uefi-
sct/SctPkg/TestCase/UEFI/EFI/Protocol/RandomNumber/BlackBoxTest/Rand
omNumberBBTestConformance.c
+++ b/uefi-
sct/SctPkg/TestCase/UEFI/EFI/Protocol/RandomNumber/BlackBoxTest/Rand
omNumberBBTestConformance.c
@@ -169,7 +169,8 @@ BBTestGetInfoConformanceTestCheckpoint1 (
return Status;

}



- if (EFI_BUFFER_TOO_SMALL == Status && RNGAlgorithmListSize %
sizeof(EFI_RNG_ALGORITHM) == 0) {

+ if (EFI_BUFFER_TOO_SMALL == Status && RNGAlgorithmListSize &&

+ RNGAlgorithmListSize % sizeof(EFI_RNG_ALGORITHM) == 0) {

AssertionType = EFI_TEST_ASSERTION_PASSED;

} else {

AssertionType = EFI_TEST_ASSERTION_FAILED;

--
2.24.1


-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#52599): https://edk2.groups.io/g/devel/message/52599
Mute This Topic: https://groups.io/mt/69304206/1945644
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [samer.el-haj-
mahmoud@arm.com]
-=-=-=-=-=-=
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


Re: [Patch 5/6] SecurityPkg: Fix spelling mistake for occurred

Maciej Rabeda
 

Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>

On 01-Aug-20 03:04, Michael D Kinney wrote:
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2361

Cc: Qi Zhang <qi1.zhang@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
.../Library/DxeImageVerificationLib/DxeImageVerificationLib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c b/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
index 36b87e16d5..b08fe24e85 100644
--- a/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
+++ b/SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
@@ -1465,7 +1465,7 @@ IsAllowedByDb (
//
// Fetch 'dbx' content. If 'dbx' doesn't exist, continue to check 'db'.
- // If any other errors occured, no need to check 'db' but just return
+ // If any other errors occurred, no need to check 'db' but just return
// not-allowed-by-db (FALSE) to avoid bypass.
//
DbxDataSize = 0;


question about MSFT compiler/link option

Tiger Liu(BJ-RD)
 

Hi, Experts:
I have a question about MSFT compiler/link option.

I wrote a PEIM, which had a large global data array definition in a C file.
Such as:
PRI_DATA_STRUCT PdataStructTable[] = {
{01, 0x75, 0xF0, 0x0, 0x0, 0x0 },
{02, 0x77, 0xF0, 0x0, 0x0, 0x0 },
{03, 0x79, 0xF0, 0x0, 0x0, 0x0 },
{04, 0x7B, 0xF0, 0x0, 0x0, 0x0 },
{05, 0x7D, 0xF0, 0x0, 0x0, 0x0 },
{06, 0x7F, 0xF0, 0x0, 0x0, 0x0 },
......
};

This global data array is very large, about 20KB.

But I found the PEIM's compiled size is about 5KB, it seems not include this global data array in the efi binary statically.
Even the release version PEIM's size is larger than debug version.

I found when compiling release version, the link option has : /MERGE:.rdata=.data
It seems release binary included the global data array in the final efi image.

So, my question is:
Will the global data array be in linked into the final efi binary image when compiling debug version?

Thanks


保密声明:
本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其内容做任何未经授权的查阅、使用、复制或转发。
CONFIDENTIAL NOTE:
This email contains confidential or legally privileged information and is for the sole use of its intended recipient. Any unauthorized review, use, copying or forwarding of this email or the content of this email is strictly prohibited.


Re: [Patch] BaseTools: Improve the method of checking queue empty

Liming Gao
 

Reviewed-by: Liming Gao <liming.gao@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Bob Feng
Sent: 2020年8月3日 10:04
To: devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>; Chen, Christine <yuwei.chen@intel.com>; Lucy Yan <lucyyan@google.com>
Subject: [edk2-devel] [Patch] BaseTools: Improve the method of checking queue empty

From: "Feng, Bob C" <bob.c.feng@intel.com>

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2807

The Queue.empty() method is not reliable in the multiple process runtime environment. This patch uses a new method to check if all modules are processed and workers need to be stopped. That is to add a None item at the bottom of the queue. Worker check if it gets that None item to know if all the module is processed.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Lucy Yan <lucyyan@google.com>
---
.../Source/Python/AutoGen/AutoGenWorker.py | 26 ++++++++++++++-----
BaseTools/Source/Python/build/build.py | 3 ++-
2 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGenWorker.py b/BaseTools/Source/Python/AutoGen/AutoGenWorker.py
index 563d91b421..017f676399 100755
--- a/BaseTools/Source/Python/AutoGen/AutoGenWorker.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGenWorker.py
@@ -22,10 +22,11 @@ except:
from Queue import Empty
import traceback
import sys
from AutoGen.DataPipe import MemoryDataPipe import logging
+import time

def clearQ(q):
try:
while True:
q.get_nowait()
@@ -109,11 +110,15 @@ class AutoGenManager(threading.Thread):
badnews = self.feedback_q.get()
if badnews is None:
break
if badnews == "Done":
fin_num += 1
+ elif badnews == "QueueEmpty":
+ EdkLogger.debug(EdkLogger.DEBUG_9, "Worker %s: %s" % (os.getpid(), badnews))
+ self.TerminateWorkers()
else:
+ EdkLogger.debug(EdkLogger.DEBUG_9, "Worker %s: %s"
+ % (os.getpid(), badnews))
self.Status = False
self.TerminateWorkers()
if fin_num == len(self.autogen_workers):
self.clearQueue()
for w in self.autogen_workers:
@@ -225,16 +230,25 @@ class AutoGenWorkerInProcess(mp.Process):
FfsCmd = {}
GlobalData.FfsCmd = FfsCmd
PlatformMetaFile = self.GetPlatformMetaFile(self.data_pipe.Get("P_Info").get("ActivePlatform"),
self.data_pipe.Get("P_Info").get("WorkspaceDir"))
while True:
- if self.module_queue.empty():
- break
if self.error_event.is_set():
break
module_count += 1
- module_file,module_root,module_path,module_basename,module_originalpath,module_arch,IsLib = self.module_queue.get_nowait()
+ try:
+ module_file,module_root,module_path,module_basename,module_originalpath,module_arch,IsLib = self.module_queue.get_nowait()
+ except Empty:
+ EdkLogger.debug(EdkLogger.DEBUG_9, "Worker %s: %s" % (os.getpid(), "Fake Empty."))
+ time.sleep(0.01)
+ continue
+ if module_file is None:
+ EdkLogger.debug(EdkLogger.DEBUG_9, "Worker %s: %s" % (os.getpid(), "Worker get the last item in the queue."))
+ self.feedback_q.put("QueueEmpty")
+ time.sleep(0.01)
+ continue
+
modulefullpath = os.path.join(module_root,module_file)
taskname = " : ".join((modulefullpath,module_arch))
module_metafile = PathClass(module_file,module_root)
if module_path:
module_metafile.Path = module_path @@ -278,15 +292,15 @@ class AutoGenWorkerInProcess(mp.Process):
self.cache_q.put((Ma.MetaFile.Path, Ma.Arch, "MakeCache", True))
continue
else:
self.cache_q.put((Ma.MetaFile.Path, Ma.Arch, "MakeCache", False))

- except Empty:
- pass
- except:
+ except Exception as e:
+ EdkLogger.debug(EdkLogger.DEBUG_9, "Worker %s: %s" %
+ (os.getpid(), str(e)))
self.feedback_q.put(taskname)
finally:
+ EdkLogger.debug(EdkLogger.DEBUG_9, "Worker %s: %s" %
+ (os.getpid(), "Done"))
self.feedback_q.put("Done")
self.cache_q.put("CacheDone")

def printStatus(self):
print("Processs ID: %d Run %d modules in AutoGen " % (os.getpid(),len(AutoGen.Cache())))
diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py
index 1ab1e60a64..59ceacfed0 100755
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -1215,11 +1215,11 @@ class Build():
if Target not in ['clean', 'cleanlib', 'cleanall', 'run', 'fds']:
# for target which must generate AutoGen code and makefile
mqueue = mp.Queue()
for m in AutoGenObject.GetAllModuleInfo:
mqueue.put(m)
-
+ mqueue.put((None,None,None,None,None,None,None))
AutoGenObject.DataPipe.DataContainer = {"CommandTarget": self.Target}
AutoGenObject.DataPipe.DataContainer = {"Workspace_timestamp": AutoGenObject.Workspace._SrcTimeStamp}
AutoGenObject.CreateLibModuelDirs()
AutoGenObject.DataPipe.DataContainer = {"LibraryBuildDirectoryList":AutoGenObject.LibraryBuildDirectoryList}
AutoGenObject.DataPipe.DataContainer = {"ModuleBuildDirectoryList":AutoGenObject.ModuleBuildDirectoryList}
@@ -2172,10 +2172,11 @@ class Build():
ToolChain, Arch, self.PlatformFile,Pa.DataPipe)
self.AllModules.add(Ma)
data_pipe_file = os.path.join(Pa.BuildDir, "GlobalVar_%s_%s.bin" % (str(Pa.Guid),Pa.Arch))
Pa.DataPipe.dump(data_pipe_file)

+ mqueue.put((None,None,None,None,None,None,None))
autogen_rt, errorcode = self.StartAutoGen(mqueue, Pa.DataPipe, self.SkipAutoGen, PcdMaList, cqueue)

if not autogen_rt:
self.AutoGenMgr.TerminateWorkers()
self.AutoGenMgr.join(1)
--
2.20.1.windows.1


Re: [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.

Yao, Jiewen
 

The code is already pushed after review.

 

Please take a look the latest one.

 

If it does not work, then you can file a new BZ.

 

Thank you

Yao Jiewen

 

 

From: Bret Barkelew <Bret.Barkelew@...>
Sent: Tuesday, August 4, 2020 1:05 PM
To: Yao, Jiewen <jiewen.yao@...>; devel@edk2.groups.io; Zhang, Qi1 <qi1.zhang@...>; Bret Barkelew <Bret.Barkelew@...>
Cc: Wang, Jian J <jian.j.wang@...>
Subject: Re: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.

 

The more I think about it, the more I like your idea of registering early and allowing a PPI notification callback.

 

Is that something we could get in this change, or would it be best to open a new BZ to track that request? Thanks!

 

- Bret

 


From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Bret Barkelew via groups.io <bret.barkelew@...>
Sent: Wednesday, July 15, 2020 8:32 AM
To: Yao, Jiewen <jiewen.yao@...>; devel@edk2.groups.io <devel@edk2.groups.io>; Zhang, Qi1 <qi1.zhang@...>
Cc: Wang, Jian J <jian.j.wang@...>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.

 

Yeah, that’s kinda what I was thinking. It seemed like there was a little of overlap that might eliminate the need for the extra libs (in our current solution).

 

I’ll try to get a more detailed problem statement today, but I think you’ve got the right idea there.

 

- Bret

 

From: Yao, Jiewen
Sent: Wednesday, July 15, 2020 8:20 AM
To: devel@edk2.groups.io; Yao, Jiewen; Bret Barkelew; Zhang, Qi1
Cc: Wang, Jian J
Subject: [EXTERNAL] RE: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.

 

Maybe we can let TCG PEIM install the TCG_PPI *before* any measurement record, then the other PEIM can register a callback to record the HW ROT measurement ?

 

Thank you

Yao Jiewen

 

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Yao, Jiewen
Sent: Wednesday, July 15, 2020 10:45 PM
To: Bret Barkelew <Bret.Barkelew@...>; devel@edk2.groups.io; Zhang, Qi1 <qi1.zhang@...>
Cc: Wang, Jian J <jian.j.wang@...>
Subject: Re: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.

 

Hi Bret

Do you have a full problem statement or Bugzilla?

 

If we are resolving same problem, we can resolve altogether.

If we are talking different problem, we can resolve one by one.

 

Thank you

Yao Jiewen

 

From: Bret Barkelew <Bret.Barkelew@...>
Sent: Wednesday, July 15, 2020 1:53 PM
To: devel@edk2.groups.io; Yao, Jiewen <jiewen.yao@...>; Zhang, Qi1 <qi1.zhang@...>
Cc: Wang, Jian J <jian.j.wang@...>
Subject: Re: [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.

 

Since we’re working on early boot TCG interfaces, is this a good time to discuss a standard way to init the log with measurements made by the HW root of trust prior to Tcg2Pei? We were using a NULL lib and a registration pattern on the PEIM, but I’m open to other ideas, too. Thoughts?

 

- Bret

From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Yao, Jiewen via groups.io <jiewen.yao@...>
Sent: Tuesday, July 14, 2020 10:08:30 PM
To: Zhang, Qi1 <qi1.zhang@...>; devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Wang, Jian J <jian.j.wang@...>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.

 

Thanks Qi.

I just thought one use case that a PEIM may already have a calculated hash  (https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FSecurityPkg%2FTcg%2FTcg2Pei%2FTcg2Pei.c%23L652&amp;data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cbe2bb9ca3e0c4dd95a0a08d8287d21ec%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303865193113145&amp;sdata=V3ofX%2Fvs6Pp%2Bc79cQx4iSB6K324Lyptqrj7FtvmDwsc%3D&amp;reserved=0)
We may need add a flag to support this pre-hash use case. Such as:

> +(EFIAPI *EDKII_TCG_HASH_LOG_EXTEND_EVENT)(
>
> +  IN      EDKII_TCG_PPI             *This,
>
> +  IN      UINT64                   Flags,  // new field. BIT0 = 0 means HashData is the data to be hashed; BIT0 = 1 means HashData is the pre-hash digest.
>
> +  IN      UINT8                     *HashData,
>
> +  IN      UINTN                     HashDataLen,
>
> +  IN      TCG_PCR_EVENT_HDR         *NewEventHdr,
>
> +  IN      UINT8                     *NewEventData
>
> +  );

> -----Original Message-----
> From: Zhang, Qi1 <qi1.zhang@...>
> Sent: Tuesday, July 14, 2020 2:49 PM
> To: devel@edk2.groups.io
> Cc: Yao, Jiewen <jiewen.yao@...>; Wang, Jian J <jian.j.wang@...>;
> Zhang, Chao B <chao.b.zhang@...>
> Subject: [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.
>
> From: Jiewen Yao <jiewen.yao@...>
>
> REF: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2841&amp;data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cbe2bb9ca3e0c4dd95a0a08d8287d21ec%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303865193113145&amp;sdata=VgWc2LNPqJRlBisa%2Bvuqq2THVK62f66uzzqh4cle4Rs%3D&amp;reserved=0
>
> Cc: Jiewen Yao <jiewen.yao@...>
> Cc: Jian J Wang <jian.j.wang@...>
> Cc: Chao Zhang <chao.b.zhang@...>
> Signed-off-by: Jiewen Yao <jiewen.yao@...>
> ---
>  SecurityPkg/Include/Ppi/Tcg.h | 50 +++++++++++++++++++++++++++++++++++
>  1 file changed, 50 insertions(+)
>  create mode 100644 SecurityPkg/Include/Ppi/Tcg.h
>
> diff --git a/SecurityPkg/Include/Ppi/Tcg.h b/SecurityPkg/Include/Ppi/Tcg.h
> new file mode 100644
> index 0000000000..4eacd57166
> --- /dev/null
> +++ b/SecurityPkg/Include/Ppi/Tcg.h
> @@ -0,0 +1,50 @@
> +/** @file
>
> +  TCG PPI services.
>
> +
>
> +Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
>
> +SPDX-License-Identifier: BSD-2-Clause-Patent
>
> +
>
> +**/
>
> +
>
> +#ifndef _TCG_PPI_H_
>
> +#define _TCG_PPI_H_
>
> +
>
> +#include <IndustryStandard/UefiTcgPlatform.h>
>
> +
>
> +typedef struct _EDKII_TCG_PPI EDKII_TCG_PPI;
>
> +
>
> +/**
>
> +  Tpm measure and log data, and extend the measurement result into a specific
> PCR.
>
> +
>
> +  @param[in]      This          Indicates the calling context
>
> +  @param[in]      HashData      Physical address of the start of the data buffer
>
> +                                to be hashed, extended, and logged.
>
> +  @param[in]      HashDataLen   The length, in bytes, of the buffer referenced by
> HashData.
>
> +  @param[in]      NewEventHdr   Pointer to a TCG_PCR_EVENT_HDR data
> structure.
>
> +  @param[in]      NewEventData  Pointer to the new event data.
>
> +
>
> +  @retval EFI_SUCCESS           Operation completed successfully.
>
> +  @retval EFI_UNSUPPORTED       TPM device not available.
>
> +  @retval EFI_OUT_OF_RESOURCES  Out of memory.
>
> +  @retval EFI_DEVICE_ERROR      The operation was unsuccessful.
>
> +**/
>
> +typedef
>
> +EFI_STATUS
>
> +(EFIAPI *EDKII_TCG_HASH_LOG_EXTEND_EVENT)(
>
> +  IN      EDKII_TCG_PPI             *This,
>
> +  IN      UINT8                     *HashData,
>
> +  IN      UINTN                     HashDataLen,
>
> +  IN      TCG_PCR_EVENT_HDR         *NewEventHdr,
>
> +  IN      UINT8                     *NewEventData
>
> +  );
>
> +
>
> +///
>
> +/// The EFI_TCG Protocol abstracts TCG activity.
>
> +///
>
> +struct _EDKII_TCG_PPI {
>
> +  EDKII_TCG_HASH_LOG_EXTEND_EVENT     HashLogExtendEvent;
>
> +};
>
> +
>
> +extern EFI_GUID gEdkiiTcgPpiGuid;
>
> +
>
> +#endif
>
> --
> 2.26.2.windows.1

 


Re: [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.

Bret Barkelew
 

The more I think about it, the more I like your idea of registering early and allowing a PPI notification callback.

Is that something we could get in this change, or would it be best to open a new BZ to track that request? Thanks!

- Bret



From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Bret Barkelew via groups.io <bret.barkelew@...>
Sent: Wednesday, July 15, 2020 8:32 AM
To: Yao, Jiewen <jiewen.yao@...>; devel@edk2.groups.io <devel@edk2.groups.io>; Zhang, Qi1 <qi1.zhang@...>
Cc: Wang, Jian J <jian.j.wang@...>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.
 

Yeah, that’s kinda what I was thinking. It seemed like there was a little of overlap that might eliminate the need for the extra libs (in our current solution).

 

I’ll try to get a more detailed problem statement today, but I think you’ve got the right idea there.

 

- Bret

 

From: Yao, Jiewen
Sent: Wednesday, July 15, 2020 8:20 AM
To: devel@edk2.groups.io; Yao, Jiewen; Bret Barkelew; Zhang, Qi1
Cc: Wang, Jian J
Subject: [EXTERNAL] RE: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.

 

Maybe we can let TCG PEIM install the TCG_PPI *before* any measurement record, then the other PEIM can register a callback to record the HW ROT measurement ?

 

Thank you

Yao Jiewen

 

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Yao, Jiewen
Sent: Wednesday, July 15, 2020 10:45 PM
To: Bret Barkelew <Bret.Barkelew@...>; devel@edk2.groups.io; Zhang, Qi1 <qi1.zhang@...>
Cc: Wang, Jian J <jian.j.wang@...>
Subject: Re: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.

 

Hi Bret

Do you have a full problem statement or Bugzilla?

 

If we are resolving same problem, we can resolve altogether.

If we are talking different problem, we can resolve one by one.

 

Thank you

Yao Jiewen

 

From: Bret Barkelew <Bret.Barkelew@...>
Sent: Wednesday, July 15, 2020 1:53 PM
To: devel@edk2.groups.io; Yao, Jiewen <jiewen.yao@...>; Zhang, Qi1 <qi1.zhang@...>
Cc: Wang, Jian J <jian.j.wang@...>
Subject: Re: [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.

 

Since we’re working on early boot TCG interfaces, is this a good time to discuss a standard way to init the log with measurements made by the HW root of trust prior to Tcg2Pei? We were using a NULL lib and a registration pattern on the PEIM, but I’m open to other ideas, too. Thoughts?

 

- Bret

From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Yao, Jiewen via groups.io <jiewen.yao@...>
Sent: Tuesday, July 14, 2020 10:08:30 PM
To: Zhang, Qi1 <qi1.zhang@...>; devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Wang, Jian J <jian.j.wang@...>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.

 

Thanks Qi.

I just thought one use case that a PEIM may already have a calculated hash  (https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FSecurityPkg%2FTcg%2FTcg2Pei%2FTcg2Pei.c%23L652&amp;data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cbe2bb9ca3e0c4dd95a0a08d8287d21ec%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303865193113145&amp;sdata=V3ofX%2Fvs6Pp%2Bc79cQx4iSB6K324Lyptqrj7FtvmDwsc%3D&amp;reserved=0)
We may need add a flag to support this pre-hash use case. Such as:

> +(EFIAPI *EDKII_TCG_HASH_LOG_EXTEND_EVENT)(
>
> +  IN      EDKII_TCG_PPI             *This,
>
> +  IN      UINT64                   Flags,  // new field. BIT0 = 0 means HashData is the data to be hashed; BIT0 = 1 means HashData is the pre-hash digest.
>
> +  IN      UINT8                     *HashData,
>
> +  IN      UINTN                     HashDataLen,
>
> +  IN      TCG_PCR_EVENT_HDR         *NewEventHdr,
>
> +  IN      UINT8                     *NewEventData
>
> +  );

> -----Original Message-----
> From: Zhang, Qi1 <qi1.zhang@...>
> Sent: Tuesday, July 14, 2020 2:49 PM
> To: devel@edk2.groups.io
> Cc: Yao, Jiewen <jiewen.yao@...>; Wang, Jian J <jian.j.wang@...>;
> Zhang, Chao B <chao.b.zhang@...>
> Subject: [PATCH 1/6] SecurityPkg/TcgPpi: Add TcgPpi header file.
>
> From: Jiewen Yao <jiewen.yao@...>
>
> REF: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2841&amp;data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cbe2bb9ca3e0c4dd95a0a08d8287d21ec%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637303865193113145&amp;sdata=VgWc2LNPqJRlBisa%2Bvuqq2THVK62f66uzzqh4cle4Rs%3D&amp;reserved=0
>
> Cc: Jiewen Yao <jiewen.yao@...>
> Cc: Jian J Wang <jian.j.wang@...>
> Cc: Chao Zhang <chao.b.zhang@...>
> Signed-off-by: Jiewen Yao <jiewen.yao@...>
> ---
>  SecurityPkg/Include/Ppi/Tcg.h | 50 +++++++++++++++++++++++++++++++++++
>  1 file changed, 50 insertions(+)
>  create mode 100644 SecurityPkg/Include/Ppi/Tcg.h
>
> diff --git a/SecurityPkg/Include/Ppi/Tcg.h b/SecurityPkg/Include/Ppi/Tcg.h
> new file mode 100644
> index 0000000000..4eacd57166
> --- /dev/null
> +++ b/SecurityPkg/Include/Ppi/Tcg.h
> @@ -0,0 +1,50 @@
> +/** @file
>
> +  TCG PPI services.
>
> +
>
> +Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
>
> +SPDX-License-Identifier: BSD-2-Clause-Patent
>
> +
>
> +**/
>
> +
>
> +#ifndef _TCG_PPI_H_
>
> +#define _TCG_PPI_H_
>
> +
>
> +#include <IndustryStandard/UefiTcgPlatform.h>
>
> +
>
> +typedef struct _EDKII_TCG_PPI EDKII_TCG_PPI;
>
> +
>
> +/**
>
> +  Tpm measure and log data, and extend the measurement result into a specific
> PCR.
>
> +
>
> +  @param[in]      This          Indicates the calling context
>
> +  @param[in]      HashData      Physical address of the start of the data buffer
>
> +                                to be hashed, extended, and logged.
>
> +  @param[in]      HashDataLen   The length, in bytes, of the buffer referenced by
> HashData.
>
> +  @param[in]      NewEventHdr   Pointer to a TCG_PCR_EVENT_HDR data
> structure.
>
> +  @param[in]      NewEventData  Pointer to the new event data.
>
> +
>
> +  @retval EFI_SUCCESS           Operation completed successfully.
>
> +  @retval EFI_UNSUPPORTED       TPM device not available.
>
> +  @retval EFI_OUT_OF_RESOURCES  Out of memory.
>
> +  @retval EFI_DEVICE_ERROR      The operation was unsuccessful.
>
> +**/
>
> +typedef
>
> +EFI_STATUS
>
> +(EFIAPI *EDKII_TCG_HASH_LOG_EXTEND_EVENT)(
>
> +  IN      EDKII_TCG_PPI             *This,
>
> +  IN      UINT8                     *HashData,
>
> +  IN      UINTN                     HashDataLen,
>
> +  IN      TCG_PCR_EVENT_HDR         *NewEventHdr,
>
> +  IN      UINT8                     *NewEventData
>
> +  );
>
> +
>
> +///
>
> +/// The EFI_TCG Protocol abstracts TCG activity.
>
> +///
>
> +struct _EDKII_TCG_PPI {
>
> +  EDKII_TCG_HASH_LOG_EXTEND_EVENT     HashLogExtendEvent;
>
> +};
>
> +
>
> +extern EFI_GUID gEdkiiTcgPpiGuid;
>
> +
>
> +#endif
>
> --
> 2.26.2.windows.1

 


Cancelled Event: TianoCore Bug Triage - APAC / NAMO - Tuesday, 4 August 2020 #cal-cancelled

devel@edk2.groups.io Calendar <devel@...>
 

Cancelled: TianoCore Bug Triage - APAC / NAMO

This event has been cancelled.

When:
Tuesday, 4 August 2020
6:30pm to 7:30pm
(UTC-07:00) America/Los Angeles

Where:
https://bluejeans.com/889357567?src=join_info

Organizer: Brian Richardson brian.richardson@...

Description:

https://www.tianocore.org/bug-triage

 

Meeting URL

https://bluejeans.com/889357567?src=join_info

 

Meeting ID

889 357 567

 

Want to dial in from a phone?

Dial one of the following numbers:

+1.408.740.7256 (US (San Jose))

+1.408.317.9253 (US (Primary, San Jose))

 

(see all numbers - https://www.bluejeans.com/numbers)

Enter the meeting ID and passcode followed by #

10561 - 10580 of 74227