Page MenuHomeFreeBSD
Feed Advanced Search

Jan 29 2017

jah closed D9370: Implement get_pcpu() for i386 by committing rS312952: Implement get_pcpu() for i386 and use it to replace pcpu_find(curcpu).
Jan 29 2017, 4:55 PM
jah updated the diff for D9370: Implement get_pcpu() for i386.

Whitespace fixes

Jan 29 2017, 4:26 PM
jah added inline comments to D9370: Implement get_pcpu() for i386.
Jan 29 2017, 4:15 PM
jah added a reviewer for D9370: Implement get_pcpu() for i386: kib.
Jan 29 2017, 3:20 AM
jah retitled D9370: Implement get_pcpu() for i386 from to Implement get_pcpu() for i386.
Jan 29 2017, 3:20 AM

Jan 26 2017

jah closed D9312: Clean up ARM per-cpu qmap fields by committing rS312792: Further cleanup of per-CPU armv6 pmap data:.
Jan 26 2017, 5:23 AM
jah committed rS312792: Further cleanup of per-CPU armv6 pmap data:.
Further cleanup of per-CPU armv6 pmap data:
Jan 26 2017, 5:23 AM

Jan 25 2017

jah updated the diff for D9312: Clean up ARM per-cpu qmap fields.

Replace pcpu_find with get_pcpu()

Jan 25 2017, 5:29 PM
jah added inline comments to D9312: Clean up ARM per-cpu qmap fields.
Jan 25 2017, 5:29 PM

Jan 24 2017

jah added inline comments to D9312: Clean up ARM per-cpu qmap fields.
Jan 24 2017, 4:31 PM
jah added inline comments to D9312: Clean up ARM per-cpu qmap fields.
Jan 24 2017, 4:20 PM
jah added a reviewer for D9312: Clean up ARM per-cpu qmap fields: skra.
Jan 24 2017, 5:24 AM
jah retitled D9312: Clean up ARM per-cpu qmap fields from to Clean up ARM per-cpu qmap fields.
Jan 24 2017, 5:23 AM

Jan 22 2017

jah committed rS312610: Like r310481 for i386, move the objects used to create temporary.
Like r310481 for i386, move the objects used to create temporary
Jan 22 2017, 12:46 AM
jah closed D9172: Move armv6 sysmaps to MD PCPU region by committing rS312610: Like r310481 for i386, move the objects used to create temporary.
Jan 22 2017, 12:46 AM

Jan 21 2017

jah committed rS312561: MFC r312153, r312191.
MFC r312153, r312191
Jan 21 2017, 6:49 AM

Jan 14 2017

jah updated the diff for D9172: Move armv6 sysmaps to MD PCPU region.

Return sched_unpin() to original order, rename fields

Jan 14 2017, 8:54 PM
jah committed rS312191: Add comment explaining relative order of sched_unpin() and mtx_unlock()..
Add comment explaining relative order of sched_unpin() and mtx_unlock().
Jan 14 2017, 7:35 PM
jah committed rS312153: For i386 temporary mappings, unpin the thread before releasing.
For i386 temporary mappings, unpin the thread before releasing
Jan 14 2017, 9:56 AM
jah added inline comments to D9172: Move armv6 sysmaps to MD PCPU region.
Jan 14 2017, 9:43 AM
jah added reviewers for D9172: Move armv6 sysmaps to MD PCPU region: skra, mmel, andrew.
Jan 14 2017, 4:21 AM
jah retitled D9172: Move armv6 sysmaps to MD PCPU region from to Move armv6 sysmaps to MD PCPU region.
Jan 14 2017, 4:18 AM

Jan 7 2017

jah committed rS311653: MFC r310481:.
MFC r310481:
Jan 7 2017, 6:55 PM

Dec 23 2016

jah committed rS310481: Move the objects used to create temporary mappings for i386 pmap zero and copy.
Move the objects used to create temporary mappings for i386 pmap zero and copy
Dec 23 2016, 3:15 PM
jah closed D8833: Move i386 sysmaps to MD per-cpu region by committing rS310481: Move the objects used to create temporary mappings for i386 pmap zero and copy.
Dec 23 2016, 3:15 PM
jah updated the diff for D8833: Move i386 sysmaps to MD per-cpu region.

Use constant for pcpu padding. Collapse sysmaps struct.

Dec 23 2016, 5:01 AM

Dec 20 2016

jah added inline comments to D8833: Move i386 sysmaps to MD per-cpu region.
Dec 20 2016, 2:46 AM

Dec 19 2016

jah added inline comments to D8833: Move i386 sysmaps to MD per-cpu region.
Dec 19 2016, 7:27 AM

Dec 18 2016

jah added inline comments to D8833: Move i386 sysmaps to MD per-cpu region.
Dec 18 2016, 6:55 PM
jah added a reviewer for D8833: Move i386 sysmaps to MD per-cpu region: kib.
Dec 18 2016, 12:53 AM
jah retitled D8833: Move i386 sysmaps to MD per-cpu region from to Move i386 sysmaps to MD per-cpu region.
Dec 18 2016, 12:52 AM

Aug 7 2016

jah closed D3989: Update powerpc busdma to handle unmapped/out-of-context buffers by committing rS303814: powerpc busdma: Use pmap_quick_enter_page()/pmap_quick_remove_page() to handle.
Aug 7 2016, 3:50 PM
jah committed rS303814: powerpc busdma: Use pmap_quick_enter_page()/pmap_quick_remove_page() to handle.
powerpc busdma: Use pmap_quick_enter_page()/pmap_quick_remove_page() to handle
Aug 7 2016, 3:50 PM

Jul 24 2016

jah added a comment to D3989: Update powerpc busdma to handle unmapped/out-of-context buffers.

Did some light testing, but not sure if I triggered anything.

Jul 24 2016, 6:32 PM

May 29 2016

jah committed rS300948: MFC r300258:.
MFC r300258:
May 29 2016, 7:15 AM

May 20 2016

jah committed rS300258: iic_rdwr_data->nmsgs is uint32_t, so limit the allowable number of messages….
iic_rdwr_data->nmsgs is uint32_t, so limit the allowable number of messages…
May 20 2016, 3:03 AM
jah closed D5155: Add some missing integrity checks in iicrdwr() by committing rS300258: iic_rdwr_data->nmsgs is uint32_t, so limit the allowable number of messages….
May 20 2016, 3:03 AM

May 19 2016

jah updated the diff for D5155: Add some missing integrity checks in iicrdwr().

Add comment noting size limit of each message

May 19 2016, 2:12 PM
jah retitled D5155: Add some missing integrity checks in iicrdwr() from Check the results of copyin(9) before continuing in iicrdwr(..) to Add some missing integrity checks in iicrdwr().
May 19 2016, 2:02 PM
jah updated the diff for D5155: Add some missing integrity checks in iicrdwr().

Limit number of messages to 42 to prevent exhaustion/short allocation on 32-bit systems

May 19 2016, 1:48 PM
jah commandeered D5155: Add some missing integrity checks in iicrdwr().
May 19 2016, 1:46 PM

May 16 2016

jah added a comment to D3989: Update powerpc busdma to handle unmapped/out-of-context buffers.

I think qemu can boot powerpc64 (see https://wiki.freebsd.org/QemuRecipes ). What kinds of testing should be done? I have a Book-E board I could boot test with, and do basic SATA I/O, would that be enough? I also have some PowerMac hardware. Would need a week or two before I can test with that though.

May 16 2016, 2:49 AM

May 15 2016

jah added a comment to D5155: Add some missing integrity checks in iicrdwr().

Garrett, were you planning to add the limit on nmsgs and commit this? If not, I can do it.

May 15 2016, 8:30 PM
jah added a comment to D3989: Update powerpc busdma to handle unmapped/out-of-context buffers.

This one's been sitting for a while. Anything I can do to test this out on my own? qemu maybe?

May 15 2016, 8:23 PM

Apr 14 2016

jah added a comment to D5917: busdma/bounce: force bouncing of full buffer.

I think it's better to revert r292255 than to add this. Like Hans mentioned it adds complexity, and the fact that it forces entire buffers to be bounced seems wrong to me. The added memcpy probably isn't that big of a deal, since performance goes out the window if you're bouncing anyway. But the memory those bounce pages come from is likely to be somewhat precious. This could make large transfers use a lot more of that, which makes me nervous.

Apr 14 2016, 2:16 PM

Feb 1 2016

jah added a comment to D5155: Add some missing integrity checks in iicrdwr().
In D5155#109705, @kib wrote:

Copy/paste from my mail to the OP:

> > $ svn diff iic.c 
> > Index: iic.c
> > ===================================================================
> > --- iic.c       (revision 295081)
> > +++ iic.c       (working copy)
> > @@ -303,6 +303,10 @@
> >         buf = malloc(sizeof(*d->msgs) * d->nmsgs, M_IIC, M_WAITOK);
> >  
> >         error = copyin(d->msgs, buf, sizeof(*d->msgs) * d->nmsgs);
> > +       if (error != 0) {
> > +               free(buf, M_IIC);
> > +               return (error);
> > +       }
> >  
> >         /* Alloc kernel buffers for userland data, copyin write data */
> >         usrbufs = malloc(sizeof(void *) * d->nmsgs, M_IIC, M_WAITOK | M_ZERO);
> > 
> This just continues the original bug.
> 
> If you look at the line above the changed line, you would see the
> multiplication with the user-supplied value, which could e.g. overflow
> and results in the short buffer being malloced. Then copying trashes the
> kernel heap.
> 
> That said, even if overflow does not occur, the user-controlled malloc(9)
> either causes DoS by over-allocation of the kernel memory, or by causing
> panic by exhausting the kmem address space on 32bit arches.
Feb 1 2016, 3:52 PM
jah accepted D5155: Add some missing integrity checks in iicrdwr().
Feb 1 2016, 6:48 AM
jah added a comment to D5155: Add some missing integrity checks in iicrdwr().

I might've missed something, but it looks like we don't actually use the contents of buf for anything if error is set. We might store some of that bogus data in usrbufs at line 311, but we'll avoid using it.

Feb 1 2016, 6:48 AM

Nov 18 2015

jah accepted D4120: ARM: Fix dma_dcache_sync().
Nov 18 2015, 3:20 PM

Nov 14 2015

jah added inline comments to D4120: ARM: Fix dma_dcache_sync().
Nov 14 2015, 8:38 AM

Oct 28 2015

jah added a comment to D3986: Update mips busdma to handle unmapped/out-of-context buffers.
In D3986#83956, @adrian wrote:

Just build some software or something that'll churn the VM and do disk IO. :)

Oct 28 2015, 10:21 PM
jah committed rS290120: Retire pmap_dmap_iscurrent(). It is only a wrapper around pmap_is_current()….
Retire pmap_dmap_iscurrent(). It is only a wrapper around pmap_is_current()…
Oct 28 2015, 9:17 PM
jah added a comment to D3986: Update mips busdma to handle unmapped/out-of-context buffers.
In D3986#83554, @adrian wrote:

Can you test this out via a qemu-system-mips (from qemu-devel) package?

https://github.com/freebsd/freebsd-wifi-build/wiki/MipsQemuEmulatorImages

Oct 28 2015, 4:00 AM

Oct 23 2015

jah updated the diff for D3989: Update powerpc busdma to handle unmapped/out-of-context buffers.

Remove unclear comment on PHYS_TO_VM_PAGE().
Noted by: avg

Oct 23 2015, 12:10 PM
jah updated the diff for D3986: Update mips busdma to handle unmapped/out-of-context buffers.

Remove unclear comments on PHYS_TO_VM_PAGE().
Noted by: avg

Oct 23 2015, 12:08 PM
jah committed rS289826: Fix capitalization.
Fix capitalization
Oct 23 2015, 12:06 PM
jah committed rS289825: Remove unclear comment about address truncation in busdma. Add (hopefully….
Remove unclear comment about address truncation in busdma. Add (hopefully…
Oct 23 2015, 12:03 PM

Oct 22 2015

jah added a reviewer for D3989: Update powerpc busdma to handle unmapped/out-of-context buffers: jhibbits.
Oct 22 2015, 10:05 PM
jah retitled D3989: Update powerpc busdma to handle unmapped/out-of-context buffers from to Update powerpc busdma to handle unmapped/out-of-context buffers.
Oct 22 2015, 10:02 PM
jah added a reviewer for D3986: Update mips busdma to handle unmapped/out-of-context buffers: adrian.
Oct 22 2015, 9:14 PM
jah retitled D3986: Update mips busdma to handle unmapped/out-of-context buffers from to Update mips busdma to handle unmapped/out-of-context buffers.
Oct 22 2015, 9:13 PM
jah committed rS289759: Use pmap_quick* functions in armv6 busdma, for bounce buffers and cache….
Use pmap_quick* functions in armv6 busdma, for bounce buffers and cache…
Oct 22 2015, 4:38 PM
jah closed D3869: Update armv6 busdma implementation to support unmapped/out-of-context userspace buffers by committing rS289759: Use pmap_quick* functions in armv6 busdma, for bounce buffers and cache….
Oct 22 2015, 4:38 PM

Oct 21 2015

jah committed rS289717: Use pmap_quick* functions in arm64 busdma to make bounce buffer….
Use pmap_quick* functions in arm64 busdma to make bounce buffer…
Oct 21 2015, 7:44 PM
jah closed D3870: Use pmap_quick* in arm64 busdma by committing rS289717: Use pmap_quick* functions in arm64 busdma to make bounce buffer….
Oct 21 2015, 7:44 PM
jah added a comment to D888: x86/dma_bounce: rework _bus_dmamap_load_ma implementation.
In D888#82509, @royger wrote:
In D888#80533, @jah wrote:

Thinking about this some more, I wonder if it would be better to have add_bounce_page() do coalescing in much the same way as _bus_dmamap_addseg() already does. You'd still have the 2-page array in struct bounce_page, but add_bounce_page() would go back to just taking one address. It would look at the tail of map->bpages (if that exists). If that last bounce page can still fit the new segment with the right alignment, then its datacount will be increased and datapage[1] will be set if necessary. Otherwise, a new bounce page will be pulled from the bz queue.

With that scheme, you wouldn't need the dedicated load_ma or count_ma functions; existing load_phys and load_buffer would "do the right thing". We'd also make more efficient use of bounce pages when magsegz is much smaller than a page. Right now, if maxsegsz is, say, 512 and those 512-byte segments get bounced, each one will waste a whole bounce page. Of course, I doubt that's a common use case.

A downside would be that you'd probably need to duplicate some of the coalescing logic in count_phys and count_pages to avoid over-requesting bounce pages.

Just a thought I had; there are probably holes in that scheme that I haven't thought of.

The solution you are proposing seems fine, but I don't think I will have time to look into it until a couple of weeks, do you mind if I commit this now so we can get unmapped IO for blkfront?

Oct 21 2015, 1:13 PM
jah committed rS289675: Use pmap_quick* for out-of-context bounce buffers and (limited) cache….
Use pmap_quick* for out-of-context bounce buffers and (limited) cache…
Oct 21 2015, 4:53 AM
jah closed D3522: Use pmap_quick* in pre-v6 arm busdma implementation by committing rS289675: Use pmap_quick* for out-of-context bounce buffers and (limited) cache….
Oct 21 2015, 4:53 AM
jah updated the test plan for D3522: Use pmap_quick* in pre-v6 arm busdma implementation.
Oct 21 2015, 4:52 AM

Oct 20 2015

jah updated the test plan for D3522: Use pmap_quick* in pre-v6 arm busdma implementation.
Oct 20 2015, 9:54 AM
jah updated the diff for D3522: Use pmap_quick* in pre-v6 arm busdma implementation.

Narrow the scope of the temporary bounce buffer mappings

Oct 20 2015, 9:52 AM

Oct 18 2015

jah added inline comments to D3869: Update armv6 busdma implementation to support unmapped/out-of-context userspace buffers.
Oct 18 2015, 11:34 AM

Oct 17 2015

jah updated the diff for D3869: Update armv6 busdma implementation to support unmapped/out-of-context userspace buffers.

Fixed confusion of client page addr vs. bounce page addr, trimmed trailing whitespace

Oct 17 2015, 9:30 PM
jah added inline comments to D3869: Update armv6 busdma implementation to support unmapped/out-of-context userspace buffers.
Oct 17 2015, 9:08 PM
jah updated the diff for D3869: Update armv6 busdma implementation to support unmapped/out-of-context userspace buffers.

Comment on unaligned pages, move page array assertion back to dma_dcache_sync()

Oct 17 2015, 3:51 PM
jah committed rS289457: Don't page-align the physical address when calling PHYS_TO_VM_PAGE()..
Don't page-align the physical address when calling PHYS_TO_VM_PAGE().
Oct 17 2015, 2:59 PM
jah added inline comments to D3869: Update armv6 busdma implementation to support unmapped/out-of-context userspace buffers.
Oct 17 2015, 2:33 PM
jah updated the diff for D3869: Update armv6 busdma implementation to support unmapped/out-of-context userspace buffers.

Re-adding comment, moving POSTWRITE check to beginning of _bus_dmamap_sync() as is done for armv5 and mips

Oct 17 2015, 12:01 AM

Oct 16 2015

jah added inline comments to D3869: Update armv6 busdma implementation to support unmapped/out-of-context userspace buffers.
Oct 16 2015, 10:52 PM

Oct 13 2015

jah added a comment to D888: x86/dma_bounce: rework _bus_dmamap_load_ma implementation.

Thinking about this some more, I wonder if it would be better to have add_bounce_page() do coalescing in much the same way as _bus_dmamap_addseg() already does. You'd still have the 2-page array in struct bounce_page, but add_bounce_page() would go back to just taking one address. It would look at the tail of map->bpages (if that exists). If that last bounce page can still fit the new segment with the right alignment, then its datacount will be increased and datapage[1] will be set if necessary. Otherwise, a new bounce page will be pulled from the bz queue.

Oct 13 2015, 11:01 PM
jah updated the diff for D3869: Update armv6 busdma implementation to support unmapped/out-of-context userspace buffers.

Port unmapped bounce buffer alignment fix from x86

Oct 13 2015, 11:45 AM
jah updated the diff for D3870: Use pmap_quick* in arm64 busdma.

Port unmapped bounce buffer alignment fix from x86

Oct 13 2015, 11:43 AM
jah updated the diff for D3522: Use pmap_quick* in pre-v6 arm busdma implementation.

Port unmapped bounce buffer alignment fix from x86

Oct 13 2015, 11:42 AM
jah committed rS289202: Ensure the client regions for unmapped bounce buffers created through….
Ensure the client regions for unmapped bounce buffers created through…
Oct 13 2015, 2:18 AM

Oct 12 2015

jah accepted D888: x86/dma_bounce: rework _bus_dmamap_load_ma implementation.
Oct 12 2015, 10:43 PM
jah added a comment to D888: x86/dma_bounce: rework _bus_dmamap_load_ma implementation.

I like the memdesc idea, or at least something like it. I also agree that it's too tall an order to do everywhere right now, especially if Xen needs this right away.

Oct 12 2015, 10:42 PM

Oct 11 2015

jah updated D3869: Update armv6 busdma implementation to support unmapped/out-of-context userspace buffers.
Oct 11 2015, 9:44 PM
jah added reviewers for D3870: Use pmap_quick* in arm64 busdma: andrew, emaste.
Oct 11 2015, 9:35 PM
jah retitled D3870: Use pmap_quick* in arm64 busdma from to Use pmap_quick* in arm64 busdma.
Oct 11 2015, 9:34 PM
jah added reviewers for D3869: Update armv6 busdma implementation to support unmapped/out-of-context userspace buffers: loos, ian.
Oct 11 2015, 9:30 PM
jah retitled D3869: Update armv6 busdma implementation to support unmapped/out-of-context userspace buffers from to Update armv6 busdma implementation to support unmapped/out-of-context userspace buffers.
Oct 11 2015, 9:27 PM
jah updated the diff for D3522: Use pmap_quick* in pre-v6 arm busdma implementation.

Adding assert on non-contiguous pages

Oct 11 2015, 5:55 PM

Oct 1 2015

jah updated the diff for D3522: Use pmap_quick* in pre-v6 arm busdma implementation.
  • Simplify loop in sync_sl
Oct 1 2015, 4:56 PM
jah updated the diff for D3522: Use pmap_quick* in pre-v6 arm busdma implementation.
  • Fix logic errors around call to sync_buf and bounce buffer cache maintenance
  • Remove sync_buf call for unmapped case: cache operations in pmap_quick_enter_page()->pmap_kenter()->pmap_fix_cache() make sync_buf irrelevant
Oct 1 2015, 4:25 PM

Sep 16 2015

jah updated the diff for D3522: Use pmap_quick* in pre-v6 arm busdma implementation.

Style fixes. Initialize sl outside the mapping loop, since it is incremented inside the loop.

Sep 16 2015, 3:54 PM

Sep 1 2015

jah updated the diff for D3522: Use pmap_quick* in pre-v6 arm busdma implementation.

Making sl coalescing logic a little clearer, preventing coalescing in the case where the sl has a non-contiguous KVA but the physical pages happen to be adjacent.

Sep 1 2015, 3:59 AM

Aug 28 2015

jah added reviewers for D3522: Use pmap_quick* in pre-v6 arm busdma implementation: ian, kib.
Aug 28 2015, 4:58 PM
jah retitled D3522: Use pmap_quick* in pre-v6 arm busdma implementation from to Use pmap_quick* in pre-v6 arm busdma implementation.
Aug 28 2015, 4:56 PM

Aug 17 2015

jah committed rS286851: Some cleanups to make the style of pmap_quick_enter_page() and….
Some cleanups to make the style of pmap_quick_enter_page() and…
Aug 17 2015, 6:28 PM

Aug 14 2015

jah committed rS286787: Use pmap_quick_enter_page() to handle bouncing of unmapped buffers in the x86….
Use pmap_quick_enter_page() to handle bouncing of unmapped buffers in the x86…
Aug 14 2015, 8:08 PM