Page MenuHomeFreeBSD
Feed Advanced Search

May 29 2019

kib committed rS348358: MFC r348052:.
MFC r348052:
May 29 2019, 1:47 PM
kib committed rS348357: MFC r348075:.
MFC r348075:
May 29 2019, 1:33 PM

May 28 2019

kib added a comment to D20348: arm64: pmap: Try to find the correct attribute.
In D20348#441376, @jhb wrote:

I think a better approach if we want to honor the EFI map on both x86 and arm is to check the memory map when creating the direct map itself so that we set the right attributes on the entire range (e.g. the entire MMIO range at once) allowing use of large pages instead of breaking them down into small pages when a device first requests a resource and the only re-promoting if the entire MMIO range is claimed by devices. I would still like to have pmap_mapbios never set an explicit attr but just use whatever is configured as well.

May 28 2019, 6:23 PM
kib added a comment to D20448: style.9: Codify tolerance for eliding blank lines.
In D20448#441421, @cem wrote:

I would even be fine with "If the function has no local variables",

I would be fine with that too, but I think that might be more contentious than this weaker change. If the consensus favors permitting leaving out a blank line entirely, I'm happy to make that change.

Can someone explain why we have this special case at all?

It dates back to phk's initial adaption of BSD 4.4-Lite2 src/admin/style/style in r12823. I did not dig back into the CSRG repo.

May 28 2019, 6:20 PM
kib accepted D16901: Eliminate some needless attempts to merge buddies.
May 28 2019, 10:46 AM

May 27 2019

kib accepted D20256: Simplify vm_reserv_break.
May 27 2019, 10:30 PM
kib added inline comments to D20362: procdesc: allow to collect status through wait(1) if process is traced.
May 27 2019, 7:52 PM
kib accepted D20412: arm32 support for inline ffs, fls.

So you can commit with both mentor' approvals after testing.

May 27 2019, 7:14 PM
kib updated the diff for D20266: Simplify flow of pmap_demote_pde_locked() and add more comprehensive debugging checks..

Unwrap one more CTR format string.

May 27 2019, 7:13 PM
kib updated the diff for D20430: posixshmcontrol(1) page.

Handle feedback.

May 27 2019, 6:25 PM
kib created D20430: posixshmcontrol(1) page.
May 27 2019, 5:41 PM
kib accepted D20347: efirt: Add efi_memory_attribute.
May 27 2019, 4:20 PM
kib updated the diff for D20381: Do not go into sleep in sleepq_catch_signals() when SIGSTOP from PT_ATTACH was consumed..

Fix language in the comment.

May 27 2019, 3:54 PM
kib added inline comments to D20381: Do not go into sleep in sleepq_catch_signals() when SIGSTOP from PT_ATTACH was consumed..
May 27 2019, 3:52 PM
kib updated the diff for D20266: Simplify flow of pmap_demote_pde_locked() and add more comprehensive debugging checks..

Handle Alan' comments. Adjust the output of the diagnostic version of the checker even more.

May 27 2019, 3:43 PM
kib committed rS348306: Correct some inconsistencies in the earliest created kernel page.
Correct some inconsistencies in the earliest created kernel page
May 27 2019, 3:21 PM
kib added a comment to D20361: procdesc: fix reparenting when the debugger is attached.
In D20361#440566, @kib wrote:

So I wonder is it possible that your patched code would see non-traced process which is not yet safe to reparent. Or rather, I do not see anything that prevents this situation.

What exactly makes it unsafe? The procdesc close may race with a PT_DETACH, but PT_DETACH should not modify the process tree when p_oppid and p_ptr refer to the same process.

May 27 2019, 3:08 PM
kib added a comment to D20348: arm64: pmap: Try to find the correct attribute.

May be Doug with his experience with efficient data structures can suggest.

May 27 2019, 1:57 PM
kib added a reviewer for D20348: arm64: pmap: Try to find the correct attribute: dougm.
May 27 2019, 1:56 PM
kib added inline comments to D20348: arm64: pmap: Try to find the correct attribute.
May 27 2019, 1:56 PM

May 26 2019

kib added a comment to D20380: Fixes for some corner cases of amd64 demotions..
In D20380#440728, @alc wrote:

Everything here looks good to me.

May 26 2019, 7:01 PM
kib added a comment to D20412: arm32 support for inline ffs, fls.

No testing on an actual arm machine has been performed.

May 26 2019, 4:01 PM
kib added a comment to D20412: arm32 support for inline ffs, fls.

__clzdi2() and other functions are indeed libgcc symbols implementing the builtins, so at least gcc cannot properly inline the operation.

May 26 2019, 3:32 PM
kib added a comment to D20411: Add devfs(5) support for VOP_MKDIR(9) and VOP_RMDIR(9).
In D20411#440658, @tijl wrote:
In D20411#440580, @mjg wrote:

I think arbitrary mkdir/rmdir is a can of worms, perfectly avoidable for the stated purpose.

Arbitrary symlinks are already supported. Why would mkdir be any different?

May 26 2019, 10:40 AM
kib added inline comments to D19247: Merge hold_count into wire_count..
May 26 2019, 9:20 AM
kib added a comment to D20412: arm32 support for inline ffs, fls.

So why not do this for all architectures ? Is the problem that old gcc on ppc/sparc64/mips does not support __builtins required ?

May 26 2019, 9:16 AM
kib added a comment to D20266: Simplify flow of pmap_demote_pde_locked() and add more comprehensive debugging checks..
In D20266#440649, @pho wrote:

I ran tests on D20266.57868.diff for 24 hours without seeing any problems.

May 26 2019, 9:09 AM
kib added a comment to D20380: Fixes for some corner cases of amd64 demotions..
In D20380#440642, @alc wrote:
In D20380#440609, @kib wrote:

I am not sure why do check that KERNend != round_2mpage() before rounding, IMO it simply less lines to not do that.

Are you asking about this snippet?

if (*firstaddr < round_2mpage(KERNend))
        *firstaddr = round_2mpage(KERNend);
May 26 2019, 9:08 AM

May 25 2019

kib updated the diff for D20380: Fixes for some corner cases of amd64 demotions..

alc' version of the patch, with one minor style fix.
Testing this properly almost certainly requires D20266.

May 25 2019, 10:36 PM
kib added a comment to D20380: Fixes for some corner cases of amd64 demotions..
In D20380#440605, @alc wrote:

I _think_ that what you mean is that we should connect all preallocated page tables to directories, but only pre-promote to the rounded KERNend, and store in radix only page tables pages which were shadowed by the manual promotion.

Yes, except that the way that the loop is written, we don't need to round KERNend for correctness. I would only round it if you think that doing so makes it less likely that someone will misinterpret the code. Here are all of the changes that I would make.

I do not think that the check needs changing.
Also I see that indeed page table pages do not need non-zero initialization after we switched to PG_PROMOTED test.

May 25 2019, 10:35 PM
kib added inline comments to D13484: swapoff to release multiple swap blocks at a time.
May 25 2019, 10:04 PM
kib added a comment to D20411: Add devfs(5) support for VOP_MKDIR(9) and VOP_RMDIR(9).

How did you tested this ? I am curious if you tried massively-parallel mkdir/rmdir for the same name. Perhaps try to ask Peter Holm to test this.

May 25 2019, 8:13 PM
kib added inline comments to D13484: swapoff to release multiple swap blocks at a time.
May 25 2019, 6:58 PM
kib added a comment to D20361: procdesc: fix reparenting when the debugger is attached.

P_TRACED is always set or cleared with proctree_lock exclusively locked, except at the process exit. After that, the process lock in exit1() is dropped and we acquire the proctree_lock. PRS_ZOMBIE is set much later on the process.

May 25 2019, 6:43 PM
kib added inline comments to D20362: procdesc: allow to collect status through wait(1) if process is traced.
May 25 2019, 2:43 PM
kib added inline comments to D20361: procdesc: fix reparenting when the debugger is attached.
May 25 2019, 2:39 PM
kib added inline comments to D19247: Merge hold_count into wire_count..
May 25 2019, 12:25 PM
kib added a comment to D20390: Show shm_open() and shmget() path/key in procstat -v..

Implemented using a callback. Vnodes are still a special case though, because they have different locking requirements (don't want to do that stuff while holding the vmobject lock).

Better?

In fact, not. Look at the struct vm_object change. You are adding 16 bytes to it. vm_object_t is allocated for each once-opened vnode in the system, and e.g. on my low-end 16G router I have 1M vnodes. So the change, if applied, takes 16M away for almost never used memory.

May 25 2019, 11:19 AM

May 24 2019

kib committed rS348258: Fix too loose assert in pmap_large_unmap()..
Fix too loose assert in pmap_large_unmap().
May 24 2019, 11:28 PM
kib closed D20386: Make pmap_kextract() operational over the large map..
May 24 2019, 11:26 PM
kib committed rS348257: Add PG_PS_PDP_FRAME symbol..
Add PG_PS_PDP_FRAME symbol.
May 24 2019, 11:26 PM
kib updated the diff for D20386: Make pmap_kextract() operational over the large map..

PMAP_LARGEMAP_MAX_ADDRESS()
PG_PS_PDP_FRAME

May 24 2019, 10:48 PM
kib updated the diff for D20266: Simplify flow of pmap_demote_pde_locked() and add more comprehensive debugging checks..

Split large comment.
_fault() -> _abort().

May 24 2019, 10:12 PM
kib added inline comments to D20266: Simplify flow of pmap_demote_pde_locked() and add more comprehensive debugging checks..
May 24 2019, 10:11 PM
kib closed D20380: Fixes for some corner cases of amd64 demotions..
May 24 2019, 10:09 PM
kib accepted D20380: Fixes for some corner cases of amd64 demotions..
May 24 2019, 10:09 PM
kib updated the diff for D20386: Make pmap_kextract() operational over the large map..

LARGEMAP_RT_MAX_ADDRESS

May 24 2019, 9:58 PM
kib updated the diff for D20380: Fixes for some corner cases of amd64 demotions..

Clip at KERNend.

May 24 2019, 9:48 PM
kib added inline comments to D20380: Fixes for some corner cases of amd64 demotions..
May 24 2019, 9:47 PM
kib reopened D20380: Fixes for some corner cases of amd64 demotions..
May 24 2019, 5:35 PM
kib retitled D20266: Simplify flow of pmap_demote_pde_locked() and add more comprehensive debugging checks. from Fixes for some corner cases of amd64 demotions. to Simplify flow of pmap_demote_pde_locked() and add more comprehensive debugging checks..
May 24 2019, 5:34 PM
kib updated the diff for D20266: Simplify flow of pmap_demote_pde_locked() and add more comprehensive debugging checks..

Leave only refactoring of the demotion in this review.

May 24 2019, 5:30 PM
kib committed rS348246: Fix a corner case in demotion of kernel mappings..
Fix a corner case in demotion of kernel mappings.
May 24 2019, 5:19 PM
kib closed D20380: Fixes for some corner cases of amd64 demotions..
May 24 2019, 5:19 PM
kib accepted D19902: bsearc.3: Add EXAMPLES section.
May 24 2019, 4:53 PM
kib updated the diff for D20386: Make pmap_kextract() operational over the large map..

Use symbolic name for 1G superpage frame mask.
Fix upper boundary check for large map.

May 24 2019, 4:46 PM
kib added inline comments to D20370: Eliminate code duplication around clip_start.
May 24 2019, 4:35 PM
kib added reviewers for D20390: Show shm_open() and shmget() path/key in procstat -v.: markj, jhb.
May 24 2019, 10:15 AM
kib added a comment to D20390: Show shm_open() and shmget() path/key in procstat -v..

I dislike the idea of allocating and keeping the string around as long as the object is alive. The string is almost never used, also it is always a duplicate of some other string that kernel already has allocated.

May 24 2019, 10:14 AM

May 23 2019

kib added inline comments to D19902: bsearc.3: Add EXAMPLES section.
May 23 2019, 9:08 PM
kib added inline comments to D20348: arm64: pmap: Try to find the correct attribute.
May 23 2019, 7:29 PM
kib added inline comments to D20347: efirt: Add efi_memory_attribute.
May 23 2019, 7:23 PM
kib accepted D20370: Eliminate code duplication around clip_start.
May 23 2019, 7:14 PM
kib created D20386: Make pmap_kextract() operational over the large map..
May 23 2019, 6:41 PM
kib added inline comments to D20370: Eliminate code duplication around clip_start.
May 23 2019, 5:05 PM
kib added inline comments to D19902: bsearc.3: Add EXAMPLES section.
May 23 2019, 4:08 PM
kib added inline comments to D20370: Eliminate code duplication around clip_start.
May 23 2019, 4:04 PM
kib updated the summary of D20381: Do not go into sleep in sleepq_catch_signals() when SIGSTOP from PT_ATTACH was consumed..
May 23 2019, 3:10 PM
kib created D20381: Do not go into sleep in sleepq_catch_signals() when SIGSTOP from PT_ATTACH was consumed..
May 23 2019, 3:08 PM
kib committed rS348168: Use int for the getopt() result..
Use int for the getopt() result.
May 23 2019, 3:00 PM
kib committed rS348167: Add posixshmcontrol(1), an utility to manipulate posix shared memory segments..
Add posixshmcontrol(1), an utility to manipulate posix shared memory segments.
May 23 2019, 2:33 PM
kib created D20380: Fixes for some corner cases of amd64 demotions..
May 23 2019, 2:29 PM
kib committed rS348163: MFC r347698:.
MFC r347698:
May 23 2019, 1:05 PM
kib committed rS348162: MFC r347694:.
MFC r347694:
May 23 2019, 1:03 PM
kib committed rS348161: MFC r347693:.
MFC r347693:
May 23 2019, 12:52 PM
kib committed rS348160: MFC r347692:.
MFC r347692:
May 23 2019, 12:51 PM
kib committed rS348158: Add a kern.ipc.posix_shm_list sysctl..
Add a kern.ipc.posix_shm_list sysctl.
May 23 2019, 12:35 PM
kib committed rS348157: Report ref count of the backing object as st_nlink for posix shm fd..
Report ref count of the backing object as st_nlink for posix shm fd.
May 23 2019, 12:28 PM
kib closed D20258: posixshmcontrol(1), an utility to query and manipulate named posix shm objects.
May 23 2019, 12:25 PM
kib committed rS348156: Make pack_kinfo() available for external callers..
Make pack_kinfo() available for external callers.
May 23 2019, 12:25 PM

May 22 2019

kib updated the diff for D20266: Simplify flow of pmap_demote_pde_locked() and add more comprehensive debugging checks..

Remove KERNend.

May 22 2019, 11:38 PM
kib added inline comments to D20361: procdesc: fix reparenting when the debugger is attached.
May 22 2019, 10:10 PM
kib added inline comments to D20361: procdesc: fix reparenting when the debugger is attached.
May 22 2019, 9:47 PM
kib added inline comments to D20362: procdesc: allow to collect status through wait(1) if process is traced.
May 22 2019, 9:37 PM
kib added a comment to D20362: procdesc: allow to collect status through wait(1) if process is traced.

wait(2) and pdfork(2)

May 22 2019, 8:46 PM
kib added inline comments to D20362: procdesc: allow to collect status through wait(1) if process is traced.
May 22 2019, 8:46 PM
kib added inline comments to D20266: Simplify flow of pmap_demote_pde_locked() and add more comprehensive debugging checks..
May 22 2019, 8:01 PM
kib updated the diff for D20266: Simplify flow of pmap_demote_pde_locked() and add more comprehensive debugging checks..

Fix VM_MAXUSER_ADDRESS spelling.
Remember the last initialized page table page for insertion into the pmap radix.

May 22 2019, 7:38 PM
kib updated the diff for D20266: Simplify flow of pmap_demote_pde_locked() and add more comprehensive debugging checks..

Use PG_PROMOTED == 0 as a predicate for the pmap_pt_fill() call.

May 22 2019, 6:24 PM
kib accepted D20356: Pass resize parameter to vm_map_entry_resize_free.
May 22 2019, 5:35 PM
kib added a comment to D20356: Pass resize parameter to vm_map_entry_resize_free.

Other than the note about if()s, this looks fine.

May 22 2019, 4:57 PM
kib added inline comments to D20347: efirt: Add efi_memory_attribute.
May 22 2019, 10:26 AM
kib added a comment to D20348: arm64: pmap: Try to find the correct attribute.
In D20348#438886, @manu wrote:
In D20348#438878, @kib wrote:

I think this change should be somewhat improved by taking the most strong attr mode between pair of what is reported by UEFI memory map, and what is requested by a caller. For instance, if caller requests uncacheable, while UEFI reports write-combining, uncacheable should win.

I don't really understand, the caller of pmap_mapbios never request the mapping attr.

May 22 2019, 9:46 AM
kib added inline comments to D20347: efirt: Add efi_memory_attribute.
May 22 2019, 9:20 AM
kib added a comment to D20327: Don't reset memory attributes when mapping physical addresses for ACPI..
In D20327#438582, @jhb wrote:
In D20327#438513, @kib wrote:
In D20327#438503, @jhb wrote:

What happens on the laptops today is that it calls AcpiOsMapMemory for the MCFG region which uses pmap_mapbios and switches the mapping in the direct map from UC to WB and flushes the cache which then hangs. What patch is changing is making AcpiOsMapMemory just leave the direct map as-is and if the requested address has been marked UC prior to the use of AcpiOsMapMemory, it just leaves it alone instead of changing it to WB. I am actually inclined to do this for all the pmap_mapbios calls by having them always honor existing attributes which was my first question above. A further question at that point is if we'd rather just use the new name always since 'mapbios' is kind of a crummy name. Originally 'mapbios' meant 'map a table provided by the BIOS', but given that AML is free to map whatever random thing it chooses, 'mapphys' is probably a better name (and more generic for platforms that don't have BIOS).

Yes, I both do not like that pmap_mapbios() does not change the attributes for random requests ( I believe that GPU apertures are mapped by pmap_mapbios()), and that it could be done more explicit, snce we actually care about MFCG. Let me provide more or less accurate sketch of what I mean. The code duplication can be optimized out, I am more about the approach.

Hmm, I guess I'd just rather avoid hardcoding this just for MCFG. In theory there can be multiple MCFG address ranges for example. But what I'm really paranoid about is some future bit of AML code that uses SystemMemory to read a register in a BAR. I wouldn't want that to remap the BAR to be WB instead of UC either. I really feel like AcpiOsMapMemory() should not be forcing WB, just using that as the default if a new mapping needs to be created. In the case of GPU apertures, are you saying that pmap_mapbios is being used to force GPU apertures to use WB that were previously mapped using something else? I don't see that in the current calls to pmap_mapbios:

amd64/acpica/acpi_machdep.c:    rsdp = pmap_mapbios(rsdp_ptr, sizeof(ACPI_TABLE_RSDP));
arm64/acpica/acpi_machdep.c:    header = pmap_mapbios(pa, sizeof(ACPI_TABLE_HEADER));
arm64/acpica/acpi_machdep.c:    table = pmap_mapbios(pa, length);
arm64/acpica/acpi_machdep.c:    table = pmap_mapbios(address, sizeof(ACPI_TABLE_HEADER));
arm64/acpica/acpi_machdep.c:    rsdp = pmap_mapbios(rsdp_ptr, sizeof(ACPI_TABLE_RSDP));
compat/x86bios/x86bios.c:       x86bios_ivt = pmap_mapbios(X86BIOS_IVT_BASE, X86BIOS_IVT_SIZE);
dev/acpica/acpi_pxm.c:  cpus = (struct cpu_info *)pmap_mapbios(addr, size);
dev/acpica/Osd/OsdMemory.c:    return (pmap_mapbios((vm_offset_t)PhysicalAddress, Length));
dev/ipmi/ipmi_smbios.c: header = pmap_mapbios(addr, sizeof(struct smbios_eps));
dev/ipmi/ipmi_smbios.c: table = pmap_mapbios(addr, header->length);
dev/ipmi/ipmi_smbios.c: table = pmap_mapbios(header->structure_table_address,
dev/pci/vga_pci.c:              return (pmap_mapbios(VGA_PCI_BIOS_SHADOW_ADDR, *size));
i386/acpica/acpi_machdep.c:     va = pmap_mapbios(0xffff0, 16);
i386/acpica/acpi_machdep.c:     rsdp = pmap_mapbios(rsdp_ptr, sizeof(ACPI_TABLE_RSDP));
x86/acpica/madt.c:      madt = pmap_mapbios(madt_physaddr, madt_length);

Of those, combat/x86/x86bios.c is mapping the real-mode IDT, dev/pci/vga_pci.c is mapping the VGA BIOS ROM at 0xc0000, and the rest are all mapping BIOS tables (smbios, ACPI, etc.) except for OsdMemory.c which is mapping anything AML asks for. I don't see any of these mapping GPU apertures?

May 22 2019, 9:07 AM
kib added a comment to D20348: arm64: pmap: Try to find the correct attribute.

Can you do the same for amd64 ?

May 22 2019, 9:01 AM
kib added a reviewer for D20348: arm64: pmap: Try to find the correct attribute: jhb.
May 22 2019, 9:00 AM
kib added inline comments to D20347: efirt: Add efi_memory_attribute.
May 22 2019, 9:00 AM

May 21 2019

kib committed rS348075: Do not call hw_mds_recalculate() from initializecpu()..
Do not call hw_mds_recalculate() from initializecpu().
May 21 2019, 10:56 PM
kib accepted D20339: Link fhlinkat(2) man page.

r341689 was already merged, so mentioning it in the commit message is not quite useful.

May 21 2019, 9:13 PM