linux_dsm_epyc7002/arch/x86/include/asm
Linus Torvalds 36126f8f2e word-at-a-time: make the interfaces truly generic
This changes the interfaces in <asm/word-at-a-time.h> to be a bit more
complicated, but a lot more generic.

In particular, it allows us to really do the operations efficiently on
both little-endian and big-endian machines, pretty much regardless of
machine details.  For example, if you can rely on a fast population
count instruction on your architecture, this will allow you to make your
optimized <asm/word-at-a-time.h> file with that.

NOTE! The "generic" version in include/asm-generic/word-at-a-time.h is
not truly generic, it actually only works on big-endian.  Why? Because
on little-endian the generic algorithms are wasteful, since you can
inevitably do better. The x86 implementation is an example of that.

(The only truly non-generic part of the asm-generic implementation is
the "find_zero()" function, and you could make a little-endian version
of it.  And if the Kbuild infrastructure allowed us to pick a particular
header file, that would be lovely)

The <asm/word-at-a-time.h> functions are as follows:

 - WORD_AT_A_TIME_CONSTANTS: specific constants that the algorithm
   uses.

 - has_zero(): take a word, and determine if it has a zero byte in it.
   It gets the word, the pointer to the constant pool, and a pointer to
   an intermediate "data" field it can set.

   This is the "quick-and-dirty" zero tester: it's what is run inside
   the hot loops.

 - "prep_zero_mask()": take the word, the data that has_zero() produced,
   and the constant pool, and generate an *exact* mask of which byte had
   the first zero.  This is run directly *outside* the loop, and allows
   the "has_zero()" function to answer the "is there a zero byte"
   question without necessarily getting exactly *which* byte is the
   first one to contain a zero.

   If you do multiple byte lookups concurrently (eg "hash_name()", which
   looks for both NUL and '/' bytes), after you've done the prep_zero_mask()
   phase, the result of those can be or'ed together to get the "either
   or" case.

 - The result from "prep_zero_mask()" can then be fed into "find_zero()"
   (to find the byte offset of the first byte that was zero) or into
   "zero_bytemask()" (to find the bytemask of the bytes preceding the
   zero byte).

   The existence of zero_bytemask() is optional, and is not necessary
   for the normal string routines.  But dentry name hashing needs it, so
   if you enable DENTRY_WORD_AT_A_TIME you need to expose it.

This changes the generic strncpy_from_user() function and the dentry
hashing functions to use these modified word-at-a-time interfaces.  This
gets us back to the optimized state of the x86 strncpy that we lost in
the previous commit when moving over to the generic version.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-05-26 11:33:40 -07:00
..
numachip
uv x86/uv: Fix uv_gpa_to_soc_phys_ram() shift 2012-01-26 10:58:27 +01:00
visws
xen Merge branch 'stable/autoballoon.v5.2' into stable/for-linus-3.5 2012-05-07 15:33:27 -04:00
a.out-core.h
a.out.h
acpi.h
aes.h
agp.h
alternative-asm.h
alternative.h x86: Adjust asm constraints in atomic64 wrappers 2012-01-20 17:29:31 -08:00
amd_nb.h
apb_timer.h
apic_flat_64.h
apic.h x86/apic: Implement EIO micro-optimization 2012-05-18 09:46:09 +02:00
apicdef.h x86/apic: Fix typo EIO_ACK -> EOI_ACK and document it 2012-05-18 09:46:07 +02:00
apm.h
arch_hweight.h
archrandom.h
asm-offsets.h
asm.h x86, extable: Switch to relative exception table entries 2012-04-20 17:22:34 -07:00
atomic64_32.h atomic64_32.h: fix parameter naming mismatch 2012-05-09 11:38:20 +02:00
atomic64_64.h
atomic.h
auxvec.h Disintegrate asm/system.h for X86 2012-03-28 18:11:12 +01:00
barrier.h Disintegrate asm/system.h for X86 2012-03-28 18:11:12 +01:00
bios_ebda.h
bitops.h
bitsperlong.h
boot.h x86: Use common threadinfo allocator 2012-05-08 14:08:44 +02:00
bootparam.h keyboard: Use BIOS Keyboard variable to set Numlock 2012-05-08 14:19:41 -07:00
bug.h Disintegrate asm/system.h for X86 2012-03-28 18:11:12 +01:00
bugs.h
byteorder.h
cache.h
cacheflush.h Disintegrate asm/system.h for X86 2012-03-28 18:11:12 +01:00
calgary.h
calling.h
ce4100.h
checksum_32.h
checksum_64.h
checksum.h
clocksource.h
cmpxchg_32.h
cmpxchg_64.h
cmpxchg.h x86: Use correct byte-sized register constraint in __add() 2012-04-06 09:40:07 -07:00
compat.h x86: replace percpu_xxx funcs with this_cpu_xxx 2012-05-14 14:15:31 -07:00
cpu_device_id.h Add driver auto probing for x86 features v4 2012-01-26 16:44:41 -08:00
cpu.h
cpufeature.h Merge branches 'x86-cpu-for-linus', 'x86-boot-for-linus', 'x86-cpufeature-for-linus', 'x86-process-for-linus' and 'x86-uv-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-03-22 09:28:15 -07:00
cpumask.h
cputime.h
current.h x86: replace percpu_xxx funcs with this_cpu_xxx 2012-05-14 14:15:31 -07:00
debugreg.h x86: relocate get/set debugreg fcns to include/asm/debugreg. 2012-02-28 17:48:04 -05:00
delay.h
desc_defs.h
desc.h x86: replace percpu_xxx funcs with this_cpu_xxx 2012-05-14 14:15:31 -07:00
device.h x86-32: Introduce CONFIG_X86_DEV_DMA_OPS 2012-04-12 11:09:56 -07:00
div64.h
dma-contiguous.h X86: integrate CMA with DMA-mapping subsystem 2012-05-21 15:09:38 +02:00
dma-mapping.h Merge branch 'for-linus' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping 2012-05-25 09:18:59 -07:00
dma.h
dmi.h
dwarf2.h
e820.h
edac.h
efi.h x86, efi: Allow basic init with mixed 32/64-bit efi/kernel 2012-02-23 18:54:51 -08:00
elf.h Merge branch 'x86-x32-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-03-29 18:12:23 -07:00
emergency-restart.h
entry_arch.h
errno.h
exec.h Disintegrate asm/system.h for X86 2012-03-28 18:11:12 +01:00
fb.h
fcntl.h
fixmap.h
floppy.h
fpu-internal.h x86: replace percpu_xxx funcs with this_cpu_xxx 2012-05-14 14:15:31 -07:00
frame.h
ftrace.h ftrace/x86: Have arch x86_64 use breakpoints instead of stop machine 2012-04-27 21:10:44 -04:00
futex.h Disintegrate asm/system.h for X86 2012-03-28 18:11:12 +01:00
gart.h
genapic.h
geode.h
gpio.h gpiolib/arches: Centralise bolierplate asm/gpio.h 2012-05-11 18:00:14 -06:00
hardirq.h x86: replace percpu_xxx funcs with this_cpu_xxx 2012-05-14 14:15:31 -07:00
highmem.h highmem: kill all __kmap_atomic() 2012-03-20 21:48:30 +08:00
hpet.h
hugetlb.h
hw_breakpoint.h
hw_irq.h
hypertransport.h
hyperv.h
hypervisor.h
i387.h Disintegrate asm/system.h for X86 2012-03-28 18:11:12 +01:00
i8259.h
ia32_unistd.h
ia32.h signal, x86: add SIGSYS info and make it synchronous. 2012-04-14 11:13:21 +10:00
idle.h x86: Merge the x86_32 and x86_64 cpu_idle() functions 2012-03-26 03:16:07 +02:00
inat_types.h
inat.h x86: Fix to decode grouped AVX with VEX pp bits 2012-02-11 15:11:35 +01:00
init.h
insn.h x86: Fix to decode grouped AVX with VEX pp bits 2012-02-11 15:11:35 +01:00
inst.h
intel_scu_ipc.h
io_apic.h x86/apic: Replace io_apic_ops with x86_io_apic_ops. 2012-05-01 14:50:09 -04:00
io.h
ioctl.h
ioctls.h
iomap.h
iommu_table.h
iommu.h
ipcbuf.h
ipi.h
irq_regs.h x86: replace percpu_xxx funcs with this_cpu_xxx 2012-05-14 14:15:31 -07:00
irq_remapping.h irq_remap: Fix compiler warning with CONFIG_IRQ_REMAP=y 2012-05-08 11:17:29 +02:00
irq_vectors.h
irq.h
irqflags.h
ist.h
jump_label.h static keys: Introduce 'struct static_key', static_key_true()/false() and static_key_slow_[inc|dec]() 2012-02-24 10:05:59 +01:00
kbdleds.h keyboard: Use BIOS Keyboard variable to set Numlock 2012-05-08 14:19:41 -07:00
Kbuild x32: Generate <asm/unistd_x32.h> 2012-02-20 12:51:00 -08:00
kdebug.h x86: Avoid double stack traces with show_regs() 2012-05-09 11:44:42 +02:00
kexec.h
kgdb.h kgdb: x86: Return all segment registers also in 64-bit mode 2012-03-22 15:07:15 -05:00
kmap_types.h
kmemcheck.h
kprobes.h
kvm_emulate.h KVM: x86 emulator: MMX support 2012-04-16 20:36:16 -03:00
kvm_host.h Merge branch 'next' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2012-05-24 16:17:30 -07:00
kvm_para.h Merge branch 'next' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2012-05-24 16:17:30 -07:00
kvm.h KVM: provide synchronous registers in kvm_run 2012-03-05 14:52:22 +02:00
ldt.h
lguest_hcall.h
lguest.h
linkage.h
local64.h
local.h Disintegrate asm/system.h for X86 2012-03-28 18:11:12 +01:00
mach_timer.h
mach_traps.h
math_emu.h
mc146818rtc.h Disintegrate asm/system.h for X86 2012-03-28 18:11:12 +01:00
mce.h x86/mce: Convert static array of pointers to per-cpu variables 2012-02-22 12:58:06 -08:00
microcode.h
mman.h
mmconfig.h
mmu_context.h x86: replace percpu_xxx funcs with this_cpu_xxx 2012-05-14 14:15:31 -07:00
mmu.h
mmx.h
mmzone_32.h x86: Drop obsolete ARCH_BOOTMEM support 2012-04-14 14:28:58 +02:00
mmzone_64.h
mmzone.h
module.h
mpspec_def.h MCA: delete all remaining traces of microchannel bus support. 2012-05-17 19:06:13 -04:00
mpspec.h MCA: delete all remaining traces of microchannel bus support. 2012-05-17 19:06:13 -04:00
mrst-vrtc.h
mrst.h x86/mid: Remove Intel Moorestown 2012-01-26 21:23:53 +01:00
msgbuf.h
mshyperv.h
msidef.h
msr-index.h Merge branch 'perf/x86-ibs' into perf/core 2012-05-09 15:22:23 +02:00
msr.h x86, doc: Revert "x86: Document rdmsr_safe restrictions" 2012-04-19 17:07:34 -07:00
mtrr.h x86, mtrr: Use explicit sizing and padding for the 64-bit ioctls 2012-03-01 12:48:52 -08:00
mutex_32.h
mutex_64.h
mutex.h
mwait.h
nmi.h x86/nmi: Fix the type of the nmiaction.flags field 2012-05-07 12:32:11 +02:00
nops.h x86, nop: Make the ASM_NOP* macros work from assembly 2012-04-19 15:07:42 -07:00
numa_32.h
numa_64.h
numa.h
numaq.h
olpc_ofw.h
olpc.h
page_32_types.h x86: Use common threadinfo allocator 2012-05-08 14:08:44 +02:00
page_32.h
page_64_types.h x86: Use common threadinfo allocator 2012-05-08 14:08:44 +02:00
page_64.h
page_types.h Move all declarations of free_initmem() to linux/mm.h 2012-03-28 18:30:03 +01:00
page.h
param.h
paravirt_types.h
paravirt.h x86, paravirt: Replace GET_CR2_INTO_RCX with GET_CR2_INTO_RAX 2012-04-19 15:07:56 -07:00
parport.h
pat.h
pci_64.h
pci_x86.h
pci-direct.h
pci-functions.h
pci.h
percpu.h percpu: remove percpu_xxx() functions 2012-05-14 14:15:32 -07:00
perf_event_p4.h
perf_event.h perf/x86/ibs: Fix undefined reference to `get_ibs_caps' 2012-05-14 14:31:35 +02:00
pgalloc.h
pgtable_32_types.h
pgtable_32.h
pgtable_64_types.h
pgtable_64.h
pgtable_types.h
pgtable-2level_types.h
pgtable-2level.h
pgtable-3level_types.h
pgtable-3level.h
pgtable.h
poll.h
posix_types_32.h x86: Use generic posix_types.h 2012-02-14 12:01:30 -08:00
posix_types_64.h x86: Use generic posix_types.h 2012-02-14 12:01:30 -08:00
posix_types_x32.h x32: Create posix_types_x32.h 2012-02-20 12:48:47 -08:00
posix_types.h x32: Check __ILP32__ instead of __LP64__ for x32 2012-04-23 14:51:14 -07:00
prctl.h
probe_roms.h
processor-cyrix.h
processor-flags.h
processor.h Merge branch 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-05-23 10:59:07 -07:00
prom.h irq_domain/x86: Convert x86 (embedded) to use common irq_domain 2012-02-23 14:37:47 -07:00
proto.h
ptrace-abi.h
ptrace.h x86: Move some signal-handling definitions to a common header 2012-02-20 12:52:04 -08:00
pvclock-abi.h x86: pvclock: Add flag to indicate that a vm was stopped by the host 2012-04-08 12:48:57 +03:00
pvclock.h
reboot_fixups.h
reboot.h
required-features.h
resource.h
resume-trace.h
rio.h
rtc.h
rwlock.h
rwsem.h
scatterlist.h
seccomp_32.h
seccomp_64.h
seccomp.h
sections.h
segment.h x86-64: Handle exception table entries during early boot 2012-04-19 15:42:45 -07:00
sembuf.h
serial.h
serpent.h
setup_arch.h
setup.h
shmbuf.h
shmparam.h
sigcontext32.h
sigcontext.h x32: Check __ILP32__ instead of __LP64__ for x32 2012-04-23 14:51:14 -07:00
sigframe.h x32: Add rt_sigframe_x32 2012-02-20 12:52:05 -08:00
sighandling.h x32: Export setup/restore_sigcontext from signal.c 2012-02-20 12:52:04 -08:00
siginfo.h x32, siginfo: Provide proper overrides for x32 siginfo_t 2012-04-23 18:11:40 -07:00
signal.h
smp.h Merge branch 'for-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2012-05-22 17:37:47 -07:00
smpboot_hooks.h
socket.h
sockios.h
sparsemem.h
special_insns.h Disintegrate asm/system.h for X86 2012-03-28 18:11:12 +01:00
spinlock_types.h x86/spinlocks: Eliminate TICKET_MASK 2012-02-07 10:09:54 +01:00
spinlock.h x86: spinlock.h: Remove REG_PTR_MODE 2012-03-30 10:01:59 -07:00
stackprotector.h x86: replace percpu_xxx funcs with this_cpu_xxx 2012-05-14 14:15:31 -07:00
stacktrace.h
stat.h vfs: don't force a big memset of stat data just to clear padding fields 2012-05-06 18:02:40 -07:00
statfs.h
string_32.h
string_64.h
string.h
suspend_32.h
suspend_64.h
suspend.h
svm.h
swab.h
swiotlb.h
switch_to.h Disintegrate asm/system.h for X86 2012-03-28 18:11:12 +01:00
sync_bitops.h
sys_ia32.h x86: Add #ifdef CONFIG_COMPAT to <asm/sys_ia32.h> 2012-02-20 12:52:05 -08:00
syscall.h arch/x86: add syscall_get_arch to syscall.h 2012-04-14 11:13:20 +10:00
syscalls.h
tce.h
termbits.h
termios.h
thread_info.h Merge branch 'perf-uprobes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-05-24 11:39:34 -07:00
time.h
timer.h sched/x86: Fix overflow in cyc2ns_offset 2012-03-13 16:27:51 +01:00
timex.h
tlb.h
tlbflush.h Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2012-05-23 11:06:59 -07:00
topology.h sched/numa: Rewrite the CONFIG_NUMA sched domain support 2012-05-09 15:00:55 +02:00
trampoline.h
traps.h x86: Use enum instead of literals for trap values 2012-03-09 16:47:54 -08:00
tsc.h x86: kvmclock: abstract save/restore sched_clock_state 2012-03-20 12:37:45 +02:00
types.h
uaccess_32.h x86: merge 32/64-bit versions of 'strncpy_from_user()' and speed it up 2012-04-11 09:41:28 -07:00
uaccess_64.h x86: merge 32/64-bit versions of 'strncpy_from_user()' and speed it up 2012-04-11 09:41:28 -07:00
uaccess.h x86: use generic strncpy_from_user routine 2012-05-26 10:14:39 -07:00
ucontext.h
unaligned.h
unistd.h x32: Check __ILP32__ instead of __LP64__ for x32 2012-04-23 14:51:14 -07:00
uprobes.h uprobes/core: Handle breakpoint and singlestep exceptions 2012-03-14 07:41:36 +01:00
user32.h
user_32.h
user_64.h
user.h
vdso.h
vga.h efifb: Implement vga_default_device() (v2) 2012-04-24 09:50:18 +01:00
vgtod.h x86-64: Simplify and optimize vdso clock_gettime monotonic variants 2012-03-23 16:49:33 -07:00
virtext.h Disintegrate asm/system.h for X86 2012-03-28 18:11:12 +01:00
vm86.h
vmx.h
vsyscall.h
vvar.h
word-at-a-time.h word-at-a-time: make the interfaces truly generic 2012-05-26 11:33:40 -07:00
x2apic.h x86/apic: Add separate apic_id_valid() functions for selected apic drivers 2012-03-23 13:28:43 +01:00
x86_init.h x86/apic: Replace io_apic_ops with x86_io_apic_ops. 2012-05-01 14:50:09 -04:00
xcr.h
xor_32.h raid5: add AVX optimized RAID5 checksumming 2012-05-22 13:54:04 +10:00
xor_64.h raid5: add AVX optimized RAID5 checksumming 2012-05-22 13:54:04 +10:00
xor_avx.h raid5: add AVX optimized RAID5 checksumming 2012-05-22 13:54:04 +10:00
xor.h
xsave.h x86, extable: Remove open-coded exception table entries in arch/x86/include/asm/xsave.h 2012-04-20 13:51:40 -07:00