Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F159370683
D57368.id179008.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D57368.id179008.diff
View Options
diff --git a/sys/x86/x86/ucode.c b/sys/x86/x86/ucode.c
--- a/sys/x86/x86/ucode.c
+++ b/sys/x86/x86/ucode.c
@@ -377,18 +377,20 @@
(void)ucode_loader->load(ucode_data, UNSAFE, NULL, NULL);
}
-static void *
-map_ucode(uintptr_t free, size_t len)
+static const void *
+map_ucode(const void *match, uintptr_t free, size_t len)
{
#ifdef __i386__
uintptr_t va;
for (va = free; va < free + len; va += PAGE_SIZE)
pmap_kenter(va, (vm_paddr_t)va);
+ memcpy_early(free, match, len);
+ return ((const void *)free);
#else
(void)len;
+ return (match);
#endif
- return ((void *)free);
}
static void
@@ -421,7 +423,7 @@
char vendor[13];
} cpuid;
const uint8_t *fileaddr, *match;
- uint8_t *addr;
+ const uint8_t *addr;
char *type;
uint64_t nrev, orev;
caddr_t file;
@@ -456,14 +458,10 @@
len = preload_fetch_size(file);
match = ucode_loader->match(fileaddr, &len);
if (match != NULL) {
- addr = map_ucode(free, len);
- /* We can't use memcpy() before ifunc resolution. */
- memcpy_early(addr, match, len);
- match = addr;
-
- error = ucode_loader->load(match, EARLY, &nrev, &orev);
+ addr = map_ucode(match, free, len);
+ error = ucode_loader->load(addr, EARLY, &nrev, &orev);
if (error == 0) {
- ucode_data = early_ucode_data = match;
+ ucode_data = early_ucode_data = addr;
ucode_nrev = nrev;
ucode_orev = orev;
return (len);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jun 14, 9:50 AM (18 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33660487
Default Alt Text
D57368.id179008.diff (1 KB)
Attached To
Mode
D57368: amd64: there is no reason to copy ucode around in ucode_load_bsp()
Attached
Detach File
Event Timeline
Log In to Comment