History log of /freebsd-10.0-release/sys/crypto/via/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


230426 21-Jan-2012 kib

Add support for the extended FPU states on amd64, both for native
64bit and 32bit ABIs. As a side-effect, it enables AVX on capable
CPUs.

In particular:

- Query the CPU support for XSAVE, list of the supported extensions
and the required size of FPU save area. The hw.use_xsave tunable is
provided for disabling XSAVE, and hw.xsave_mask may be used to
select the enabled extensions.

- Remove the FPU save area from PCB and dynamically allocate the
(run-time sized) user save area on the top of the kernel stack,
right above the PCB. Reorganize the thread0 PCB initialization to
postpone it after BSP is queried for save area size.

- The dumppcb, stoppcbs and susppcbs now do not carry the FPU state as
well. FPU state is only useful for suspend, where it is saved in
dynamically allocated suspfpusave area.

- Use XSAVE and XRSTOR to save/restore FPU state, if supported and
enabled.

- Define new mcontext_t flag _MC_HASFPXSTATE, indicating that
mcontext_t has a valid pointer to out-of-struct extended FPU
state. Signal handlers are supplied with stack-allocated fpu
state. The sigreturn(2) and setcontext(2) syscall honour the flag,
allowing the signal handlers to inspect and manipilate extended
state in the interrupted context.

- The getcontext(2) never returns extended state, since there is no
place in the fixed-sized mcontext_t to place variable-sized save
area. And, since mcontext_t is embedded into ucontext_t, makes it
impossible to fix in a reasonable way. Instead of extending
getcontext(2) syscall, provide a sysarch(2) facility to query
extended FPU state.

- Add ptrace(2) support for getting and setting extended state; while
there, implement missed PT_I386_{GET,SET}XMMREGS for 32bit binaries.

- Change fpu_kern KPI to not expose struct fpu_kern_ctx layout to
consumers, making it opaque. Internally, struct fpu_kern_ctx now
contains a space for the extended state. Convert in-kernel consumers
of fpu_kern KPI both on i386 and amd64.

First version of the support for AVX was submitted by Tim Bird
<tim.bird am sony com> on behalf of Sony. This version was written
from scratch.

Tested by: pho (previous version), Yamagi Burmeister <lists yamagi org>
MFC after: 1 month


215864 26-Nov-2010 kib

MFaesni r215427:
Only save FPU context when not executing in the context of the crypto
thread.

Tested by: Mike Tancsa
MFC after: 1 week


208834 05-Jun-2010 kib

Use the fpu_kern_enter() interface to properly separate usermode FPU
context from in-kernel execution of padlock instructions and to handle
spurious FPUDNA exceptions that sometime are raised when doing padlock
calculations.

Globally mark crypto(9) kthread as using FPU.

Reviewed by: pjd
Hardware provided by: Sentex Communications
Tested by: pho
PR: amd64/135014
MFC after: 1 month


192883 27-May-2009 vanhu

Changed to M_NOWAIT when reallocing psc_buf in padlock_sha_update(),
as we already hold the non sleepable crypto_driver_mutex.

Approved by: gnn(mentor)
Obtained from: NETASQ
MFC after: 2 weeks


188171 05-Feb-2009 imp

identify routine takes driver_t *, not device_t *.


187112 12-Jan-2009 jkim

Connect padlock(4) to amd64 build for VIA Nano processors.


185026 17-Nov-2008 philip

Fix a potential NULL-pointer dereference in padlock(4).

Spotted by: Coverity (via pjd)
MFC after: 1 week


181478 09-Aug-2008 pjd

Simplify session selection/allocation.


181477 09-Aug-2008 pjd

- Fix freeing session on newsession failure.
- Update copyright years.


181476 09-Aug-2008 pjd

Implify sessions freeing loop.


181475 09-Aug-2008 pjd

We don't have to drop a lock around malloc(M_NOWAIT).


181474 09-Aug-2008 pjd

When freeing session, restore its ID after zeroing memory.

Bug tracked down by: Patrick Lamaiziere <patfbsd@davenulle.org>


181473 09-Aug-2008 pjd

Sessions in-use are at the end of the queue, so use TAILQ_FOREACH_REVERSE()
when looking for them.

Idea from: Patrick Lamaiziere <patfbsd@davenulle.org>


180626 20-Jul-2008 pjd

Convert lock that protects sessions list from a mutex to a rwlock.
Now we can use read lock in fast path (padlock_process()).


171167 03-Jul-2007 gnn

Commit the change from FAST_IPSEC to IPSEC. The FAST_IPSEC
option is now deprecated, as well as the KAME IPsec code.
What was FAST_IPSEC is now IPSEC.

Approved by: re
Sponsored by: Secure Computing


167755 21-Mar-2007 sam

Overhaul driver/subsystem api's:
o make all crypto drivers have a device_t; pseudo drivers like the s/w
crypto driver synthesize one
o change the api between the crypto subsystem and drivers to use kobj;
cryptodev_if.m defines this api
o use the fact that all crypto drivers now have a device_t to add support
for specifying which of several potential devices to use when doing
crypto operations
o add new ioctls that allow user apps to select a specific crypto device
to use (previous ioctls maintained for compatibility)
o overhaul crypto subsystem code to eliminate lots of cruft and hide
implementation details from drivers
o bring in numerous fixes from Michale Richardson/hifn; mostly for
795x parts
o add an optional mechanism for mmap'ing the hifn 795x public key h/w
to user space for use by openssl (not enabled by default)
o update crypto test tools to use new ioctl's and add cmd line options
to specify a device to use for tests

These changes will also enable much future work on improving the core
crypto subsystem; including proper load balancing and interposing code
between the core and drivers to dispatch small operations to the s/w
driver as appropriate.

These changes were instigated by the work of Michael Richardson.

Reviewed by: pjd
Approved by: re


162316 15-Sep-2006 pjd

Less magic.

MFC after: 3 days


160785 28-Jul-2006 pjd

Remove trailing spaces.


160784 28-Jul-2006 pjd

Use existing roundup2() macro.

Suggested by: njl


160677 25-Jul-2006 pjd

Remove redundant check committed by accident.


160676 25-Jul-2006 pjd

Avoid memory allocations when the given address is already 16 bytes aligned.
Such an address can be used directly in padlock's AES.
This improves speed of geli(8) significantly:

# sysctl kern.geom.zero.clear=0
# geli onetime -s 4096 gzero
# dd if=/dev/gzero.eli of=/dev/null bs=1m count=1000

Before: 113MB/s
After: 203MB/s

BTW. If sector size is set to 128kB, I can read at 276MB/s :)


160675 25-Jul-2006 pjd

Modify PADLOCK_ALIGN() macro, so when the given address is already 16 bytes
aligned, it will be used directly, not 'address + 16'.


160674 25-Jul-2006 pjd

Style fixes.


160582 22-Jul-2006 pjd

Implement support for HMAC/SHA1 and HMAC/SHA256 acceleration found in
new VIA CPUs.
For older CPUs HMAC/SHA1 and HMAC/SHA256 (and others) will still be done
in software.

Move symmetric cryptography (currently only AES-CBC 128/192/256) to
padlock_cipher.c file. Move HMAC cryptography to padlock_hash.c file.

Hardware from: Centaur Technologies


160573 22-Jul-2006 pjd

Correct few bzero()s.

MFC after: 3 days


160568 22-Jul-2006 pjd

Set ses_ictx and ses_octx to NULL after freeing them, so we won't free
them twice.
This is possible for example in situation when session is used in
authentication context, then freed and then used in encryption context
and freed - in encryption context ses_ictx and ses_octx are not touched
at newsession time, but padlock_freesession could still try to free them
when they are not NULL.


160325 13-Jul-2006 mr

Use the already stored VIA RNG probe information
instead of probing again.
Adjust style(9) somewhat in probe.c

Reviewed by: pjd
MFC after: 1 week


159405 08-Jun-2006 pjd

Fix gratuitous compiler warning.

Reported by: Rong-en Fan <grafan@gmail.com>


159279 05-Jun-2006 pjd

- Pretend to accelerate various HMAC algorithms, so padlock(4) can be used
with fast_ipsec(4) and geli(8) authentication (comming soon).
If consumer requests only for HMAC algorithm (without encryption), return
EINVAL.
- Add support for the CRD_F_KEY_EXPLICIT flag, for both encryption and
authentication.


157899 20-Apr-2006 pjd

padlock(4) doesn't support explicitly provided keys yet.
Return an error instead of encrypting/decrypting data with a wrong key.


157684 12-Apr-2006 pjd

On padlock initialization, allocate memory with M_WAITOK.


149211 18-Aug-2005 pjd

Add VIA/ACE "PadLock" support as a crypto(9) driver.

HW donated by: Mike Tancsa <mike@sentex.net>
Most of the code obtained from: OpenBSD
MFC after: 3 days