* [Qemu-devel] [PATCH 3/3] migration: Don't create decompression threads if not enabled
From: Juan Quintela @ 2016-11-14 20:55 UTC (permalink / raw)
To: qemu-devel; +Cc: amit.shah, dgilbert
In-Reply-To: <1479156950-2517-1-git-send-email-quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
--
I removed the [HACK] part because previous patch just check that
compression pages are not received.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/ram.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/migration/ram.c b/migration/ram.c
index 4bb707c..24e2591 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -2260,6 +2260,9 @@ void migrate_decompress_threads_create(void)
{
int i, thread_count;
+ if (!migrate_use_compression()) {
+ return;
+ }
thread_count = migrate_decompress_threads();
decompress_threads = g_new0(QemuThread, thread_count);
decomp_param = g_new0(DecompressParam, thread_count);
@@ -2281,6 +2284,9 @@ void migrate_decompress_threads_join(void)
{
int i, thread_count;
+ if (!migrate_use_compression()) {
+ return;
+ }
thread_count = migrate_decompress_threads();
for (i = 0; i < thread_count; i++) {
qemu_mutex_lock(&decomp_param[i].mutex);
--
2.7.4
^ permalink raw reply related
* Re: [PATCH 3/4] selinux: Clean up initialization of isec->sclass
From: Paul Moore @ 2016-11-14 20:56 UTC (permalink / raw)
To: Andreas Gruenbacher; +Cc: Stephen Smalley, Eric Paris, selinux
In-Reply-To: <1478812710-17190-4-git-send-email-agruenba@redhat.com>
On Thu, Nov 10, 2016 at 4:18 PM, Andreas Gruenbacher
<agruenba@redhat.com> wrote:
> Now that isec->initialized == LABEL_INITIALIZED implies that
> isec->sclass is valid, skip such inodes immediately in
> inode_doinit_with_dentry.
>
> For the remaining inodes, initialize isec->sclass at the beginning of
> inode_doinit_with_dentry to simplify the code.
>
> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
> ---
> security/selinux/hooks.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
Merged, thanks.
> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index e4527d9..cf5067e 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -1389,12 +1389,15 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
> int rc = 0;
>
> if (isec->initialized == LABEL_INITIALIZED)
> - goto out;
> + return 0;
>
> mutex_lock(&isec->lock);
> if (isec->initialized == LABEL_INITIALIZED)
> goto out_unlock;
>
> + if (isec->sclass == SECCLASS_FILE)
> + isec->sclass = inode_mode_to_security_class(inode->i_mode);
> +
> sbsec = inode->i_sb->s_security;
> if (!(sbsec->flags & SE_SBINITIALIZED)) {
> /* Defer initialization until selinux_complete_init,
> @@ -1512,7 +1515,6 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
> isec->sid = sbsec->sid;
>
> /* Try to obtain a transition SID. */
> - isec->sclass = inode_mode_to_security_class(inode->i_mode);
> rc = security_transition_sid(isec->task_sid, sbsec->sid,
> isec->sclass, NULL, &sid);
> if (rc)
> @@ -1548,7 +1550,6 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
> */
> if (!dentry)
> goto out_unlock;
> - isec->sclass = inode_mode_to_security_class(inode->i_mode);
> rc = selinux_genfs_get_sid(dentry, isec->sclass,
> sbsec->flags, &sid);
> dput(dentry);
> @@ -1563,9 +1564,6 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
>
> out_unlock:
> mutex_unlock(&isec->lock);
> -out:
> - if (isec->sclass == SECCLASS_FILE)
> - isec->sclass = inode_mode_to_security_class(inode->i_mode);
> return rc;
> }
>
> --
> 2.7.4
>
--
paul moore
www.paul-moore.com
^ permalink raw reply
* Re: [PATCH RFC] xfs: drop SYNC_WAIT from xfs_reclaim_inodes_ag during slab reclaim
From: Chris Mason @ 2016-11-14 20:56 UTC (permalink / raw)
To: Dave Chinner; +Cc: linux-xfs
In-Reply-To: <20161114072708.GN28922@dastard>
On 11/14/2016 02:27 AM, Dave Chinner wrote:
> On Sun, Nov 13, 2016 at 08:00:04PM -0500, Chris Mason wrote:
>> On Tue, Oct 18, 2016 at 01:03:24PM +1100, Dave Chinner wrote:
>>
>> [ Long stalls from xfs_reclaim_inodes_ag ]
>>
>>> XFS has *1* tunable that can change the behaviour of metadata
>>> writeback. Please try it.
>>
>> [ weeks go by, so this email is insanely long ]
>>
>> Testing all of this was slow going because two of the three test
>> boxes I had with the hadoop configuration starting having hardware
>> problems. The good news is that while I was adjusting the
>> benchmark, we lined up access to a bunch of duplicate boxes, so I
>> can now try ~20 different configurations in parallel.
>>
>> My rough benchmark is here:
>>
>> git://git.kernel.org/pub/scm/linux/kernel/git/mason/simoop.git
>>
>> The command line I ended up using was:
>>
>> simoop -t 512 -m 190 -M 128 -C 28 -r 60000 -f 70 -T 20 -R1 -W 1 -i
>> 60 -w 300 -D 2 /hammer/*
>
> There's a lightly tested patch below that should do the trick.
>
> After 5 minutes on a modified simoop cli on a single filesystem,
> 4.9-rc4+for-next:
>
> $ ./simoop -t 128 -m 50 -M 128 -C 14 -r 60000 -f 2 -T 20 -R1 -W 1 -i 60 -w 300 -D 2 /mnt/scratch
> ....
> Run time: 300 seconds
> Read latency (p50: 3,174,400) (p95: 4,530,176) (p99: 18,055,168)
> Write latency (p50: 14,991,360) (p95: 28,672,000) (p99: 33,325,056)
> Allocation latency (p50: 1,771,520) (p95: 17,530,880) (p99: 23,756,800)
> work rate = 4.75/sec (avg 5.24/sec) (p50: 5.79) (p95: 6.99) (p99: 6.99)
> alloc stall rate = 94.42/sec (avg: 51.63) (p50: 51.60) (p95: 59.12) (p99: 59.12)
>
> With the patch below:
>
> Run time: 300 seconds
> Read latency (p50: 3,043,328) (p95: 3,649,536) (p99: 4,710,400)
> Write latency (p50: 21,004,288) (p95: 27,557,888) (p99: 29,130,752)
> Allocation latency (p50: 280,064) (p95: 680,960) (p99: 863,232)
> work rate = 4.08/sec (avg 4.76/sec) (p50: 5.39) (p95: 6.93) (p99: 6.93)
> alloc stall rate = 0.08/sec (avg: 0.02) (p50: 0.00) (p95: 0.01) (p99: 0.01)
>
> Stall rate went to zero and stayed there at the 120s mark of the
> warmup. Note the p99 difference for read and allocation latency,
> too.
>
> I'll post some graphs tomorrow from my live PCP telemetry that
> demonstrate the difference in behaviour better than any words...
Thanks Dave, this is definitely better. But at least for the multi-disk
setup, it's not quite there yet.
Your patch:
___
Run time: 15535 seconds
Read latency (p50: 22,708,224) (p95: 34,668,544) (p99: 41,746,432)
Write latency (p50: 21,200,896) (p95: 34,799,616) (p99: 41,877,504)
Allocation latency (p50: 11,550,720) (p95: 31,424,512) (p99: 39,518,208)
work rate = 7.48/sec (avg 8.41/sec) (p50: 8.69) (p95: 9.57) (p99: 9.87)
alloc stall rate = 14.08/sec (avg: 14.85) (p50: 15.74) (p95: 19.74)
(p99: 22.04)
Original patch:
___
Run time: 15474 seconds
Read latency (p50: 20,414,464) (p95: 29,786,112) (p99: 34,275,328)
Write latency (p50: 15,155,200) (p95: 25,591,808) (p99: 31,621,120)
Allocation latency (p50: 7,675,904) (p95: 22,970,368) (p99: 29,523,968)
work rate = 8.33/sec (avg 10.54/sec) (p50: 10.54) (p95: 10.58) (p99: 10.58)
alloc stall rate = 37.08/sec (avg: 21.73) (p50: 23.16) (p95: 24.68)
(p99: 25.00)
v4.8
___
Run time: 15492 seconds
Read latency (p50: 22,642,688) (p95: 35,848,192) (p99: 43,712,512)
Write latency (p50: 21,200,896) (p95: 35,454,976) (p99: 43,450,368)
Allocation latency (p50: 12,599,296) (p95: 34,144,256) (p99: 41,615,360)
work rate = 9.77/sec (avg 8.15/sec) (p50: 8.37) (p95: 9.29) (p99: 9.55)
alloc stall rate = 8.33/sec (avg: 33.65) (p50: 34.52) (p95: 37.40) (p99:
37.96)
One thing that might have been too far buried in my email yesterday.
The read/write latencies include the time to start threads, that's not
just IO in there.
I've had this running all day, but the differences stabilized after 5-10
minutes. Everyone's p99s trend higher as the day goes on, but the
percentage difference stays about the same.
I think the difference between mine and yours is we didn't quite get the
allocation stalls down to zero, so making tasks wait for the shrinker
shows up in the end numbers.
For your patch, the stalls from xfs_reclaim_inodes_ag() were about the
same as the unpatched kernel yesterday. We still had long tails in the
30 second+ category.
I did a trace on vmscan:mm_vmscan_direct_reclaim_begin, and 91% of the
allocation stalls were:
order=0 may_writepage=1 gfp_flags=GFP_HIGHUSER_MOVABLE|__GFP_ZERO
classzone_idx=3
These are all page faults, either during read() syscalls or when simoop
was touching all the pages in its mmap()'d area (-M from the cmdline)
One detail I didn't give yesterday was these are all using deadline as
the IO scheduler.
-chris
^ permalink raw reply
* Re: [Bug 186671] New: OOM on system with just rsync running 32GB of ram 30GB of pagecache
From: E V @ 2016-11-14 20:56 UTC (permalink / raw)
To: Vlastimil Babka
Cc: Andrew Morton, bugzilla-daemon, linux-mm, Michal Hocko,
linux-btrfs, Kirill A. Shutemov
In-Reply-To: <bbcd6cb7-3b73-02e9-0409-4601a6f573f5@suse.cz>
Pretty sure it was the system after the OOM just did a history search
to check, though it is 3 days afterwards and several OOMs killed
several processes in somewhat rapid succession, I just listed the 1st.
I'll turn on CONFIG_DEBUG_VM and reboot again.
On Mon, Nov 14, 2016 at 12:04 PM, Vlastimil Babka <vbabka@suse.cz> wrote:
> On 11/14/2016 02:27 PM, E V wrote:
>> System is an intel dual socket Xeon E5620, 7500/5520/5500/X58 ICH10
>> family according to lspci. Anyways 4.8.4 OOM'd while I was gone. I'll
>> download the current 4.9rc and reboot, but in the mean time here's
>> xxd, vmstat & kern.log output:
>> 8532039 0000000000000000
>
> Hmm this would suggest that the memory is mostly free. But not according
> to vmstat. Is it possible you mistakenly provided the xxd from a fresh
> boot, but vmstat from after the OOM?
>
> But sure, a page_count() of zero is a reason why __isolate_lru_page()
> would fail due to its get_page_unless_zero(). The question is then how
> could it drop to zero without being freed at the same time, as
> put_page() does.
>
> I was going to suspect commit 83929372f6 and a page_ref_sub() it adds to
> delete_from_page_cache(), but that's since 4.8 and you mention problems
> since 4.7.
>
> Anyway it might be worth enabling CONFIG_DEBUG_VM as the relevant code
> usually has VM_BUG_ONs.
>
> Vlastimil
>
>> 9324 0100000000000000
>> 2226 0200000000000000
>> 405 0300000000000000
>> 80 0400000000000000
>> 34 0500000000000000
>> 48 0600000000000000
>> 17 0700000000000000
>> 17 0800000000000000
>> 32 0900000000000000
>> 19 0a00000000000000
>> 1 0c00000000000000
>> 1 0d00000000000000
>> 1 0e00000000000000
>> 12 1000000000000000
>> 8 1100000000000000
>> 32 1200000000000000
>> 10 1300000000000000
>> 2 1400000000000000
>> 11 1500000000000000
>> 12 1600000000000000
>> 7 1700000000000000
>> 3 1800000000000000
>> 5 1900000000000000
>> 6 1a00000000000000
>> 11 1b00000000000000
>> 22 1c00000000000000
>> 3 1d00000000000000
>> 19 1e00000000000000
>> 21 1f00000000000000
>> 18 2000000000000000
>> 28 2100000000000000
>> 40 2200000000000000
>> 38 2300000000000000
>> 85 2400000000000000
>> 59 2500000000000000
>> 40520 81ffffffffffffff
>>
>> /proc/vmstat:
>> nr_free_pages 60965
>> nr_zone_inactive_anon 4646
>> nr_zone_active_anon 3265
>> nr_zone_inactive_file 633882
>> nr_zone_active_file 7017458
>> nr_zone_unevictable 0
>> nr_zone_write_pending 0
>> nr_mlock 0
>> nr_slab_reclaimable 299205
>> nr_slab_unreclaimable 195497
>> nr_page_table_pages 935
>> nr_kernel_stack 4976
>> nr_bounce 0
>> numa_hit 3577063288
>> numa_miss 541393191
>> numa_foreign 541393191
>> numa_interleave 19415
>> numa_local 3577063288
>> numa_other 0
>> nr_free_cma 0
>> nr_inactive_anon 4646
>> nr_active_anon 3265
>> nr_inactive_file 633882
>> nr_active_file 7017458
>> nr_unevictable 0
>> nr_isolated_anon 0
>> nr_isolated_file 0
>> nr_pages_scanned 0
>> workingset_refault 42685891
>> workingset_activate 15247281
>> workingset_nodereclaim 26375216
>> nr_anon_pages 5067
>> nr_mapped 5630
>> nr_file_pages 7654746
>> nr_dirty 0
>> nr_writeback 0
>> nr_writeback_temp 0
>> nr_shmem 2504
>> nr_shmem_hugepages 0
>> nr_shmem_pmdmapped 0
>> nr_anon_transparent_hugepages 0
>> nr_unstable 0
>> nr_vmscan_write 5243750485
>> nr_vmscan_immediate_reclaim 4207633857
>> nr_dirtied 1839143430
>> nr_written 1832626107
>> nr_dirty_threshold 1147728
>> nr_dirty_background_threshold 151410
>> pgpgin 166731189
>> pgpgout 7328142335
>> pswpin 98608
>> pswpout 117794
>> pgalloc_dma 29504
>> pgalloc_dma32 1006726216
>> pgalloc_normal 5275218188
>> pgalloc_movable 0
>> allocstall_dma 0
>> allocstall_dma32 0
>> allocstall_normal 36461
>> allocstall_movable 5867
>> pgskip_dma 0
>> pgskip_dma32 0
>> pgskip_normal 6417890
>> pgskip_movable 0
>> pgfree 6309223401
>> pgactivate 35076483
>> pgdeactivate 63556974
>> pgfault 35753842
>> pgmajfault 69126
>> pglazyfreed 0
>> pgrefill 70008598
>> pgsteal_kswapd 3567289713
>> pgsteal_direct 5878057
>> pgscan_kswapd 9059309872
>> pgscan_direct 4239367903
>> pgscan_direct_throttle 0
>> zone_reclaim_failed 0
>> pginodesteal 102916
>> slabs_scanned 460790262
>> kswapd_inodesteal 9130243
>> kswapd_low_wmark_hit_quickly 10634373
>> kswapd_high_wmark_hit_quickly 7348173
>> pageoutrun 18349115
>> pgrotated 16291322
>> drop_pagecache 0
>> drop_slab 0
>> pgmigrate_success 18912908
>> pgmigrate_fail 63382146
>> compact_migrate_scanned 2986269789
>> compact_free_scanned 190451505123
>> compact_isolated 109549437
>> compact_stall 3544
>> compact_fail 8
>> compact_success 3536
>> compact_daemon_wake 1403515
>> htlb_buddy_alloc_success 0
>> htlb_buddy_alloc_fail 0
>> unevictable_pgs_culled 12473
>> unevictable_pgs_scanned 0
>> unevictable_pgs_rescued 11979
>> unevictable_pgs_mlocked 14556
>> unevictable_pgs_munlocked 14556
>> unevictable_pgs_cleared 0
>> unevictable_pgs_stranded 0
>> thp_fault_alloc 0
>> thp_fault_fallback 0
>> thp_collapse_alloc 0
>> thp_collapse_alloc_failed 0
>> thp_file_alloc 0
>> thp_file_mapped 0
>> thp_split_page 0
>> thp_split_page_failed 0
>> thp_deferred_split_page 0
>> thp_split_pmd 0
>> thp_zero_page_alloc 0
>> thp_zero_page_alloc_failed 0
>>
>> kern.log OOM message:
>> [737778.724194] snmpd invoked oom-killer:
>> gfp_mask=0x24200ca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=0
>> [737778.724246] snmpd cpuset=/ mems_allowed=0-1
>> [737778.724278] CPU: 15 PID: 2976 Comm: snmpd Tainted: G W I 4.8.4 #1
>> [737778.724352] 0000000000000000 ffffffff81292069 ffff88041e043c48
>> ffff88041e043c48
>> [737778.724403] ffffffff8118d1f6 ffff88041dd70fc0 ffff88041e043c48
>> 000000000136236f
>> [737778.724454] ffffffff8170e11e 0000000000000001 ffffffff8112a700
>> 000000000000030f
>> [737778.724505] Call Trace:
>> [737778.724533] [<ffffffff81292069>] ? dump_stack+0x46/0x5d
>> [737778.727077] [<ffffffff8118d1f6>] ? dump_header.isra.16+0x56/0x185
>> [737778.727108] [<ffffffff8112a700>] ? oom_kill_process+0x210/0x3c0
>> [737778.727136] [<ffffffff8112ac4b>] ? out_of_memory+0x34b/0x420
>> [737778.727165] [<ffffffff8112fcca>] ? __alloc_pages_nodemask+0xd9a/0xde0
>> [737778.727195] [<ffffffff811768e1>] ? alloc_pages_vma+0xc1/0x240
>> [737778.727223] [<ffffffff81126512>] ? pagecache_get_page+0x22/0x230
>> [737778.727253] [<ffffffff81169f44>] ? __read_swap_cache_async+0x104/0x180
>> [737778.727282] [<ffffffff81169fcf>] ? read_swap_cache_async+0xf/0x30
>> [737778.727311] [<ffffffff8116a0dc>] ? swapin_readahead+0xec/0x1a0
>> [737778.727340] [<ffffffff81156270>] ? do_swap_page+0x420/0x5c0
>> [737778.727369] [<ffffffff813f36d8>] ? SYSC_recvfrom+0xa8/0x110
>> [737778.727397] [<ffffffff81157a39>] ? handle_mm_fault+0x629/0xe30
>> [737778.727426] [<ffffffff81048fc5>] ? __do_page_fault+0x1b5/0x480
>> [737778.727456] [<ffffffff814fbaa2>] ? page_fault+0x22/0x30
>> [737778.727497] Mem-Info:
>> [737778.727524] active_anon:24 inactive_anon:49 isolated_anon:0
>> [737778.727524] active_file:6920154 inactive_file:798043 isolated_file:576
>> [737778.727524] unevictable:0 dirty:800528 writeback:1307 unstable:0
>> [737778.727524] slab_reclaimable:264367 slab_unreclaimable:193348
>> [737778.727524] mapped:4063 shmem:0 pagetables:1719 bounce:0
>> [737778.727524] free:39225 free_pcp:47 free_cma:0
>> [737778.727677] Node 0 active_anon:16kB inactive_anon:76kB
>> active_file:14249324kB inactive_file:1296908kB unevictable:0kB
>> isolated(anon):0kB isolated(file):1920kB mapped:10432kB
>> dirty:1308528kB writeback:0kB shmem:0kB shmem_thp: 0kB
>> shmem_pmdmapped: 0kB anon_thp: 0kB writeback_tmp:0kB unstable:0kB
>> pages_scanned:23557303 all_unreclaimable? yes
>> [737778.727806] Node 1 active_anon:80kB inactive_anon:120kB
>> active_file:13431292kB inactive_file:1895264kB unevictable:0kB
>> isolated(anon):0kB isolated(file):384kB mapped:5820kB dirty:1893584kB
>> writeback:5228kB shmem:0kB shmem_thp: 0kB shmem_pmdmapped: 0kB
>> anon_thp: 0kB writeback_tmp:0kB unstable:0kB pages_scanned:25598673
>> all_unreclaimable? yes
>> [737778.727930] Node 0 Normal free:44864kB min:45192kB low:61736kB
>> high:78280kB active_anon:16kB inactive_anon:76kB
>> active_file:14249324kB inactive_file:1296908kB unevictable:0kB
>> writepending:1308528kB present:16777216kB managed:16544856kB
>> mlocked:0kB slab_reclaimable:562644kB slab_unreclaimable:317504kB
>> kernel_stack:3840kB pagetables:3672kB bounce:0kB free_pcp:20kB
>> local_pcp:0kB free_cma:0kB
>> [737778.728066] lowmem_reserve[]: 0 0 0 0
>> [737778.728100] Node 1 DMA free:15896kB min:40kB low:52kB high:64kB
>> active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB
>> unevictable:0kB writepending:0kB present:15996kB managed:15896kB
>> mlocked:0kB slab_reclaimable:0kB slab_unreclaimable:0kB
>> kernel_stack:0kB pagetables:0kB bounce:0kB free_pcp:0kB local_pcp:0kB
>> free_cma:0kB
>> [737778.728228] lowmem_reserve[]: 0 3216 16044 16044
>> [737778.728263] Node 1 DMA32 free:60300kB min:8996kB low:12288kB
>> high:15580kB active_anon:4kB inactive_anon:4kB active_file:2660988kB
>> inactive_file:474956kB unevictable:0kB writepending:475116kB
>> present:3378660kB managed:3304720kB mlocked:0kB
>> slab_reclaimable:83612kB slab_unreclaimable:16668kB kernel_stack:320kB
>> pagetables:16kB bounce:0kB free_pcp:4kB local_pcp:4kB free_cma:0kB
>> [737778.728397] lowmem_reserve[]: 0 0 12827 12827
>> [737778.728431] Node 1 Normal free:35840kB min:35876kB low:49008kB
>> high:62140kB active_anon:76kB inactive_anon:116kB
>> active_file:10770304kB inactive_file:1420308kB unevictable:0kB
>> writepending:1423696kB present:13369344kB managed:13135424kB
>> mlocked:0kB slab_reclaimable:411212kB slab_unreclaimable:439220kB
>> kernel_stack:2864kB pagetables:3188kB bounce:0kB free_pcp:164kB
>> local_pcp:36kB free_cma:0kB
>> [737778.728568] lowmem_reserve[]: 0 0 0 0
>> [737778.728601] Node 0 Normal: 11208*4kB (UME) 4*8kB (U) 0*16kB 0*32kB
>> 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 44864kB
>> [737778.728686] Node 1 DMA: 0*4kB 1*8kB (U) 1*16kB (U) 0*32kB 2*64kB
>> (U) 1*128kB (U) 1*256kB (U) 0*512kB 1*1024kB (U) 1*2048kB (M) 3*4096kB
>> (M) = 15896kB
>> [737778.728786] Node 1 DMA32: 11759*4kB (UME) 1658*8kB (UM) 0*16kB
>> 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB =
>> 60300kB
>> [737778.728875] Node 1 Normal: 7984*4kB (UME) 470*8kB (UME) 3*16kB (U)
>> 3*32kB (UM) 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB
>> = 35840kB
>> [737778.728973] Node 0 hugepages_total=0 hugepages_free=0
>> hugepages_surp=0 hugepages_size=1048576kB
>> [737778.729019] Node 0 hugepages_total=0 hugepages_free=0
>> hugepages_surp=0 hugepages_size=2048kB
>> [737778.729065] Node 1 hugepages_total=0 hugepages_free=0
>> hugepages_surp=0 hugepages_size=1048576kB
>> [737778.729111] Node 1 hugepages_total=0 hugepages_free=0
>> hugepages_surp=0 hugepages_size=2048kB
>> [737778.729156] 7718841 total pagecache pages
>> [737778.729179] 68 pages in swap cache
>> [737778.729202] Swap cache stats: add 193888, delete 193820, find 160188/213014
>> [737778.729231] Free swap = 48045076kB
>> [737778.729254] Total swap = 48300028kB
>> [737778.729277] 8385304 pages RAM
>> [737778.729299] 0 pages HighMem/MovableOnly
>> [737778.729322] 135080 pages reserved
>> [737778.729344] 0 pages hwpoisoned
>> [737778.729365] [ pid ] uid tgid total_vm rss nr_ptes nr_pmds
>> swapents oom_score_adj name
>> [737778.729417] [ 1927] 0 1927 9941 447 22 3
>> 299 -1000 systemd-udevd
>> [737778.729465] [ 2812] 0 2812 9289 412 23 4
>> 161 0 rpcbind
>> [737778.729512] [ 2836] 102 2836 9320 414 23 3
>> 151 0 rpc.statd
>> [737778.729560] [ 2851] 104 2851 162257 276 75 3
>> 7489 0 apt-cacher-ng
>> [737778.729608] [ 2856] 0 2856 13796 345 31 3
>> 167 -1000 sshd
>> [737778.729655] [ 2857] 0 2857 64668 504 27 4
>> 355 0 rsyslogd
>> [737778.729702] [ 2858] 0 2858 6876 518 18 3
>> 83 0 cron
>> [737778.729748] [ 2859] 0 2859 4756 360 14 3
>> 44 0 atd
>> [737778.729795] [ 2860] 0 2860 7059 523 18 3
>> 591 0 smartd
>> [737778.729842] [ 2864] 0 2864 7082 559 19 4
>> 96 0 systemd-logind
>> [737778.729890] [ 2865] 106 2865 10563 528 24 3
>> 110 -900 dbus-daemon
>> [737778.729938] [ 2925] 0 2925 3604 421 12 3
>> 38 0 agetty
>> [737778.729985] [ 2974] 0 2974 4852 365 13 3
>> 73 0 irqbalance
>> [737778.730032] [ 2976] 105 2976 14299 496 29 3
>> 1534 0 snmpd
>> [737778.730078] [ 2992] 0 2992 3180 227 11 3
>> 38 0 mcelog
>> [737778.730125] [ 3095] 0 3095 26571 344 43 3
>> 259 0 sfcbd
>> [737778.730172] [ 3172] 0 3172 20392 261 40 3
>> 236 0 sfcbd
>> [737778.730219] [ 3248] 0 3248 22441 0 41 3
>> 238 0 sfcbd
>> [737778.730265] [ 3249] 0 3249 39376 155 44 3
>> 357 0 sfcbd
>> [737778.730312] [ 3450] 0 3450 39377 104 44 3
>> 244 0 sfcbd
>> [737778.730359] [ 3467] 0 3467 58324 301 46 3
>> 284 0 sfcbd
>> [737778.730405] [ 3548] 0 3548 262686 643 66 4
>> 4097 0 dsm_sa_datamgrd
>> [737778.730453] [ 3563] 101 3563 13312 403 29 3
>> 162 0 exim4
>> [737778.730499] [ 3576] 107 3576 7293 493 19 3
>> 148 0 ntpd
>> [737778.730546] [ 3585] 0 3585 61531 577 117 3
>> 496 0 winbindd
>> [737778.730593] [ 3586] 0 3586 61531 578 118 3
>> 512 0 winbindd
>> [737778.730640] [ 3651] 0 3651 48584 566 36 3
>> 487 0 dsm_sa_eventmgr
>> [737778.730688] [ 3674] 0 3674 99593 576 47 3
>> 1402 0 dsm_sa_snmpd
>> [737778.730736] [ 3717] 0 3717 7923 285 18 3
>> 115 0 dsm_om_connsvcd
>> [737778.730784] [ 3718] 0 3718 740234 1744 202 7
>> 30685 0 dsm_om_connsvcd
>> [737778.730832] [ 3736] 0 3736 178651 0 55 3
>> 3789 0 dsm_sa_datamgrd
>> [737778.730880] [ 4056] 0 4056 26472 498 57 3
>> 252 0 sshd
>> [737778.730926] [ 4060] 1000 4060 8973 501 23 3
>> 184 0 systemd
>> [737778.730973] [ 4061] 1000 4061 15702 0 34 4
>> 612 0 (sd-pam)
>> [737778.731020] [ 4063] 1000 4063 26472 158 54 3
>> 260 0 sshd
>> [737778.731067] [ 4064] 1000 4064 6041 739 16 3
>> 686 0 bash
>> [737778.731113] [ 4083] 1000 4083 16853 493 37 3
>> 128 0 su
>> [737778.731160] [ 4084] 0 4084 5501 756 15 3
>> 160 0 bash
>> [737778.731207] [15150] 0 15150 3309 678 10 3
>> 57 0 run_mirror.sh
>> [737778.731256] [24296] 0 24296 1450 139 8 3
>> 23 0 flock
>> [737778.731302] [24297] 0 24297 9576 622 22 3
>> 3990 0 rsync
>> [737778.731349] [24298] 0 24298 7552 541 18 3
>> 1073 0 rsync
>> [737778.731395] [24299] 0 24299 9522 401 22 3
>> 2416 0 rsync
>> [737778.731445] [25910] 0 25910 10257 522 23 3
>> 81 0 systemd-journal
>> [737778.731494] [25940] 0 25940 16365 617 37 3
>> 126 0 cron
>> [737778.731540] Out of memory: Kill process 3718 (dsm_om_connsvcd)
>> score 1 or sacrifice child
>> [737778.731644] Killed process 3718 (dsm_om_connsvcd)
>> total-vm:2960936kB, anon-rss:0kB, file-rss:6976kB, shmem-rss:0kB
>> [737778.768375] oom_reaper: reaped process 3718 (dsm_om_connsvcd), now
>> anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
>>
>> On Fri, Nov 4, 2016 at 5:00 PM, Vlastimil Babka <vbabka@suse.cz> wrote:
>>> On 11/04/2016 03:13 PM, E V wrote:
>>>> After the system panic'd yesterday I booted back into 4.8.4 and
>>>> restarted the rsync's. I'm away on vacation next week, so when I get
>>>> back I'll get rc4 or rc5 and try again. In the mean time here's data
>>>> from the system running 4.8.4 without problems for about a day. I'm
>>>> not familiar with xxd and didn't see a -e option, so used -E:
>>>> xxd -E -g8 -c8 /proc/kpagecount | cut -d" " -f2 | sort | uniq -c
>>>> 8258633 0000000000000000
>>>> 216440 0100000000000000
>>>
>>> The lack of -e means it's big endian, which is not a big issue. So here
>>> most of memory is free, some pages have just one pin, and only
>>> relatively few have more. The vmstats also doesn't show anything bad, so
>>> we'll have to wait if something appears within the week, or after you
>>> try 4.9 again. Thanks.
>
^ permalink raw reply
* Re: [Bug 186671] New: OOM on system with just rsync running 32GB of ram 30GB of pagecache
From: E V @ 2016-11-14 20:56 UTC (permalink / raw)
To: Vlastimil Babka
Cc: Andrew Morton, bugzilla-daemon, linux-mm, Michal Hocko,
linux-btrfs, Kirill A. Shutemov
In-Reply-To: <bbcd6cb7-3b73-02e9-0409-4601a6f573f5@suse.cz>
Pretty sure it was the system after the OOM just did a history search
to check, though it is 3 days afterwards and several OOMs killed
several processes in somewhat rapid succession, I just listed the 1st.
I'll turn on CONFIG_DEBUG_VM and reboot again.
On Mon, Nov 14, 2016 at 12:04 PM, Vlastimil Babka <vbabka@suse.cz> wrote:
> On 11/14/2016 02:27 PM, E V wrote:
>> System is an intel dual socket Xeon E5620, 7500/5520/5500/X58 ICH10
>> family according to lspci. Anyways 4.8.4 OOM'd while I was gone. I'll
>> download the current 4.9rc and reboot, but in the mean time here's
>> xxd, vmstat & kern.log output:
>> 8532039 0000000000000000
>
> Hmm this would suggest that the memory is mostly free. But not according
> to vmstat. Is it possible you mistakenly provided the xxd from a fresh
> boot, but vmstat from after the OOM?
>
> But sure, a page_count() of zero is a reason why __isolate_lru_page()
> would fail due to its get_page_unless_zero(). The question is then how
> could it drop to zero without being freed at the same time, as
> put_page() does.
>
> I was going to suspect commit 83929372f6 and a page_ref_sub() it adds to
> delete_from_page_cache(), but that's since 4.8 and you mention problems
> since 4.7.
>
> Anyway it might be worth enabling CONFIG_DEBUG_VM as the relevant code
> usually has VM_BUG_ONs.
>
> Vlastimil
>
>> 9324 0100000000000000
>> 2226 0200000000000000
>> 405 0300000000000000
>> 80 0400000000000000
>> 34 0500000000000000
>> 48 0600000000000000
>> 17 0700000000000000
>> 17 0800000000000000
>> 32 0900000000000000
>> 19 0a00000000000000
>> 1 0c00000000000000
>> 1 0d00000000000000
>> 1 0e00000000000000
>> 12 1000000000000000
>> 8 1100000000000000
>> 32 1200000000000000
>> 10 1300000000000000
>> 2 1400000000000000
>> 11 1500000000000000
>> 12 1600000000000000
>> 7 1700000000000000
>> 3 1800000000000000
>> 5 1900000000000000
>> 6 1a00000000000000
>> 11 1b00000000000000
>> 22 1c00000000000000
>> 3 1d00000000000000
>> 19 1e00000000000000
>> 21 1f00000000000000
>> 18 2000000000000000
>> 28 2100000000000000
>> 40 2200000000000000
>> 38 2300000000000000
>> 85 2400000000000000
>> 59 2500000000000000
>> 40520 81ffffffffffffff
>>
>> /proc/vmstat:
>> nr_free_pages 60965
>> nr_zone_inactive_anon 4646
>> nr_zone_active_anon 3265
>> nr_zone_inactive_file 633882
>> nr_zone_active_file 7017458
>> nr_zone_unevictable 0
>> nr_zone_write_pending 0
>> nr_mlock 0
>> nr_slab_reclaimable 299205
>> nr_slab_unreclaimable 195497
>> nr_page_table_pages 935
>> nr_kernel_stack 4976
>> nr_bounce 0
>> numa_hit 3577063288
>> numa_miss 541393191
>> numa_foreign 541393191
>> numa_interleave 19415
>> numa_local 3577063288
>> numa_other 0
>> nr_free_cma 0
>> nr_inactive_anon 4646
>> nr_active_anon 3265
>> nr_inactive_file 633882
>> nr_active_file 7017458
>> nr_unevictable 0
>> nr_isolated_anon 0
>> nr_isolated_file 0
>> nr_pages_scanned 0
>> workingset_refault 42685891
>> workingset_activate 15247281
>> workingset_nodereclaim 26375216
>> nr_anon_pages 5067
>> nr_mapped 5630
>> nr_file_pages 7654746
>> nr_dirty 0
>> nr_writeback 0
>> nr_writeback_temp 0
>> nr_shmem 2504
>> nr_shmem_hugepages 0
>> nr_shmem_pmdmapped 0
>> nr_anon_transparent_hugepages 0
>> nr_unstable 0
>> nr_vmscan_write 5243750485
>> nr_vmscan_immediate_reclaim 4207633857
>> nr_dirtied 1839143430
>> nr_written 1832626107
>> nr_dirty_threshold 1147728
>> nr_dirty_background_threshold 151410
>> pgpgin 166731189
>> pgpgout 7328142335
>> pswpin 98608
>> pswpout 117794
>> pgalloc_dma 29504
>> pgalloc_dma32 1006726216
>> pgalloc_normal 5275218188
>> pgalloc_movable 0
>> allocstall_dma 0
>> allocstall_dma32 0
>> allocstall_normal 36461
>> allocstall_movable 5867
>> pgskip_dma 0
>> pgskip_dma32 0
>> pgskip_normal 6417890
>> pgskip_movable 0
>> pgfree 6309223401
>> pgactivate 35076483
>> pgdeactivate 63556974
>> pgfault 35753842
>> pgmajfault 69126
>> pglazyfreed 0
>> pgrefill 70008598
>> pgsteal_kswapd 3567289713
>> pgsteal_direct 5878057
>> pgscan_kswapd 9059309872
>> pgscan_direct 4239367903
>> pgscan_direct_throttle 0
>> zone_reclaim_failed 0
>> pginodesteal 102916
>> slabs_scanned 460790262
>> kswapd_inodesteal 9130243
>> kswapd_low_wmark_hit_quickly 10634373
>> kswapd_high_wmark_hit_quickly 7348173
>> pageoutrun 18349115
>> pgrotated 16291322
>> drop_pagecache 0
>> drop_slab 0
>> pgmigrate_success 18912908
>> pgmigrate_fail 63382146
>> compact_migrate_scanned 2986269789
>> compact_free_scanned 190451505123
>> compact_isolated 109549437
>> compact_stall 3544
>> compact_fail 8
>> compact_success 3536
>> compact_daemon_wake 1403515
>> htlb_buddy_alloc_success 0
>> htlb_buddy_alloc_fail 0
>> unevictable_pgs_culled 12473
>> unevictable_pgs_scanned 0
>> unevictable_pgs_rescued 11979
>> unevictable_pgs_mlocked 14556
>> unevictable_pgs_munlocked 14556
>> unevictable_pgs_cleared 0
>> unevictable_pgs_stranded 0
>> thp_fault_alloc 0
>> thp_fault_fallback 0
>> thp_collapse_alloc 0
>> thp_collapse_alloc_failed 0
>> thp_file_alloc 0
>> thp_file_mapped 0
>> thp_split_page 0
>> thp_split_page_failed 0
>> thp_deferred_split_page 0
>> thp_split_pmd 0
>> thp_zero_page_alloc 0
>> thp_zero_page_alloc_failed 0
>>
>> kern.log OOM message:
>> [737778.724194] snmpd invoked oom-killer:
>> gfp_mask=0x24200ca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=0
>> [737778.724246] snmpd cpuset=/ mems_allowed=0-1
>> [737778.724278] CPU: 15 PID: 2976 Comm: snmpd Tainted: G W I 4.8.4 #1
>> [737778.724352] 0000000000000000 ffffffff81292069 ffff88041e043c48
>> ffff88041e043c48
>> [737778.724403] ffffffff8118d1f6 ffff88041dd70fc0 ffff88041e043c48
>> 000000000136236f
>> [737778.724454] ffffffff8170e11e 0000000000000001 ffffffff8112a700
>> 000000000000030f
>> [737778.724505] Call Trace:
>> [737778.724533] [<ffffffff81292069>] ? dump_stack+0x46/0x5d
>> [737778.727077] [<ffffffff8118d1f6>] ? dump_header.isra.16+0x56/0x185
>> [737778.727108] [<ffffffff8112a700>] ? oom_kill_process+0x210/0x3c0
>> [737778.727136] [<ffffffff8112ac4b>] ? out_of_memory+0x34b/0x420
>> [737778.727165] [<ffffffff8112fcca>] ? __alloc_pages_nodemask+0xd9a/0xde0
>> [737778.727195] [<ffffffff811768e1>] ? alloc_pages_vma+0xc1/0x240
>> [737778.727223] [<ffffffff81126512>] ? pagecache_get_page+0x22/0x230
>> [737778.727253] [<ffffffff81169f44>] ? __read_swap_cache_async+0x104/0x180
>> [737778.727282] [<ffffffff81169fcf>] ? read_swap_cache_async+0xf/0x30
>> [737778.727311] [<ffffffff8116a0dc>] ? swapin_readahead+0xec/0x1a0
>> [737778.727340] [<ffffffff81156270>] ? do_swap_page+0x420/0x5c0
>> [737778.727369] [<ffffffff813f36d8>] ? SYSC_recvfrom+0xa8/0x110
>> [737778.727397] [<ffffffff81157a39>] ? handle_mm_fault+0x629/0xe30
>> [737778.727426] [<ffffffff81048fc5>] ? __do_page_fault+0x1b5/0x480
>> [737778.727456] [<ffffffff814fbaa2>] ? page_fault+0x22/0x30
>> [737778.727497] Mem-Info:
>> [737778.727524] active_anon:24 inactive_anon:49 isolated_anon:0
>> [737778.727524] active_file:6920154 inactive_file:798043 isolated_file:576
>> [737778.727524] unevictable:0 dirty:800528 writeback:1307 unstable:0
>> [737778.727524] slab_reclaimable:264367 slab_unreclaimable:193348
>> [737778.727524] mapped:4063 shmem:0 pagetables:1719 bounce:0
>> [737778.727524] free:39225 free_pcp:47 free_cma:0
>> [737778.727677] Node 0 active_anon:16kB inactive_anon:76kB
>> active_file:14249324kB inactive_file:1296908kB unevictable:0kB
>> isolated(anon):0kB isolated(file):1920kB mapped:10432kB
>> dirty:1308528kB writeback:0kB shmem:0kB shmem_thp: 0kB
>> shmem_pmdmapped: 0kB anon_thp: 0kB writeback_tmp:0kB unstable:0kB
>> pages_scanned:23557303 all_unreclaimable? yes
>> [737778.727806] Node 1 active_anon:80kB inactive_anon:120kB
>> active_file:13431292kB inactive_file:1895264kB unevictable:0kB
>> isolated(anon):0kB isolated(file):384kB mapped:5820kB dirty:1893584kB
>> writeback:5228kB shmem:0kB shmem_thp: 0kB shmem_pmdmapped: 0kB
>> anon_thp: 0kB writeback_tmp:0kB unstable:0kB pages_scanned:25598673
>> all_unreclaimable? yes
>> [737778.727930] Node 0 Normal free:44864kB min:45192kB low:61736kB
>> high:78280kB active_anon:16kB inactive_anon:76kB
>> active_file:14249324kB inactive_file:1296908kB unevictable:0kB
>> writepending:1308528kB present:16777216kB managed:16544856kB
>> mlocked:0kB slab_reclaimable:562644kB slab_unreclaimable:317504kB
>> kernel_stack:3840kB pagetables:3672kB bounce:0kB free_pcp:20kB
>> local_pcp:0kB free_cma:0kB
>> [737778.728066] lowmem_reserve[]: 0 0 0 0
>> [737778.728100] Node 1 DMA free:15896kB min:40kB low:52kB high:64kB
>> active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB
>> unevictable:0kB writepending:0kB present:15996kB managed:15896kB
>> mlocked:0kB slab_reclaimable:0kB slab_unreclaimable:0kB
>> kernel_stack:0kB pagetables:0kB bounce:0kB free_pcp:0kB local_pcp:0kB
>> free_cma:0kB
>> [737778.728228] lowmem_reserve[]: 0 3216 16044 16044
>> [737778.728263] Node 1 DMA32 free:60300kB min:8996kB low:12288kB
>> high:15580kB active_anon:4kB inactive_anon:4kB active_file:2660988kB
>> inactive_file:474956kB unevictable:0kB writepending:475116kB
>> present:3378660kB managed:3304720kB mlocked:0kB
>> slab_reclaimable:83612kB slab_unreclaimable:16668kB kernel_stack:320kB
>> pagetables:16kB bounce:0kB free_pcp:4kB local_pcp:4kB free_cma:0kB
>> [737778.728397] lowmem_reserve[]: 0 0 12827 12827
>> [737778.728431] Node 1 Normal free:35840kB min:35876kB low:49008kB
>> high:62140kB active_anon:76kB inactive_anon:116kB
>> active_file:10770304kB inactive_file:1420308kB unevictable:0kB
>> writepending:1423696kB present:13369344kB managed:13135424kB
>> mlocked:0kB slab_reclaimable:411212kB slab_unreclaimable:439220kB
>> kernel_stack:2864kB pagetables:3188kB bounce:0kB free_pcp:164kB
>> local_pcp:36kB free_cma:0kB
>> [737778.728568] lowmem_reserve[]: 0 0 0 0
>> [737778.728601] Node 0 Normal: 11208*4kB (UME) 4*8kB (U) 0*16kB 0*32kB
>> 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 44864kB
>> [737778.728686] Node 1 DMA: 0*4kB 1*8kB (U) 1*16kB (U) 0*32kB 2*64kB
>> (U) 1*128kB (U) 1*256kB (U) 0*512kB 1*1024kB (U) 1*2048kB (M) 3*4096kB
>> (M) = 15896kB
>> [737778.728786] Node 1 DMA32: 11759*4kB (UME) 1658*8kB (UM) 0*16kB
>> 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB =
>> 60300kB
>> [737778.728875] Node 1 Normal: 7984*4kB (UME) 470*8kB (UME) 3*16kB (U)
>> 3*32kB (UM) 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB
>> = 35840kB
>> [737778.728973] Node 0 hugepages_total=0 hugepages_free=0
>> hugepages_surp=0 hugepages_size=1048576kB
>> [737778.729019] Node 0 hugepages_total=0 hugepages_free=0
>> hugepages_surp=0 hugepages_size=2048kB
>> [737778.729065] Node 1 hugepages_total=0 hugepages_free=0
>> hugepages_surp=0 hugepages_size=1048576kB
>> [737778.729111] Node 1 hugepages_total=0 hugepages_free=0
>> hugepages_surp=0 hugepages_size=2048kB
>> [737778.729156] 7718841 total pagecache pages
>> [737778.729179] 68 pages in swap cache
>> [737778.729202] Swap cache stats: add 193888, delete 193820, find 160188/213014
>> [737778.729231] Free swap = 48045076kB
>> [737778.729254] Total swap = 48300028kB
>> [737778.729277] 8385304 pages RAM
>> [737778.729299] 0 pages HighMem/MovableOnly
>> [737778.729322] 135080 pages reserved
>> [737778.729344] 0 pages hwpoisoned
>> [737778.729365] [ pid ] uid tgid total_vm rss nr_ptes nr_pmds
>> swapents oom_score_adj name
>> [737778.729417] [ 1927] 0 1927 9941 447 22 3
>> 299 -1000 systemd-udevd
>> [737778.729465] [ 2812] 0 2812 9289 412 23 4
>> 161 0 rpcbind
>> [737778.729512] [ 2836] 102 2836 9320 414 23 3
>> 151 0 rpc.statd
>> [737778.729560] [ 2851] 104 2851 162257 276 75 3
>> 7489 0 apt-cacher-ng
>> [737778.729608] [ 2856] 0 2856 13796 345 31 3
>> 167 -1000 sshd
>> [737778.729655] [ 2857] 0 2857 64668 504 27 4
>> 355 0 rsyslogd
>> [737778.729702] [ 2858] 0 2858 6876 518 18 3
>> 83 0 cron
>> [737778.729748] [ 2859] 0 2859 4756 360 14 3
>> 44 0 atd
>> [737778.729795] [ 2860] 0 2860 7059 523 18 3
>> 591 0 smartd
>> [737778.729842] [ 2864] 0 2864 7082 559 19 4
>> 96 0 systemd-logind
>> [737778.729890] [ 2865] 106 2865 10563 528 24 3
>> 110 -900 dbus-daemon
>> [737778.729938] [ 2925] 0 2925 3604 421 12 3
>> 38 0 agetty
>> [737778.729985] [ 2974] 0 2974 4852 365 13 3
>> 73 0 irqbalance
>> [737778.730032] [ 2976] 105 2976 14299 496 29 3
>> 1534 0 snmpd
>> [737778.730078] [ 2992] 0 2992 3180 227 11 3
>> 38 0 mcelog
>> [737778.730125] [ 3095] 0 3095 26571 344 43 3
>> 259 0 sfcbd
>> [737778.730172] [ 3172] 0 3172 20392 261 40 3
>> 236 0 sfcbd
>> [737778.730219] [ 3248] 0 3248 22441 0 41 3
>> 238 0 sfcbd
>> [737778.730265] [ 3249] 0 3249 39376 155 44 3
>> 357 0 sfcbd
>> [737778.730312] [ 3450] 0 3450 39377 104 44 3
>> 244 0 sfcbd
>> [737778.730359] [ 3467] 0 3467 58324 301 46 3
>> 284 0 sfcbd
>> [737778.730405] [ 3548] 0 3548 262686 643 66 4
>> 4097 0 dsm_sa_datamgrd
>> [737778.730453] [ 3563] 101 3563 13312 403 29 3
>> 162 0 exim4
>> [737778.730499] [ 3576] 107 3576 7293 493 19 3
>> 148 0 ntpd
>> [737778.730546] [ 3585] 0 3585 61531 577 117 3
>> 496 0 winbindd
>> [737778.730593] [ 3586] 0 3586 61531 578 118 3
>> 512 0 winbindd
>> [737778.730640] [ 3651] 0 3651 48584 566 36 3
>> 487 0 dsm_sa_eventmgr
>> [737778.730688] [ 3674] 0 3674 99593 576 47 3
>> 1402 0 dsm_sa_snmpd
>> [737778.730736] [ 3717] 0 3717 7923 285 18 3
>> 115 0 dsm_om_connsvcd
>> [737778.730784] [ 3718] 0 3718 740234 1744 202 7
>> 30685 0 dsm_om_connsvcd
>> [737778.730832] [ 3736] 0 3736 178651 0 55 3
>> 3789 0 dsm_sa_datamgrd
>> [737778.730880] [ 4056] 0 4056 26472 498 57 3
>> 252 0 sshd
>> [737778.730926] [ 4060] 1000 4060 8973 501 23 3
>> 184 0 systemd
>> [737778.730973] [ 4061] 1000 4061 15702 0 34 4
>> 612 0 (sd-pam)
>> [737778.731020] [ 4063] 1000 4063 26472 158 54 3
>> 260 0 sshd
>> [737778.731067] [ 4064] 1000 4064 6041 739 16 3
>> 686 0 bash
>> [737778.731113] [ 4083] 1000 4083 16853 493 37 3
>> 128 0 su
>> [737778.731160] [ 4084] 0 4084 5501 756 15 3
>> 160 0 bash
>> [737778.731207] [15150] 0 15150 3309 678 10 3
>> 57 0 run_mirror.sh
>> [737778.731256] [24296] 0 24296 1450 139 8 3
>> 23 0 flock
>> [737778.731302] [24297] 0 24297 9576 622 22 3
>> 3990 0 rsync
>> [737778.731349] [24298] 0 24298 7552 541 18 3
>> 1073 0 rsync
>> [737778.731395] [24299] 0 24299 9522 401 22 3
>> 2416 0 rsync
>> [737778.731445] [25910] 0 25910 10257 522 23 3
>> 81 0 systemd-journal
>> [737778.731494] [25940] 0 25940 16365 617 37 3
>> 126 0 cron
>> [737778.731540] Out of memory: Kill process 3718 (dsm_om_connsvcd)
>> score 1 or sacrifice child
>> [737778.731644] Killed process 3718 (dsm_om_connsvcd)
>> total-vm:2960936kB, anon-rss:0kB, file-rss:6976kB, shmem-rss:0kB
>> [737778.768375] oom_reaper: reaped process 3718 (dsm_om_connsvcd), now
>> anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
>>
>> On Fri, Nov 4, 2016 at 5:00 PM, Vlastimil Babka <vbabka@suse.cz> wrote:
>>> On 11/04/2016 03:13 PM, E V wrote:
>>>> After the system panic'd yesterday I booted back into 4.8.4 and
>>>> restarted the rsync's. I'm away on vacation next week, so when I get
>>>> back I'll get rc4 or rc5 and try again. In the mean time here's data
>>>> from the system running 4.8.4 without problems for about a day. I'm
>>>> not familiar with xxd and didn't see a -e option, so used -E:
>>>> xxd -E -g8 -c8 /proc/kpagecount | cut -d" " -f2 | sort | uniq -c
>>>> 8258633 0000000000000000
>>>> 216440 0100000000000000
>>>
>>> The lack of -e means it's big endian, which is not a big issue. So here
>>> most of memory is free, some pages have just one pin, and only
>>> relatively few have more. The vmstats also doesn't show anything bad, so
>>> we'll have to wait if something appears within the week, or after you
>>> try 4.9 again. Thanks.
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: Connection problems with Qualcomm Atheros QCA6174
From: Henrý Þór Baldursson @ 2016-11-14 20:56 UTC (permalink / raw)
To: Michal Kazior; +Cc: ath10k@lists.infradead.org
In-Reply-To: <CA+BoTQk9znROEy4o958DVuBkv1cpY6eG=-wCof1fahuh93PObw@mail.gmail.com>
Hi
Thanks for your reply. :-)
The BIOS didn't display options related to S0x or S0ix ACPI modes. But
then, it's a Lenovo BIOS and they disable alot of features and don't
offer any expert mode.
I applied your patch, and will see if it keeps my network from failing.
It's been a while since I've done this, is this a problem?:
Nov 14 20:47:58 tempest kernel: ath10k_core: loading out-of-tree
module taints kernel.
- Henry.
On Mon, Nov 14, 2016 at 1:13 PM, Michal Kazior <michal.kazior@tieto.com> wrote:
> On 13 November 2016 at 06:57, Henrý Þór Baldursson
> <henry.baldursson@gmail.com> wrote:
>> Hello
>>
>> I have a Lenovo Ideapad Yoga 910 running Athergos, kernel version 4.8.7.
>>
>> My problem is that intermittently my wifi will just grind to a halt
>> and even stop working.
>>
>> The driver reports the firmware as being WLAN.RM.2.0-00180-QCARMSWPZ-1
>>
>> Here's the initialization in dmesg:
>>
>> [ 1.900033] ath10k_pci 0000:01:00.0: pci irq msi oper_irq_mode 2
>> irq_mode 0 reset_mode 0
>> [ 2.173039] ath10k_pci 0000:01:00.0: Direct firmware load for
>> ath10k/pre-cal-pci-0000:01:00.0.bin failed with error -2
>> [ 2.173054] ath10k_pci 0000:01:00.0: Direct firmware load for
>> ath10k/cal-pci-0000:01:00.0.bin failed with error -2
>> [ 2.174217] ath10k_pci 0000:01:00.0: Direct firmware load for
>> ath10k/QCA6174/hw3.0/firmware-5.bin failed with error -2
>> [ 2.174218] ath10k_pci 0000:01:00.0: could not fetch firmware file
>> 'ath10k/QCA6174/hw3.0/firmware-5.bin': -2
>> [ 2.175485] ath10k_pci 0000:01:00.0: qca6174 hw3.2 target
>> 0x05030000 chip_id 0x00340aff sub 17aa:0827
>> [ 2.175487] ath10k_pci 0000:01:00.0: kconfig debug 0 debugfs 1
>> tracing 0 dfs 0 testmode 0
>> [ 2.175876] ath10k_pci 0000:01:00.0: firmware ver
>> WLAN.RM.2.0-00180-QCARMSWPZ-1 api 4 features
>> wowlan,ignore-otp,no-4addr-pad crc32 75dee6c5
>> [ 2.240312] ath10k_pci 0000:01:00.0: board_file api 2 bmi_id N/A
>> crc32 6fc88fe7
>> [ 4.405741] ath10k_pci 0000:01:00.0: htt-ver 3.26 wmi-op 4 htt-op 3
>> cal otp max-sta 32 raw 0 hwcrypto 1
>> [ 4.485362] ath10k_pci 0000:01:00.0 wlp1s0: renamed from wlan0
>>
>>
>> Here's what dmesg shows during the errors:
>>
>> [ 1238.710899] pcieport 0000:00:1c.0: AER: Corrected error received: id=00e0
>> [ 1238.710920] pcieport 0000:00:1c.0: PCIe Bus Error:
>> severity=Corrected, type=Data Link Layer, id=00e0(Transmitter ID)
>> [ 1238.710935] pcieport 0000:00:1c.0: device [8086:9d14] error
>> status/mask=00001000/00000000
>> [ 1238.710945] pcieport 0000:00:1c.0: [12] Replay Timer Timeout
>> [ 1243.855456] pcieport 0000:00:1c.0: AER: Corrected error received: id=00e0
>> [ 1243.855472] pcieport 0000:00:1c.0: PCIe Bus Error:
>> severity=Corrected, type=Data Link Layer, id=00e0(Transmitter ID)
>> [ 1243.855484] pcieport 0000:00:1c.0: device [8086:9d14] error
>> status/mask=00001000/00000000
>> [ 1243.855491] pcieport 0000:00:1c.0: [12] Replay Timer Timeout
>> [ 1296.095437] pcieport 0000:00:1c.0: AER: Corrected error received: id=00e0
>> [ 1296.095452] pcieport 0000:00:1c.0: PCIe Bus Error:
>> severity=Corrected, type=Data Link Layer, id=00e0(Transmitter ID)
>> [ 1296.095464] pcieport 0000:00:1c.0: device [8086:9d14] error
>> status/mask=00001000/00000000
>> [ 1296.095472] pcieport 0000:00:1c.0: [12] Replay Timer Timeout
>> [ 1305.877547] pcieport 0000:00:1c.0: AER: Corrected error received: id=00e0
>> [ 1305.877562] pcieport 0000:00:1c.0: PCIe Bus Error:
>> severity=Corrected, type=Data Link Layer, id=00e0(Transmitter ID)
>> [ 1305.877574] pcieport 0000:00:1c.0: device [8086:9d14] error
>> status/mask=00001000/00000000
>> [ 1305.877581] pcieport 0000:00:1c.0: [12] Replay Timer Timeout
>> [ 1556.596092] pcieport 0000:00:1c.0: AER: Corrected error received: id=00e0
>> [ 1556.596107] pcieport 0000:00:1c.0: PCIe Bus Error:
>> severity=Corrected, type=Data Link Layer, id=00e0(Transmitter ID)
>> [ 1556.596115] pcieport 0000:00:1c.0: device [8086:9d14] error
>> status/mask=00001000/00000000
>> [ 1556.596122] pcieport 0000:00:1c.0: [12] Replay Timer Timeout
>> [ 1612.764108] pcieport 0000:00:1c.0: AER: Corrected error received: id=00e0
>> [ 1612.764124] pcieport 0000:00:1c.0: PCIe Bus Error:
>> severity=Corrected, type=Data Link Layer, id=00e0(Transmitter ID)
>> [ 1612.764135] pcieport 0000:00:1c.0: device [8086:9d14] error
>> status/mask=00001000/00000000
>> [ 1612.764143] pcieport 0000:00:1c.0: [12] Replay Timer Timeout
>
> Can you try to override ar_pci->pci_ps to false in ath10k_pci_probe()
> and see if it helps? Something along the diff:
>
> --- a/drivers/net/wireless/ath/ath10k/pci.c
> +++ b/drivers/net/wireless/ath/ath10k/pci.c
> @@ -3236,7 +3236,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
> ar_pci->dev = &pdev->dev;
> ar_pci->ar = ar;
> ar->dev_id = pci_dev->device;
> - ar_pci->pci_ps = pci_ps;
> + ar_pci->pci_ps = false;
> ar_pci->bus_ops = &ath10k_pci_bus_ops;
> ar_pci->pci_soft_reset = pci_soft_reset;
> ar_pci->pci_hard_reset = pci_hard_reset;
>
> Another thing which could be happening is ACPI S0ix states which - to
> the best of my knowledge - Linux does not support. I've seen at least
> i915 not being able to wake-up DSI displays properly when S0ix states
> are enabled on some 10 inch 2-in-1 devices. I wouldn't be surprised if
> other PCI-E (such as wifi/network devices) can be affected adversely
> as well.
>
> Therefore, can you check UEFI/BIOS (you may need to enable "expert
> settings") if there are any mentions about S0x or S0ix ACPI modes
> there and - if found - try disabling them and checking back if you
> still get AER/bus errors, please?
>
>
> Michał
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply
* Re: [PATCH kvm-unit-tests v2 15/17] pci: add msi support for 32/64bit address
From: Peter Xu @ 2016-11-14 20:58 UTC (permalink / raw)
To: Andrew Jones; +Cc: kvm, rkrcmar, agordeev, jan.kiszka, pbonzini
In-Reply-To: <20161110201014.kmoj4mhncxwlvigh@hawk.localdomain>
On Thu, Nov 10, 2016 at 09:10:14PM +0100, Andrew Jones wrote:
[...]
> > +bool pci_setup_msi(struct pci_dev *dev, uint64_t msi_addr, uint32_t msi_data)
> > +{
> > + uint16_t msi_control;
> > + uint16_t offset;
> > + pcidevaddr_t addr = dev->bdf;
> > +
> > + assert(dev);
>
> If you're worried that dev might be null then you can't dereference
> it the line above.
Right. Fixing up.
Thanks,
-- peterx
^ permalink raw reply
* [U-Boot] [PATCH v3 7/8] x86: efi: Add a hello world test program
From: Simon Glass @ 2016-11-14 20:58 UTC (permalink / raw)
To: u-boot
In-Reply-To: <44437559-36e5-1551-27f5-4f47edf71246@suse.de>
Hi Alex,
On 14 November 2016 at 13:46, Alexander Graf <agraf@suse.de> wrote:
>
>
> On 14/11/2016 21:44, Simon Glass wrote:
>>
>> Hi Alex,
>>
>> On 11 November 2016 at 23:23, Alexander Graf <agraf@suse.de> wrote:
>>>
>>>
>>>
>>>> Am 11.11.2016 um 17:17 schrieb Simon Glass <sjg@chromium.org>:
>>>>
>>>> Hi Alex,
>>>>
>>>>> On 7 November 2016 at 09:32, Alexander Graf <agraf@suse.de> wrote:
>>>>>
>>>>>
>>>>>> On 07/11/2016 10:46, Simon Glass wrote:
>>>>>>
>>>>>> Hi Alex,
>>>>>>
>>>>>>> On 19 October 2016 at 01:09, Alexander Graf <agraf@suse.de> wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> On 18/10/2016 22:37, Simon Glass wrote:
>>>>>>>>
>>>>>>>> Hi Alex,
>>>>>>>>
>>>>>>>>> On 18 October 2016 at 01:14, Alexander Graf <agraf@suse.de> wrote:
>>>>>>>>>
>>>>>>>>>> On 10/18/2016 04:29 AM, Simon Glass wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> It is useful to have a basic sanity check for EFI loader support.
>>>>>>>>>> Add
>>>>>>>>>> a
>>>>>>>>>> 'bootefi hello' command which loads HelloWord.efi and runs it
>>>>>>>>>> under
>>>>>>>>>> U-Boot.
>>>>>>>>>>
>>>>>>>>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>>>>>>>>> ---
>>>>>>>>>>
>>>>>>>>>> Changes in v3:
>>>>>>>>>> - Include a link to the program instead of adding it to the tree
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> So, uh, where is the link?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> I put it in the README (see the arm patch).
>>>>>>>>
>>>>>>>>>
>>>>>>>>> I'm really not convinced this command buys us anything yet. I do
>>>>>>>>> agree
>>>>>>>>> that
>>>>>>>>> we want automated testing - but can't we get that using QEMU and a
>>>>>>>>> downloadable image file that we pass in as disk and have the distro
>>>>>>>>> boot do
>>>>>>>>> its magic?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> That seems very heavyweight as a sanity check, although I agree it
>>>>>>>> is
>>>>>>>> useful.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> It's not really much more heavy weight. The "image file" could simply
>>>>>>> contain your hello world binary. But with this we don't just verify
>>>>>>> whether "bootefi" works, but also whether the default boot path works
>>>>>>> ok.
>>>>>>
>>>>>>
>>>>>>
>>>>>> I don't think I understand what you mean by 'image file'. Is it
>>>>>> something other than the .efi file? Do you mean a disk image?
>>>>>
>>>>>
>>>>>
>>>>> Yes. For reasonable test coverage, we should also verify that the
>>>>> distro
>>>>> defaults wrote a sane boot script that automatically searches for a
>>>>> default
>>>>> EFI binary in /efi/boot/bootx86.efi on the first partition of all
>>>>> devices
>>>>> and runs it.
>>>>>
>>>>> So if we just provide an SD card image or hard disk image to QEMU which
>>>>> contains a hello world .efi binary as that default boot file, we don't
>>>>> only
>>>>> test whether the "bootefi" command works, but also whether the distro
>>>>> boot
>>>>> script works.
>>>>
>>>>
>>>> That's right.
>>>>
>>>>>
>>>>>>
>>>>>>>
>>>>>>>> Here I am just making sure that EFI programs can start, print output
>>>>>>>> and exit. It is a test that we can easily run without a lot of
>>>>>>>> overhead, much less than a full distro boot.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Again, I don't think it's much more overhead and I do believe it
>>>>>>> gives
>>>>>>> us much cleaner separation between responsibilities of code (tests go
>>>>>>> where tests are).
>>>>>>
>>>>>>
>>>>>>
>>>>>> You are talking about a functional test, something that tests things
>>>>>> end to end. I prefer to at least start with a smaller test. Granted it
>>>>>> takes a little more work but it means there are fewer things to hunt
>>>>>> through when something goes wrong.
>>>>>
>>>>>
>>>>>
>>>>> Yes, I personally find unit tests terribly annoying and unproductive
>>>>> and
>>>>> functional tests very helpful :). And in this case, the effort to write
>>>>> it
>>>>> is about the same for both, just that the functional test actually
>>>>> tells you
>>>>> that things work or don't work at the end of the day.
>>>>>
>>>>> With a code base like U-Boot, a simple functional test like the above
>>>>> plus
>>>>> git bisect should get you to an offending patch very quickly.
>>>>
>>>>
>>>> This is not a unit test - in fact the EFI stuff has no unit tests. I
>>>> suppose if we are trying to find a name this is a small functional
>>>> test since it exercises the general functionality.
>>>>
>>>> I am much keener on small tests than large ones for finding simple
>>>> bugs. Of course you can generally bisect to find a bug, but the more
>>>> layers of software you need to look for the harder this is.
>>>>
>>>> We could definitely use a pytest which checks an EFI boot into an
>>>> image, but I don't think this obviates the need for a smaller targeted
>>>> test like this one.
>>>
>>>
>>> I think arguing over this is moot :). More tests is usually a good thing,
>>> so whoever gets to write them gets to push them ;). As long as the licenses
>>> are sound at least.
>>
>>
>> OK good, well please can you review this at some point?
>
>
> Review what exactly?
I mean the patches. There should be ~14 in your queue.
>
>> Also, are you
>> planning to write the 'larger' test? How do you test this all in suse?
>
>
> Planning yes, but I'm very good at not writing tests :).
>
> Currently I'm testing this all in suse by running systems which rely on the
> code to work.
OK I see.
Regards,
Simon
^ permalink raw reply
* Re: linux-next: manual merge of the driver-core tree with the pm tree
From: Rafael J. Wysocki @ 2016-11-14 21:07 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: Greg KH, linux-next, linux-kernel, Brian Norris
In-Reply-To: <20161114130902.532c3c64@canb.auug.org.au>
On Monday, November 14, 2016 01:09:02 PM Stephen Rothwell wrote:
> Hi Greg,
>
> Today's linux-next merge of the driver-core tree got a conflict in:
>
> drivers/base/power/main.c
>
> between commit:
>
> 6f75c3fd56da ("PM / sleep: don't suspend parent when async child suspend_{noirq, late} fails")
>
> from the pm tree and commit:
>
> 8c73b4288496 ("PM / sleep: Make async suspend/resume of devices use device links")
>
> from the driver-core tree.
Well, right. The device links series predates the Brian's fix (which is in -rc5
already, BTW).
> I fixed it up (maybe .. see below) and can carry the fix as necessary.
That's the correct one, thanks Stephen!
Cheers,
Rafael
^ permalink raw reply
* Re: [PATCH 1/5] PCI: Make pci_std_enable_acs() non-static
From: Bjorn Helgaas @ 2016-11-14 20:59 UTC (permalink / raw)
To: Alex Williamson; +Cc: linux-pci, bhelgaas, iommu, linux-kernel
In-Reply-To: <20161026180116.23495.77322.stgit@gimli.home>
On Wed, Oct 26, 2016 at 12:01:16PM -0600, Alex Williamson wrote:
> For use by quirks.
>
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> ---
> drivers/pci/pci.c | 2 +-
> include/linux/pci.h | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index aab9d51..b901ee7 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -2728,7 +2728,7 @@ void pci_request_acs(void)
> * pci_std_enable_acs - enable ACS on devices using standard ACS capabilites
> * @dev: the PCI device
> */
> -static void pci_std_enable_acs(struct pci_dev *dev)
> +void pci_std_enable_acs(struct pci_dev *dev)
> {
> int pos;
> u16 cap;
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 0ab8359..c3248d5 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1900,6 +1900,7 @@ static inline int pci_pcie_type(const struct pci_dev *dev)
> bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags);
> bool pci_acs_path_enabled(struct pci_dev *start,
> struct pci_dev *end, u16 acs_flags);
> +void pci_std_enable_acs(struct pci_dev *dev);
I think putting this in drivers/pci/pci.h would be sufficient for what
you need, wouldn't it? Same for pcie_get_link() and pcie_retrain_link().
> #define PCI_VPD_LRDT 0x80 /* Large Resource Data Type */
> #define PCI_VPD_LRDT_ID(x) ((x) | PCI_VPD_LRDT)
>
^ permalink raw reply
* Re: [PATCH 1/3] perf: add PERF_RECORD_NAMESPACES to include namespaces related info
From: Eric W. Biederman @ 2016-11-14 20:57 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Hari Bathini, ast, lkml, acme, alexander.shishkin, mingo, daniel,
rostedt, Ananth N Mavinakayanahalli, sargun, Aravinda Prasad,
brendan.d.gregg
In-Reply-To: <20161114104612.GA3102@twins.programming.kicks-ass.net>
Peter Zijlstra <peterz@infradead.org> writes:
> On Mon, Nov 14, 2016 at 04:02:30PM +0530, Hari Bathini wrote:
>
>> >> PERF_RECORD_SWITCH_CPU_WIDE = 15,
>> >>+ /*
>> >>+ * struct {
>> >>+ * struct perf_event_header header;
>> >>+ *
>> >>+ * u32 pid, tid;
>> >>+ * u64 time;
>> >>+ * u32 uts_ns_inum;
>> >>+ * u32 ipc_ns_inum;
>> >>+ * u32 mnt_ns_inum;
>> >>+ * u32 pid_ns_inum;
>> >>+ * u32 net_ns_inum;
>> >>+ * u32 cgroup_ns_inum;
>> >>+ * u32 user_ns_inum;
>> >>+ * struct sample_id sample_id;
>> >>+ * };
>> >>+ */
>> >>+ PERF_RECORD_NAMESPACES = 16,
>> >So this format is not extensible, that is, if someone adds yet another
>> >namespace, we'll need to introduce PERF_RECORD_NAMESPACES2.
>> >
>> >Is there a 'natural' and exposed namespace index that we can use to
>> >change it like:
>> >
>> > u32 nr_nss;
>> > u32 namespace[nr_nss];
>> >
>> >?
>>
>> Nothing of that sort exists, currently.
>> Maybe, time to introduce with this patch-set..?
>
> Would be good, but you'll have to sort that with the namespace folks.
The somewhat easy answer is to use the unshare flags. AKA CLONE_NEWNS,
CLONE_NEWUSER, ...
In the worst case things may get extended to the point where perf would
have to use a different set of values than we use to unshare, clone, and
setns (as the clone flags are effectively all used up) but for the
existing namespaces that index should work just fine.
That won't allow for a natural array in the record but it will allow for
an array with that has a tag for which namespace it is in, or
alternative it will allow for one record per namespace.
Eric
^ permalink raw reply
* Re: Debugging Ethernet issues
From: Florian Fainelli @ 2016-11-14 21:00 UTC (permalink / raw)
To: Mason
Cc: Sebastian Frias, Andrew Lunn, netdev, Mans Rullgard,
Sergei Shtylyov, Tom Lendacky, Zach Brown, Shaohui Xie, Tim Beale,
Brian Hill, Vince Bridgers, Balakumaran Kannan, David S. Miller,
Kirill Kapranov
In-Reply-To: <582A1E3F.8040908@free.fr>
On 11/14/2016 12:27 PM, Mason wrote:
> On 14/11/2016 19:20, Florian Fainelli wrote:
>
>> On 11/14/2016 09:59 AM, Sebastian Frias wrote:
>>
>>> Could you confirm that Mason's patch is correct and/or that it does not
>>> has negative side-effects?
>>
>> The patch is not correct nor incorrect per-se, it changes the default
>> policy of having pause frames advertised by default to not having them
>> advertised by default. This influences both your Ethernet MAC and the
>> link partner in that the result is either flow control is enabled
>> (before) or it is not (with the patch). There must be something amiss if
>> you see packet loss or some kind of problem like that with an early
>> exchange such as DHCP. Flow control tend to kick in under higher packet
>> rates (at least, that's what you expect).
>
> Did you note that, without the change under discussion (i.e. with
> the eth driver as it is upstream), when the board is connected to
> a 100 Mbps switch, then *nothing* works *systematically (no ping,
> no DHCP; are there other relevant low-level network tools?).
No I missed that, way too many emails, really. So how about you compare
the register settings that could be (that is, all that could be modified
by the PHYLIB adjust_link function) and try to spot where things could
go wrong? Any other register that can be influenced by the link speed?
It seems like a possible (yet after re-reading, very unlikely) scenario,
considering that priv->speed, priv->duplex and priv->link are initially
zero-initialized (because nb8800_priv is zero initialized) may not force
a correct link transition and a full MAC reconfiguration in
nb8800_link_reconfigure() where some of the cached values are used.
NB: you will see most drivers initialize the previous link, speed,
duplex values to -1, because those are outside of the range of values
that PHYLIB would assign to phydev->{link,duplex,speed}, and therefore,
this is guaranteed to make the adjust_link callback that tries to
minimize these settings to force a transition.
>
> Also, maybe this comment was lost in my own noise:
>
> If I manually set the link up, then down, then run udhcpc
> => then nothing works, as if something is wedged somewhere
> (a kernel thread gets borked by a race condition?)
Well then start seriously debugging the problem: firs thing you need to
check is is the RUNNING flag set on the interface (which indicates a
carrier on?) without that, the networking stack won't even send packets.
If it is not set, why is not it set? Did nb8800_mac_config() get called
in the first place to configure the MAC wrt. the link settings?
When you transmit, do transmit counters increase? That would indicate
the TX DMA does its job. When transmission occurs, it is successful or
is it reporting errors? If the PHY supports it, can you access PHY
counters and look for success/error counters changing? Finally, try to
put another golden (working) host and if your switch supports it,
configure port mirroring to look at packets. If the switch does not
support it, then try different link partners.
>
> Could not advertising pause frames result in making such a
> race condition impossible? (I don't really believe in a race,
> due to the 100% nature of the problem.)
>
>>> Right now we know that Mason's patch makes this work, but we do not understand
>>> why nor its implications.
>>
>> You need to understand why, right now, the way this problem is
>> presented, you came up with a workaround, not with the root cause or the
>> solution. What does your link partner (switch?) reports, that is, what
>> is the ethtool output when you have a link up from your nb8800 adapter?
>
> Isn't that what ethtool -a eth0 prints?
No, ethtool -a prints the local pause settings.
> How do I get the link partner information?
ethtool eth0:
# ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
^======================
Link partner advertised pause frame use: Symmetric
Link partner advertised auto-negotiation: Yes
^========================
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: gs
Wake-on: d
SecureOn password: 00:00:00:00:00:00
Current message level: 0x00000007 (7)
drv probe link
Link detected: yes
#
> Just ethtool eth0?
Yes, just that.
--
Florian
^ permalink raw reply
* Re: Tracker "Source" field default value changed from "other" to empty
From: Gregory Farnum @ 2016-11-14 21:00 UTC (permalink / raw)
To: Nathan Cutler; +Cc: ceph-devel@vger.kernel.org
In-Reply-To: <939a67e9-160c-421b-eb60-87f054c53464@suse.cz>
On Fri, Nov 11, 2016 at 1:11 AM, Nathan Cutler <ncutler@suse.cz> wrote:
> The tracker has a custom field called "Source" which is supposed to indicate
> who found, or first reported, a given issue. In practice, the field is
> rarely used and it typically is left at its default value, which is "other".
> Over time, I have found this to be a low-grade annoyance, so today I changed
> the default value to empty (not filled out).
>
> For me, this is a no-brainer :-) but if anyone has objections let's discuss!
Thumbs up from me! I'm not sure about who else, but I definitely
maintain these fields whenever I'm handling a ticket, and these fields
have been used for statistics analysis in the past.
-Greg
^ permalink raw reply
* [RFC][PATCH 0/7] crypto: Adding Hash-Encrypt-Hash(HEH)
From: Alex Cope @ 2016-11-14 21:01 UTC (permalink / raw)
To: linux-crypto; +Cc: mhalcrow, edknapp, Alex Cope
This patchset implements HEH, which is currently specified by the
following Internet Draft:
https://tools.ietf.org/html/draft-cope-heh-00
This patchset is a request for comments, and should not be merged at
this time. We would like to wait for further comments on the Internet
Draft before merging this patchset.
Thanks
^ permalink raw reply
* [RFC][PATCH 1/7] crypto: skcipher adding skciper_walk_virt_init
From: Alex Cope @ 2016-11-14 21:01 UTC (permalink / raw)
To: linux-crypto; +Cc: mhalcrow, edknapp, Alex Cope, Eric Biggers
In-Reply-To: <1479157277-10251-1-git-send-email-alexcope@google.com>
Adding skcipher_walk_virt_init to allow a skciper_walk to specify
length and input/output sg. Provides similar funcationalty to
blkcipher_walk_init
Signed-off-by: Alex Cope <alexcope@google.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
crypto/skcipher.c | 32 +++++++++++++++++++++++---------
include/crypto/internal/skcipher.h | 4 ++++
2 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/crypto/skcipher.c b/crypto/skcipher.c
index e1633e6..df4b2de 100644
--- a/crypto/skcipher.c
+++ b/crypto/skcipher.c
@@ -447,16 +447,19 @@ static int skcipher_walk_first(struct skcipher_walk *walk)
}
static int skcipher_walk_skcipher(struct skcipher_walk *walk,
- struct skcipher_request *req)
+ struct skcipher_request *req,
+ struct scatterlist *src,
+ struct scatterlist *dst,
+ unsigned int len)
{
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
- scatterwalk_start(&walk->in, req->src);
- scatterwalk_start(&walk->out, req->dst);
+ scatterwalk_start(&walk->in, src);
+ scatterwalk_start(&walk->out, dst);
- walk->in.sg = req->src;
- walk->out.sg = req->dst;
- walk->total = req->cryptlen;
+ walk->in.sg = src;
+ walk->out.sg = dst;
+ walk->total = len;
walk->iv = req->iv;
walk->oiv = req->iv;
@@ -474,17 +477,27 @@ static int skcipher_walk_skcipher(struct skcipher_walk *walk,
int skcipher_walk_virt(struct skcipher_walk *walk,
struct skcipher_request *req, bool atomic)
{
+ return skcipher_walk_virt_init(walk, req, atomic, req->src, req->dst,
+ req->cryptlen);
+}
+EXPORT_SYMBOL_GPL(skcipher_walk_virt);
+
+int skcipher_walk_virt_init(struct skcipher_walk *walk,
+ struct skcipher_request *req, bool atomic,
+ struct scatterlist *src, struct scatterlist *dst,
+ unsigned int len)
+{
int err;
walk->flags &= ~SKCIPHER_WALK_PHYS;
- err = skcipher_walk_skcipher(walk, req);
+ err = skcipher_walk_skcipher(walk, req, src, dst, len);
walk->flags &= atomic ? ~SKCIPHER_WALK_SLEEP : ~0;
return err;
}
-EXPORT_SYMBOL_GPL(skcipher_walk_virt);
+EXPORT_SYMBOL_GPL(skcipher_walk_virt_init);
void skcipher_walk_atomise(struct skcipher_walk *walk)
{
@@ -499,7 +512,8 @@ int skcipher_walk_async(struct skcipher_walk *walk,
INIT_LIST_HEAD(&walk->buffers);
- return skcipher_walk_skcipher(walk, req);
+ return skcipher_walk_skcipher(walk, req, req->src, req->dst,
+ req->cryptlen);
}
EXPORT_SYMBOL_GPL(skcipher_walk_async);
diff --git a/include/crypto/internal/skcipher.h b/include/crypto/internal/skcipher.h
index 26934a6..1173701 100644
--- a/include/crypto/internal/skcipher.h
+++ b/include/crypto/internal/skcipher.h
@@ -144,6 +144,10 @@ int skcipher_walk_done(struct skcipher_walk *walk, int err);
int skcipher_walk_virt(struct skcipher_walk *walk,
struct skcipher_request *req,
bool atomic);
+int skcipher_walk_virt_init(struct skcipher_walk *walk,
+ struct skcipher_request *req,
+ bool atomic, struct scatterlist *src,
+ struct scatterlist *dst, unsigned int len);
void skcipher_walk_atomise(struct skcipher_walk *walk);
int skcipher_walk_async(struct skcipher_walk *walk,
struct skcipher_request *req);
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related
* [RFC][PATCH 2/7] crypto: gf128mul - Refactor gf128 overflow macros
From: Alex Cope @ 2016-11-14 21:01 UTC (permalink / raw)
To: linux-crypto; +Cc: mhalcrow, edknapp, Alex Cope, Eric Biggers
In-Reply-To: <1479157277-10251-1-git-send-email-alexcope@google.com>
Rename and clean up the overflow macros. Their usage is more general
than the name suggested.
Signed-off-by: Alex Cope <alexcope@google.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
crypto/gf128mul.c | 68 +++++++++++++++++++++++++++++++++----------------------
1 file changed, 41 insertions(+), 27 deletions(-)
diff --git a/crypto/gf128mul.c b/crypto/gf128mul.c
index 0594dd6..8b65b1e 100644
--- a/crypto/gf128mul.c
+++ b/crypto/gf128mul.c
@@ -88,33 +88,47 @@
q(0xf8), q(0xf9), q(0xfa), q(0xfb), q(0xfc), q(0xfd), q(0xfe), q(0xff) \
}
-/* Given the value i in 0..255 as the byte overflow when a field element
- in GHASH is multiplied by x^8, this function will return the values that
- are generated in the lo 16-bit word of the field value by applying the
- modular polynomial. The values lo_byte and hi_byte are returned via the
- macro xp_fun(lo_byte, hi_byte) so that the values can be assembled into
- memory as required by a suitable definition of this macro operating on
- the table above
-*/
-
-#define xx(p, q) 0x##p##q
+/*
+ * Given a value i in 0..255 as the byte overflow when a field element
+ * in GF(2^128) is multiplied by x^8, the following macro returns the
+ * 16-bit value that must be XOR-ed into the low-degree end of the
+ * product to reduce it modulo the irreducible polynomial x^128 + x^7 +
+ * x^2 + x + 1.
+ *
+ * There are two versions of the macro, and hence two tables: one for
+ * the "be" convention where the highest-order bit is the coefficient of
+ * the highest-degree polynomial term, and one for the "le" convention
+ * where the highest-order bit is the coefficient of the lowest-degree
+ * polynomial term. In both cases the values are stored in CPU byte
+ * endianness such that the coefficients are ordered consistently across
+ * bytes, i.e. in the "be" table bits 15..0 of the stored value
+ * correspond to the coefficients of x^15..x^0, and in the "le" table
+ * bits 15..0 correspond to the coefficients of x^0..x^15.
+ *
+ * Therefore, provided that the appropriate byte endianness conversions
+ * are done by the multiplication functions (and these must be in place
+ * anyway to support both little endian and big endian CPUs), the "be"
+ * table can be used for multiplications of both "bbe" and "ble"
+ * elements, and the "le" table can be used for multiplications of both
+ * "lle" and "lbe" elements.
+ */
-#define xda_bbe(i) ( \
- (i & 0x80 ? xx(43, 80) : 0) ^ (i & 0x40 ? xx(21, c0) : 0) ^ \
- (i & 0x20 ? xx(10, e0) : 0) ^ (i & 0x10 ? xx(08, 70) : 0) ^ \
- (i & 0x08 ? xx(04, 38) : 0) ^ (i & 0x04 ? xx(02, 1c) : 0) ^ \
- (i & 0x02 ? xx(01, 0e) : 0) ^ (i & 0x01 ? xx(00, 87) : 0) \
+#define xda_be(i) ( \
+ (i & 0x80 ? 0x4380 : 0) ^ (i & 0x40 ? 0x21c0 : 0) ^ \
+ (i & 0x20 ? 0x10e0 : 0) ^ (i & 0x10 ? 0x0870 : 0) ^ \
+ (i & 0x08 ? 0x0438 : 0) ^ (i & 0x04 ? 0x021c : 0) ^ \
+ (i & 0x02 ? 0x010e : 0) ^ (i & 0x01 ? 0x0087 : 0) \
)
-#define xda_lle(i) ( \
- (i & 0x80 ? xx(e1, 00) : 0) ^ (i & 0x40 ? xx(70, 80) : 0) ^ \
- (i & 0x20 ? xx(38, 40) : 0) ^ (i & 0x10 ? xx(1c, 20) : 0) ^ \
- (i & 0x08 ? xx(0e, 10) : 0) ^ (i & 0x04 ? xx(07, 08) : 0) ^ \
- (i & 0x02 ? xx(03, 84) : 0) ^ (i & 0x01 ? xx(01, c2) : 0) \
+#define xda_le(i) ( \
+ (i & 0x80 ? 0xe100 : 0) ^ (i & 0x40 ? 0x7080 : 0) ^ \
+ (i & 0x20 ? 0x3840 : 0) ^ (i & 0x10 ? 0x1c20 : 0) ^ \
+ (i & 0x08 ? 0x0e10 : 0) ^ (i & 0x04 ? 0x0708 : 0) ^ \
+ (i & 0x02 ? 0x0384 : 0) ^ (i & 0x01 ? 0x01c2 : 0) \
)
-static const u16 gf128mul_table_lle[256] = gf128mul_dat(xda_lle);
-static const u16 gf128mul_table_bbe[256] = gf128mul_dat(xda_bbe);
+static const u16 gf128mul_table_le[256] = gf128mul_dat(xda_le);
+static const u16 gf128mul_table_be[256] = gf128mul_dat(xda_be);
/* These functions multiply a field element by x, by x^4 and by x^8
* in the polynomial field representation. It uses 32-bit word operations
@@ -126,7 +140,7 @@ static void gf128mul_x_lle(be128 *r, const be128 *x)
{
u64 a = be64_to_cpu(x->a);
u64 b = be64_to_cpu(x->b);
- u64 _tt = gf128mul_table_lle[(b << 7) & 0xff];
+ u64 _tt = gf128mul_table_le[(b << 7) & 0xff];
r->b = cpu_to_be64((b >> 1) | (a << 63));
r->a = cpu_to_be64((a >> 1) ^ (_tt << 48));
@@ -136,7 +150,7 @@ static void gf128mul_x_bbe(be128 *r, const be128 *x)
{
u64 a = be64_to_cpu(x->a);
u64 b = be64_to_cpu(x->b);
- u64 _tt = gf128mul_table_bbe[a >> 63];
+ u64 _tt = gf128mul_table_be[a >> 63];
r->a = cpu_to_be64((a << 1) | (b >> 63));
r->b = cpu_to_be64((b << 1) ^ _tt);
@@ -146,7 +160,7 @@ void gf128mul_x_ble(be128 *r, const be128 *x)
{
u64 a = le64_to_cpu(x->a);
u64 b = le64_to_cpu(x->b);
- u64 _tt = gf128mul_table_bbe[b >> 63];
+ u64 _tt = gf128mul_table_be[b >> 63];
r->a = cpu_to_le64((a << 1) ^ _tt);
r->b = cpu_to_le64((b << 1) | (a >> 63));
@@ -157,7 +171,7 @@ static void gf128mul_x8_lle(be128 *x)
{
u64 a = be64_to_cpu(x->a);
u64 b = be64_to_cpu(x->b);
- u64 _tt = gf128mul_table_lle[b & 0xff];
+ u64 _tt = gf128mul_table_le[b & 0xff];
x->b = cpu_to_be64((b >> 8) | (a << 56));
x->a = cpu_to_be64((a >> 8) ^ (_tt << 48));
@@ -167,7 +181,7 @@ static void gf128mul_x8_bbe(be128 *x)
{
u64 a = be64_to_cpu(x->a);
u64 b = be64_to_cpu(x->b);
- u64 _tt = gf128mul_table_bbe[a >> 56];
+ u64 _tt = gf128mul_table_be[a >> 56];
x->a = cpu_to_be64((a << 8) | (b >> 56));
x->b = cpu_to_be64((b << 8) ^ _tt);
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related
* [RFC][PATCH 3/7] crypto: gf128mul - Add ble multiplication functions
From: Alex Cope @ 2016-11-14 21:01 UTC (permalink / raw)
To: linux-crypto; +Cc: mhalcrow, edknapp, Alex Cope, Eric Biggers
In-Reply-To: <1479157277-10251-1-git-send-email-alexcope@google.com>
Adding ble multiplication to GF128mul, and fixing up comments.
The ble multiplication functions multiply GF(2^128) elements in the
ble format. This format is preferable because the bits within each
byte map to polynomial coefficients in the natural order (lowest order
bit = coefficient of lowest degree polynomial term), and the bytes are
stored in little endian order which matches the endianness of most
modern CPUs.
These new functions will be used by the HEH algorithm.
Signed-off-by: Alex Cope <alexcope@google.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
crypto/gf128mul.c | 99 ++++++++++++++++++++++++++++++++++++++++++++---
include/crypto/gf128mul.h | 45 +++++++++++----------
2 files changed, 117 insertions(+), 27 deletions(-)
diff --git a/crypto/gf128mul.c b/crypto/gf128mul.c
index 8b65b1e..f3d9f6d 100644
--- a/crypto/gf128mul.c
+++ b/crypto/gf128mul.c
@@ -44,7 +44,7 @@
---------------------------------------------------------------------------
Issue 31/01/2006
- This file provides fast multiplication in GF(128) as required by several
+ This file provides fast multiplication in GF(2^128) as required by several
cryptographic authentication modes
*/
@@ -130,9 +130,10 @@
static const u16 gf128mul_table_le[256] = gf128mul_dat(xda_le);
static const u16 gf128mul_table_be[256] = gf128mul_dat(xda_be);
-/* These functions multiply a field element by x, by x^4 and by x^8
- * in the polynomial field representation. It uses 32-bit word operations
- * to gain speed but compensates for machine endianess and hence works
+/*
+ * The following functions multiply a field element by x or by x^8 in
+ * the polynomial field representation. They use 64-bit word operations
+ * to gain speed but compensate for machine endianness and hence work
* correctly on both styles of machine.
*/
@@ -187,6 +188,16 @@ static void gf128mul_x8_bbe(be128 *x)
x->b = cpu_to_be64((b << 8) ^ _tt);
}
+static void gf128mul_x8_ble(be128 *x)
+{
+ u64 a = le64_to_cpu(x->b);
+ u64 b = le64_to_cpu(x->a);
+ u64 _tt = gf128mul_table_be[a >> 56];
+
+ x->b = cpu_to_le64((a << 8) | (b >> 56));
+ x->a = cpu_to_le64((b << 8) ^ _tt);
+}
+
void gf128mul_lle(be128 *r, const be128 *b)
{
be128 p[8];
@@ -263,9 +274,48 @@ void gf128mul_bbe(be128 *r, const be128 *b)
}
EXPORT_SYMBOL(gf128mul_bbe);
+void gf128mul_ble(be128 *r, const be128 *b)
+{
+ be128 p[8];
+ int i;
+
+ p[0] = *r;
+ for (i = 0; i < 7; ++i)
+ gf128mul_x_ble((be128 *)&p[i + 1], (be128 *)&p[i]);
+
+ memset(r, 0, sizeof(*r));
+ for (i = 0;;) {
+ u8 ch = ((u8 *)b)[15 - i];
+
+ if (ch & 0x80)
+ be128_xor(r, r, &p[7]);
+ if (ch & 0x40)
+ be128_xor(r, r, &p[6]);
+ if (ch & 0x20)
+ be128_xor(r, r, &p[5]);
+ if (ch & 0x10)
+ be128_xor(r, r, &p[4]);
+ if (ch & 0x08)
+ be128_xor(r, r, &p[3]);
+ if (ch & 0x04)
+ be128_xor(r, r, &p[2]);
+ if (ch & 0x02)
+ be128_xor(r, r, &p[1]);
+ if (ch & 0x01)
+ be128_xor(r, r, &p[0]);
+
+ if (++i >= 16)
+ break;
+
+ gf128mul_x8_ble(r);
+ }
+}
+EXPORT_SYMBOL(gf128mul_ble);
+
+
/* This version uses 64k bytes of table space.
A 16 byte buffer has to be multiplied by a 16 byte key
- value in GF(128). If we consider a GF(128) value in
+ value in GF(2^128). If we consider a GF(2^128) value in
the buffer's lowest byte, we can construct a table of
the 256 16 byte values that result from the 256 values
of this byte. This requires 4096 bytes. But we also
@@ -399,7 +449,7 @@ EXPORT_SYMBOL(gf128mul_64k_bbe);
/* This version uses 4k bytes of table space.
A 16 byte buffer has to be multiplied by a 16 byte key
- value in GF(128). If we consider a GF(128) value in a
+ value in GF(2^128). If we consider a GF(2^128) value in a
single byte, we can construct a table of the 256 16 byte
values that result from the 256 values of this byte.
This requires 4096 bytes. If we take the highest byte in
@@ -457,6 +507,28 @@ struct gf128mul_4k *gf128mul_init_4k_bbe(const be128 *g)
}
EXPORT_SYMBOL(gf128mul_init_4k_bbe);
+struct gf128mul_4k *gf128mul_init_4k_ble(const be128 *g)
+{
+ struct gf128mul_4k *t;
+ int j, k;
+
+ t = kzalloc(sizeof(*t), GFP_KERNEL);
+ if (!t)
+ goto out;
+
+ t->t[1] = *g;
+ for (j = 1; j <= 64; j <<= 1)
+ gf128mul_x_ble(&t->t[j + j], &t->t[j]);
+
+ for (j = 2; j < 256; j += j)
+ for (k = 1; k < j; ++k)
+ be128_xor(&t->t[j + k], &t->t[j], &t->t[k]);
+
+out:
+ return t;
+}
+EXPORT_SYMBOL(gf128mul_init_4k_ble);
+
void gf128mul_4k_lle(be128 *a, struct gf128mul_4k *t)
{
u8 *ap = (u8 *)a;
@@ -487,5 +559,20 @@ void gf128mul_4k_bbe(be128 *a, struct gf128mul_4k *t)
}
EXPORT_SYMBOL(gf128mul_4k_bbe);
+void gf128mul_4k_ble(be128 *a, struct gf128mul_4k *t)
+{
+ u8 *ap = (u8 *)a;
+ be128 r[1];
+ int i = 15;
+
+ *r = t->t[ap[15]];
+ while (i--) {
+ gf128mul_x8_ble(r);
+ be128_xor(r, r, &t->t[ap[i]]);
+ }
+ *a = *r;
+}
+EXPORT_SYMBOL(gf128mul_4k_ble);
+
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Functions for multiplying elements of GF(2^128)");
diff --git a/include/crypto/gf128mul.h b/include/crypto/gf128mul.h
index 7217fe6..230760a 100644
--- a/include/crypto/gf128mul.h
+++ b/include/crypto/gf128mul.h
@@ -43,7 +43,7 @@
---------------------------------------------------------------------------
Issue Date: 31/01/2006
- An implementation of field multiplication in Galois Field GF(128)
+ An implementation of field multiplication in Galois Field GF(2^128)
*/
#ifndef _CRYPTO_GF128MUL_H
@@ -65,7 +65,7 @@
* are left and the lsb's are right. char b[16] is an array and b[0] is
* the first octet.
*
- * 80000000 00000000 00000000 00000000 .... 00000000 00000000 00000000
+ * 10000000 00000000 00000000 00000000 .... 00000000 00000000 00000000
* b[0] b[1] b[2] b[3] b[13] b[14] b[15]
*
* Every bit is a coefficient of some power of X. We can store the bits
@@ -99,21 +99,21 @@
*
* bbe on a little endian machine u32 x[4]:
*
- * MS x[0] LS MS x[1] LS
+ * MS x[0] LS MS x[1] LS
* ms ls ms ls ms ls ms ls ms ls ms ls ms ls ms ls
* 103..96 111.104 119.112 127.120 71...64 79...72 87...80 95...88
*
- * MS x[2] LS MS x[3] LS
+ * MS x[2] LS MS x[3] LS
* ms ls ms ls ms ls ms ls ms ls ms ls ms ls ms ls
* 39...32 47...40 55...48 63...56 07...00 15...08 23...16 31...24
*
* ble on a little endian machine
*
- * MS x[0] LS MS x[1] LS
+ * MS x[0] LS MS x[1] LS
* ms ls ms ls ms ls ms ls ms ls ms ls ms ls ms ls
* 31...24 23...16 15...08 07...00 63...56 55...48 47...40 39...32
*
- * MS x[2] LS MS x[3] LS
+ * MS x[2] LS MS x[3] LS
* ms ls ms ls ms ls ms ls ms ls ms ls ms ls ms ls
* 95...88 87...80 79...72 71...64 127.120 199.112 111.104 103..96
*
@@ -127,7 +127,7 @@
* machines this will automatically aligned to wordsize and on a 64-bit
* machine also.
*/
-/* Multiply a GF128 field element by x. Field elements are held in arrays
+/* Multiply a GF128 field element by x. Field elements are held in arrays
of bytes in which field bits 8n..8n + 7 are held in byte[n], with lower
indexed bits placed in the more numerically significant bit positions
within bytes.
@@ -135,45 +135,47 @@
On little endian machines the bit indexes translate into the bit
positions within four 32-bit words in the following way
- MS x[0] LS MS x[1] LS
+ MS x[0] LS MS x[1] LS
ms ls ms ls ms ls ms ls ms ls ms ls ms ls ms ls
24...31 16...23 08...15 00...07 56...63 48...55 40...47 32...39
- MS x[2] LS MS x[3] LS
+ MS x[2] LS MS x[3] LS
ms ls ms ls ms ls ms ls ms ls ms ls ms ls ms ls
88...95 80...87 72...79 64...71 120.127 112.119 104.111 96..103
On big endian machines the bit indexes translate into the bit
positions within four 32-bit words in the following way
- MS x[0] LS MS x[1] LS
+ MS x[0] LS MS x[1] LS
ms ls ms ls ms ls ms ls ms ls ms ls ms ls ms ls
00...07 08...15 16...23 24...31 32...39 40...47 48...55 56...63
- MS x[2] LS MS x[3] LS
+ MS x[2] LS MS x[3] LS
ms ls ms ls ms ls ms ls ms ls ms ls ms ls ms ls
64...71 72...79 80...87 88...95 96..103 104.111 112.119 120.127
*/
-/* A slow generic version of gf_mul, implemented for lle and bbe
- * It multiplies a and b and puts the result in a */
+/* A slow generic version of gf_mul, implemented for lle, bbe, and ble.
+ * It multiplies a and b and puts the result in a
+ */
void gf128mul_lle(be128 *a, const be128 *b);
-
void gf128mul_bbe(be128 *a, const be128 *b);
+void gf128mul_ble(be128 *a, const be128 *b);
-/* multiply by x in ble format, needed by XTS */
+/* multiply by x in ble format, needed by XTS and HEH */
void gf128mul_x_ble(be128 *a, const be128 *b);
/* 4k table optimization */
-
struct gf128mul_4k {
be128 t[256];
};
struct gf128mul_4k *gf128mul_init_4k_lle(const be128 *g);
struct gf128mul_4k *gf128mul_init_4k_bbe(const be128 *g);
+struct gf128mul_4k *gf128mul_init_4k_ble(const be128 *g);
void gf128mul_4k_lle(be128 *a, struct gf128mul_4k *t);
void gf128mul_4k_bbe(be128 *a, struct gf128mul_4k *t);
+void gf128mul_4k_ble(be128 *a, struct gf128mul_4k *t);
static inline void gf128mul_free_4k(struct gf128mul_4k *t)
{
@@ -181,16 +183,17 @@ static inline void gf128mul_free_4k(struct gf128mul_4k *t)
}
-/* 64k table optimization, implemented for lle and bbe */
+/* 64k table optimization, implemented for lle, ble, and bbe */
struct gf128mul_64k {
struct gf128mul_4k *t[16];
};
-/* first initialize with the constant factor with which you
- * want to multiply and then call gf128_64k_lle with the other
- * factor in the first argument, the table in the second and a
- * scratch register in the third. Afterwards *a = *r. */
+/* First initialize with the constant factor with which you
+ * want to multiply and then call gf128mul_64k_bbe with the other
+ * factor in the first argument, and the table in the second.
+ * Afterwards, the result is stored in *a.
+ */
struct gf128mul_64k *gf128mul_init_64k_lle(const be128 *g);
struct gf128mul_64k *gf128mul_init_64k_bbe(const be128 *g);
void gf128mul_free_64k(struct gf128mul_64k *t);
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related
* [PATCH 1/2 nft] tests: py: add some testcases for log flags
From: Pablo Neira Ayuso @ 2016-11-14 21:01 UTC (permalink / raw)
To: netfilter-devel
Remove null and zero flags from tests, to reduce the noise when running
tests.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
tests/py/any/log.t.payload | 26 +++++++++++++-------------
tests/py/ip/icmp.t.payload.ip | 2 +-
tests/py/ip6/icmpv6.t.payload.ip6 | 6 +++---
3 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/tests/py/any/log.t.payload b/tests/py/any/log.t.payload
index 689668b6ed68..dc885b4b3e47 100644
--- a/tests/py/any/log.t.payload
+++ b/tests/py/any/log.t.payload
@@ -1,52 +1,52 @@
# log
ip test-ip4 output
- [ log prefix (null) ]
+ [ log ]
# log level emerg
ip test-ip4 output
- [ log prefix (null) level 0 flags 0]
+ [ log level 0 ]
# log level alert
ip test-ip4 output
- [ log prefix (null) level 1 flags 0]
+ [ log level 1 ]
# log level crit
ip test-ip4 output
- [ log prefix (null) level 2 flags 0]
+ [ log level 2 ]
# log level err
ip test-ip4 output
- [ log prefix (null) level 3 flags 0]
+ [ log level 3 ]
# log level warn
ip test-ip4 output
- [ log prefix (null) level 4 flags 0]
+ [ log level 4 ]
# log level notice
ip test-ip4 output
- [ log prefix (null) level 5 flags 0]
+ [ log level 5 ]
# log level info
ip test-ip4 output
- [ log prefix (null) level 6 flags 0]
+ [ log level 6 ]
# log level debug
ip test-ip4 output
- [ log prefix (null) level 7 flags 0]
+ [ log level 7 ]
# log prefix aaaaa-aaaaaa group 2 snaplen 33
ip test-ip4 output
- [ log prefix aaaaa-aaaaaa group 2 snaplen 33 qthreshold 0]
+ [ log prefix aaaaa-aaaaaa group 2 snaplen 33 qthreshold 0 ]
# log group 2 queue-threshold 2
ip test-ip4 output
- [ log prefix (null) group 2 snaplen 0 qthreshold 2]
+ [ log group 2 snaplen 0 qthreshold 2 ]
# log group 2 snaplen 33
ip test-ip4 output
- [ log prefix (null) group 2 snaplen 33 qthreshold 0]
+ [ log group 2 snaplen 33 qthreshold 0 ]
# log group 2 prefix \"nft-test: \"
ip test-ip4 output
- [ log prefix nft-test: group 2 snaplen 0 qthreshold 0]
+ [ log prefix nft-test: group 2 snaplen 0 qthreshold 0 ]
diff --git a/tests/py/ip/icmp.t.payload.ip b/tests/py/ip/icmp.t.payload.ip
index c7df75db1f70..b740ff80eff6 100644
--- a/tests/py/ip/icmp.t.payload.ip
+++ b/tests/py/ip/icmp.t.payload.ip
@@ -225,7 +225,7 @@ ip test-ip4 input
[ cmp eq reg 1 0x00000001 ]
[ payload load 2b @ transport header + 4 => reg 1 ]
[ cmp eq reg 1 0x0000dd04 ]
- [ log prefix (null) ]
+ [ log ]
# icmp id 22
ip test-ip4 input
diff --git a/tests/py/ip6/icmpv6.t.payload.ip6 b/tests/py/ip6/icmpv6.t.payload.ip6
index 822db2d5a2c5..a00f392e9bb7 100644
--- a/tests/py/ip6/icmpv6.t.payload.ip6
+++ b/tests/py/ip6/icmpv6.t.payload.ip6
@@ -193,7 +193,7 @@ ip6 test-ip6 input
[ cmp eq reg 1 0x0000003a ]
[ payload load 2b @ transport header + 2 => reg 1 ]
[ cmp eq reg 1 0x0000ae08 ]
- [ log prefix (null) ]
+ [ log ]
# icmpv6 checksum != 2222 log
ip6 test-ip6 input
@@ -201,7 +201,7 @@ ip6 test-ip6 input
[ cmp eq reg 1 0x0000003a ]
[ payload load 2b @ transport header + 2 => reg 1 ]
[ cmp neq reg 1 0x0000ae08 ]
- [ log prefix (null) ]
+ [ log ]
# icmpv6 checksum 222-226
ip6 test-ip6 input
@@ -217,7 +217,7 @@ ip6 test-ip6 input
[ cmp eq reg 1 0x0000003a ]
[ payload load 2b @ transport header + 2 => reg 1 ]
[ cmp neq reg 1 0x0000ae08 ]
- [ log prefix (null) ]
+ [ log ]
# icmpv6 checksum { 222, 226}
__set%d test-ip6 3
--
2.1.4
^ permalink raw reply related
* [RFC][PATCH 4/7] crypto: shash - Add crypto_grab_shash() and crypto_spawn_shash_alg()
From: Alex Cope @ 2016-11-14 21:01 UTC (permalink / raw)
To: linux-crypto; +Cc: mhalcrow, edknapp, Alex Cope, Eric Biggers
In-Reply-To: <1479157277-10251-1-git-send-email-alexcope@google.com>
Analogous to crypto_grab_skcipher() and crypto_spawn_skcipher_alg(),
these are useful for algorithms that need to use a shash sub-algorithm,
possibly in addition to other sub-algorithms.
Signed-off-by: Alex Cope <alexcope@google.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
crypto/shash.c | 8 ++++++++
include/crypto/internal/hash.h | 8 ++++++++
2 files changed, 16 insertions(+)
diff --git a/crypto/shash.c b/crypto/shash.c
index a051541..55a5535 100644
--- a/crypto/shash.c
+++ b/crypto/shash.c
@@ -536,6 +536,14 @@ void shash_free_instance(struct crypto_instance *inst)
}
EXPORT_SYMBOL_GPL(shash_free_instance);
+int crypto_grab_shash(struct crypto_shash_spawn *spawn,
+ const char *name, u32 type, u32 mask)
+{
+ spawn->base.frontend = &crypto_shash_type;
+ return crypto_grab_spawn(&spawn->base, name, type, mask);
+}
+EXPORT_SYMBOL_GPL(crypto_grab_shash);
+
int crypto_init_shash_spawn(struct crypto_shash_spawn *spawn,
struct shash_alg *alg,
struct crypto_instance *inst)
diff --git a/include/crypto/internal/hash.h b/include/crypto/internal/hash.h
index 1d4f365..54e4425 100644
--- a/include/crypto/internal/hash.h
+++ b/include/crypto/internal/hash.h
@@ -99,6 +99,8 @@ int shash_register_instance(struct crypto_template *tmpl,
struct shash_instance *inst);
void shash_free_instance(struct crypto_instance *inst);
+int crypto_grab_shash(struct crypto_shash_spawn *spawn,
+ const char *name, u32 type, u32 mask);
int crypto_init_shash_spawn(struct crypto_shash_spawn *spawn,
struct shash_alg *alg,
struct crypto_instance *inst);
@@ -108,6 +110,12 @@ static inline void crypto_drop_shash(struct crypto_shash_spawn *spawn)
crypto_drop_spawn(&spawn->base);
}
+static inline struct shash_alg *crypto_spawn_shash_alg(
+ struct crypto_shash_spawn *spawn)
+{
+ return container_of(spawn->base.alg, struct shash_alg, base);
+}
+
struct shash_alg *shash_attr_alg(struct rtattr *rta, u32 type, u32 mask);
int shash_ahash_update(struct ahash_request *req, struct shash_desc *desc);
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related
* [RFC][PATCH 5/7] crypto: heh - Add Hash Encrypt Hash(HEH) algorithm
From: Alex Cope @ 2016-11-14 21:01 UTC (permalink / raw)
To: linux-crypto; +Cc: mhalcrow, edknapp, Alex Cope, Eric Biggers
In-Reply-To: <1479157277-10251-1-git-send-email-alexcope@google.com>
Hash Encrypt Hash (HEH) is a proposed block cipher mode of operation
which extends the strong pseudo-random permutation property of block
ciphers (e.g. AES) to arbitrary length input strings. This provides a
stronger notion of security than existing block cipher modes of
operation (e.g. CBC, CTR, XTS), though it is less performant. It uses
two keyed invertible hash functions with a layer of ECB encryption
applied in-between.
This patch adds HEH as a skcipher. Support for HEH as an AEAD is not
yet implemented.
HEH will use existing accelerated ecb(block_cipher) implementation for
the encrypt step if available. Accelerated versions of the hash step
are planned but not yet implemented.
HEH will be used for filename encryption in ext4 and f2fs.
The algorithm is currently specified by the following Internet Draft:
https://tools.ietf.org/html/draft-cope-heh-00
Signed-off-by: Alex Cope <alexcope@google.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
crypto/Kconfig | 17 ++
crypto/Makefile | 1 +
crypto/heh.c | 814 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 832 insertions(+)
create mode 100644 crypto/heh.c
diff --git a/crypto/Kconfig b/crypto/Kconfig
index 1db2a19..78b0e93 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -316,6 +316,23 @@ config CRYPTO_CBC
CBC: Cipher Block Chaining mode
This block cipher algorithm is required for IPSec.
+config CRYPTO_HEH
+ tristate "HEH support"
+ select CRYPTO_CMAC
+ select CRYPTO_ECB
+ select CRYPTO_GF128MUL
+ select CRYPTO_MANAGER
+ help
+ HEH: Hash Encrypt Hash mode
+ HEH is a proposed block cipher mode of operation which extends the
+ strong pseudo-random permutation (SPRP) property of block ciphers to
+ arbitrary-length input strings. This provides a stronger notion of
+ security than existing block cipher modes of operation (e.g. CBC, CTR,
+ XTS), though it is less performant. Applications include disk
+ encryption and encryption of file names and contents. Currently, this
+ implementation only provides a symmetric cipher interface, so it can't
+ yet be used as an AEAD.
+
config CRYPTO_CTR
tristate "CTR support"
select CRYPTO_BLKCIPHER
diff --git a/crypto/Makefile b/crypto/Makefile
index 82ffeee..1458d3f 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -78,6 +78,7 @@ obj-$(CONFIG_CRYPTO_TGR192) += tgr192.o
obj-$(CONFIG_CRYPTO_GF128MUL) += gf128mul.o
obj-$(CONFIG_CRYPTO_ECB) += ecb.o
obj-$(CONFIG_CRYPTO_CBC) += cbc.o
+obj-$(CONFIG_CRYPTO_HEH) += heh.o
obj-$(CONFIG_CRYPTO_PCBC) += pcbc.o
obj-$(CONFIG_CRYPTO_CTS) += cts.o
obj-$(CONFIG_CRYPTO_LRW) += lrw.o
diff --git a/crypto/heh.c b/crypto/heh.c
new file mode 100644
index 0000000..efd49cc
--- /dev/null
+++ b/crypto/heh.c
@@ -0,0 +1,814 @@
+/*
+ * HEH: Hash Encrypt Hash mode
+ *
+ * Copyright (c) 2016 Google Inc.
+ *
+ * Authors:
+ * Alex Cope <alexcope@google.com>
+ * Eric Biggers <ebiggers@google.com>
+ */
+
+/*
+ * Hash Encrypt Hash (HEH) is a proposed block cipher mode of operation which
+ * extends the strong pseudo-random permutation (SPRP) property of block ciphers
+ * (e.g. AES) to arbitrary length input strings. It uses two keyed invertible
+ * hash functions with a layer of ECB encryption applied in-between. The
+ * algorithm is specified by the following Internet Draft:
+ *
+ * https://tools.ietf.org/html/draft-cope-heh-00
+ *
+ * Although HEH can be used as either a regular symmetric cipher or as an AEAD,
+ * currently this module only provides it as a symmetric cipher (skcipher).
+ * Additionally, only 48-byte keys and 16-byte nonces are supported.
+ */
+
+#include <crypto/gf128mul.h>
+#include <crypto/internal/hash.h>
+#include <crypto/internal/skcipher.h>
+#include <crypto/scatterwalk.h>
+#include <crypto/skcipher.h>
+#include "internal.h"
+
+/*
+ * The block size is the size of GF(2^128) elements and also the required block
+ * size of the underlying block cipher.
+ */
+#define HEH_BLOCK_SIZE 16
+
+/* Required key size in bytes */
+#define HEH_KEY_SIZE 48
+#define HEH_PRF_KEY_OFFSET 16
+#define HEH_BLK_KEY_OFFSET 32
+
+/*
+ * Macro to get the offset in bytes to the last full block
+ * (or equivalently the length of all full blocks excluding the last)
+ */
+#define HEH_TAIL_OFFSET(len) (((len) - HEH_BLOCK_SIZE) & ~(HEH_BLOCK_SIZE - 1))
+
+struct heh_instance_ctx {
+ struct crypto_shash_spawn cmac;
+ struct crypto_skcipher_spawn ecb;
+};
+
+struct heh_tfm_ctx {
+ struct crypto_shash *cmac;
+ struct crypto_skcipher *ecb;
+ struct gf128mul_4k *tau_key;
+};
+
+struct heh_cmac_data {
+ u8 nonce[HEH_BLOCK_SIZE];
+ __le32 nonce_length;
+ __le32 aad_length;
+ __le32 message_length;
+ __le32 padding;
+};
+
+struct heh_req_ctx { /* aligned to alignmask */
+ be128 beta1_key;
+ be128 beta2_key;
+ union {
+ struct {
+ struct heh_cmac_data data;
+ struct shash_desc desc;
+ /* + crypto_shash_descsize(cmac) */
+ } cmac;
+ struct {
+ u8 tail[2 * HEH_BLOCK_SIZE];
+ int (*crypt)(struct skcipher_request *);
+ struct scatterlist tmp_sgl[2];
+ struct skcipher_request req;
+ /* + crypto_skcipher_reqsize(ecb) */
+ } ecb;
+ } u;
+};
+
+static inline struct heh_req_ctx *heh_req_ctx(struct skcipher_request *req)
+{
+ unsigned int alignmask = crypto_skcipher_alignmask(
+ crypto_skcipher_reqtfm(req));
+
+ return (void *)PTR_ALIGN((u8 *)skcipher_request_ctx(req),
+ alignmask + 1);
+}
+
+static inline void async_done(struct crypto_async_request *areq, int err,
+ int (*next_step)(struct skcipher_request *, u32))
+{
+ struct skcipher_request *req = areq->data;
+
+ if (err)
+ goto out;
+
+ err = next_step(req, req->base.flags & ~CRYPTO_TFM_REQ_MAY_SLEEP);
+ if (err == -EINPROGRESS ||
+ (err == -EBUSY && (req->base.flags & CRYPTO_TFM_REQ_MAY_BACKLOG)))
+ return;
+out:
+ skcipher_request_complete(req, err);
+}
+
+/*
+ * Generate the per-message "beta" keys used by the hashing layers of HEH. The
+ * first beta key is the CMAC of the nonce, the additional authenticated data
+ * (AAD), and the lengths in bytes of the nonce, AAD, and message. The nonce
+ * and AAD are each zero-padded to the next 16-byte block boundary, and the
+ * lengths are serialized as 4-byte little endian integers and zero-padded to
+ * the next 16-byte block boundary. The second beta key is the first one
+ * interpreted as an element in GF(2^128) and multiplied by x.
+ *
+ * Note that because the nonce and AAD may, in general, be variable-length, the
+ * key generation must be done by a pseudo-random function (PRF) on
+ * variable-length inputs. CBC-MAC does not satisfy this, as it is only a PRF
+ * on fixed-length inputs. CMAC remedies this flaw. Including the lengths of
+ * the nonce, AAD, and message is also critical to avoid collisions.
+ *
+ * That being said, this implementation does not yet operate as an AEAD and
+ * therefore there is never any AAD, nor are variable-length nonces supported.
+ */
+static int generate_betas(struct skcipher_request *req,
+ be128 *beta1_key, be128 *beta2_key)
+{
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
+ struct heh_tfm_ctx *ctx = crypto_skcipher_ctx(tfm);
+ struct heh_req_ctx *rctx = heh_req_ctx(req);
+ struct heh_cmac_data *data = &rctx->u.cmac.data;
+ struct shash_desc *desc = &rctx->u.cmac.desc;
+ int err;
+
+ BUILD_BUG_ON(sizeof(*data) != HEH_BLOCK_SIZE + 16);
+ memcpy(data->nonce, req->iv, HEH_BLOCK_SIZE);
+ data->nonce_length = cpu_to_le32(HEH_BLOCK_SIZE);
+ data->aad_length = cpu_to_le32(0);
+ data->message_length = cpu_to_le32(req->cryptlen);
+ data->padding = cpu_to_le32(0);
+
+ desc->tfm = ctx->cmac;
+ desc->flags = req->base.flags;
+
+ err = crypto_shash_digest(desc, (const u8 *)data, sizeof(*data),
+ (u8 *)beta1_key);
+ if (err)
+ return err;
+
+ gf128mul_x_ble(beta2_key, beta1_key);
+ return 0;
+}
+
+/*
+ * Evaluation of a polynomial over GF(2^128) using Horner's rule. The
+ * polynomial is evaluated at 'point'. The polynomial's coefficients are taken
+ * from 'coeffs_sgl' and are for terms with consecutive descending degree ending
+ * at degree 1. 'bytes_of_coeffs' is 16 times the number of terms.
+ */
+static be128 evaluate_polynomial(struct gf128mul_4k *point,
+ struct scatterlist *coeffs_sgl,
+ unsigned int bytes_of_coeffs)
+{
+ be128 value = {0};
+ struct sg_mapping_iter miter;
+ unsigned int remaining = bytes_of_coeffs;
+ unsigned int needed = 0;
+
+ sg_miter_start(&miter, coeffs_sgl, sg_nents(coeffs_sgl),
+ SG_MITER_FROM_SG | SG_MITER_ATOMIC);
+ while (remaining) {
+ be128 coeff;
+ const u8 *src;
+ unsigned int srclen;
+ u8 *dst = (u8 *)&value;
+
+ /*
+ * Note: scatterlist elements are not necessarily evenly
+ * divisible into blocks, nor are they necessarily aligned to
+ * __alignof__(be128).
+ */
+ sg_miter_next(&miter);
+
+ src = miter.addr;
+ srclen = min_t(unsigned int, miter.length, remaining);
+ remaining -= srclen;
+
+ if (needed) {
+ unsigned int n = min(srclen, needed);
+ u8 *pos = dst + (HEH_BLOCK_SIZE - needed);
+
+ needed -= n;
+ srclen -= n;
+
+ while (n--)
+ *pos++ ^= *src++;
+
+ if (!needed)
+ gf128mul_4k_ble(&value, point);
+ }
+
+ while (srclen >= HEH_BLOCK_SIZE) {
+ memcpy(&coeff, src, HEH_BLOCK_SIZE);
+ be128_xor(&value, &value, &coeff);
+ gf128mul_4k_ble(&value, point);
+ src += HEH_BLOCK_SIZE;
+ srclen -= HEH_BLOCK_SIZE;
+ }
+
+ if (srclen) {
+ needed = HEH_BLOCK_SIZE - srclen;
+ do {
+ *dst++ ^= *src++;
+ } while (--srclen);
+ }
+ }
+ sg_miter_stop(&miter);
+ return value;
+}
+
+/*
+ * Split the message into 16 byte blocks, padding out the last block, and use
+ * the blocks as coefficients in the evaluation of a polynomial over GF(2^128)
+ * at the secret point 'tau_key'. For ease of implementing the higher-level
+ * heh_hash_inv() function, the constant and degree-1 coefficients are swapped.
+ *
+ * Mathematically, compute:
+ * t^N * m_0 + ... + t^2 * m_{N-2} + t * m_N + m_{N-1}
+ *
+ * where:
+ * t is tau_key
+ * N is the number of full blocks in the message
+ * m_i is the i-th full block in the message for i = 0 to N-1 inclusive
+ * m_N is the (possibly empty) partial block of the message padded up to 16
+ * bytes with a 0x01 byte followed by 0x00 bytes
+ *
+ * Note that when the message length is a multiple of 16, m_N is composed
+ * entirely of padding, i.e. 0x0100...00.
+ */
+static be128 poly_hash(struct crypto_skcipher *tfm, struct scatterlist *sgl,
+ unsigned int len)
+{
+ struct heh_tfm_ctx *ctx = crypto_skcipher_ctx(tfm);
+ unsigned int tail_offset = HEH_TAIL_OFFSET(len);
+ unsigned int tail_len = len - tail_offset;
+ be128 hash;
+ be128 tail[2];
+
+ /* Handle all full blocks except the last */
+ hash = evaluate_polynomial(ctx->tau_key, sgl, tail_offset);
+
+ /* Handle the last full block and the partial block */
+
+ scatterwalk_map_and_copy(tail, sgl, tail_offset, tail_len, 0);
+ *((u8 *)tail + tail_len) = 0x01;
+ memset((u8 *)tail + tail_len + 1, 0, sizeof(tail) - 1 - tail_len);
+
+ be128_xor(&hash, &hash, &tail[1]);
+ gf128mul_4k_ble(&hash, ctx->tau_key);
+ be128_xor(&hash, &hash, &tail[0]);
+ return hash;
+}
+
+/*
+ * Transform all full blocks except the last.
+ * This is used by both the hash and inverse hash phases.
+ */
+static int heh_tfm_blocks(struct skcipher_request *req,
+ struct scatterlist *src_sgl,
+ struct scatterlist *dst_sgl, unsigned int len,
+ const be128 *hash, const be128 *beta_key)
+{
+ struct skcipher_walk walk;
+ be128 e = *beta_key;
+ int err;
+ unsigned int nbytes;
+
+ err = skcipher_walk_virt_init(&walk, req, false, src_sgl, dst_sgl, len);
+ while ((nbytes = walk.nbytes)) {
+ const be128 *src = (be128 *)walk.src.virt.addr;
+ be128 *dst = (be128 *)walk.dst.virt.addr;
+
+ do {
+ gf128mul_x_ble(&e, &e);
+ be128_xor(dst, src, hash);
+ be128_xor(dst, dst, &e);
+ src++;
+ dst++;
+ } while ((nbytes -= HEH_BLOCK_SIZE) >= HEH_BLOCK_SIZE);
+ err = skcipher_walk_done(&walk, nbytes);
+ }
+ return err;
+}
+
+/*
+ * The hash phase of HEH. Given a message, compute:
+ *
+ * (m_0 + H, ..., m_{N-2} + H, H, m_N) + (xb, x^2b, ..., x^{N-1}b, b, 0)
+ *
+ * where:
+ * N is the number of full blocks in the message
+ * m_i is the i-th full block in the message for i = 0 to N-1 inclusive
+ * m_N is the unpadded partial block, possibly empty
+ * H is the poly_hash() of the message, keyed by tau_key
+ * b is beta_key
+ * x is the element x in our representation of GF(2^128)
+ *
+ * Note that the partial block remains unchanged, but it does affect the result
+ * of poly_hash() and therefore the transformation of all the full blocks.
+ */
+static int heh_hash(struct skcipher_request *req, const be128 *beta_key)
+{
+ be128 hash;
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
+ unsigned int tail_offset = HEH_TAIL_OFFSET(req->cryptlen);
+ unsigned int partial_len = req->cryptlen % HEH_BLOCK_SIZE;
+ int err;
+
+ /* poly_hash() the full message including the partial block */
+ hash = poly_hash(tfm, req->src, req->cryptlen);
+
+ /* Transform all full blocks except the last */
+ err = heh_tfm_blocks(req, req->src, req->dst, tail_offset, &hash,
+ beta_key);
+ if (err)
+ return err;
+
+ /* Set the last full block to hash XOR beta_key */
+ be128_xor(&hash, &hash, beta_key);
+ scatterwalk_map_and_copy(&hash, req->dst, tail_offset, HEH_BLOCK_SIZE,
+ 1);
+
+ /* Copy the partial block if needed */
+ if (partial_len != 0 && req->src != req->dst) {
+ unsigned int offs = tail_offset + HEH_BLOCK_SIZE;
+
+ scatterwalk_map_and_copy(&hash, req->src, offs, partial_len, 0);
+ scatterwalk_map_and_copy(&hash, req->dst, offs, partial_len, 1);
+ }
+ return 0;
+}
+
+/*
+ * The inverse hash phase of HEH. This undoes the result of heh_hash().
+ */
+static int heh_hash_inv(struct skcipher_request *req, const be128 *beta_key)
+{
+ be128 hash;
+ be128 tmp;
+ struct scatterlist tmp_sgl[2];
+ struct scatterlist *tail_sgl;
+ unsigned int len = req->cryptlen;
+ unsigned int tail_offset = HEH_TAIL_OFFSET(len);
+ struct scatterlist *sgl = req->dst;
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
+ int err;
+
+ /*
+ * The last full block was computed as hash XOR beta_key, so XOR it with
+ * beta_key to recover hash.
+ */
+ tail_sgl = scatterwalk_ffwd(tmp_sgl, sgl, tail_offset);
+ scatterwalk_map_and_copy(&hash, tail_sgl, 0, HEH_BLOCK_SIZE, 0);
+ be128_xor(&hash, &hash, beta_key);
+
+ /* Transform all full blocks except the last */
+ err = heh_tfm_blocks(req, sgl, sgl, tail_offset, &hash, beta_key);
+ if (err)
+ return err;
+
+ /*
+ * Recover the last full block. We know 'hash', i.e. the poly_hash() of
+ * the the original message. The last full block was the constant term
+ * of the polynomial. To recover the last full block, temporarily zero
+ * it, compute the poly_hash(), and take the difference from 'hash'.
+ */
+ memset(&tmp, 0, sizeof(tmp));
+ scatterwalk_map_and_copy(&tmp, tail_sgl, 0, HEH_BLOCK_SIZE, 1);
+ tmp = poly_hash(tfm, sgl, len);
+ be128_xor(&tmp, &tmp, &hash);
+ scatterwalk_map_and_copy(&tmp, tail_sgl, 0, HEH_BLOCK_SIZE, 1);
+ return 0;
+}
+
+static int heh_hash_inv_step(struct skcipher_request *req, u32 flags)
+{
+ struct heh_req_ctx *rctx = heh_req_ctx(req);
+
+ return heh_hash_inv(req, &rctx->beta2_key);
+}
+
+static void heh_ecb_tail_done(struct crypto_async_request *areq, int err)
+{
+ return async_done(areq, err, heh_hash_inv_step);
+}
+
+static int heh_ecb_tail(struct skcipher_request *req, u32 flags)
+{
+ struct heh_req_ctx *rctx = heh_req_ctx(req);
+ unsigned int partial_len = req->cryptlen % HEH_BLOCK_SIZE;
+ struct scatterlist *tail_sgl;
+ int err;
+
+ if (partial_len == 0) /* no partial block? */
+ goto next_step;
+
+ /*
+ * Extract the already encrypted/decrypted last full block and the not
+ * yet encrypted/decrypted partial block. The former will be used as a
+ * pad to encrypt/decrypt the partial block.
+ */
+ tail_sgl = scatterwalk_ffwd(rctx->u.ecb.tmp_sgl, req->dst,
+ HEH_TAIL_OFFSET(req->cryptlen));
+ scatterwalk_map_and_copy(rctx->u.ecb.tail, tail_sgl, 0,
+ HEH_BLOCK_SIZE + partial_len, 0);
+
+ /* Encrypt/decrypt the partial block using the pad */
+ crypto_xor(&rctx->u.ecb.tail[HEH_BLOCK_SIZE], rctx->u.ecb.tail,
+ partial_len);
+ scatterwalk_map_and_copy(&rctx->u.ecb.tail[HEH_BLOCK_SIZE], tail_sgl,
+ HEH_BLOCK_SIZE, partial_len, 1);
+
+ /* Encrypt/decrypt the last full block again */
+ skcipher_request_set_callback(&rctx->u.ecb.req, flags,
+ heh_ecb_tail_done, req);
+ skcipher_request_set_crypt(&rctx->u.ecb.req, tail_sgl, tail_sgl,
+ HEH_BLOCK_SIZE, NULL);
+ err = rctx->u.ecb.crypt(&rctx->u.ecb.req);
+ if (err)
+ return err;
+next_step:
+ return heh_hash_inv_step(req, flags);
+}
+
+static void heh_ecb_full_done(struct crypto_async_request *areq, int err)
+{
+ return async_done(areq, err, heh_ecb_tail);
+}
+
+/*
+ * The encrypt phase of HEH. This uses ECB encryption, with special handling
+ * for the partial block at the end if any. The source data is already in
+ * req->dst, so the encryption happens in-place.
+ *
+ * After the encrypt phase we continue on to the inverse hash phase. The
+ * functions calls are chained to support asynchronous ECB algorithms.
+ */
+static int heh_ecb(struct skcipher_request *req, bool decrypt)
+{
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
+ struct heh_tfm_ctx *ctx = crypto_skcipher_ctx(tfm);
+ struct heh_req_ctx *rctx = heh_req_ctx(req);
+ struct skcipher_request *ecb_req = &rctx->u.ecb.req;
+ unsigned int full_len = HEH_TAIL_OFFSET(req->cryptlen) + HEH_BLOCK_SIZE;
+
+ rctx->u.ecb.crypt = decrypt ? crypto_skcipher_decrypt :
+ crypto_skcipher_encrypt;
+
+ /* Encrypt/decrypt all full blocks */
+ skcipher_request_set_tfm(ecb_req, ctx->ecb);
+ skcipher_request_set_callback(ecb_req, req->base.flags,
+ heh_ecb_full_done, req);
+ skcipher_request_set_crypt(ecb_req, req->dst, req->dst, full_len, NULL);
+ return rctx->u.ecb.crypt(ecb_req) ?: heh_ecb_tail(req, req->base.flags);
+}
+
+static int heh_crypt(struct skcipher_request *req, bool decrypt)
+{
+ struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
+ struct heh_tfm_ctx *ctx = crypto_skcipher_ctx(tfm);
+ struct heh_req_ctx *rctx = heh_req_ctx(req);
+ int err;
+
+ /* Inputs must be at least one full block */
+ if (req->cryptlen < HEH_BLOCK_SIZE)
+ return -EINVAL;
+
+ /* Key must have been set */
+ if (!ctx->tau_key)
+ return -ENOKEY;
+
+ err = generate_betas(req, &rctx->beta1_key, &rctx->beta2_key);
+ if (err)
+ return err;
+
+ if (decrypt)
+ swap(rctx->beta1_key, rctx->beta2_key);
+
+ err = heh_hash(req, &rctx->beta1_key);
+ if (err)
+ return err;
+
+ return heh_ecb(req, decrypt);
+}
+
+static int heh_encrypt(struct skcipher_request *req)
+{
+ return heh_crypt(req, false);
+}
+
+static int heh_decrypt(struct skcipher_request *req)
+{
+ return heh_crypt(req, true);
+}
+
+static int heh_setkey(struct crypto_skcipher *parent, const u8 *key,
+ unsigned int keylen)
+{
+ struct heh_tfm_ctx *ctx = crypto_skcipher_ctx(parent);
+ struct crypto_shash *cmac = ctx->cmac;
+ struct crypto_skcipher *ecb = ctx->ecb;
+ const u8 *prf_key, *blk_key;
+ int err;
+
+ if (keylen != HEH_KEY_SIZE) {
+ crypto_skcipher_set_flags(parent, CRYPTO_TFM_RES_BAD_KEY_LEN);
+ return -EINVAL;
+ }
+
+ prf_key = key + HEH_PRF_KEY_OFFSET;
+ blk_key = key + HEH_BLK_KEY_OFFSET;
+
+ /* tau_key */
+ if (ctx->tau_key)
+ gf128mul_free_4k(ctx->tau_key);
+ ctx->tau_key = gf128mul_init_4k_ble((const be128 *)key);
+ if (!ctx->tau_key)
+ return -ENOMEM;
+
+ /* prf_key */
+ crypto_shash_clear_flags(cmac, CRYPTO_TFM_REQ_MASK);
+ crypto_shash_set_flags(cmac, crypto_skcipher_get_flags(parent) &
+ CRYPTO_TFM_REQ_MASK);
+ err = crypto_shash_setkey(cmac, prf_key, 16);
+ crypto_skcipher_set_flags(parent, crypto_shash_get_flags(cmac) &
+ CRYPTO_TFM_RES_MASK);
+ if (err)
+ return err;
+
+ /* blk_key */
+ crypto_skcipher_clear_flags(ecb, CRYPTO_TFM_REQ_MASK);
+ crypto_skcipher_set_flags(ecb, crypto_skcipher_get_flags(parent) &
+ CRYPTO_TFM_REQ_MASK);
+ err = crypto_skcipher_setkey(ecb, blk_key, 16);
+ crypto_skcipher_set_flags(parent, crypto_skcipher_get_flags(ecb) &
+ CRYPTO_TFM_RES_MASK);
+ return err;
+}
+
+static int heh_init_tfm(struct crypto_skcipher *tfm)
+{
+ struct skcipher_instance *inst = skcipher_alg_instance(tfm);
+ struct heh_instance_ctx *ictx = skcipher_instance_ctx(inst);
+ struct heh_tfm_ctx *ctx = crypto_skcipher_ctx(tfm);
+ struct crypto_shash *cmac;
+ struct crypto_skcipher *ecb;
+ unsigned int reqsize;
+ int err;
+
+ cmac = crypto_spawn_shash(&ictx->cmac);
+ if (IS_ERR(cmac))
+ return PTR_ERR(cmac);
+
+ ecb = crypto_spawn_skcipher(&ictx->ecb);
+ err = PTR_ERR(ecb);
+ if (IS_ERR(ecb))
+ goto err_free_cmac;
+
+ ctx->cmac = cmac;
+ ctx->ecb = ecb;
+
+ reqsize = crypto_skcipher_alignmask(tfm) &
+ ~(crypto_tfm_ctx_alignment() - 1);
+ reqsize += max(offsetof(struct heh_req_ctx, u.cmac.desc) +
+ sizeof(struct shash_desc) +
+ crypto_shash_descsize(cmac),
+ offsetof(struct heh_req_ctx, u.ecb.req) +
+ sizeof(struct skcipher_request) +
+ crypto_skcipher_reqsize(ecb));
+ crypto_skcipher_set_reqsize(tfm, reqsize);
+ return 0;
+
+err_free_cmac:
+ crypto_free_shash(cmac);
+ return err;
+}
+
+static void heh_exit_tfm(struct crypto_skcipher *tfm)
+{
+ struct heh_tfm_ctx *ctx = crypto_skcipher_ctx(tfm);
+
+ gf128mul_free_4k(ctx->tau_key);
+ crypto_free_shash(ctx->cmac);
+ crypto_free_skcipher(ctx->ecb);
+}
+
+static void heh_free_instance(struct skcipher_instance *inst)
+{
+ struct heh_instance_ctx *ctx = skcipher_instance_ctx(inst);
+
+ crypto_drop_shash(&ctx->cmac);
+ crypto_drop_skcipher(&ctx->ecb);
+ kfree(inst);
+}
+
+/*
+ * Create an instance of HEH as a skcipher.
+ *
+ * This relies on underlying CMAC and ECB algorithms, usually cmac(aes) and
+ * ecb(aes). For performance reasons we support asynchronous ECB algorithms.
+ * However, we do not yet support asynchronous CMAC algorithms because CMAC is
+ * only used on a small fixed amount of data per request, independent of the
+ * request length. This would change if AEAD or variable-length nonce support
+ * were to be exposed.
+ */
+static int heh_create_common(struct crypto_template *tmpl, struct rtattr **tb,
+ const char *full_name, const char *cmac_name,
+ const char *ecb_name)
+{
+ struct crypto_attr_type *algt;
+ struct skcipher_instance *inst;
+ struct heh_instance_ctx *ctx;
+ struct shash_alg *cmac;
+ struct skcipher_alg *ecb;
+ int err;
+
+ algt = crypto_get_attr_type(tb);
+ if (IS_ERR(algt))
+ return PTR_ERR(algt);
+
+ /* User must be asking for something compatible with skcipher */
+ if ((algt->type ^ CRYPTO_ALG_TYPE_SKCIPHER) & algt->mask)
+ return -EINVAL;
+
+ /* Allocate the skcipher instance */
+ inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL);
+ if (!inst)
+ return -ENOMEM;
+
+ ctx = skcipher_instance_ctx(inst);
+
+ /* Set up the cmac and ecb spawns */
+
+ ctx->cmac.base.inst = skcipher_crypto_instance(inst);
+ err = crypto_grab_shash(&ctx->cmac, cmac_name, 0, CRYPTO_ALG_ASYNC);
+ if (err)
+ goto err_free_inst;
+ cmac = crypto_spawn_shash_alg(&ctx->cmac);
+
+ ctx->ecb.base.inst = skcipher_crypto_instance(inst);
+ err = crypto_grab_skcipher(&ctx->ecb, ecb_name, 0,
+ crypto_requires_sync(algt->type,
+ algt->mask));
+ if (err)
+ goto err_drop_cmac;
+ ecb = crypto_spawn_skcipher_alg(&ctx->ecb);
+
+ /* HEH only supports block ciphers with 16 byte block size */
+ err = -EINVAL;
+ if (ecb->base.cra_blocksize != HEH_BLOCK_SIZE)
+ goto err_drop_ecb;
+
+ /* The underlying "ECB" algorithm must not require an IV */
+ err = -EINVAL;
+ if (crypto_skcipher_alg_ivsize(ecb) != 0)
+ goto err_drop_ecb;
+
+ /* Set the instance names */
+
+ err = -ENAMETOOLONG;
+ if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME,
+ "heh_base(%s,%s)", cmac->base.cra_driver_name,
+ ecb->base.cra_driver_name) >= CRYPTO_MAX_ALG_NAME)
+ goto err_drop_ecb;
+
+ strcpy(inst->alg.base.cra_name, full_name); /* guaranteed to fit */
+
+ /* Finish initializing the instance */
+
+ inst->alg.base.cra_flags = (cmac->base.cra_flags |
+ ecb->base.cra_flags) & CRYPTO_ALG_ASYNC;
+ inst->alg.base.cra_blocksize = HEH_BLOCK_SIZE;
+ inst->alg.base.cra_ctxsize = sizeof(struct heh_tfm_ctx);
+ inst->alg.base.cra_alignmask = ecb->base.cra_alignmask |
+ (__alignof__(be128) - 1);
+ inst->alg.base.cra_priority = ecb->base.cra_priority;
+
+ inst->alg.ivsize = HEH_BLOCK_SIZE;
+ inst->alg.min_keysize = HEH_KEY_SIZE;
+ inst->alg.max_keysize = HEH_KEY_SIZE;
+
+ inst->alg.init = heh_init_tfm;
+ inst->alg.exit = heh_exit_tfm;
+ inst->alg.setkey = heh_setkey;
+ inst->alg.encrypt = heh_encrypt;
+ inst->alg.decrypt = heh_decrypt;
+ inst->free = heh_free_instance;
+
+ /* Register the instance */
+ err = skcipher_register_instance(tmpl, inst);
+ if (err)
+ goto err_drop_ecb;
+ return 0;
+
+err_drop_ecb:
+ crypto_drop_skcipher(&ctx->ecb);
+err_drop_cmac:
+ crypto_drop_shash(&ctx->cmac);
+err_free_inst:
+ kfree(inst);
+ return err;
+}
+
+static int heh_create(struct crypto_template *tmpl, struct rtattr **tb)
+{
+ const char *cipher_name;
+ char full_name[CRYPTO_MAX_ALG_NAME];
+ char cmac_name[CRYPTO_MAX_ALG_NAME];
+ char ecb_name[CRYPTO_MAX_ALG_NAME];
+
+ /* Get the name of the requested block cipher (e.g. aes) */
+ cipher_name = crypto_attr_alg_name(tb[1]);
+ if (IS_ERR(cipher_name))
+ return PTR_ERR(cipher_name);
+
+ if (snprintf(full_name, CRYPTO_MAX_ALG_NAME, "heh(%s)", cipher_name) >=
+ CRYPTO_MAX_ALG_NAME)
+ return -ENAMETOOLONG;
+
+ if (snprintf(cmac_name, CRYPTO_MAX_ALG_NAME, "cmac(%s)", cipher_name) >=
+ CRYPTO_MAX_ALG_NAME)
+ return -ENAMETOOLONG;
+
+ if (snprintf(ecb_name, CRYPTO_MAX_ALG_NAME, "ecb(%s)", cipher_name) >=
+ CRYPTO_MAX_ALG_NAME)
+ return -ENAMETOOLONG;
+
+ return heh_create_common(tmpl, tb, full_name, cmac_name, ecb_name);
+}
+
+static struct crypto_template heh_tmpl = {
+ .name = "heh",
+ .create = heh_create,
+ .module = THIS_MODULE,
+};
+
+static int heh_base_create(struct crypto_template *tmpl, struct rtattr **tb)
+{
+ char full_name[CRYPTO_MAX_ALG_NAME];
+ const char *cmac_name;
+ const char *ecb_name;
+
+ cmac_name = crypto_attr_alg_name(tb[1]);
+ if (IS_ERR(cmac_name))
+ return PTR_ERR(cmac_name);
+
+ ecb_name = crypto_attr_alg_name(tb[2]);
+ if (IS_ERR(ecb_name))
+ return PTR_ERR(ecb_name);
+
+ if (snprintf(full_name, CRYPTO_MAX_ALG_NAME, "heh_base(%s,%s)",
+ cmac_name, ecb_name) >= CRYPTO_MAX_ALG_NAME)
+ return -ENAMETOOLONG;
+
+ return heh_create_common(tmpl, tb, full_name, cmac_name, ecb_name);
+}
+
+/*
+ * If HEH is instantiated as "heh_base" instead of "heh", then specific
+ * implementations of cmac and ecb can be specified instead of just the cipher
+ */
+static struct crypto_template heh_base_tmpl = {
+ .name = "heh_base",
+ .create = heh_base_create,
+ .module = THIS_MODULE,
+};
+
+static int __init heh_module_init(void)
+{
+ int err;
+
+ err = crypto_register_template(&heh_tmpl);
+ if (err)
+ return err;
+
+ err = crypto_register_template(&heh_base_tmpl);
+ if (err)
+ goto out_undo_heh;
+
+ return 0;
+
+out_undo_heh:
+ crypto_unregister_template(&heh_tmpl);
+ return err;
+}
+
+static void __exit heh_module_exit(void)
+{
+ crypto_unregister_template(&heh_tmpl);
+ crypto_unregister_template(&heh_base_tmpl);
+}
+
+module_init(heh_module_init);
+module_exit(heh_module_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Hash-Encrypt-Hash block cipher mode");
+MODULE_ALIAS_CRYPTO("heh");
+MODULE_ALIAS_CRYPTO("heh_base");
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related
* [RFC][PATCH 6/7] crypto: testmgr - Add test vectors for HEH
From: Alex Cope @ 2016-11-14 21:01 UTC (permalink / raw)
To: linux-crypto; +Cc: mhalcrow, edknapp, Alex Cope, Eric Biggers
In-Reply-To: <1479157277-10251-1-git-send-email-alexcope@google.com>
Adding test vectors from
https://tools.ietf.org/html/draft-cope-heh-00
Signed-off-by: Alex Cope <alexcope@google.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
crypto/testmgr.c | 15 ++++
crypto/testmgr.h | 226 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 241 insertions(+)
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index ded50b6..bab027b 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -3481,6 +3481,21 @@ static const struct alg_test_desc alg_test_descs[] = {
}
}
}, {
+ .alg = "heh(aes)",
+ .test = alg_test_skcipher,
+ .suite = {
+ .cipher = {
+ .enc = {
+ .vecs = aes_heh_enc_tv_template,
+ .count = AES_HEH_ENC_TEST_VECTORS
+ },
+ .dec = {
+ .vecs = aes_heh_dec_tv_template,
+ .count = AES_HEH_DEC_TEST_VECTORS
+ }
+ }
+ }
+ }, {
.alg = "hmac(crc32)",
.test = alg_test_hash,
.suite = {
diff --git a/crypto/testmgr.h b/crypto/testmgr.h
index e64a4ef..b2daad3 100644
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
@@ -15172,6 +15172,8 @@ static struct cipher_testvec cast6_xts_dec_tv_template[] = {
#define AES_DEC_TEST_VECTORS 4
#define AES_CBC_ENC_TEST_VECTORS 5
#define AES_CBC_DEC_TEST_VECTORS 5
+#define AES_HEH_ENC_TEST_VECTORS 4
+#define AES_HEH_DEC_TEST_VECTORS 4
#define HMAC_MD5_ECB_CIPHER_NULL_ENC_TEST_VECTORS 2
#define HMAC_MD5_ECB_CIPHER_NULL_DEC_TEST_VECTORS 2
#define HMAC_SHA1_ECB_CIPHER_NULL_ENC_TEST_VEC 2
@@ -15544,6 +15546,230 @@ static struct cipher_testvec aes_dec_tv_template[] = {
},
};
+static struct cipher_testvec aes_heh_enc_tv_template[] = {
+ {
+ .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
+ "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
+ "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F",
+ .klen = 48,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .input = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F",
+ .ilen = 16,
+ .result = "\x61\x76\x38\xa5\x12\x0b\x6d\x89"
+ "\x92\x68\x30\x7e\x0d\x6e\x81\xe3",
+ .rlen = 16,
+ .also_non_np = 1,
+ .np = 2,
+ .tap = { 8, 8 },
+ }, {
+ .key = "\x68\xf8\x27\x87\xdc\x30\x33\xfd"
+ "\x65\x5b\x8e\x51\x2e\x02\xff\x9d"
+ "\x21\x28\x1e\x64\xcd\x9c\x33\x88"
+ "\xf6\x2c\x43\x8f\xf5\x6f\xf5\x8f"
+ "\xa8\xda\x24\x9b\x5e\xfa\x13\xc2"
+ "\xc1\x94\xbf\x32\xba\x38\xa3\x77",
+ .klen = 48,
+ .iv = "\x4d\x47\x61\x37\x2b\x47\x86\xf0"
+ "\xd6\x47\xb5\xc2\xe8\xcf\x85\x27",
+ .input = "\xb8\xee\x29\xe4\xa5\xd1\xe7\x55"
+ "\xd0\xfd\xe7\x22\x63\x76\x36\xe2"
+ "\xf8\x0c\xf8\xfe\x65\x76\xe7\xca"
+ "\xc1\x42\xf5\xca\x5a\xa8\xac\x2a",
+ .ilen = 32,
+ .result = "\x1f\x4c\x6a\x1e\x1d\x20\x0d\x99"
+ "\xdf\xbb\x13\xd8\x35\xdc\x1d\xbe"
+ "\xed\x50\x0a\x9f\xfd\xd6\x94\x85"
+ "\xd0\x8b\xf7\xb4\x49\x7f\x70\x6d",
+ .rlen = 32,
+ .also_non_np = 1,
+ .np = 3,
+ .tap = { 16, 13, 3 },
+ }, {
+ .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
+ "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
+ "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F",
+ .klen = 48,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .input = "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00",
+ .ilen = 63,
+ .result = "\xfb\x30\x90\x47\xc5\x4e\xcc\xfd"
+ "\xc4\x90\xa2\x9f\x7c\x03\x63\xc3"
+ "\xcb\xaf\x2e\xee\x62\x18\xeb\x20"
+ "\x62\x97\xe4\x9b\xf2\x8b\xf3\x3f"
+ "\x76\x3b\xaa\xab\xf0\x19\x54\xdb"
+ "\xb4\xaf\x2e\xd9\xa7\xe0\x92\x04"
+ "\x5a\xe4\x81\xfc\x58\xf2\xda\xbf"
+ "\x5d\xc9\xb1\x47\xd5\x08\xb1",
+ .rlen = 63,
+ .also_non_np = 1,
+ .np = 8,
+ .tap = { 20, 20, 10, 8, 2, 1, 1, 1 },
+ }, {
+ .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
+ "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
+ "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F",
+ .klen = 48,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .input = "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x01"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00",
+ .ilen = 63,
+ .result = "\x9c\xdf\xa5\x50\x83\xe0\xa3\xb5"
+ "\x0d\x35\x83\x34\x6e\x6e\x40\xd6"
+ "\x0f\x81\xc8\x1a\x9c\x40\x81\xfb"
+ "\xb3\x6e\xb4\xbf\xfc\xca\xc9\x50"
+ "\xcd\x33\xfd\xb3\x43\x11\xe6\x32"
+ "\x02\x3d\x3e\xc6\x49\x6e\xcf\x58"
+ "\x3e\x14\x15\x6d\x39\x2a\x58\x99"
+ "\x83\xaf\xdd\x22\x3e\x7f\x6c",
+ .rlen = 63,
+ .also_non_np = 1,
+ .np = 8,
+ .tap = { 20, 20, 10, 8, 2, 1, 1, 1 },
+ }
+};
+
+static struct cipher_testvec aes_heh_dec_tv_template[] = {
+ {
+ .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
+ "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
+ "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F",
+ .klen = 48,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .input = "\x61\x76\x38\xa5\x12\x0b\x6d\x89"
+ "\x92\x68\x30\x7e\x0d\x6e\x81\xe3",
+ .ilen = 16,
+ .result = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F",
+ .rlen = 16,
+ .also_non_np = 1,
+ .np = 2,
+ .tap = { 8, 8 },
+ }, {
+ .key = "\x68\xf8\x27\x87\xdc\x30\x33\xfd"
+ "\x65\x5b\x8e\x51\x2e\x02\xff\x9d"
+ "\x21\x28\x1e\x64\xcd\x9c\x33\x88"
+ "\xf6\x2c\x43\x8f\xf5\x6f\xf5\x8f"
+ "\xa8\xda\x24\x9b\x5e\xfa\x13\xc2"
+ "\xc1\x94\xbf\x32\xba\x38\xa3\x77",
+ .klen = 48,
+ .iv = "\x4d\x47\x61\x37\x2b\x47\x86\xf0"
+ "\xd6\x47\xb5\xc2\xe8\xcf\x85\x27",
+ .input = "\x1f\x4c\x6a\x1e\x1d\x20\x0d\x99"
+ "\xdf\xbb\x13\xd8\x35\xdc\x1d\xbe"
+ "\xed\x50\x0a\x9f\xfd\xd6\x94\x85"
+ "\xd0\x8b\xf7\xb4\x49\x7f\x70\x6d",
+ .ilen = 32,
+ .result = "\xb8\xee\x29\xe4\xa5\xd1\xe7\x55"
+ "\xd0\xfd\xe7\x22\x63\x76\x36\xe2"
+ "\xf8\x0c\xf8\xfe\x65\x76\xe7\xca"
+ "\xc1\x42\xf5\xca\x5a\xa8\xac\x2a",
+ .rlen = 32,
+ .also_non_np = 1,
+ .np = 3,
+ .tap = { 16, 13, 3 },
+ }, {
+ .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
+ "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
+ "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F",
+ .klen = 48,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .result = "\xfb\x30\x90\x47\xc5\x4e\xcc\xfd"
+ "\xc4\x90\xa2\x9f\x7c\x03\x63\xc3"
+ "\xcb\xaf\x2e\xee\x62\x18\xeb\x20"
+ "\x62\x97\xe4\x9b\xf2\x8b\xf3\x3f"
+ "\x76\x3b\xaa\xab\xf0\x19\x54\xdb"
+ "\xb4\xaf\x2e\xd9\xa7\xe0\x92\x04"
+ "\x5a\xe4\x81\xfc\x58\xf2\xda\xbf"
+ "\x5d\xc9\xb1\x47\xd5\x08\xb1",
+ .ilen = 63,
+ .input = "\xfb\x30\x90\x47\xc5\x4e\xcc\xfd"
+ "\xc4\x90\xa2\x9f\x7c\x03\x63\xc3"
+ "\xcb\xaf\x2e\xee\x62\x18\xeb\x20"
+ "\x62\x97\xe4\x9b\xf2\x8b\xf3\x3f"
+ "\x76\x3b\xaa\xab\xf0\x19\x54\xdb"
+ "\xb4\xaf\x2e\xd9\xa7\xe0\x92\x04"
+ "\x5a\xe4\x81\xfc\x58\xf2\xda\xbf"
+ "\x5d\xc9\xb1\x47\xd5\x08\xb1",
+ .result = "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00",
+ .rlen = 63,
+ .also_non_np = 1,
+ .np = 8,
+ .tap = { 20, 20, 10, 8, 2, 1, 1, 1 },
+ }, {
+ .key = "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
+ "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
+ "\x00\x01\x02\x03\x04\x05\x06\x07"
+ "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F",
+ .klen = 48,
+ .iv = "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00",
+ .input = "\x9c\xdf\xa5\x50\x83\xe0\xa3\xb5"
+ "\x0d\x35\x83\x34\x6e\x6e\x40\xd6"
+ "\x0f\x81\xc8\x1a\x9c\x40\x81\xfb"
+ "\xb3\x6e\xb4\xbf\xfc\xca\xc9\x50"
+ "\xcd\x33\xfd\xb3\x43\x11\xe6\x32"
+ "\x02\x3d\x3e\xc6\x49\x6e\xcf\x58"
+ "\x3e\x14\x15\x6d\x39\x2a\x58\x99"
+ "\x83\xaf\xdd\x22\x3e\x7f\x6c",
+ .ilen = 63,
+ .result = "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00\x01"
+ "\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x00\x00\x00\x00\x00\x00\x00",
+ .rlen = 63,
+ .also_non_np = 1,
+ .np = 8,
+ .tap = { 20, 20, 10, 8, 2, 1, 1, 1 },
+ }
+};
+
static struct cipher_testvec aes_cbc_enc_tv_template[] = {
{ /* From RFC 3602 */
.key = "\x06\xa9\x21\x40\x36\xb8\xa1\x5b"
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related
* Re: [PATCH 2/5] PCI: Extract link speed & width retrieval from pcie_get_minimum_link()
From: Bjorn Helgaas @ 2016-11-14 21:02 UTC (permalink / raw)
To: Alex Williamson; +Cc: linux-pci, bhelgaas, iommu, linux-kernel
In-Reply-To: <20161026180122.23495.26258.stgit@gimli.home>
On Wed, Oct 26, 2016 at 12:01:22PM -0600, Alex Williamson wrote:
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> ---
> drivers/pci/pci.c | 26 ++++++++++++++++++++------
> include/linux/pci.h | 2 ++
> 2 files changed, 22 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index b901ee7..6d6cf89 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -4729,6 +4729,25 @@ int pcie_set_mps(struct pci_dev *dev, int mps)
> }
> EXPORT_SYMBOL(pcie_set_mps);
>
> +int pcie_get_link(struct pci_dev *dev, enum pci_bus_speed *speed,
> + enum pcie_link_width *width)
Seems like "pcie_get_link" is missing a word. I know
pcie_get_minimum_link() exists already and is similar.
pcie_get_link_speed(), maybe? I know it also gets the width, so maybe
there's a more inclusive term that would be better.
> +{
> + int ret;
> + u16 lnksta;
> +
> + ret = pcie_capability_read_word(dev, PCI_EXP_LNKSTA, &lnksta);
> + if (ret)
> + return ret;
> +
> + if (speed)
> + *speed = pcie_link_speed[lnksta & PCI_EXP_LNKSTA_CLS];
> + if (width)
> + *width = (lnksta & PCI_EXP_LNKSTA_NLW) >>
> + PCI_EXP_LNKSTA_NLW_SHIFT;
> +
> + return 0;
> +}
> +
> /**
> * pcie_get_minimum_link - determine minimum link settings of a PCI device
> * @dev: PCI device to query
> @@ -4747,18 +4766,13 @@ int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed,
> *width = PCIE_LNK_WIDTH_UNKNOWN;
>
> while (dev) {
> - u16 lnksta;
> enum pci_bus_speed next_speed;
> enum pcie_link_width next_width;
>
> - ret = pcie_capability_read_word(dev, PCI_EXP_LNKSTA, &lnksta);
> + ret = pcie_get_link(dev, &next_speed, &next_width);
> if (ret)
> return ret;
>
> - next_speed = pcie_link_speed[lnksta & PCI_EXP_LNKSTA_CLS];
> - next_width = (lnksta & PCI_EXP_LNKSTA_NLW) >>
> - PCI_EXP_LNKSTA_NLW_SHIFT;
> -
> if (next_speed < *speed)
> *speed = next_speed;
>
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index c3248d5..fbfbb40 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1026,6 +1026,8 @@ static inline int pci_is_managed(struct pci_dev *pdev)
> int pcie_set_mps(struct pci_dev *dev, int mps);
> int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed,
> enum pcie_link_width *width);
> +int pcie_get_link(struct pci_dev *dev, enum pci_bus_speed *speed,
> + enum pcie_link_width *width);
> int __pci_reset_function(struct pci_dev *dev);
> int __pci_reset_function_locked(struct pci_dev *dev);
> int pci_reset_function(struct pci_dev *dev);
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH 2/2 nft] tests: py: missing range conversion in icmpv6
From: Pablo Neira Ayuso @ 2016-11-14 21:01 UTC (permalink / raw)
To: netfilter-devel
In-Reply-To: <1479157289-26503-1-git-send-email-pablo@netfilter.org>
Use range expression to negate ranges.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
tests/py/ip6/icmpv6.t.payload.ip6 | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tests/py/ip6/icmpv6.t.payload.ip6 b/tests/py/ip6/icmpv6.t.payload.ip6
index a00f392e9bb7..8d33249e49f3 100644
--- a/tests/py/ip6/icmpv6.t.payload.ip6
+++ b/tests/py/ip6/icmpv6.t.payload.ip6
@@ -389,8 +389,7 @@ ip6 test-ip6 input
[ payload load 1b @ network header + 6 => reg 1 ]
[ cmp eq reg 1 0x0000003a ]
[ payload load 2b @ transport header + 4 => reg 1 ]
- [ cmp lt reg 1 0x00002100 ]
- [ cmp gt reg 1 0x00002d00 ]
+ [ range neq reg 1 0x00002100 0x00002d00 ]
# icmpv6 max-delay {33, 55, 67, 88}
__set%d test-ip6 3
--
2.1.4
^ permalink raw reply related
* Re: [PATCH 5/5] PCI: Balance ports to avoid ACS errata on Pericom switches
From: Bjorn Helgaas @ 2016-11-14 21:03 UTC (permalink / raw)
To: Alex Williamson; +Cc: linux-pci, bhelgaas, iommu, linux-kernel
In-Reply-To: <20161026180140.23495.27388.stgit@gimli.home>
On Wed, Oct 26, 2016 at 12:01:40PM -0600, Alex Williamson wrote:
> As described in the included code comment, this quirk is intended to
> work around an errata in a variety of Pericom 4-lane, 3 and 4 port
> PCIe 2.0 switches. The switches advertise ACS capabilities, but the
> P2P Request Redirection support includes an errata that PCI_ACS_RR
> effectively doesn't work and results in transactions being queued and
> not delivered within the PCIe switch. The errata has no planned
> hardware fix.
Is there a published erratum we can reference here? It'd be really
nice to have a URL.
^ permalink raw reply
* [PATCH dtv-scan-tables] Rename pl-Krosno_Sucha_Gora with only ASCII characters
From: Thomas Petazzoni @ 2016-11-14 21:05 UTC (permalink / raw)
To: Olliver Schinagl, linux-media, Mauro Carvalho Chehab; +Cc: Thomas Petazzoni
The pl-Krosno_Sucha_Gora file, added in commit
4cb113fd15e562f0629000fcad9f41405595198d, is the only file that
contains non-ASCII characters in the tree. This causes a number of
build issues with other packages that don't necessarily handle very
well non-ASCII file name encodings.
Since no other file in the tree contain non-ASCII characters in their
name, this commit renames pl-Krosno_Sucha_Gora similarly.
Examples of files that are named with only ASCII characters even if
the city name really contains non-ASCII characters:
- pl-Wroclaw should be written pl-Wrocław
- se-Laxsjo should be written se-Laxsjö
- de-Dusseldorf should be written de-Düsseldorf
- vn-Thaibinh should be written vn-Thái_Bình
Since there is no real standardization on the encoding of file names,
we'd better be safe and use only ASCII characters.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
"dvb-t/pl-Krosno_Sucha_G\303\263ra" => dvb-t/pl-Krosno_Sucha_Gora | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename "dvb-t/pl-Krosno_Sucha_G\303\263ra" => dvb-t/pl-Krosno_Sucha_Gora (100%)
diff --git "a/dvb-t/pl-Krosno_Sucha_G\303\263ra" b/dvb-t/pl-Krosno_Sucha_Gora
similarity index 100%
rename from "dvb-t/pl-Krosno_Sucha_G\303\263ra"
rename to dvb-t/pl-Krosno_Sucha_Gora
--
2.7.4
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.