-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
1320-xen-tpm.c-add-memcpy-implementation-inside-EARLY_TPM.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
From 198ac8180ec5bda23aa56574f4c2282549324040 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Tomasz=20=C5=BByjewski?= <[email protected]> | ||
Date: Mon, 20 Feb 2023 17:21:06 +0100 | ||
Subject: [PATCH] xen: tpm.c: add memcpy implementation inside EARLY_TPM | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
|
||
Compiling xen fails when `-mtune=generic` is set, the error is | ||
|
||
ld: arch/x86/boot/tpm_early.o: in function `tpm_hash_extend': | ||
tpm.c:(.text+0x43f): undefined reference to `memcpy' | ||
|
||
Add memcpy implementation so linker can use it for tpm_early.o | ||
|
||
Signed-off-by: Tomasz Żyjewski <[email protected]> | ||
--- | ||
xen/arch/x86/tpm.c | 9 +++++++++ | ||
1 file changed, 9 insertions(+) | ||
|
||
diff --git a/xen/arch/x86/tpm.c b/xen/arch/x86/tpm.c | ||
index 705c00c9029f..7139835ddb39 100644 | ||
--- a/xen/arch/x86/tpm.c | ||
+++ b/xen/arch/x86/tpm.c | ||
@@ -34,6 +34,15 @@ asm ( | ||
#endif | ||
#define __va(x) _p(x) | ||
|
||
+void *memcpy(void *dest, const void *src, size_t n) | ||
+{ | ||
+ const uint8_t *s = src; | ||
+ uint8_t *d = dest; | ||
+ while(n--) | ||
+ *d++ = *s++; | ||
+ return dest; | ||
+} | ||
+ | ||
#else /* __EARLY_TPM__ */ | ||
|
||
#include <xen/mm.h> | ||
-- | ||
2.25.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters