Skip to content

s390x: z17 target feature detection #1832

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

folkertdev
Copy link
Contributor

tracking issue: rust-lang/rust#130869

I didn't add feature detection yet in #1826.

The implementation follows the information in rust-lang/rust#135413 (comment), in particular that HWCAP is used to check for the vector feature because it needs kernel support, and stfle is used for the other features because they only need hardware support.

cc @uweigand @taiki-e

@rustbot
Copy link
Collaborator

rustbot commented Jun 12, 2025

r? @Amanieu

rustbot has assigned @Amanieu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@folkertdev folkertdev force-pushed the s390x-z17-target-feature-detection branch from d968db9 to 7bf8a59 Compare June 12, 2025 17:20
/// These values are part of the platform-specific [asm/elf.h][kernel], and are a selection of the
/// fields found in the [Facility Indications].
///
/// [Facility Indications]: https://www.ibm.com/support/pages/sites/default/files/2021-05/SA22-7871-10.pdf#page=63
Copy link
Member

Choose a reason for hiding this comment

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

Where did you get the information about the facility bits that will be added in z17? (It is not included in the documentation at this link.)

Choose a reason for hiding this comment

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

I can confirm that the z17 facility bit values are correct. The new version of the Principles of Operation including z17 features will be released shortly after the general availability of the new machine (which is next week).

@folkertdev folkertdev force-pushed the s390x-z17-target-feature-detection branch from 7bf8a59 to 3809ead Compare June 12, 2025 17:31
enable_if_set(133, Feature::guarded_storage);
enable_if_set(150, Feature::enhanced_sort);
enable_if_set(151, Feature::deflate_conversion);
// added in z17

Choose a reason for hiding this comment

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

Do we need this comment? If so, should we add this information also for the vector-related facilities, and also specific machine information for pre-z17 machines?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nah, this list doesn't really have structure to it, but it should be OK given the official docs.

enable_if_set(151, Feature::deflate_conversion);
// added in z17
enable_if_set(84, Feature::miscellaneous_extensions_4);
enable_if_set(86, Feature::message_security_assist_extension12);

Choose a reason for hiding this comment

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

We should really include all currently defined features here. What I see missing is the older variants of miscellaneous_extensions and messact_security_assist_extension. These all have defined facility bits.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can only add features here when they are also recognized by the compiler. I'll add them there, but that does not need to block this PR I think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, I forgot that we did already add these to the compiler. Now they're in this PR too.

Choose a reason for hiding this comment

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

Thanks! Looks good to me now.

@folkertdev folkertdev force-pushed the s390x-z17-target-feature-detection branch from 3809ead to e8c0822 Compare June 14, 2025 13:44
@folkertdev folkertdev force-pushed the s390x-z17-target-feature-detection branch from e8c0822 to 9ab93dc Compare June 14, 2025 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants