vm_ooffset_t is now unsignedvm_ooffset_t is now unsigned. Remove some tests for negative values,or make other adjustments accordingly.Reported by: CoverityReviewed by: kib markjSponsored by: D
vm_ooffset_t is now unsignedvm_ooffset_t is now unsigned. Remove some tests for negative values,or make other adjustments accordingly.Reported by: CoverityReviewed by: kib markjSponsored by: Dell EMC IsilonDifferential Revision: https://reviews.freebsd.org/D26214
show more ...
Convert allocations of the phys pager to vm_pager_allocate().Future changes would require additional initialization of OBJT_PHYSobjects, and vm_object_allocate() is not suitable for it.Reviewed
Convert allocations of the phys pager to vm_pager_allocate().Future changes would require additional initialization of OBJT_PHYSobjects, and vm_object_allocate() is not suitable for it.Reviewed by: markjTested by: phoSponsored by: The FreeBSD FoundationMFC after: 1 weekDifferential revision: https://reviews.freebsd.org/D24652
[PowerPC] More relocation fixesIt turns out relocating the symbol table itself can cause issues, like fbtcrashing because it applies the offsets to the kernel twice.This had been previously brou
[PowerPC] More relocation fixesIt turns out relocating the symbol table itself can cause issues, like fbtcrashing because it applies the offsets to the kernel twice.This had been previously brought up in rS333447 when the stoffs hack wasadded, but I had been unaware of this and reimplemented symtab relocation.Instead of relocating the symbol table, keep track of the relocation basein ddb, so the ddb symbols behave like the kernel linker-provided symbols.This is intended to be NFC on platforms other than PowerPC, which do notuse fully relocatable kernels. (The relbase will always be 0) * Remove the rest of the stoffs hack. * Remove my half-baked displace_symbol_table() function. * Extend ddb initialization to cope with having a relocation offset on the kernel symbol table. * Fix my kernel-as-initrd hack to work with booke64 by using a temporary mapping to access the data. * Fix another instance of __powerpc__ that is actually RELOCATABLE_KERNEL. * Change the behavior or X_db_symbol_values to apply the relocation base when updating valp, to match link_elf_symbol_values() behavior.Reviewed by: jhibbitsSponsored by: Tag1 Consulting, Inc.Differential Revision: https://reviews.freebsd.org/D25223
Convert ksyms(4) to use an OBJT_PHYS object.The pages stored in the ksyms object are not pageable. Moreover, thisobviates the need to set OBJ_NOSPLIT.Reviewed by: alc, kibMFC after: 3 daysSpo
Convert ksyms(4) to use an OBJT_PHYS object.The pages stored in the ksyms object are not pageable. Moreover, thisobviates the need to set OBJ_NOSPLIT.Reviewed by: alc, kibMFC after: 3 daysSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D22229
Set OBJ_NOSPLIT on the ksyms(4) VM object.The object does not provide anonymous memory.Reported by: kibReviewed by: kibMFC after: 3 daysSponsored by: The FreeBSD FoundationDifferential Revisi
Set OBJ_NOSPLIT on the ksyms(4) VM object.The object does not provide anonymous memory.Reported by: kibReviewed by: kibMFC after: 3 daysSponsored by: The FreeBSD FoundationDifferential Revision: https://reviews.freebsd.org/D22123
ksyms: Fixup symbols for powerpc in the kernel, not just modulesSummary:PowerPC kernels are fully position independent, just like kernel modules.The same fixups that are done for modules therefor
ksyms: Fixup symbols for powerpc in the kernel, not just modulesSummary:PowerPC kernels are fully position independent, just like kernel modules.The same fixups that are done for modules therefore need to be done to thekernel, else symbol resolution in, e.g., DTrace, cannot resolve the kernelsymbols, so only addresses in the kernel are printed, while kernel modulesymbols are printed.Test Plan:Run lockstat on powerpc64. Note symbols are resolved for kernel andmodules.Reviewed By: markjDifferential Revision: https://reviews.freebsd.org/D20316
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - error
sys/dev: further adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.
Remove D_TRACKCLOSE now that ksyms no longer has a close method.Reported by: jhbX-MFC with: r321963
Rework and simplify the ksyms(4) implementation.- Store the symbol table contents in an anonymous swap-backed object. Have mmap(/dev/ksyms) map that object, and stop mapping the symbol table into
Rework and simplify the ksyms(4) implementation.- Store the symbol table contents in an anonymous swap-backed object. Have mmap(/dev/ksyms) map that object, and stop mapping the symbol table into the calling process in ksyms_open(). Previously we would cache a pointer to the pmap of the opening process, and mmap(/dev/ksyms) would create a mapping using the physical address found by a pmap lookup at the initial mapping address. However, this assumes that the cached pmap is valid, which may not be the case. [1]- Remove the ksyms ioctl interface. It appears to have been added to work around a limitation in libelf that no longer exists; see r321842. Moreover, the interface is difficult to support and isn't present in illumos. Since ksyms was added specifically to support lockstat(1), it is expected that this removal won't have any real impact.- Simplify ksyms_read() to avoid unnecessary copying.- Don't call the device handle destructor if we fail to capture a snapshot of the kernel's symbol table. devfs will do that for us.Reported by: Ilja van Sprundel <[email protected]> [1]Reviewed by: kib (previous revision)MFC after: 1 weekDifferential Revision: https://reviews.freebsd.org/D11789
Fix style bugs in ksyms.c.No functional change intended.MFC after: 3 days
Restrict permissions on /dev/ksyms to 0400.The ksyms(4) device was added specifically for use by lockstat(1), whichas a DTrace consumer must run as root.Discussed with: emasteMFC after: 3 days
Streamline use of cdevpriv and correct some corner cases.1) It is not useful to call "devfs_clear_cdevpriv()" from"d_close" callbacks, hence for example read, write, ioctl andso on might be sleep
Streamline use of cdevpriv and correct some corner cases.1) It is not useful to call "devfs_clear_cdevpriv()" from"d_close" callbacks, hence for example read, write, ioctl andso on might be sleeping at the time of "d_close" being calledand then then freed private data can still be accessed.Examples: dtrace, linux_compat, ksyms (all fixed by this patch)2) In sys/dev/drm* there are some cases in which memory willbe freed twice, if open fails, first by code in the openroutine, secondly by the cdevpriv destructor. Move registrationof the cdevpriv to the end of the drm open routines.3) devfs_clear_cdevpriv() is not called if the "d_open" callbackregistered cdevpriv data and the "d_open" callback functionreturned an error. Fix this.Discussed with: phkMFC after: 2 weeks
Get rid of D_PSEUDO.It seems the D_PSEUDO flag was meant to allow make_dev() to return NULL.Nowadays we have a different interface for that; make_dev_p(). There'sno need to keep it there.While
Get rid of D_PSEUDO.It seems the D_PSEUDO flag was meant to allow make_dev() to return NULL.Nowadays we have a different interface for that; make_dev_p(). There'sno need to keep it there.While there, remove an unneeded D_NEEDMINOR from the gpio driver.Discussed with: gonzo@ (gpio)
Promote ksyms_map() and ksyms_unmap() to general facilitycopyout_map() and copyout_unmap() interfaces.Submitted by: John Wehle <john feith com>, noxMFC after: 2 weeks
Update d_mmap() to accept vm_ooffset_t and vm_memattr_t.This replaces d_mmap() with the d_mmap2() implementation and alsochanges the type of offset to vm_ooffset_t.Purge d_mmap2().All driver m
Update d_mmap() to accept vm_ooffset_t and vm_memattr_t.This replaces d_mmap() with the d_mmap2() implementation and alsochanges the type of offset to vm_ooffset_t.Purge d_mmap2().All driver modules will need to be rebuilt since D_VERSION is alsobumped.Reviewed by: jhb@MFC after: Not in this lifetime...
(S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.Fix some wrong usages.Note: this does not affect generated binaries as this argument is not used.PR: 137213Submitted by: Eygene Ryab
(S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.Fix some wrong usages.Note: this does not affect generated binaries as this argument is not used.PR: 137213Submitted by: Eygene Ryabinkin (initial version)MFC after: 1 month
strict kobj signatures: linker_if fixesin symtab_get method symtab parameter is made constant as this reflectsactual intention and usage of the methodReviewed by: imp, current@Approved by: jhb
strict kobj signatures: linker_if fixesin symtab_get method symtab parameter is made constant as this reflectsactual intention and usage of the methodReviewed by: imp, current@Approved by: jhb (mentor)
Remove another d_thread_t use that crept in.
Change from using vm_map_delete() to vm_map_remove().Approved by: gnn (mentor)Obtained from: kib
Add the ksyms(4) pseudo driver. The ksyms driver allows a process toget a quick snapshot of the kernel's symbol table including the symbolsfrom any loaded modules (the symbols are all merged into
Add the ksyms(4) pseudo driver. The ksyms driver allows a process toget a quick snapshot of the kernel's symbol table including the symbolsfrom any loaded modules (the symbols are all merged into one symboltable). Unlike like other implementations, this ksyms driver mapsmemory in the process memory space to store the snapshot at the time/dev/ksyms is opened. It also checks to see if the process has alreadya snapshot open and won't allow it to open /dev/ksyms it again until itcloses first. This prevents kernel and process memory from beingexhausted. Note that /dev/ksyms is used by the lockstat(1) command.Reviewed by: gallatin kib (freebsd-arch)Approved by: gnn (mentor)