Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[linux-6.6.y] Driver for Zhaoxin SM3 SM4 algorithms #272

Merged

Conversation

leoliu-oc
Copy link
Contributor

Includes:

  1. Add support for Zhaoxin GMI SM3 Secure Hash algorithm
    This SM3 algorithm driver is developed to support the SM3 instruction,
    making user develop their applications with both high performance and high
    security.
  2. Add support for Zhaoxin GMI SM4 Block Cipher algorithm
    This SM4 algorithm driver is developed to support the SM4 instruction,
    making user develop their applications with both high performance and high
    security.

@deepin-ci-robot
Copy link

Hi @leoliu-oc. Thanks for your PR.

I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign goldendeng for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

if (gmi_available() == 0)
return crypto_register_shash(&zx_sm3_alg);

pr_warn("GMI is unavailable on this platform.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里应该是pr_info 不应该是pr_warn吧 所有x86都会走

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

更新了一般,这里调整了逻辑。在匹配成功后才会pr_info打印。匹配不成功时不打印。这样就只有在兆芯平台才会有打印信息。

pr_notice("GMI SM4 is detected by CPUID\n");
return 0;
}
pr_notice("GMI SM4 is available\n");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is available 为什么要用pr_notice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

新版本中改为了pr_debug,供debug时判定用。正常情况下不输出log。

if ((edx & 0x0030) != 0x0030)
return -ENODEV;

pr_notice("GMI SM4 is detected by CPUID\n");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is available 为什么要用pr_notice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上。

if ((edx & 0x0030) != 0x0030)
return -ENODEV;

pr_notice("GMI SM3 detected by CPUID\n");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is available 为什么要用pr_notice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上。

pr_notice("GMI SM3 detected by CPUID\n");
return 0;
}
pr_notice("GMI SM3 is available\n");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is available 为什么要用pr_notice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上。

@leoliu-oc leoliu-oc force-pushed the linux-6.6.y-47-sm3-sm4 branch from 0dd3699 to 7e843ed Compare July 4, 2024 03:19
leoliu-oc added 2 commits July 4, 2024 11:24
zhaoxin inclusion
category: feature
CVE: NA

-----------------

This SM3 algorithm driver is developed to support the SM3 instruction,
making user develop their applications with both high performance and high
security.

Signed-off-by: leoliu-oc <[email protected]>
zhaoxin inclusion
category: feature
CVE: NA

-----------------

This SM4 algorithm driver is developed to support the SM4 instruction,
making user develop their applications with both high performance and high
security.

Signed-off-by: leoliu-oc <[email protected]>
@leoliu-oc leoliu-oc force-pushed the linux-6.6.y-47-sm3-sm4 branch from 7e843ed to 1c3c56d Compare July 4, 2024 03:26
@opsiff
Copy link
Member

opsiff commented Jul 4, 2024

/lgtm

@opsiff
Copy link
Member

opsiff commented Jul 4, 2024

/ok-to-test

@deepin-ci-robot
Copy link

New changes are detected. LGTM label has been removed.

@opsiff opsiff merged commit e513a51 into deepin-community:linux-6.6.y Jul 4, 2024
2 of 3 checks passed
@deepin-ci-robot
Copy link

deepin pr auto review

Add ZX-E and ZX-C+ support for SM4

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@136214 91177308-0d34-0410-b5e6-96231b3b80d8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants