[PATCH] crypto: correct obvious misspelling "cypto-controller"
Signed-off-by: Robert P. J. Day --- diff --git a/Documentation/devicetree/bindings/crypto/rockchip-crypto.txt b/Documentation/devicetree/bindings/crypto/rockchip-crypto.txt index 5e2ba385b8c9..53e39d5f94e7 100644 --- a/Documentation/devicetree/bindings/crypto/rockchip-crypto.txt +++ b/Documentation/devicetree/bindings/crypto/rockchip-crypto.txt @@ -16,7 +16,7 @@ Required properties: Examples: - crypto: cypto-controller@ff8a { + crypto: crypto-controller@ff8a { compatible = "rockchip,rk3288-crypto"; reg = <0xff8a 0x4000>; interrupts = ; diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi index d7e49d29ace5..dcfdb2c0d206 100644 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -942,7 +942,7 @@ status = "disabled"; }; - crypto: cypto-controller@ff8a { + crypto: crypto-controller@ff8a { compatible = "rockchip,rk3288-crypto"; reg = <0x0 0xff8a 0x0 0x4000>; interrupts = ; rday -- ======== Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca/dokuwiki Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday
[PATCH] crypto: wp512: fixed a brace coding style issue
Fixed a coding style issue. Signed-off-by: Robert Donald Rickett <robert.rick...@gmail.com> --- crypto/wp512.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crypto/wp512.c b/crypto/wp512.c index 7ee5a043a988..58983e23900d 100644 --- a/crypto/wp512.c +++ b/crypto/wp512.c @@ -993,9 +993,8 @@ static int wp512_init(struct shash_desc *desc) { memset(wctx->bitLength, 0, 32); wctx->bufferBits = wctx->bufferPos = 0; wctx->buffer[0] = 0; - for (i = 0; i < 8; i++) { + for (i = 0; i < 8; i++) wctx->hash[i] = 0L; - } return 0; } -- 2.14.1
[PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()
In case buffer length is a multiple of PAGE_SIZE, the S/G table is incorrectly generated. Fix this by handling buflen = k * PAGE_SIZE separately. Signed-off-by: Robert Baronescu <robert.barone...@nxp.com> --- crypto/tcrypt.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 0022a18..bd9b66c 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -221,11 +221,13 @@ static void sg_init_aead(struct scatterlist *sg, char *xbuf[XBUFSIZE], } sg_init_table(sg, np + 1); - np--; + if (rem) + np--; for (k = 0; k < np; k++) sg_set_buf([k + 1], xbuf[k], PAGE_SIZE); - sg_set_buf([k + 1], xbuf[k], rem); + if (rem) + sg_set_buf([k + 1], xbuf[k], rem); } static void test_aead_speed(const char *algo, int enc, unsigned int secs, -- 1.9.3
[PATCH 2/2] crypto: tcrypt - fix buffer lengths in test_aead_speed()
Fix the way the length of the buffers used for encryption / decryption are computed. For e.g. in case of encryption, input buffer does not contain an authentication tag. Signed-off-by: Robert Baronescu <robert.barone...@nxp.com> --- crypto/tcrypt.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index bd9b66c..e339960 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -342,7 +342,7 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs, } sg_init_aead(sg, xbuf, - *b_size + (enc ? authsize : 0)); + *b_size + (enc ? 0 : authsize)); sg_init_aead(sgout, xoutbuf, *b_size + (enc ? authsize : 0)); @@ -350,7 +350,9 @@ static void test_aead_speed(const char *algo, int enc, unsigned int secs, sg_set_buf([0], assoc, aad_size); sg_set_buf([0], assoc, aad_size); - aead_request_set_crypt(req, sg, sgout, *b_size, iv); + aead_request_set_crypt(req, sg, sgout, + *b_size + (enc ? 0 : authsize), + iv); aead_request_set_ad(req, aad_size); if (secs) -- 1.9.3
Attention Beneficially
Attention Beneficially WESTERN UNION This is very urgent Our Operation manager has sent your first payment of $5000.00 to you. Here is what we need from you to complete the transfer, Your Name, Your Address,A Copy Of Your ID and Your Telephone Number: Noted That Only Fee Request from You Is to Reactivate Transfer Files which is Sum Of $65Only, No More Fee again after that. Western Union Agent: Mr. Peterson Godwin Direct phone line is: + 229 98782817 E-mail ::(westernunion8...@gmail.com) Bellow is your first payment for $5000usd sent today in your name. Sender Name: Mr. MTCN: Question Answer Amount Sent: $5000.00 You can use this link to confirm the payment, Best Regards, Mr.Joseph Ezo -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
HELLO DEAR
Hello Dear, how are you doing hope fine, I am (Melissa Robert) by name. i will like to know more about you believing that friendship is a free gift of nature. Please get back to me as soon as possible through this my private Email. (mr4785...@gmail.com) thank you. -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 1/4] scatterlist: Introduce some helper functions
Baolin Wang <baolin.w...@linaro.org> writes: > +/** > + * sg_is_contiguous - Check if the scatterlists are contiguous > + * @sga: SG entry > + * @sgb: SG entry > + * > + * Description: > + * If the sga scatterlist is contiguous with the sgb scatterlist, > + * that means they can be merged together. > + * > + **/ > +static inline bool sg_is_contiguous(struct scatterlist *sga, > + struct scatterlist *sgb) > +{ > + return *(unsigned long *)sg_virt(sga) + sga->length == > + *(unsigned long *)sg_virt(sgb); As I already said, I don't like casts. But let's take some height : you're needing this function to decide to merge scatterlists. That means that you think the probability of having 2 scatterlist mergeable is not meaningless, ie. 50% or more. I suppose your scatterlists are allocated through kmalloc(). I'd like to know, through your testing, what is the success rate of sg_is_contiguous(), ie. I'd like to know how many times sg_is_contiguous() was called, and amongst these calls how many times it returned true. That will tell me how "worth" is this optimization. > + * sg_add_sg_to_table - Add one scatterlist into sg table > + * @sgt: The sg table header to use > + * @src: The sg need to be added into sg table > + * > + * Description: > + * The 'nents' member indicates how many mapped scatterlists has been added > + * in the dynamic sg table. The 'orig_nents' member indicates the size of > the > + * dynamic sg table. > + * > + * Copy one mapped @src@ scatterlist into the dynamic sg table and increase > + * 'nents' member. > + * > + **/ Okay, I still believe this one is wrong, because we don't understand each other. So let's take an example : sg_table = { .sgl = { { .page_link = PAGE_48, .offset = 0, .length = 2048, .dma_address = 0x3, .dma_length = 4096, }, { .page_link = PAGE_48 | 0x02, .offset = 2048, .length = 2048, .dma_address = 0, .dma_length = 0, }, }, .nents = 1, .orig_nents = 2, }; In this example, by sheer luck the 2 scatterlist entries were physically contiguous, and the mapping function coallesced the 2 entries into only one (dma_address, dma_length) entry. That could also happen with an IOMMU by the way. Therefore, sg_table.nents = 1. If I understand your function correctly, it will erase sg_table.sgl[1], and that looks incorrect to me. This is why I can't understand how your code can be correct, and why I say you add a new "meaning" to sg_table->nents, which is not consistent with the meaning I understand. Cheers. -- Robert -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: RE
Please confirm receipt of my previous mail..When can i call you -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/4] scatterlist: Introduce some helper functions
Baolin Wang <baolin.w...@linaro.org> writes: > Hi Robert, > > On 4 March 2016 at 03:15, Robert Jarzmik <robert.jarz...@free.fr> wrote: >> Baolin Wang <baolin.w...@linaro.org> writes: >>> +static inline bool sg_is_contiguous(struct scatterlist *sga, >>> + struct scatterlist *sgb) >>> +{ >>> + return ((sga->page_link & ~0x3UL) + sga->offset + sga->length == >>> + (sgb->page_link & ~0x3UL)); >>> +} >> I don't understand that one. >> sga->page_link is a pointer to a "struct page *". How can it be added to an >> offset within a page ??? > > > Ah, sorry that's a mistake. It should check as below: > static inline bool sg_is_contiguous(struct scatterlist *sga, struct > scatterlist *sgb) > { > return (unsigned int)sg_virt(sga) + sga->length == (unsigned > int)sg_virt(sgb); > } NAK. First, I don't like the cast. Second ask yourself: what if you compile on a 64 bit architecture ? Third, I don't like void* arithmetics, some compilers might refuse it. And as a last comment, is it "virtual" contiguity you're looking after, physical contiguity, or dma_addr_t contiguity ? >>> @@ -370,6 +370,65 @@ int sg_alloc_table(struct sg_table *table, unsigned int >>> nents, gfp_t gfp_mask) >> ... >>> /** >>> + * sg_add_sg_to_table - Add one scatterlist into sg table >>> + * @sgt: The sg table header to use >>> + * @src: The sg need to be added into sg table >>> + * >>> + * Description: >>> + * The 'nents' member indicates how many scatterlists added in the sg >>> table. >>> + * Copy the @src@ scatterlist into sg table and increase 'nents' member. >>> + * >>> + **/ >>> +int sg_add_sg_to_table(struct sg_table *sgt, struct scatterlist *src) >>> +{ >>> + unsigned int i = 0, orig_nents = sgt->orig_nents; >>> + struct scatterlist *sgl = sgt->sgl; >>> + struct scatterlist *sg; >>> + >>> + /* Check if there are enough space for the new sg to be added */ >>> + if (sgt->nents >= sgt->orig_nents) >>> + return -EINVAL; >> I must admit I don't understand that one either : how do comparing the >> number of >> "mapped" entries against the number of "allocated" entries determines if >> there >> is enough room ? > > That's for a dynamic sg table. If there is one sg table allocated > 'orig_nents' scatterlists, and we need copy another mapped scatterlist > into the sg table if there are some requirements. So we use 'nents' to > record how many scatterlists have been copied into the sg table. As I'm still having difficulities to understand, please explain to me : - what is a dynamic sg_table - how it works - if it's "struct sg_table", how the field of this structure are different when it's a dynamic sg_table from a "static sg_table" ? >>> +/** >>> + * sg_alloc_empty_table - Allocate one empty sg table >>> + * @sgt: The sg table header to use >>> + * @nents: Number of entries in sg list >>> + * @gfp_mask:GFP allocation mask >>> + * >>> + * Description: >>> + *Allocate and initialize an sg table. The 'nents' member of sg_table >>> + *indicates how many scatterlists added in the sg table. It should set >>> + *0 which means there are no scatterlists added in this sg table now. >>> + * >>> + **/ >>> +int sg_alloc_empty_table(struct sg_table *sgt, unsigned int nents, >>> + gfp_t gfp_mask) >> As for this one, there has to be a purpose for it I fail to see. From far >> away >> it looks exactly like sg_alloc_table(), excepting it "works around" the >> nents > >> 0 protection of __sg_alloc_table(). >> What is exactly the need for this one, and if it's usefull why not simply >> changing the __sg_alloc_table() "nents > 0" test and see what the outcome of >> the >> review will be ? > > Like I said above. If we want to copy some mapped scatterlists into > one sg table, we should set the 'nents' to 0 to indicates how many > scatterlists coppied in the sg table. So how do you unmap this scatterlist once you've lost the number of mapped entries ? I think we'll come back to this once I understand how a "dynamic" sg_table is different from a "static" one. Cheers. -- Robert -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/4] scatterlist: Introduce some helper functions
Baolin Wang <baolin.w...@linaro.org> writes: > @@ -212,6 +212,37 @@ static inline void sg_unmark_end(struct scatterlist *sg) > } > > /** > + * sg_is_contiguous - Check if the scatterlists are contiguous > + * @sga: SG entry > + * @sgb: SG entry > + * > + * Description: > + * If the sga scatterlist is contiguous with the sgb scatterlist, > + * that means they can be merged together. > + * > + **/ > +static inline bool sg_is_contiguous(struct scatterlist *sga, > + struct scatterlist *sgb) > +{ > + return ((sga->page_link & ~0x3UL) + sga->offset + sga->length == > + (sgb->page_link & ~0x3UL)); > +} I don't understand that one. sga->page_link is a pointer to a "struct page *". How can it be added to an offset within a page ??? > @@ -370,6 +370,65 @@ int sg_alloc_table(struct sg_table *table, unsigned int > nents, gfp_t gfp_mask) ... > /** > + * sg_add_sg_to_table - Add one scatterlist into sg table > + * @sgt: The sg table header to use > + * @src: The sg need to be added into sg table > + * > + * Description: > + * The 'nents' member indicates how many scatterlists added in the sg > table. > + * Copy the @src@ scatterlist into sg table and increase 'nents' member. > + * > + **/ > +int sg_add_sg_to_table(struct sg_table *sgt, struct scatterlist *src) > +{ > + unsigned int i = 0, orig_nents = sgt->orig_nents; > + struct scatterlist *sgl = sgt->sgl; > + struct scatterlist *sg; > + > + /* Check if there are enough space for the new sg to be added */ > + if (sgt->nents >= sgt->orig_nents) > + return -EINVAL; I must admit I don't understand that one either : how do comparing the number of "mapped" entries against the number of "allocated" entries determines if there is enough room ? > +/** > + * sg_alloc_empty_table - Allocate one empty sg table > + * @sgt: The sg table header to use > + * @nents: Number of entries in sg list > + * @gfp_mask:GFP allocation mask > + * > + * Description: > + *Allocate and initialize an sg table. The 'nents' member of sg_table > + *indicates how many scatterlists added in the sg table. It should set > + *0 which means there are no scatterlists added in this sg table now. > + * > + **/ > +int sg_alloc_empty_table(struct sg_table *sgt, unsigned int nents, > + gfp_t gfp_mask) As for this one, there has to be a purpose for it I fail to see. From far away it looks exactly like sg_alloc_table(), excepting it "works around" the nents > 0 protection of __sg_alloc_table(). What is exactly the need for this one, and if it's usefull why not simply changing the __sg_alloc_table() "nents > 0" test and see what the outcome of the review will be ? Cheers. -- Robert -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] ARM: convert all mov.* pc, reg to bx reg for ARMv6+ (part1)
Russell King rmk+ker...@arm.linux.org.uk writes: ARMv6 and greater introduced a new instruction (bx) which can be used to return from function calls. Recent CPUs perform better when the bx lr instruction is used rather than the mov pc, lr instruction, and this sequence is strongly recommended to be used by the ARM architecture manual (section A.4.1.1). For ARMv5 - XScale, and more specificaly the mioa701_bootresume.S path (suspend to RAM) : Tested-by: Robert Jarzmik robert.jarz...@free.fr Cheers. -- Robert -- To unsubscribe from this list: send the line unsubscribe linux-crypto in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 03/17] powerpc: Add PFO support to the VIO bus
* Benjamin Herrenschmidt (b...@kernel.crashing.org) wrote: Hrm... I don't like that much: + if (op-timeout) + deadline = jiffies + msecs_to_jiffies(op-timeout); + + while (true) { + hret = plpar_hcall_norets(H_COP, op-flags, + vdev-resource_id, + op-in, op-inlen, op-out, + op-outlen, op-csbcpb); + + if (hret == H_SUCCESS || + (hret != H_NOT_ENOUGH_RESOURCES +hret != H_BUSY hret != H_RESOURCE) || + (op-timeout time_after(deadline, jiffies))) + break; + + dev_dbg(dev, %s: hcall ret(%ld), retrying.\n, __func__, hret); + } + Is this meant to be called in atomic context ? If not, maybe it should at the very least do a cond_resched() ? Else, what about ceding the processor ? Or at the very least reducing the thread priority for a bit ? Shouldn't we also enforce to always have a timeout ? IE. Something like 30s or so if nothing specified to avoid having the kernel just hard lock... In general I don't like that sort of synchronous code, I'd rather return the busy status up the chain which gives a chance to the caller to take more appropriate measures depending on what it's doing, but that really depends what you use that synchronous call for. I suppose if it's for configuration type operations, it's ok... This function is called in atomic context, it is used by PFO-type device drivers to perform operations with the nest accelerator unit (like crypto acceleration). Having the timeout and retries in this function is the wrong thing to do. We'll resubmit this without the loop and the caller will be responsible for retrying the operations. I would rather have the caller cede the processor or alter thread priority where appropriate than doing that in this function. I don't think this should be done in this crypto driver. --Rob Jennings -- To unsubscribe from this list: send the line unsubscribe linux-crypto in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] CRYPTO: Simplify code using ARRAY_SIZE() macro.
On Mon, 26 May 2008, Herbert Xu wrote: On Sun, May 25, 2008 at 11:32:45AM +, Robert P. J. Day wrote: Signed-off-by: Robert P. J. Day [EMAIL PROTECTED] --- diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c index 81f3f95..c4c018d 100644 --- a/drivers/crypto/hifn_795x.c +++ b/drivers/crypto/hifn_795x.c @@ -894,7 +894,7 @@ static int hifn_enable_crypto(struct hifn_device *dev) char *offtbl = NULL; int i; - for (i = 0; i sizeof(pci2id)/sizeof(pci2id[0]); i++) { + for (i = 0; i ARRAY_SIZE(pci2id)); i++) { You've got an extra parenthesis here. You should be building the patches that you send, no matter how trivial they might look! I've fixed it for you this time. yes, my apologies. thanks. rday -- Robert P. J. Day Linux Consulting, Training and Annoying Kernel Pedantry: Have classroom, will lecture. http://crashcourse.ca Waterloo, Ontario, CANADA -- To unsubscribe from this list: send the line unsubscribe linux-crypto in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] CRYPTO: Simplify code using ARRAY_SIZE() macro.
Signed-off-by: Robert P. J. Day [EMAIL PROTECTED] --- diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c index 81f3f95..c4c018d 100644 --- a/drivers/crypto/hifn_795x.c +++ b/drivers/crypto/hifn_795x.c @@ -894,7 +894,7 @@ static int hifn_enable_crypto(struct hifn_device *dev) char *offtbl = NULL; int i; - for (i = 0; i sizeof(pci2id)/sizeof(pci2id[0]); i++) { + for (i = 0; i ARRAY_SIZE(pci2id)); i++) { if (pci2id[i].pci_vendor == dev-pdev-vendor pci2id[i].pci_prod == dev-pdev-device) { offtbl = pci2id[i].card_id; Robert P. J. Day Linux Consulting, Training and Annoying Kernel Pedantry: Have classroom, will lecture. http://crashcourse.ca Waterloo, Ontario, CANADA -- To unsubscribe from this list: send the line unsubscribe linux-crypto in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html