Page MenuHomeFreeBSD

kib (Konstantin Belousov)
User

Projects

User Details

User Since
May 16 2014, 7:35 PM (231 w, 3 d)

Recent Activity

Today

kib updated the test plan for D17658: Only call sigdeferstop() for NFS..
Tue, Oct 23, 9:03 AM

Yesterday

kib created D17658: Only call sigdeferstop() for NFS..
Mon, Oct 22, 11:48 PM
kib added a comment to D17367: Eliminate pointless calls to vm_fault_prefault().
In D17367#376752, @alc wrote:
I *really* wish that vm_fault() knew whether the copy-on-write fault was caused by a protection violation or an invalid mapping.  I think that a better heuristic for determining whether to call vm_fault_prefault() would be based on that knowledge.  Specifically, I would call vm_fault_prefault() when the mapping was invalid.

We can try to approximately calculate this information, but it is not reliable even on x86. For instance, we get a nonsensical error code for spurious page faults. But still, translating the bits from x86 exceptional error code into some additional information to vm_fault() is easy.

Mon, Oct 22, 10:24 AM
kib accepted D17616: Add missing function attributes and assert for refcount_acquire_if_not_zero() and refcount_acquire_if_not_last().
Mon, Oct 22, 10:21 AM

Sun, Oct 21

kib accepted D17585: ichwd: add support for TCO watchdog timer in Lewisburg PCH (C620).
Sun, Oct 21, 11:07 AM
kib added a comment to D17635: Avoid duplicate set_max_free after unlink.

This looks like a hack, and deserves a comment at least, if applied.

Sun, Oct 21, 11:00 AM
kib added a comment to D15968: newvers.sh: fix git false positive -dirty tag.

Can you use --shortstat instead of parsing sha's ?

Sun, Oct 21, 10:49 AM
kib added inline comments to D17616: Add missing function attributes and assert for refcount_acquire_if_not_zero() and refcount_acquire_if_not_last().
Sun, Oct 21, 10:40 AM
kib committed rS339508: Unindent vm_map_simplify_entry() after r339506..
Unindent vm_map_simplify_entry() after r339506.
Sun, Oct 21, 12:12 AM
kib closed D17632: Unindent vm_map_simplify_entry()..
Sun, Oct 21, 12:12 AM
kib accepted D17631: libc: Use musl's optimized memchr.
Sun, Oct 21, 12:08 AM
kib accepted D17630: libc: Use musl's optimized strchr, strchrnul, strcspn.

Looks fine from PoV of libc integration. I did not looked at the algorithms.

Sun, Oct 21, 12:07 AM

Sat, Oct 20

kib created D17632: Unindent vm_map_simplify_entry()..
Sat, Oct 20, 11:24 PM
kib committed rS339507: amd64: flush L1 data cache on syscall return with an error..
amd64: flush L1 data cache on syscall return with an error.
Sat, Oct 20, 11:17 PM
kib closed D17536: Flush L1 data cache on syscall return with an error..
Sat, Oct 20, 11:17 PM
kib committed rS339506: Reduce code duplication in merging vm_entry neighbors..
Reduce code duplication in merging vm_entry neighbors.
Sat, Oct 20, 11:08 PM
kib closed D17610: Use helper functions to reduce code duplication in merging vm_entry neighbors.
Sat, Oct 20, 11:08 PM
kib updated the diff for D17547: Implement O_BENEATH and AT_BENEATH.

Reword man pages changes.

Sat, Oct 20, 10:35 PM
kib added a comment to D17547: Implement O_BENEATH and AT_BENEATH.

On a more substantive point, do we set errno in the same way as Linux when openat(... O_BENEATH) fails? It might be helpful to porters if our behaviour is consistent, i.e., we don't set ENOTCAPABLE when people are expecting something like EINVAL.

Sat, Oct 20, 10:34 PM
kib updated the diff for D17547: Implement O_BENEATH and AT_BENEATH.

Patch all manpages.

Sat, Oct 20, 9:12 PM
kib accepted D17626: Add an assertion to pmap_enter()..
Sat, Oct 20, 8:25 PM
kib added a comment to D17616: Add missing function attributes and assert for refcount_acquire_if_not_zero() and refcount_acquire_if_not_last().

So both you and mjg mentioned that there are a lot of consumers which do not check the result from release_if_not_last. How is it handled ?

Sat, Oct 20, 2:39 PM

Fri, Oct 19

kib added inline comments to D17616: Add missing function attributes and assert for refcount_acquire_if_not_zero() and refcount_acquire_if_not_last().
Fri, Oct 19, 8:58 PM
kib accepted D17617: Fix for use-after-free in if_vlan.c.
Fri, Oct 19, 8:52 PM
kib updated the diff for D17547: Implement O_BENEATH and AT_BENEATH.

Disallow absolute paths for BENEATH.

Fri, Oct 19, 7:54 PM
kib updated the diff for D13671: Collection of fixes for OOM handling of some corner cases..

Remove no longer needed addition of timo argument to vm_wait().

Fri, Oct 19, 7:51 PM
kib committed rS339438: MFC r339331:.
MFC r339331:
Fri, Oct 19, 12:47 AM
kib committed rS339437: MFC r339384:.
MFC r339384:
Fri, Oct 19, 12:44 AM

Thu, Oct 18

kib accepted D17615: amd64: relax constraints in curthead and curpcb.
Thu, Oct 18, 11:48 PM
kib added a comment to D17615: amd64: relax constraints in curthead and curpcb.
In D17615#376018, @mjg wrote:
Thu, Oct 18, 10:58 PM
kib added a comment to D17615: amd64: relax constraints in curthead and curpcb.
In D17615#376015, @kib wrote:

Wnere is the 'P' constraint documented ? I see that in gcc 8 manual, 'P' is listed and machine-specific constraint, but x86 section does not mention it.

Thu, Oct 18, 10:25 PM
kib added a comment to D17615: amd64: relax constraints in curthead and curpcb.

Wnere is the 'P' constraint documented ? I see that in gcc 8 manual, 'P' is listed and machine-specific constraint, but x86 section does not mention it.

Thu, Oct 18, 10:18 PM
kib added a comment to D17587: Implement a BSD licensed crtbegin/crtend.

Not supporting .ctors could be a problem when linking objects created with different compilers, e.g. a static library built with gcc, but linked through clang.

This is precisely the reason for maintaining .ctors/.dtors support; even if GCC uses .init_array/.fini_array on all platforms on FreeBSD now users may have existing .o files which do not.

Thu, Oct 18, 9:40 PM
kib added a comment to D17604: Maintain qualifiers on (struct thread_lite) members.
In D17604#375787, @jtl wrote:
In D17604#375736, @kib wrote:

I definitely agree with the genoffset.sh changes.

On the other hand, I am not sure that we need to restore volatile qualifiers in the thread_lite, instead of removing them in the struct thread. The manipulations of the critnest level and pin count should use barriers, and I believe that the thread_lite patch and some of its follow-ups just did that. Volatile relied on the compiler-specific semantic to get similar effect.

Thanks for the review!

Here are my thoughts:

  1. struct thread and struct thread_lite should use the same qualifiers. (Actually, I think they should use exactly the same types.) That way, we end up with the same behavior regardless of which is used.
  2. I do think there is a use for the volatile keyword, even with compiler barriers.

    I could be wrong, but my understanding is that the volatile keyword keeps the compiler from assuming it can cache memory values in registers. Therefore, to increment a volatile variable, it would need to do something like this:

    ` inc 0x48(%rbx) ` Without the volatile qualifier, I think the following would be legal: ` mov 0x48(%rbx), %rax inc %rax mov %rax, 0x48(%rbx) ` If the value in memory changes between the load and store, it would be lost.

I do not believe that volatile makes such guarantees. I think that gcc and clang only do not allow the accesses to vanish, i.e. to optimize them based on cached values. But the load/inc/store code generation is legal for volatile x++;. In fact, the standard states that the value in the externally visible storage must be correct on the sequence point, thats all.
See the handling of amd64 pcb_flags where we do care about the interrupt safety of the value and use inline assembly instead of relying on the code generation.

Thu, Oct 18, 9:34 PM
kib committed rS339432: Do not flush cache for PCIe config window..
Do not flush cache for PCIe config window.
Thu, Oct 18, 8:49 PM
kib closed D17612: Do not flush cache for PCIe config window..
Thu, Oct 18, 8:49 PM
kib added a comment to D17598: Properly handle case when system is out of network interface numbers.

Can we drop the operation, leaving the kernel structures in consistent state ?

Thu, Oct 18, 7:45 PM
kib added reviewers for D17610: Use helper functions to reduce code duplication in merging vm_entry neighbors: alc, markj.
Thu, Oct 18, 7:11 PM
kib accepted D17610: Use helper functions to reduce code duplication in merging vm_entry neighbors.
Thu, Oct 18, 7:11 PM
kib added inline comments to D17598: Properly handle case when system is out of network interface numbers.
Thu, Oct 18, 7:07 PM
kib closed D17070: pmap_large_map() KPI.
Thu, Oct 18, 6:49 PM
kib accepted D17070: pmap_large_map() KPI.
Thu, Oct 18, 6:48 PM
kib created D17612: Do not flush cache for PCIe config window..
Thu, Oct 18, 6:26 PM
kib added a comment to D13999: add map header sentinel to vm_map search tree.

Can you extract the helpers functions into separate review ?

Thu, Oct 18, 1:09 PM
kib accepted D17598: Properly handle case when system is out of network interface numbers.
Thu, Oct 18, 12:52 PM
kib added a comment to D17599: Fix for double free when deleting entries from epoch managed lists.

Again, please upoad the context.

Thu, Oct 18, 11:06 AM
kib added a comment to D17587: Implement a BSD licensed crtbegin/crtend.

After some investigation, I see that crtbegin/crtend.o are shipped with compilers, at least it does with gcc. So I do not see a reason to provide the .ctor fallback for e.g. amd64 or i386: in-tree compiler does not need it, and out-of-tree gcc should cope on its own.

Thu, Oct 18, 11:05 AM
kib accepted D17598: Properly handle case when system is out of network interface numbers.
Thu, Oct 18, 10:59 AM
kib added a comment to D17598: Properly handle case when system is out of network interface numbers.

Can you reupload the diff with full context ?

Thu, Oct 18, 10:26 AM
kib added a comment to D17604: Maintain qualifiers on (struct thread_lite) members.

I definitely agree with the genoffset.sh changes.

Thu, Oct 18, 10:16 AM

Wed, Oct 17

kib added inline comments to D17586: Make fsck(8) use pread(2).
Wed, Oct 17, 11:10 AM
kib added inline comments to D17587: Implement a BSD licensed crtbegin/crtend.
Wed, Oct 17, 11:07 AM
kib added a comment to D17547: Implement O_BENEATH and AT_BENEATH.

Unconditionally allowing absolute paths with O_BENEATH seems a bit strange, as I expect this to be used for partially untrusted paths. An application can easily check for absolute paths and cause either behaviour (allowing or disallowing).

This was one of my questions. But, it is not clear to me what change, if any, you are proposing.

Wed, Oct 17, 9:30 AM

Tue, Oct 16

kib committed rS339391: Add initial driver for ACPI NFIT-enumerated NVDIMMs..
Add initial driver for ACPI NFIT-enumerated NVDIMMs.
Tue, Oct 16, 8:12 PM
kib accepted D17589: Reparent to the process' reaper when a procdesc is closed..
Tue, Oct 16, 5:59 PM
kib reopened D17070: pmap_large_map() KPI.
Tue, Oct 16, 5:29 PM
kib committed rS339386: Provide pmap_large_map() KPI on amd64..
Provide pmap_large_map() KPI on amd64.
Tue, Oct 16, 5:28 PM
kib closed D17070: pmap_large_map() KPI.
Tue, Oct 16, 5:00 PM
kib committed rS339384: Add clwb()..
Add clwb().
Tue, Oct 16, 5:00 PM

Mon, Oct 15

kib updated the diff for D5603: ASLR.

Fix asserted issues on i386.

Mon, Oct 15, 10:44 PM
kib accepted D17488: Remove the need for backslashes in syscalls.master..
Mon, Oct 15, 9:25 PM
kib accepted D17574: Remove __restrict qualifiers from syscalls.master..
Mon, Oct 15, 9:24 PM
kib accepted D17571: Get rid of unneccessary calls to lseek(2) from getgrent(3).
Mon, Oct 15, 7:44 PM
kib updated the diff for D17070: pmap_large_map() KPI.

Simplify retry case as suggested.

Mon, Oct 15, 7:17 PM
kib updated the diff for D17070: pmap_large_map() KPI.

Update comments.

Mon, Oct 15, 5:41 PM
kib added inline comments to D17070: pmap_large_map() KPI.
Mon, Oct 15, 5:39 PM
kib committed rS339359: MFC r339241:.
MFC r339241:
Mon, Oct 15, 10:50 AM

Sun, Oct 14

kib accepted D17550: strptime: fix %C, %y, and %Y permutations.
Sun, Oct 14, 6:53 PM
kib added a comment to D17550: strptime: fix %C, %y, and %Y permutations.
In D17550#374655, @kib wrote:

So we apparently have Y2K bug ?

If you mean the negative values for tm_year, then it likely should be called Y1.9K bug. Otherwise, we seem to have followed the standard, just didn't care about %C and %y both appearing in the format string in arbitrary order.

Sun, Oct 14, 1:15 PM
kib updated subscribers of D17549: amd64: convert libc bzero to a C func to avoid future bloat .
Sun, Oct 14, 12:59 PM
kib added a comment to D17549: amd64: convert libc bzero to a C func to avoid future bloat .

You probably need to add the workaround to Makefile.inc1.

Sun, Oct 14, 12:59 PM
kib accepted D17549: amd64: convert libc bzero to a C func to avoid future bloat .
Sun, Oct 14, 12:58 PM
kib added a reviewer for D17550: strptime: fix %C, %y, and %Y permutations: jilles.
Sun, Oct 14, 12:48 PM
kib added a comment to D17550: strptime: fix %C, %y, and %Y permutations.

So we apparently have Y2K bug ?

Sun, Oct 14, 12:48 PM

Sat, Oct 13

kib committed rS339351: Process irelocs for statically linked binaries from crt1 on x86..
Process irelocs for statically linked binaries from crt1 on x86.
Sat, Oct 13, 11:53 PM
kib closed D17363: Process irelocs for statically linked binaries from crt1..
Sat, Oct 13, 11:53 PM
kib added a comment to D17547: Implement O_BENEATH and AT_BENEATH.

Compare with D2808

Sat, Oct 13, 10:00 PM
kib updated the diff for D17547: Implement O_BENEATH and AT_BENEATH.

Wording for stat(2).

Sat, Oct 13, 7:51 PM
kib accepted D17538: amd64: import updated kernel memmove to libc.
Sat, Oct 13, 6:48 PM
kib accepted D17539: amd64: convert libc bcopy to a C func to avoid future bloat.
Sat, Oct 13, 6:46 PM
kib accepted D17542: amd64: partially depessimize cpu_fetch_syscall_args and cpu_set_syscall_retval.
Sat, Oct 13, 6:39 PM
kib added inline comments to D17363: Process irelocs for statically linked binaries from crt1..
Sat, Oct 13, 6:30 PM
kib updated the diff for D17547: Implement O_BENEATH and AT_BENEATH.

Reword O_BENEATH explanation.

Sat, Oct 13, 5:36 PM
kib added a comment to D17547: Implement O_BENEATH and AT_BENEATH.

I accept absolute paths for O_BENEATH. This can be tweaked, I am not sure what is the useful approach there.

Sat, Oct 13, 5:33 PM
kib created D17547: Implement O_BENEATH and AT_BENEATH.
Sat, Oct 13, 5:19 PM
kib added inline comments to D17539: amd64: convert libc bcopy to a C func to avoid future bloat.
Sat, Oct 13, 4:40 PM
kib added inline comments to D17538: amd64: import updated kernel memmove to libc.
Sat, Oct 13, 4:37 PM
kib added a comment to D17542: amd64: partially depessimize cpu_fetch_syscall_args and cpu_set_syscall_retval.

Commit _retval() change now, I agree with it.

Sat, Oct 13, 11:11 AM
kib updated the diff for D17363: Process irelocs for statically linked binaries from crt1..

Commit candidate, passed tinderbox.

Sat, Oct 13, 12:33 AM
kib accepted D17543: strptime: disallow zero hour for %I and %l.
Sat, Oct 13, 12:26 AM
kib added a comment to D17543: strptime: disallow zero hour for %I and %l.

I think that all hand-rolled string->number conversions in this file should check for overflow. Otherwise we call for undefined behavior and allow compiler authors to bully us.

Sat, Oct 13, 12:19 AM
kib added inline comments to D17543: strptime: disallow zero hour for %I and %l.
Sat, Oct 13, 12:15 AM
kib added inline comments to D17542: amd64: partially depessimize cpu_fetch_syscall_args and cpu_set_syscall_retval.
Sat, Oct 13, 12:09 AM
kib added a reviewer for D17536: Flush L1 data cache on syscall return with an error.: mjg.
Sat, Oct 13, 12:00 AM

Fri, Oct 12

kib added inline comments to D17363: Process irelocs for statically linked binaries from crt1..
Fri, Oct 12, 5:20 PM
kib updated the diff for D17363: Process irelocs for statically linked binaries from crt1..

Add suppression for !x86 arches.

Fri, Oct 12, 4:29 PM
kib created D17536: Flush L1 data cache on syscall return with an error..
Fri, Oct 12, 4:22 PM
kib committed rS339333: Call initializecpucache() before ifuncs are resolved..
Call initializecpucache() before ifuncs are resolved.
Fri, Oct 12, 4:00 PM
kib accepted D17526: amd64: employ MEMMOVE in copyin/copyout.
Fri, Oct 12, 3:58 PM
kib committed rS339331: bhyve: emulate CLFLUSH and CLFLUSHOPT..
bhyve: emulate CLFLUSH and CLFLUSHOPT.
Fri, Oct 12, 3:30 PM