函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\alternative.c Create Date:2022-07-27 08:45:00
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__text_poke

函数原型:static void *__text_poke(void *addr, const void *opcode, size_t len)

返回类型:void

参数:

类型参数名称
void *addr
const void *opcode
size_tlen
791  cross_page_boundary等于offset_in_page(addr)加len大于PAGE_SIZE
792  struct page * pages[2] = {NULL}
803  BUG_ON(!after_bootmem)
805  如果非core_kernel_text((unsignedlong)addr)则
806  pages[0]等于Support for virtually mapped pages
807  如果cross_page_boundarypages[1]等于Support for virtually mapped pages
809  否则
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]))
812  如果cross_page_boundarypages[1]等于virt_to_page(kaddr) returns a valid pointer if and only if* virt_addr_valid(kaddr) returns true.(addr + PAGE_SIZE)
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)
837  VM_BUG_ON(!ptep)
839  pte等于Conversion functions: convert a page and protection to a page entry,* and a page entry and page directory to the page they refer to.* (Currently stuck as a macro because of indirect forward reference* to linux/mm.h:page_to_nid())(pages[0], pgprot)
840  set_pte_at(poking_mm, poking_addr, ptep, pte)
842  如果cross_page_boundary
843  pte等于Conversion functions: convert a page and protection to a page entry,* and a page entry and page directory to the page they refer to.* (Currently stuck as a macro because of indirect forward reference* to linux/mm.h:page_to_nid())(pages[1], pgprot)
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
853  Disable reporting bugs for current task
854  memcpy((u8 * )poking_addr + offset_in_page(addr), opcode, len)
855  Enable reporting bugs after kasan_disable_current()
861  The "volatile" is due to gcc bugs ()
863  pte_clear(poking_mm, poking_addr, ptep)
864  如果cross_page_boundarypte_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)
886  BUG_ON(内存比较)
888  pte_unmap_unlock(ptep, ptl)
889  local_irq_restore(flags)
890  返回:addr
调用者
名称描述
text_pokext_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_kgdbxt_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