Skip to content

Commit

Permalink
External Release v2023.07.09
Browse files Browse the repository at this point in the history
Added new CPUs and instructions according to ISE (Intel Architecture Instruction Set Extensions
and Future Features) rev-049, June 2023.

Added:
  - Added new chips: Arrow-Lake and Lunar-Lake
  - Added new instructions: AVX-VNNI-INT16, SHA512, SM3, SM4 and PBNDKB
  - Updated SRF with UINTR and ENQCMD support
  • Loading branch information
sdeadmin authored Jul 9, 2023
1 parent 4dc7713 commit 539a6a3
Show file tree
Hide file tree
Showing 26 changed files with 1,213 additions and 6 deletions.
86 changes: 86 additions & 0 deletions .github/scripts/antivirus_scan.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/usr/bin/env python
# -*- python -*-
#BEGIN_LEGAL
#
#Copyright (c) 2023 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#END_LEGAL

from pathlib import Path
import platform
import re
import sys
import os
import utils
import argparse

def setup():
"""This function sets up the script env according to cmd line knobs."""
parser = argparse.ArgumentParser(description='anti-virus scan argument parser')
parser.add_argument('--path',
dest='av_path',
help='Path to anti-virus scan',
type=Path,
default='')
env = vars(parser.parse_args())
return env

def get_infected_files(avscan_path: Path) -> int:
"""
Returns the number of possibly infected files
Args:
avscan_path (Path): a path to malware scan results file
"""
with open(avscan_path, 'r') as f:
lines = f.readlines()

pattern = r"Possibly Infected:.............\s+(\d+)$"

for line in lines:
line = " ".join(line.split())
match = re.match(pattern, line)
if match:
return int(match.group(1))

assert False, 'Malware scan summary not found.' # normally shouldn't get here


if __name__ == '__main__':

env = setup()

os.makedirs('logs', exist_ok=True)
avscan_res_path = Path('logs', 'avscan.txt')
avscan_sum_path = Path('logs', 'antivirus_summary.txt')
# delete previous anti-virus scan results and summary
if avscan_res_path.exists(): os.remove(avscan_res_path)
if avscan_sum_path.exists(): os.remove(avscan_sum_path)

os = platform.system()

assert os == 'Linux', 'Anti-virus scan is currently only supported on Linux'

avargs = '--VERBOSE --RECURSIVE --SUMMARY'
av_scan_cmd = f"{env['av_path']} {avargs} {Path('./')} > {avscan_res_path}"
retval, retlines = utils.run_subprocess(av_scan_cmd)

# the summary yields number of suspicious files
infected_files = get_infected_files(avscan_res_path)

with open(avscan_sum_path, 'w') as f:
f.write(f'{infected_files} possibly infected files.')

sys.exit(retval)
46 changes: 46 additions & 0 deletions .github/workflows/sanity_external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,49 @@ jobs:
run: |
cd xed
python3 .github/scripts/sanity_external.py
# Malware scan
anti_virus_scan:
needs: init
runs-on:
- self-hosted
- xed-runners
- Linux
env:
AV_SCAN_PATH: ${{ secrets.AV_SCAN_PATH }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: xed
fetch-depth: 0
- name: Checkout mbuild
uses: actions/checkout@v3
with:
repository: intel-innersource/libraries.isa.xed.mbuild
ref: ${{ needs.init.outputs.mbuild_branch }}
path: mbuild
token: ${{ secrets.PAT }}
- name: anti-virus check
run: |
cd xed
python3 .github/scripts/antivirus_scan.py --path "${AV_SCAN_PATH}"
- name: upload full results # uploads anti-virus scan results as artifact
id: upload
uses: actions/upload-artifact@v3
with:
name: anti-virus-sum
path: xed/logs/avscan.txt
- name: add comment # uploads anti-virus scan summary as pull-request comment
uses: actions/github-script@v6
if: github.event_name == 'pull_request' # add scan summary as comment only if there is a PR
with:
script: |
const fs = require('fs');
const antivirusSummary = fs.readFileSync('xed/logs/antivirus_summary.txt', 'utf8');
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "Anti-virus scan summary: " + antivirusSummary
})
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2023.06.07
v2023.07.09
29 changes: 29 additions & 0 deletions datafiles/arrow-lake/arrow-lake-chips.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#BEGIN_LEGAL
#
#Copyright (c) 2023 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#END_LEGAL

ARROW_LAKE: \
ALL_OF(ALDER_LAKE) \
AVX_IFMA \
AVX_VNNI_INT8 \
AVX_NE_CONVERT \
CMPCCXADD \
UINTR \
AVX_VNNI_INT16 \
SM3 \
SM4 \
SHA512
20 changes: 20 additions & 0 deletions datafiles/arrow-lake/files.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#BEGIN_LEGAL
#
#Copyright (c) 2023 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#END_LEGAL

chip-models: arrow-lake-chips.txt

22 changes: 22 additions & 0 deletions datafiles/avx-vnni-int16/avx-vnni-int16-element-types.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#BEGIN_LEGAL
#
#Copyright (c) 2023 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#END_LEGAL
#XTYPE TYPE BITS-PER-ELEM
2i16 INT 32
2u16 UINT 32


Loading

0 comments on commit 539a6a3

Please sign in to comment.