Function report |
Source Code:arch\x86\kernel\alternative.c |
Create Date:2022-07-28 07:45:08 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:__text_poke
Proto:static void *__text_poke(void *addr, const void *opcode, size_t len)
Type:void
Parameter:
Type | Parameter | Name |
---|---|---|
void * | addr | |
const void * | opcode | |
size_t | len |
791 | cross_page_boundary = offset_in_page(addr) + len > PAGE_SIZE |
803 | BUG_ON(!after_bootmem) |
805 | If Not core_kernel_text((unsignedlong)addr) Then |
806 | pages[0] = Support for virtually mapped pages |
807 | If cross_page_boundary Then pages[1] = Support for virtually mapped pages |
809 | Else |
810 | pages[0] = virt_to_page(kaddr) returns a valid pointer if and only if* virt_addr_valid(kaddr) returns true.(addr) |
811 | WARN_ON(!PageReserved(pages[0])) |
819 | BUG_ON(!pages[0] || (cross_page_boundary && !pages[1])) |
821 | local_irq_save(flags) |
827 | pgprot = __pgprot(pgprot_val(PAGE_KERNEL) & ~_PAGE_GLOBAL) |
832 | ptep = get_locked_pte(poking_mm, poking_addr, & ptl) |
840 | set_pte_at(poking_mm, poking_addr, ptep, pte) |
842 | If cross_page_boundary Then |
844 | set_pte_at(poking_mm, poking_addr + PAGE_SIZE, ptep + 1, pte) |
851 | prev = Using a temporary mm allows to set temporary mappings that are not accessible* by other CPUs |
854 | memcpy((u8 * )poking_addr + offset_in_page(addr), opcode, len) |
863 | pte_clear(poking_mm, poking_addr, ptep) |
864 | If cross_page_boundary Then pte_clear(poking_mm, poking_addr + PAGE_SIZE, ptep + 1) |
872 | unuse_temporary_mm(prev) |
878 | flush_tlb_mm_range(poking_mm, poking_addr, poking_addr + (cross_page_boundary ? 2 : 1) * PAGE_SIZE, PAGE_SHIFT determines the page size , false) |
888 | pte_unmap_unlock(ptep, ptl) |
889 | local_irq_restore(flags) |
890 | Return addr |
Name | Describe |
---|---|
text_poke | xt_poke - Update instructions on a live kernel*@addr: address to modify*@opcode: source of the copy*@len: length to copy* Only atomic text poke/set should be allowed when not doing early patching |
text_poke_kgdb | xt_poke_kgdb - Update instructions on a live kernel by kgdb*@addr: address to modify*@opcode: source of the copy*@len: length to copy* Only atomic text poke/set should be allowed when not doing early patching |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |