9c0e3d3a53
Some crypto consumers such as GELI and KTLS for file-backed sendfile need to store their output in a separate buffer from the input. Currently these consumers copy the contents of the input buffer into the output buffer and queue an in-place crypto operation on the output buffer. Using a separate output buffer avoids this copy. - Create a new 'struct crypto_buffer' describing a crypto buffer containing a type and type-specific fields. crp_ilen is gone, instead buffers that use a flat kernel buffer have a cb_buf_len field for their length. The length of other buffer types is inferred from the backing store (e.g. uio_resid for a uio). Requests now have two such structures: crp_buf for the input buffer, and crp_obuf for the output buffer. - Consumers now use helper functions (crypto_use_*, e.g. crypto_use_mbuf()) to configure the input buffer. If an output buffer is not configured, the request still modifies the input buffer in-place. A consumer uses a second set of helper functions (crypto_use_output_*) to configure an output buffer. - Consumers must request support for separate output buffers when creating a crypto session via the CSP_F_SEPARATE_OUTPUT flag and are only permitted to queue a request with a separate output buffer on sessions with this flag set. Existing drivers already reject sessions with unknown flags, so this permits drivers to be modified to support this extension without requiring all drivers to change. - Several data-related functions now have matching versions that operate on an explicit buffer (e.g. crypto_apply_buf, crypto_contiguous_subsegment_buf, bus_dma_load_crp_buf). - Most of the existing data-related functions operate on the input buffer. However crypto_copyback always writes to the output buffer if a request uses a separate output buffer. - For the regions in input/output buffers, the following conventions are followed: - AAD and IV are always present in input only and their fields are offsets into the input buffer. - payload is always present in both buffers. If a request uses a separate output buffer, it must set a new crp_payload_start_output field to the offset of the payload in the output buffer. - digest is in the input buffer for verify operations, and in the output buffer for compute operations. crp_digest_start is relative to the appropriate buffer. - Add a crypto buffer cursor abstraction. This is a more general form of some bits in the cryptosoft driver that tried to always use uio's. However, compared to the original code, this avoids rewalking the uio iovec array for requests with multiple vectors. It also avoids allocate an iovec array for mbufs and populating it by instead walking the mbuf chain directly. - Update the cryptosoft(4) driver to support separate output buffers making use of the cursor abstraction. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D24545 |
||
---|---|---|
.. | ||
accept_filter.9 | ||
accf_data.9 | ||
accf_dns.9 | ||
accf_http.9 | ||
acl.9 | ||
alq.9 | ||
altq.9 | ||
atomic.9 | ||
bhnd_erom.9 | ||
bhnd.9 | ||
bios.9 | ||
bitset.9 | ||
boot.9 | ||
bpf.9 | ||
BUF_ISLOCKED.9 | ||
BUF_LOCK.9 | ||
BUF_LOCKFREE.9 | ||
BUF_LOCKINIT.9 | ||
BUF_RECURSED.9 | ||
buf_ring.9 | ||
BUF_TIMELOCK.9 | ||
BUF_UNLOCK.9 | ||
buf.9 | ||
bus_activate_resource.9 | ||
BUS_ADD_CHILD.9 | ||
bus_adjust_resource.9 | ||
bus_alloc_resource.9 | ||
BUS_BIND_INTR.9 | ||
BUS_CHILD_DELETED.9 | ||
BUS_CHILD_DETACHED.9 | ||
bus_child_present.9 | ||
BUS_CONFIG_INTR.9 | ||
bus_delayed_attach_children.9 | ||
BUS_DESCRIBE_INTR.9 | ||
bus_dma.9 | ||
bus_generic_attach.9 | ||
bus_generic_detach.9 | ||
bus_generic_new_pass.9 | ||
bus_generic_print_child.9 | ||
bus_generic_read_ivar.9 | ||
bus_generic_shutdown.9 | ||
BUS_GET_CPUS.9 | ||
bus_get_resource.9 | ||
bus_map_resource.9 | ||
BUS_NEW_PASS.9 | ||
BUS_PRINT_CHILD.9 | ||
BUS_READ_IVAR.9 | ||
bus_release_resource.9 | ||
BUS_RESCAN.9 | ||
bus_set_pass.9 | ||
bus_set_resource.9 | ||
BUS_SETUP_INTR.9 | ||
bus_space.9 | ||
byteorder.9 | ||
callout.9 | ||
casuword.9 | ||
cd.9 | ||
cnv.9 | ||
condvar.9 | ||
config_intrhook.9 | ||
contigmalloc.9 | ||
copy.9 | ||
counter.9 | ||
cpuset.9 | ||
cr_cansee.9 | ||
cr_seeothergids.9 | ||
cr_seeotheruids.9 | ||
critical_enter.9 | ||
crypto_asym.9 | ||
crypto_buffer.9 | ||
crypto_driver.9 | ||
crypto_request.9 | ||
crypto_session.9 | ||
crypto.9 | ||
CTASSERT.9 | ||
DB_COMMAND.9 | ||
DECLARE_GEOM_CLASS.9 | ||
DECLARE_MODULE.9 | ||
DEFINE_IFUNC.9 | ||
DELAY.9 | ||
dev_clone.9 | ||
DEV_MODULE.9 | ||
dev_refthread.9 | ||
devclass_find.9 | ||
devclass_get_count.9 | ||
devclass_get_device.9 | ||
devclass_get_devices.9 | ||
devclass_get_drivers.9 | ||
devclass_get_maxunit.9 | ||
devclass_get_name.9 | ||
devclass_get_softc.9 | ||
devclass.9 | ||
devfs_set_cdevpriv.9 | ||
device_add_child.9 | ||
DEVICE_ATTACH.9 | ||
device_delete_child.9 | ||
device_delete_children.9 | ||
DEVICE_DETACH.9 | ||
device_enable.9 | ||
device_find_child.9 | ||
device_get_children.9 | ||
device_get_devclass.9 | ||
device_get_driver.9 | ||
device_get_ivars.9 | ||
device_get_name.9 | ||
device_get_parent.9 | ||
device_get_softc.9 | ||
device_get_state.9 | ||
device_get_sysctl.9 | ||
device_get_unit.9 | ||
DEVICE_IDENTIFY.9 | ||
device_printf.9 | ||
device_probe_and_attach.9 | ||
DEVICE_PROBE.9 | ||
device_quiet.9 | ||
device_set_desc.9 | ||
device_set_driver.9 | ||
device_set_flags.9 | ||
DEVICE_SHUTDOWN.9 | ||
device.9 | ||
devstat.9 | ||
devtoname.9 | ||
disk.9 | ||
dnv.9 | ||
domain.9 | ||
domainset.9 | ||
dpcpu.9 | ||
drbr.9 | ||
DRIVER_MODULE.9 | ||
driver.9 | ||
efirt.9 | ||
epoch.9 | ||
EVENTHANDLER.9 | ||
eventtimers.9 | ||
extattr.9 | ||
fail.9 | ||
fdt_pinctrl.9 | ||
fetch.9 | ||
firmware.9 | ||
fpu_kern.9 | ||
g_access.9 | ||
g_attach.9 | ||
g_bio.9 | ||
g_consumer.9 | ||
g_data.9 | ||
g_event.9 | ||
g_geom.9 | ||
g_provider_by_name.9 | ||
g_provider.9 | ||
g_wither_geom.9 | ||
get_cyclecount.9 | ||
getenv.9 | ||
getnewvnode.9 | ||
groupmember.9 | ||
hash.9 | ||
hashinit.9 | ||
hexdump.9 | ||
hhook.9 | ||
ieee80211_amrr.9 | ||
ieee80211_beacon.9 | ||
ieee80211_bmiss.9 | ||
ieee80211_crypto.9 | ||
ieee80211_ddb.9 | ||
ieee80211_input.9 | ||
ieee80211_node.9 | ||
ieee80211_output.9 | ||
ieee80211_proto.9 | ||
ieee80211_radiotap.9 | ||
ieee80211_regdomain.9 | ||
ieee80211_scan.9 | ||
ieee80211_vap.9 | ||
ieee80211.9 | ||
iflib.9 | ||
iflibdd.9 | ||
iflibdi.9 | ||
iflibtxrx.9 | ||
ifnet.9 | ||
inittodr.9 | ||
insmntque.9 | ||
intro.9 | ||
ithread.9 | ||
KASSERT.9 | ||
kern_testfrwk.9 | ||
kernacc.9 | ||
kernel_mount.9 | ||
khelp.9 | ||
kobj.9 | ||
kproc.9 | ||
kqueue.9 | ||
kthread.9 | ||
ktr.9 | ||
LOCK_PROFILING.9 | ||
lock.9 | ||
locking.9 | ||
mac.9 | ||
make_dev.9 | ||
Makefile | ||
Makefile.depend | ||
malloc.9 | ||
mbchain.9 | ||
mbuf_tags.9 | ||
mbuf.9 | ||
MD5.9 | ||
mdchain.9 | ||
memcchr.9 | ||
memguard.9 | ||
mi_switch.9 | ||
microseq.9 | ||
microtime.9 | ||
microuptime.9 | ||
mod_cc.9 | ||
MODULE_DEPEND.9 | ||
MODULE_PNP_INFO.9 | ||
MODULE_VERSION.9 | ||
module.9 | ||
mtx_pool.9 | ||
mutex.9 | ||
namei.9 | ||
netisr.9 | ||
nv.9 | ||
nvmem.9 | ||
OF_child.9 | ||
OF_device_from_xref.9 | ||
OF_finddevice.9 | ||
OF_getprop.9 | ||
OF_node_from_xref.9 | ||
OF_package_to_path.9 | ||
ofw_bus_is_compatible.9 | ||
ofw_bus_status_okay.9 | ||
ofw_graph.9 | ||
osd.9 | ||
owll.9 | ||
own.9 | ||
p_candebug.9 | ||
p_cansee.9 | ||
panic.9 | ||
PCBGROUP.9 | ||
PCI_IOV_ADD_VF.9 | ||
PCI_IOV_INIT.9 | ||
pci_iov_schema.9 | ||
PCI_IOV_UNINIT.9 | ||
pci.9 | ||
pfil.9 | ||
pfind.9 | ||
pget.9 | ||
pgfind.9 | ||
PHOLD.9 | ||
physio.9 | ||
pmap_activate.9 | ||
pmap_clear_modify.9 | ||
pmap_copy.9 | ||
pmap_enter.9 | ||
pmap_extract.9 | ||
pmap_growkernel.9 | ||
pmap_init.9 | ||
pmap_is_modified.9 | ||
pmap_is_prefaultable.9 | ||
pmap_map.9 | ||
pmap_mincore.9 | ||
pmap_object_init_pt.9 | ||
pmap_page_exists_quick.9 | ||
pmap_page_init.9 | ||
pmap_pinit.9 | ||
pmap_protect.9 | ||
pmap_qenter.9 | ||
pmap_quick_enter_page.9 | ||
pmap_release.9 | ||
pmap_remove.9 | ||
pmap_resident_count.9 | ||
pmap_unwire.9 | ||
pmap_zero_page.9 | ||
pmap.9 | ||
printf.9 | ||
prison_check.9 | ||
priv.9 | ||
proc_rwmem.9 | ||
pseudofs.9 | ||
psignal.9 | ||
pwmbus.9 | ||
random_harvest.9 | ||
random.9 | ||
ratecheck.9 | ||
redzone.9 | ||
refcount.9 | ||
resettodr.9 | ||
resource_int_value.9 | ||
rijndael.9 | ||
rman.9 | ||
rmlock.9 | ||
rtalloc.9 | ||
rtentry.9 | ||
runqueue.9 | ||
rwlock.9 | ||
sbuf.9 | ||
scheduler.9 | ||
SDT.9 | ||
securelevel_gt.9 | ||
selrecord.9 | ||
sema.9 | ||
seqc.9 | ||
sf_buf.9 | ||
sglist.9 | ||
shm_map.9 | ||
signal.9 | ||
sleep.9 | ||
sleepqueue.9 | ||
socket.9 | ||
stack.9 | ||
store.9 | ||
style.9 | ||
style.lua.9 | ||
superio.9 | ||
swi.9 | ||
sx.9 | ||
syscall_helper_register.9 | ||
SYSCALL_MODULE.9 | ||
sysctl_add_oid.9 | ||
sysctl_ctx_init.9 | ||
sysctl.9 | ||
SYSINIT.9 | ||
taskqueue.9 | ||
tcp_functions.9 | ||
thread_exit.9 | ||
time.9 | ||
tvtohz.9 | ||
ucred.9 | ||
uidinfo.9 | ||
uio.9 | ||
unr.9 | ||
usbdi.9 | ||
vaccess_acl_nfs4.9 | ||
vaccess_acl_posix1e.9 | ||
vaccess.9 | ||
vcount.9 | ||
vflush.9 | ||
vfs_busy.9 | ||
VFS_CHECKEXP.9 | ||
VFS_FHTOVP.9 | ||
vfs_getnewfsid.9 | ||
vfs_getopt.9 | ||
vfs_getvfs.9 | ||
VFS_MOUNT.9 | ||
vfs_mountedfrom.9 | ||
VFS_QUOTACTL.9 | ||
VFS_ROOT.9 | ||
vfs_rootmountalloc.9 | ||
VFS_SET.9 | ||
VFS_STATFS.9 | ||
vfs_suser.9 | ||
VFS_SYNC.9 | ||
vfs_timestamp.9 | ||
vfs_unbusy.9 | ||
VFS_UNMOUNT.9 | ||
vfs_unmountall.9 | ||
VFS_VGET.9 | ||
VFS.9 | ||
vfsconf.9 | ||
vget.9 | ||
vgone.9 | ||
vhold.9 | ||
vinvalbuf.9 | ||
vm_fault_prefault.9 | ||
vm_map_check_protection.9 | ||
vm_map_create.9 | ||
vm_map_delete.9 | ||
vm_map_entry_resize_free.9 | ||
vm_map_find.9 | ||
vm_map_findspace.9 | ||
vm_map_inherit.9 | ||
vm_map_init.9 | ||
vm_map_insert.9 | ||
vm_map_lock.9 | ||
vm_map_lookup.9 | ||
vm_map_madvise.9 | ||
vm_map_max.9 | ||
vm_map_protect.9 | ||
vm_map_remove.9 | ||
vm_map_simplify_entry.9 | ||
vm_map_stack.9 | ||
vm_map_submap.9 | ||
vm_map_sync.9 | ||
vm_map_wire.9 | ||
vm_map.9 | ||
vm_page_aflag.9 | ||
vm_page_alloc.9 | ||
vm_page_bits.9 | ||
vm_page_busy.9 | ||
vm_page_deactivate.9 | ||
vm_page_dontneed.9 | ||
vm_page_free.9 | ||
vm_page_grab.9 | ||
vm_page_insert.9 | ||
vm_page_lookup.9 | ||
vm_page_rename.9 | ||
vm_page_wire.9 | ||
vm_set_page_size.9 | ||
vmem.9 | ||
vn_fullpath.9 | ||
vn_isdisk.9 | ||
vnet.9 | ||
vnode.9 | ||
VOP_ACCESS.9 | ||
VOP_ACLCHECK.9 | ||
VOP_ADVISE.9 | ||
VOP_ADVLOCK.9 | ||
VOP_ALLOCATE.9 | ||
VOP_ATTRIB.9 | ||
VOP_BMAP.9 | ||
VOP_BWRITE.9 | ||
VOP_COPY_FILE_RANGE.9 | ||
VOP_CREATE.9 | ||
VOP_FSYNC.9 | ||
VOP_GETACL.9 | ||
VOP_GETEXTATTR.9 | ||
VOP_GETPAGES.9 | ||
VOP_INACTIVE.9 | ||
VOP_IOCTL.9 | ||
VOP_LINK.9 | ||
VOP_LISTEXTATTR.9 | ||
VOP_LOCK.9 | ||
VOP_LOOKUP.9 | ||
VOP_OPENCLOSE.9 | ||
VOP_PATHCONF.9 | ||
VOP_PRINT.9 | ||
VOP_RDWR.9 | ||
VOP_READDIR.9 | ||
VOP_READLINK.9 | ||
VOP_REALLOCBLKS.9 | ||
VOP_REMOVE.9 | ||
VOP_RENAME.9 | ||
VOP_REVOKE.9 | ||
VOP_SETACL.9 | ||
VOP_SETEXTATTR.9 | ||
VOP_STRATEGY.9 | ||
VOP_VPTOCNP.9 | ||
VOP_VPTOFH.9 | ||
vref.9 | ||
vrefcnt.9 | ||
vrele.9 | ||
vslock.9 | ||
watchdog.9 | ||
zone.9 |