|
@@ -668,6 +668,7 @@ void *__init_or_module text_poke_early(void *addr, const void *opcode,
|
|
local_irq_save(flags);
|
|
local_irq_save(flags);
|
|
memcpy(addr, opcode, len);
|
|
memcpy(addr, opcode, len);
|
|
local_irq_restore(flags);
|
|
local_irq_restore(flags);
|
|
|
|
+ sync_core();
|
|
/* Could also do a CLFLUSH here to speed up CPU recovery; but
|
|
/* Could also do a CLFLUSH here to speed up CPU recovery; but
|
|
that causes hangs on some VIA CPUs. */
|
|
that causes hangs on some VIA CPUs. */
|
|
return addr;
|
|
return addr;
|
|
@@ -693,6 +694,12 @@ void *text_poke(void *addr, const void *opcode, size_t len)
|
|
struct page *pages[2];
|
|
struct page *pages[2];
|
|
int i;
|
|
int i;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * While boot memory allocator is runnig we cannot use struct
|
|
|
|
+ * pages as they are not yet initialized.
|
|
|
|
+ */
|
|
|
|
+ BUG_ON(!after_bootmem);
|
|
|
|
+
|
|
if (!core_kernel_text((unsigned long)addr)) {
|
|
if (!core_kernel_text((unsigned long)addr)) {
|
|
pages[0] = vmalloc_to_page(addr);
|
|
pages[0] = vmalloc_to_page(addr);
|
|
pages[1] = vmalloc_to_page(addr + PAGE_SIZE);
|
|
pages[1] = vmalloc_to_page(addr + PAGE_SIZE);
|