~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/lib/raid6/recov_neon.c

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /lib/raid6/recov_neon.c (Version linux-6.12-rc7) and /lib/raid6/recov_neon.c (Version linux-6.6.60)


  1 // SPDX-License-Identifier: GPL-2.0-only            1 // SPDX-License-Identifier: GPL-2.0-only
  2 /*                                                  2 /*
  3  * Copyright (C) 2012 Intel Corporation             3  * Copyright (C) 2012 Intel Corporation
  4  * Copyright (C) 2017 Linaro Ltd. <ard.biesheu      4  * Copyright (C) 2017 Linaro Ltd. <ard.biesheuvel@linaro.org>
  5  */                                                 5  */
  6                                                     6 
  7 #include <linux/raid/pq.h>                          7 #include <linux/raid/pq.h>
  8                                                     8 
  9 #ifdef __KERNEL__                                   9 #ifdef __KERNEL__
 10 #include <asm/neon.h>                              10 #include <asm/neon.h>
 11 #include "neon.h"                                  11 #include "neon.h"
 12 #else                                              12 #else
 13 #define kernel_neon_begin()                        13 #define kernel_neon_begin()
 14 #define kernel_neon_end()                          14 #define kernel_neon_end()
 15 #define cpu_has_neon()          (1)                15 #define cpu_has_neon()          (1)
 16 #endif                                             16 #endif
 17                                                    17 
 18 static int raid6_has_neon(void)                    18 static int raid6_has_neon(void)
 19 {                                                  19 {
 20         return cpu_has_neon();                     20         return cpu_has_neon();
 21 }                                                  21 }
 22                                                    22 
 23 static void raid6_2data_recov_neon(int disks,      23 static void raid6_2data_recov_neon(int disks, size_t bytes, int faila,
 24                 int failb, void **ptrs)            24                 int failb, void **ptrs)
 25 {                                                  25 {
 26         u8 *p, *q, *dp, *dq;                       26         u8 *p, *q, *dp, *dq;
 27         const u8 *pbmul;        /* P multiplie     27         const u8 *pbmul;        /* P multiplier table for B data */
 28         const u8 *qmul;         /* Q multiplie     28         const u8 *qmul;         /* Q multiplier table (for both) */
 29                                                    29 
 30         p = (u8 *)ptrs[disks - 2];                 30         p = (u8 *)ptrs[disks - 2];
 31         q = (u8 *)ptrs[disks - 1];                 31         q = (u8 *)ptrs[disks - 1];
 32                                                    32 
 33         /*                                         33         /*
 34          * Compute syndrome with zero for the      34          * Compute syndrome with zero for the missing data pages
 35          * Use the dead data pages as temporar     35          * Use the dead data pages as temporary storage for
 36          * delta p and delta q                     36          * delta p and delta q
 37          */                                        37          */
 38         dp = (u8 *)ptrs[faila];                    38         dp = (u8 *)ptrs[faila];
 39         ptrs[faila] = (void *)raid6_empty_zero     39         ptrs[faila] = (void *)raid6_empty_zero_page;
 40         ptrs[disks - 2] = dp;                      40         ptrs[disks - 2] = dp;
 41         dq = (u8 *)ptrs[failb];                    41         dq = (u8 *)ptrs[failb];
 42         ptrs[failb] = (void *)raid6_empty_zero     42         ptrs[failb] = (void *)raid6_empty_zero_page;
 43         ptrs[disks - 1] = dq;                      43         ptrs[disks - 1] = dq;
 44                                                    44 
 45         raid6_call.gen_syndrome(disks, bytes,      45         raid6_call.gen_syndrome(disks, bytes, ptrs);
 46                                                    46 
 47         /* Restore pointer table */                47         /* Restore pointer table */
 48         ptrs[faila]     = dp;                      48         ptrs[faila]     = dp;
 49         ptrs[failb]     = dq;                      49         ptrs[failb]     = dq;
 50         ptrs[disks - 2] = p;                       50         ptrs[disks - 2] = p;
 51         ptrs[disks - 1] = q;                       51         ptrs[disks - 1] = q;
 52                                                    52 
 53         /* Now, pick the proper data tables */     53         /* Now, pick the proper data tables */
 54         pbmul = raid6_vgfmul[raid6_gfexi[failb     54         pbmul = raid6_vgfmul[raid6_gfexi[failb-faila]];
 55         qmul  = raid6_vgfmul[raid6_gfinv[raid6     55         qmul  = raid6_vgfmul[raid6_gfinv[raid6_gfexp[faila] ^
 56                                          raid6     56                                          raid6_gfexp[failb]]];
 57                                                    57 
 58         kernel_neon_begin();                       58         kernel_neon_begin();
 59         __raid6_2data_recov_neon(bytes, p, q,      59         __raid6_2data_recov_neon(bytes, p, q, dp, dq, pbmul, qmul);
 60         kernel_neon_end();                         60         kernel_neon_end();
 61 }                                                  61 }
 62                                                    62 
 63 static void raid6_datap_recov_neon(int disks,      63 static void raid6_datap_recov_neon(int disks, size_t bytes, int faila,
 64                 void **ptrs)                       64                 void **ptrs)
 65 {                                                  65 {
 66         u8 *p, *q, *dq;                            66         u8 *p, *q, *dq;
 67         const u8 *qmul;         /* Q multiplie     67         const u8 *qmul;         /* Q multiplier table */
 68                                                    68 
 69         p = (u8 *)ptrs[disks - 2];                 69         p = (u8 *)ptrs[disks - 2];
 70         q = (u8 *)ptrs[disks - 1];                 70         q = (u8 *)ptrs[disks - 1];
 71                                                    71 
 72         /*                                         72         /*
 73          * Compute syndrome with zero for the      73          * Compute syndrome with zero for the missing data page
 74          * Use the dead data page as temporary     74          * Use the dead data page as temporary storage for delta q
 75          */                                        75          */
 76         dq = (u8 *)ptrs[faila];                    76         dq = (u8 *)ptrs[faila];
 77         ptrs[faila] = (void *)raid6_empty_zero     77         ptrs[faila] = (void *)raid6_empty_zero_page;
 78         ptrs[disks - 1] = dq;                      78         ptrs[disks - 1] = dq;
 79                                                    79 
 80         raid6_call.gen_syndrome(disks, bytes,      80         raid6_call.gen_syndrome(disks, bytes, ptrs);
 81                                                    81 
 82         /* Restore pointer table */                82         /* Restore pointer table */
 83         ptrs[faila]     = dq;                      83         ptrs[faila]     = dq;
 84         ptrs[disks - 1] = q;                       84         ptrs[disks - 1] = q;
 85                                                    85 
 86         /* Now, pick the proper data tables */     86         /* Now, pick the proper data tables */
 87         qmul = raid6_vgfmul[raid6_gfinv[raid6_     87         qmul = raid6_vgfmul[raid6_gfinv[raid6_gfexp[faila]]];
 88                                                    88 
 89         kernel_neon_begin();                       89         kernel_neon_begin();
 90         __raid6_datap_recov_neon(bytes, p, q,      90         __raid6_datap_recov_neon(bytes, p, q, dq, qmul);
 91         kernel_neon_end();                         91         kernel_neon_end();
 92 }                                                  92 }
 93                                                    93 
 94 const struct raid6_recov_calls raid6_recov_neo     94 const struct raid6_recov_calls raid6_recov_neon = {
 95         .data2          = raid6_2data_recov_ne     95         .data2          = raid6_2data_recov_neon,
 96         .datap          = raid6_datap_recov_ne     96         .datap          = raid6_datap_recov_neon,
 97         .valid          = raid6_has_neon,          97         .valid          = raid6_has_neon,
 98         .name           = "neon",                  98         .name           = "neon",
 99         .priority       = 10,                      99         .priority       = 10,
100 };                                                100 };
101                                                   101 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php