diff options
author | Anish Trivedi <anish@freescale.com> | 2011-04-11 14:49:02 -0500 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2012-01-09 20:08:02 +0800 |
commit | 69688106df4e88b0dd9e9a8c8a2c7c1e90c8d3a1 (patch) | |
tree | 791ec9a248bd005c57c4cfcadc676aa96ba2a3ef /include/linux/mxc_sahara.h | |
parent | 4e0d8e4848b0eb504b00cc76e001ed66d48015d9 (diff) |
ENGR00122019 SAHARA: Add padding around buffers to prevent cache incoherency
Added padding of 64 bytes (cache line size for Cortex-A8) around
buffers that are used by the hardware to prevent any cache
coherency problems that could arise if buffers share a cache line
with some other data that is used by the CPU.
Signed-off-by: Anish Trivedi <anish@freescale.com>
Diffstat (limited to 'include/linux/mxc_sahara.h')
-rw-r--r-- | include/linux/mxc_sahara.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/include/linux/mxc_sahara.h b/include/linux/mxc_sahara.h index 8e341cce9706..244d6920fd5e 100644 --- a/include/linux/mxc_sahara.h +++ b/include/linux/mxc_sahara.h @@ -968,7 +968,10 @@ typedef struct fsl_shw_hco_t { /* fsl_shw_hash_context_object */ uint8_t digest_length; /* in bytes */ uint8_t context_length; /* in bytes */ uint8_t context_register_length; /* in bytes */ - uint32_t context[9]; /* largest digest + msg size */ + /* ensure following HW buffers not cached with surrounding fields */ + uint8_t cache_front_pad[64]; /* fill out cache line */ + uint32_t context[9]; /* largest digest + msg size */ + uint8_t cache_back_pad[64]; /* fill out cache line */ } fsl_shw_hco_t; /*! @@ -980,12 +983,12 @@ typedef struct fsl_shw_hmco_t { /* fsl_shw_hmac_context_object */ uint8_t digest_length; /*!< in bytes */ uint8_t context_length; /*!< in bytes */ uint8_t context_register_length; /*!< in bytes */ - uint32_t ongoing_context[9]; /*!< largest digest + msg - size */ - uint32_t inner_precompute[9]; /*!< largest digest + msg - size */ - uint32_t outer_precompute[9]; /*!< largest digest + msg - size */ + /* ensure following HW buffers not cached with surrounding fields */ + uint8_t cache_front_pad[64]; /* fill out cache line */ + uint32_t ongoing_context[9]; /**< largest digest + msg size */ + uint32_t inner_precompute[9]; /**< largest digest + msg size */ + uint32_t outer_precompute[9]; /**< largest digest + msg size */ + uint8_t cache_back_pad[64]; /* fill out cache line */ } fsl_shw_hmco_t; /* REQ-S2LRD-PINTFC-COA-SCCO-001 */ @@ -999,7 +1002,10 @@ typedef struct fsl_shw_scco_t { /* Could put modulus plus 16-octet context in union with arc4 sbox+ptrs... */ fsl_shw_ctr_mod_t modulus_exp; + /* ensure following HW buffers not cached with surrounding fields */ + uint8_t cache_front_pad[64]; /* fill out cache line */ uint8_t context[259]; + uint8_t cache_back_pad[64]; /* fill out cache line */ } fsl_shw_scco_t; /*! @@ -1023,6 +1029,8 @@ typedef struct fsl_shw_acco_t { fsl_shw_hco_t hash_ctx_info; /*!< For running the hash */ } auth_info; /*!< "auth" info struct */ uint8_t unencrypted_mac[16]; /*!< max block size... */ + /* ensure above HW buffer not cached with any following variables */ + uint8_t cache_back_pad[64]; /* fill out cache line */ } fsl_shw_acco_t; /*! |