Skip to content

Commit

Permalink
Merge pull request sap-linuxlab#797 from berndfinger/issue-793-enable…
Browse files Browse the repository at this point in the history
…-tsx-on-rhel-9

sap_hana_preconfigure: Enable TSX also for RHEL 9
  • Loading branch information
berndfinger authored Jul 9, 2024
2 parents baafe51 + b91e53f commit c0c6a82
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 6 additions & 5 deletions roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tsx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
when:
- ansible_architecture == 'x86_64'
- ansible_distribution == 'RedHat'
- ansible_distribution_major_version == '8'
- __sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 3
- (ansible_distribution_major_version >= '9') or
(ansible_distribution_major_version == '8' and
__sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 3)
block:

# There are CPUs which are not capable of enabling the rtm flag, so we just report the status:
- name: Get all CPU flags
ansible.builtin.shell: set -o pipefail && lscpu | grep "^Flags:"
register: __sap_hana_preconfigure_register_lscpu_flags
changed_when: no
changed_when: false

- name: Report that the rtm CPU flag exists
ansible.builtin.debug:
Expand All @@ -30,7 +31,7 @@
- name: TSX - Get contents of GRUB_CMDLINE_LINUX in /etc/default/grub
ansible.builtin.command: grep GRUB_CMDLINE_LINUX /etc/default/grub
register: __sap_hana_preconfigure_register_default_grub_cmdline_tsx_assert
changed_when: no
changed_when: false

- name: Assert that tsx=on is in GRUB_CMDLINE_LINUX in /etc/default/grub
ansible.builtin.assert:
Expand All @@ -57,7 +58,7 @@
- name: TSX - Get contents of /proc/cmdline
ansible.builtin.command: cat /proc/cmdline
register: __sap_hana_preconfigure_register_proc_cmdline_tsx_assert
changed_when: no
changed_when: false

- name: Assert that tsx=on is in /proc/cmdline
ansible.builtin.assert:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
when:
- ansible_architecture == 'x86_64'
- ansible_distribution == 'RedHat'
- ansible_distribution_major_version == '8'
- __sap_hana_preconfigure_fact_ansible_distribution_minor_version|int >= 3
- (ansible_distribution_major_version >= '9') or
(ansible_distribution_major_version == '8' and
__sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 3)
- not ( __sap_hana_preconfigure_register_proc_cmdline['content'] | b64decode | regex_findall('tsx=on') )
tags: grubconfig

0 comments on commit c0c6a82

Please sign in to comment.