From: "Jarkko Sakkinen" <jarkko@kernel.org>
To: "Haitao Huang" <haitao.huang@linux.intel.com>,
<dave.hansen@linux.intel.com>, <kai.huang@intel.com>,
<tj@kernel.org>, <mkoutny@suse.com>,
<linux-kernel@vger.kernel.org>, <linux-sgx@vger.kernel.org>,
<x86@kernel.org>, <cgroups@vger.kernel.org>, <tglx@linutronix.de>,
<mingo@redhat.com>, <bp@alien8.de>, <hpa@zytor.com>,
<sohil.mehta@intel.com>, <tim.c.chen@linux.intel.com>
Cc: <zhiquan1.li@intel.com>, <kristen@linux.intel.com>,
<seanjc@google.com>, <zhanb@microsoft.com>,
<anakrish@microsoft.com>, <mikko.ylinen@linux.intel.com>,
<yangjie@microsoft.com>, <chrisyan@microsoft.com>
Subject: Re: [PATCH v12 14/14] selftests/sgx: Add scripts for EPC cgroup testing
Date: Tue, 16 Apr 2024 17:05:51 +0300 [thread overview]
Message-ID: <D0LLS28WEXYA.G15BAG7WOJGR@kernel.org> (raw)
In-Reply-To: <20240416032011.58578-15-haitao.huang@linux.intel.com>
On Tue Apr 16, 2024 at 6:20 AM EEST, Haitao Huang wrote:
> With different cgroups, the script starts one or multiple concurrent SGX
> selftests (test_sgx), each to run the unclobbered_vdso_oversubscribed
> test case, which loads an enclave of EPC size equal to the EPC capacity
> available on the platform. The script checks results against the
> expectation set for each cgroup and reports success or failure.
>
> The script creates 3 different cgroups at the beginning with following
> expectations:
>
> 1) SMALL - intentionally small enough to fail the test loading an
> enclave of size equal to the capacity.
> 2) LARGE - large enough to run up to 4 concurrent tests but fail some if
> more than 4 concurrent tests are run. The script starts 4 expecting at
> least one test to pass, and then starts 5 expecting at least one test
> to fail.
> 3) LARGER - limit is the same as the capacity, large enough to run lots of
> concurrent tests. The script starts 8 of them and expects all pass.
> Then it reruns the same test with one process randomly killed and
> usage checked to be zero after all processes exit.
>
> The script also includes a test with low mem_cg limit and LARGE sgx_epc
> limit to verify that the RAM used for per-cgroup reclamation is charged
> to a proper mem_cg. For this test, it turns off swapping before start,
> and turns swapping back on afterwards.
>
> Add README to document how to run the tests.
>
> Signed-off-by: Haitao Huang <haitao.huang@linux.intel.com>
jarkko@mustatorvisieni:~/linux-tpmdd> sudo make -C tools/testing/selftests/sgx run_tests
make: Entering directory '/home/jarkko/linux-tpmdd/tools/testing/selftests/sgx'
gcc -Wall -Werror -g -I/home/jarkko/linux-tpmdd/tools/testing/selftests/../../../tools/include -fPIC -c main.c -o /home/jarkko/linux-tpmdd/tools/testing/selftests/sgx/main.o
gcc -Wall -Werror -g -I/home/jarkko/linux-tpmdd/tools/testing/selftests/../../../tools/include -fPIC -c load.c -o /home/jarkko/linux-tpmdd/tools/testing/selftests/sgx/load.o
gcc -Wall -Werror -g -I/home/jarkko/linux-tpmdd/tools/testing/selftests/../../../tools/include -fPIC -c sigstruct.c -o /home/jarkko/linux-tpmdd/tools/testing/selftests/sgx/sigstruct.o
gcc -Wall -Werror -g -I/home/jarkko/linux-tpmdd/tools/testing/selftests/../../../tools/include -fPIC -c call.S -o /home/jarkko/linux-tpmdd/tools/testing/selftests/sgx/call.o
gcc -Wall -Werror -g -I/home/jarkko/linux-tpmdd/tools/testing/selftests/../../../tools/include -fPIC -c sign_key.S -o /home/jarkko/linux-tpmdd/tools/testing/selftests/sgx/sign_key.o
gcc -Wall -Werror -g -I/home/jarkko/linux-tpmdd/tools/testing/selftests/../../../tools/include -fPIC -o /home/jarkko/linux-tpmdd/tools/testing/selftests/sgx/test_sgx /home/jarkko/linux-tpmdd/tools/testing/selftests/sgx/main.o /home/jarkko/linux-tpmdd/tools/testing/selftests/sgx/load.o /home/jarkko/linux-tpmdd/tools/testing/selftests/sgx/sigstruct.o /home/jarkko/linux-tpmdd/tools/testing/selftests/sgx/call.o /home/jarkko/linux-tpmdd/tools/testing/selftests/sgx/sign_key.o -z noexecstack -lcrypto
gcc -Wall -Werror -static-pie -nostdlib -ffreestanding -fPIE -fno-stack-protector -mrdrnd -I/home/jarkko/linux-tpmdd/tools/testing/selftests/../../../tools/include test_encl.c test_encl_bootstrap.S -o /home/jarkko/linux-tpmdd/tools/testing/selftests/sgx/test_encl.elf -Wl,-T,test_encl.lds,--build-id=none
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: warning: /tmp/ccqvDJVg.o: missing .note.GNU-stack section implies executable stack
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
TAP version 13
1..2
# timeout set to 45
# selftests: sgx: test_sgx
# TAP version 13
# 1..16
# # Starting 16 tests from 1 test cases.
# # RUN enclave.unclobbered_vdso ...
# # OK enclave.unclobbered_vdso
# ok 1 enclave.unclobbered_vdso
# # RUN enclave.unclobbered_vdso_oversubscribed ...
# # OK enclave.unclobbered_vdso_oversubscribed
# ok 2 enclave.unclobbered_vdso_oversubscribed
# # RUN enclave.unclobbered_vdso_oversubscribed_remove ...
# # main.c:402:unclobbered_vdso_oversubscribed_remove:Creating an enclave with 98566144 bytes heap may take a while ...
# # main.c:457:unclobbered_vdso_oversubscribed_remove:Changing type of 98566144 bytes to trimmed may take a while ...
# # main.c:473:unclobbered_vdso_oversubscribed_remove:Entering enclave to run EACCEPT for each page of 98566144 bytes may take a while ...
# # main.c:494:unclobbered_vdso_oversubscribed_remove:Removing 98566144 bytes from enclave may take a while ...
# # OK enclave.unclobbered_vdso_oversubscribed_remove
# ok 3 enclave.unclobbered_vdso_oversubscribed_remove
# # RUN enclave.clobbered_vdso ...
# # OK enclave.clobbered_vdso
# ok 4 enclave.clobbered_vdso
# # RUN enclave.clobbered_vdso_and_user_function ...
# # OK enclave.clobbered_vdso_and_user_function
# ok 5 enclave.clobbered_vdso_and_user_function
# # RUN enclave.tcs_entry ...
# # OK enclave.tcs_entry
# ok 6 enclave.tcs_entry
# # RUN enclave.pte_permissions ...
# # OK enclave.pte_permissions
# ok 7 enclave.pte_permissions
# # RUN enclave.tcs_permissions ...
# # OK enclave.tcs_permissions
# ok 8 enclave.tcs_permissions
# # RUN enclave.epcm_permissions ...
# # OK enclave.epcm_permissions
# ok 9 enclave.epcm_permissions
# # RUN enclave.augment ...
# # OK enclave.augment
# ok 10 enclave.augment
# # RUN enclave.augment_via_eaccept ...
# # OK enclave.augment_via_eaccept
# ok 11 enclave.augment_via_eaccept
# # RUN enclave.tcs_create ...
# # OK enclave.tcs_create
# ok 12 enclave.tcs_create
# # RUN enclave.remove_added_page_no_eaccept ...
# # OK enclave.remove_added_page_no_eaccept
# ok 13 enclave.remove_added_page_no_eaccept
# # RUN enclave.remove_added_page_invalid_access ...
# # OK enclave.remove_added_page_invalid_access
# ok 14 enclave.remove_added_page_invalid_access
# # RUN enclave.remove_added_page_invalid_access_after_eaccept ...
# # OK enclave.remove_added_page_invalid_access_after_eaccept
# ok 15 enclave.remove_added_page_invalid_access_after_eaccept
# # RUN enclave.remove_untouched_page ...
# # OK enclave.remove_untouched_page
# ok 16 enclave.remove_untouched_page
# # PASSED: 16 / 16 tests passed.
# # Totals: pass:16 fail:0 xfail:0 xpass:0 skip:0 error:0
ok 1 selftests: sgx: test_sgx
# timeout set to 45
# selftests: sgx: run_epc_cg_selftests.sh
# # Setting up limits.
# ./run_epc_cg_selftests.sh: line 50: echo: write error: Invalid argument
# # Failed setting up misc limits.
not ok 2 selftests: sgx: run_epc_cg_selftests.sh # exit=1
make: Leaving directory '/home/jarkko/linux-tpmdd/tools/testing/selftests/sgx'
This is what happens now.
BTW, I noticed a file that should not exist, i.e. README. Only thing
that should exist is the tests for kselftest and anything else should
not exist at all, so this file by definiton should not exist.
BR, Jarkko
next prev parent reply other threads:[~2024-04-16 14:05 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-16 3:19 [PATCH v12 00/14] Add Cgroup support for SGX EPC memory Haitao Huang
2024-04-16 3:19 ` [PATCH v12 01/14] x86/sgx: Replace boolean parameters with enums Haitao Huang
2024-04-16 3:19 ` [PATCH v12 02/14] cgroup/misc: Add per resource callbacks for CSS events Haitao Huang
2024-04-16 3:20 ` [PATCH v12 03/14] cgroup/misc: Export APIs for SGX driver Haitao Huang
2024-04-16 3:20 ` [PATCH v12 04/14] cgroup/misc: Add SGX EPC resource type Haitao Huang
2024-04-16 3:20 ` [PATCH v12 05/14] x86/sgx: Implement basic EPC misc cgroup functionality Haitao Huang
2024-04-16 13:22 ` Huang, Kai
2024-04-18 22:41 ` Haitao Huang
2024-04-18 23:29 ` Huang, Kai
2024-04-19 18:15 ` Haitao Huang
2024-04-19 22:21 ` Huang, Kai
2024-04-16 22:23 ` Haitao Huang
2024-04-16 3:20 ` [PATCH v12 06/14] x86/sgx: Add sgx_epc_lru_list to encapsulate LRU list Haitao Huang
2024-04-16 3:20 ` [PATCH v12 07/14] x86/sgx: Abstract tracking reclaimable pages in LRU Haitao Huang
2024-04-16 14:07 ` Huang, Kai
2024-04-16 22:48 ` Haitao Huang
2024-04-16 3:20 ` [PATCH v12 08/14] x86/sgx: Add basic EPC reclamation flow for cgroup Haitao Huang
2024-04-17 23:51 ` Huang, Kai
2024-04-23 15:53 ` Haitao Huang
2024-04-16 3:20 ` [PATCH v12 09/14] x86/sgx: Implement async reclamation " Haitao Huang
2024-04-19 1:32 ` Huang, Kai
2024-04-19 18:55 ` Haitao Huang
2024-04-19 22:44 ` Huang, Kai
2024-04-20 1:14 ` Haitao Huang
2024-04-22 0:22 ` Huang, Kai
2024-04-22 16:17 ` Haitao Huang
2024-04-22 22:16 ` Huang, Kai
2024-04-23 13:08 ` Haitao Huang
2024-04-23 14:19 ` Huang, Kai
2024-04-23 15:30 ` Haitao Huang
2024-04-23 22:13 ` Huang, Kai
2024-04-24 0:26 ` Haitao Huang
2024-04-24 2:13 ` Huang, Kai
2024-04-16 3:20 ` [PATCH v12 10/14] x86/sgx: Charge mem_cgroup for per-cgroup reclamation Haitao Huang
2024-04-23 7:21 ` Huang, Kai
2024-04-16 3:20 ` [PATCH v12 11/14] x86/sgx: Abstract check for global reclaimable pages Haitao Huang
2024-04-16 3:20 ` [PATCH v12 12/14] x86/sgx: Turn on per-cgroup EPC reclamation Haitao Huang
2024-04-29 10:49 ` Huang, Kai
2024-04-29 16:05 ` Haitao Huang
2024-04-29 22:18 ` Huang, Kai
2024-04-30 1:31 ` Haitao Huang
2024-04-16 3:20 ` [PATCH v12 13/14] Docs/x86/sgx: Add description for cgroup support Haitao Huang
2024-04-21 7:18 ` Bagas Sanjaya
2024-04-23 7:29 ` Huang, Kai
2024-04-16 3:20 ` [PATCH v12 14/14] selftests/sgx: Add scripts for EPC cgroup testing Haitao Huang
2024-04-16 5:16 ` Haitao Huang
2024-04-16 5:42 ` Huang, Kai
2024-04-16 14:15 ` Jarkko Sakkinen
2024-04-26 14:28 ` Dave Hansen
2024-04-28 22:03 ` Jarkko Sakkinen
2024-04-29 16:18 ` Haitao Huang
2024-04-29 16:43 ` Jarkko Sakkinen
2024-04-29 17:14 ` Haitao Huang
2024-04-16 15:00 ` Haitao Huang
2024-04-16 14:05 ` Jarkko Sakkinen [this message]
2024-04-16 14:10 ` Jarkko Sakkinen
2024-04-16 14:54 ` Haitao Huang
2024-04-16 16:08 ` Jarkko Sakkinen
2024-04-16 22:04 ` Haitao Huang
2024-04-16 22:21 ` Haitao Huang
2024-04-17 3:05 ` Haitao Huang
2024-04-17 22:46 ` Jarkko Sakkinen
2024-04-24 19:42 ` Haitao Huang
2024-04-25 4:51 ` Jarkko Sakkinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D0LLS28WEXYA.G15BAG7WOJGR@kernel.org \
--to=jarkko@kernel.org \
--cc=anakrish@microsoft.com \
--cc=bp@alien8.de \
--cc=cgroups@vger.kernel.org \
--cc=chrisyan@microsoft.com \
--cc=dave.hansen@linux.intel.com \
--cc=haitao.huang@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kai.huang@intel.com \
--cc=kristen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sgx@vger.kernel.org \
--cc=mikko.ylinen@linux.intel.com \
--cc=mingo@redhat.com \
--cc=mkoutny@suse.com \
--cc=seanjc@google.com \
--cc=sohil.mehta@intel.com \
--cc=tglx@linutronix.de \
--cc=tim.c.chen@linux.intel.com \
--cc=tj@kernel.org \
--cc=x86@kernel.org \
--cc=yangjie@microsoft.com \
--cc=zhanb@microsoft.com \
--cc=zhiquan1.li@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).