RE: [RFC v1 PATCH 3/3] driver: update all the code that use soc_device_match

2021-04-19 Thread Alice Guo (OSS)
> -Original Message- > From: Dominique MARTINET > Sent: 2021年4月19日 13:03 > To: Alice Guo (OSS) > Subject: Re: [RFC v1 PATCH 3/3] driver: update all the code that use > soc_device_match > > Alice Guo (OSS) wrote on Mon, Apr 19, 2021 at 12:27:22PM +0800: > > From: Alice Guo > > > > Upda

Re: [RFC v1 PATCH 1/3] drivers: soc: add support for soc_device_match returning -EPROBE_DEFER

2021-04-19 Thread Geert Uytterhoeven
Hi Alice, CC Arnd (soc_device_match() author) On Mon, Apr 19, 2021 at 6:28 AM Alice Guo (OSS) wrote: > From: Alice Guo > > In i.MX8M boards, the registration of SoC device is later than caam > driver which needs it. Caam driver needs soc_device_match to provide > -EPROBE_DEFER when no SoC devic

Re: [RFC v1 PATCH 3/3] driver: update all the code that use soc_device_match

2021-04-19 Thread Geert Uytterhoeven
Hi Dominique, CC Arnd (soc_device_match() author) On Mon, Apr 19, 2021 at 7:03 AM Dominique MARTINET wrote: > Alice Guo (OSS) wrote on Mon, Apr 19, 2021 at 12:27:22PM +0800: > > From: Alice Guo > > Update all the code that use soc_device_match > > A single patch might be difficult to accept for

Re: [RFC v1 PATCH 3/3] driver: update all the code that use soc_device_match

2021-04-19 Thread Dominique MARTINET
Geert Uytterhoeven wrote on Mon, Apr 19, 2021 at 11:03:24AM +0200: > > This is going to need quite some more work to be acceptable, in my > > opinion, but I think it should be possible. > > In general, this is very hard to do, IMHO. Some drivers may be used on > multiple platforms, some of them

Re: [PATCH] crypto: hisilicon/hpre - fix unmapping invalid dma address

2021-04-19 Thread Hui Tang
On 2021/4/16 19:26, Herbert Xu wrote: On Sat, Apr 10, 2021 at 05:49:17PM +0800, Hui Tang wrote: Currently, an invalid dma address may be unmapped when calling 'xx_data_clr_all' in error path, so check dma address of sqe in/out whether it has been mapped before calling 'dma_free_coherent' or '

Re: [RFC v1 PATCH 3/3] driver: update all the code that use soc_device_match

2021-04-19 Thread Arnd Bergmann
On Mon, Apr 19, 2021 at 11:33 AM Dominique MARTINET wrote: > Geert Uytterhoeven wrote on Mon, Apr 19, 2021 at 11:03:24AM +0200: > > > soc_device_match() should only be used as a last resort, to identify > > systems that cannot be identified otherwise. Typically this is used for > > quirks, which

Re: [RFC Part2 PATCH 04/30] x86/mm: split the physmap when adding the page in RMP table

2021-04-19 Thread Borislav Petkov
On Wed, Mar 24, 2021 at 12:04:10PM -0500, Brijesh Singh wrote: > A write from the hypervisor goes through the RMP checks. When the > hypervisor writes to pages, hardware checks to ensures that the assigned > bit in the RMP is zero (i.e page is shared). If the page table entry that > gives the sPA i

Re: [RFC v1 PATCH 3/3] driver: update all the code that use soc_device_match

2021-04-19 Thread Guenter Roeck
On 4/18/21 9:27 PM, Alice Guo (OSS) wrote: > From: Alice Guo > > Update all the code that use soc_device_match because add support for > soc_device_match returning -EPROBE_DEFER. > > Signed-off-by: Alice Guo > --- [ ... ] > drivers/watchdog/renesas_wdt.c| 2 +- > 48 files chan

Re: [RFC Part2 PATCH 04/30] x86/mm: split the physmap when adding the page in RMP table

2021-04-19 Thread Brijesh Singh
On 4/19/21 7:32 AM, Borislav Petkov wrote: > On Wed, Mar 24, 2021 at 12:04:10PM -0500, Brijesh Singh wrote: >> A write from the hypervisor goes through the RMP checks. When the >> hypervisor writes to pages, hardware checks to ensures that the assigned >> bit in the RMP is zero (i.e page is share

Re: [RFC Part2 PATCH 04/30] x86/mm: split the physmap when adding the page in RMP table

2021-04-19 Thread Borislav Petkov
On Mon, Apr 19, 2021 at 10:25:01AM -0500, Brijesh Singh wrote: > To my understanding, we don't group 512 4K entries into a 2M for the > kernel address range. We do this for the userspace address through > khugepage daemon. If page tables get out of sync then it will cause an > RMP violation, the Pa

Re: [RFC Part2 PATCH 04/30] x86/mm: split the physmap when adding the page in RMP table

2021-04-19 Thread Dave Hansen
On 4/19/21 10:46 AM, Brijesh Singh wrote: > - guest wants to make gpa 0x1000 as a shared page. To support this, we > need to psmash the large RMP entry into 512 4K entries. The psmash > instruction breaks the large RMP entry into 512 4K entries without > affecting the previous validation. Now the w

Re: [RFC Part2 PATCH 04/30] x86/mm: split the physmap when adding the page in RMP table

2021-04-19 Thread Andy Lutomirski
> On Apr 19, 2021, at 10:58 AM, Dave Hansen wrote: > > On 4/19/21 10:46 AM, Brijesh Singh wrote: >> - guest wants to make gpa 0x1000 as a shared page. To support this, we >> need to psmash the large RMP entry into 512 4K entries. The psmash >> instruction breaks the large RMP entry into 512 4

Re: [RFC Part2 PATCH 04/30] x86/mm: split the physmap when adding the page in RMP table

2021-04-19 Thread Dave Hansen
On 4/19/21 11:10 AM, Andy Lutomirski wrote: > I’m confused by this scenario. This should only affect physical pages > that are in the 2M area that contains guest memory. But, if we have a > 2M direct map PMD entry that contains kernel data and guest private > memory, we’re already in a situation in

Re: [RFC Part2 PATCH 04/30] x86/mm: split the physmap when adding the page in RMP table

2021-04-19 Thread Andy Lutomirski
> On Apr 19, 2021, at 11:33 AM, Dave Hansen wrote: > > On 4/19/21 11:10 AM, Andy Lutomirski wrote: >> I’m confused by this scenario. This should only affect physical pages >> that are in the 2M area that contains guest memory. But, if we have a >> 2M direct map PMD entry that contains kernel

Re: [PATCH] crypto: jitterentropy - change back to module_init()

2021-04-19 Thread Eric Biggers
On Mon, Apr 19, 2021 at 04:16:13AM +, Mothershead, Hailey wrote: > Hello, >   > The patch quoted below causes the kernel to panic when fips is enabled with: >  >alg: ecdh: test failed on vector 2, err=-14 >Kernel panic - not syncing: alg: self-tests for ecdh-generic (ecd

Re: [RFC Part2 PATCH 04/30] x86/mm: split the physmap when adding the page in RMP table

2021-04-19 Thread Brijesh Singh
On 4/19/21 1:10 PM, Andy Lutomirski wrote: > >> On Apr 19, 2021, at 10:58 AM, Dave Hansen wrote: >> >> On 4/19/21 10:46 AM, Brijesh Singh wrote: >>> - guest wants to make gpa 0x1000 as a shared page. To support this, we >>> need to psmash the large RMP entry into 512 4K entries. The psmash >>>

Re: [PATCH 1/2] fscrypt: relax Kconfig dependencies for crypto API algorithms

2021-04-19 Thread Eric Biggers
On Fri, Apr 16, 2021 at 06:06:41PM +0200, Ard Biesheuvel wrote: > Even if FS encryption has strict functional dependencies on various > crypto algorithms and chaining modes. those dependencies could potentially > be satisified by other implementations than the generic ones, and no link > time depen

Re: [PATCH 2/2] fsverity: relax build time dependency on CRYPTO_SHA256

2021-04-19 Thread Eric Biggers
On Fri, Apr 16, 2021 at 06:06:42PM +0200, Ard Biesheuvel wrote: > CONFIG_CRYPTO_SHA256 denotes the generic C implementation of the SHA-256 > shash algorithm, which is selected as the default crypto shash provider > for fsverity. However, fsverity has no strict link time dependency, and > the same s

Re: [PATCH 1/1 v9] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-19 Thread Eric Biggers
On Fri, Apr 16, 2021 at 09:16:55AM -0400, Chris von Recklinghausen wrote: > Hibernation fails on a system in fips mode because md5 is used for the e820 > integrity check and is not available. Use crc32 instead. Doesn't the commit title need to be prefixed with something like "x86/power"? > The ch

RE: [PATCH 1/1 v9] use crc32 instead of md5 for hibernation e820 integrity check

2021-04-19 Thread Dexuan Cui
> From: Chris von Recklinghausen > Sent: Friday, April 16, 2021 6:17 AM > ... > Hibernation fails on a system in fips mode because md5 is used for the e820 > integrity check and is not available. Use crc32 instead. > > The check is intended to detect whether the E820 memory map provided > by the

Re: [RFC v1 PATCH 3/3] driver: update all the code that use soc_device_match

2021-04-19 Thread Dominique MARTINET
Arnd Bergmann wrote on Mon, Apr 19, 2021 at 02:16:36PM +0200: > In some cases, you can use the device_link infrastructure to deal > with dependencies between devices. Not sure if this would help > in your case, but have a look at device_link_add() etc in drivers/base/core.c I'll need to actually t

[Patch v3 1/7] crypto: qce: common: Add MAC failed error checking

2021-04-19 Thread Thara Gopinath
MAC_FAILED gets set in the status register if authenthication fails for ccm algorithms(during decryption). Add support to catch and flag this error. Reviewed-by: Bjorn Andersson Signed-off-by: Thara Gopinath --- v1->v2: - Split the error checking for -ENXIO and -EBADMSG into if-else cla

[Patch v3 0/7] Add support for AEAD algorithms in Qualcomm Crypto Engine driver

2021-04-19 Thread Thara Gopinath
Enable support for AEAD algorithms in Qualcomm CE driver. The first three patches in this series are cleanups and add a few missing pieces required to add support for AEAD algorithms. Patch 4 introduces supported AEAD transformations on Qualcomm CE. Patches 5 and 6 implements the h/w infrastruct

[Patch v3 2/7] crypto: qce: common: Make result dump optional

2021-04-19 Thread Thara Gopinath
Qualcomm crypto engine allows for IV registers and status register to be concatenated to the output. This option is enabled by setting the RESULTS_DUMP field in GOPROC register. This is useful for most of the algorithms to either retrieve status of operation or in case of authentication algorithms

[Patch v3 4/7] crypto: qce: Add support for AEAD algorithms

2021-04-19 Thread Thara Gopinath
Introduce support to enable following algorithms in Qualcomm Crypto Engine. - authenc(hmac(sha1),cbc(des)) - authenc(hmac(sha1),cbc(des3_ede)) - authenc(hmac(sha256),cbc(des)) - authenc(hmac(sha256),cbc(des3_ede)) - authenc(hmac(sha256),cbc(aes)) - ccm(aes) - rfc4309(ccm(aes)) Signed-off-by: Thar

[Patch v3 3/7] crypto: qce: Add mode for rfc4309

2021-04-19 Thread Thara Gopinath
rf4309 is the specification that uses aes ccm algorithms with IPsec security packets. Add a submode to identify rfc4309 ccm(aes) algorithm in the crypto driver. Reviewed-by: Bjorn Andersson Signed-off-by: Thara Gopinath --- v1->v2: - Moved up the QCE_ENCRYPT AND QCE_DECRYPT bit position

[Patch v3 5/7] crypto: qce: common: Clean up qce_auth_cfg

2021-04-19 Thread Thara Gopinath
Remove various redundant checks in qce_auth_cfg. Also allow qce_auth_cfg to take auth_size as a parameter which is a required setting for ccm(aes) algorithms Signed-off-by: Thara Gopinath --- drivers/crypto/qce/common.c | 21 + 1 file changed, 9 insertions(+), 12 deletions(-)

[Patch v3 7/7] crypto: qce: aead: Schedule fallback algorithm

2021-04-19 Thread Thara Gopinath
Qualcomm crypto engine does not handle the following scenarios and will issue an abort. In such cases, pass on the transformation to a fallback algorithm. - DES3 algorithms with all three keys same. - AES192 algorithms. - 0 length messages. Signed-off-by: Thara Gopinath --- v1->v2: - Up

[Patch v3 6/7] crypto: qce: common: Add support for AEAD algorithms

2021-04-19 Thread Thara Gopinath
Add register programming sequence for enabling AEAD algorithms on the Qualcomm crypto engine. Signed-off-by: Thara Gopinath --- v2->v3: - Made qce_be32_to_cpu_array truly be32 to cpu endian by using be32_to_cpup instead of cpu_to_be32p. Also remove the (u32 *) typcasting of ar

Re: [PATCH 2/4] PKCS#7: Check codeSigning EKU for kernel module and kexec pe verification

2021-04-19 Thread joeyli
Hi Varad, Thanks for your review! On Thu, Apr 15, 2021 at 02:08:32PM +0200, Varad Gautam wrote: > Hi Joey, > > On 4/9/21 4:46 AM, Lee, Chun-Yi wrote: > > This patch adds the logic for checking the CodeSigning extended > > key usage when verifying signature of kernel module or > > kexec PE binary