The old get_arch() function would only work on systems configured in English, since it looked for the 'Class:' string.
The new get_arch() function uses the 'magic' information from the readelf output to determine the architecture of the build from generated binary.
Signed-off-by: Rodolfo Silva <rodolfo@grupomarinho.com.br>
The old get_arch() function would only work on systems configured in English, since it looked for the 'Class:' string.
The new get_arch() function uses the 'magic' information from the readelf output to determine the architecture of the build from generated binary.
Signed-off-by: Rodolfo Silva <rodolfo@grupomarinho.com.br>
The old get_arch() function would only work on systems configured in English, since it looked for the 'Class:' string.
The new get_arch() function uses the 'magic' information from the readelf output to determine the architecture of the build from generated binary.
Signed-off-by: Rodolfo Silva <rodolfo@grupomarinho.com.br>
Modify build_mem_region to support an unaligned starting address. This
makes it symmetrical with regard to starting and ending partial pages;
previously, build_mem_region only support partial pages at the end of a
section (caller was responsible for handling the first page). Remove
the edge case handling of the first page from build_sections now that
build_mem_region does not have alignment restrictions.
Change the section_info_t parameter in build_mem_region to be a const
reference to eliminate any need to check for a null pointer.
Make the raw_data pointer in section_info_t const, as the source file's
data should never be modified. This is currently cast away via GET_PTR
in build_pages when calling into add_enclave_page; the add_enclave_page
flow can be modified by a future commit to retain the const modifier.
Add two utilities, is_relocation_page and build_partial_page, to reduce
copy-paste code.
Add PAGE_OFFSET macro to calculate the offset within a page.
Assert on address/size alignment in build_pages and build_context to
document expected alignment and catch any related code bugs.
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Set misc_attr in the top level sgx_create_enclave if _create_enclave
fails. This provides the user with the platform's capabilities when
sgx_create_enclave fails for any reason other than a parameter error.
Previously the misc_attr was only set upon failure if build_image
failed, which was not helpful when sgx_create_enclave failed due to
an attribute error, e.g. misc_select, as the flow aborted before it
reached build_image.
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
The signing tool parses values in the enclave configuration as 32-bit
integers. This patch changes it to parse them as 64-bit integers, so
that it can process larger enclaves. This only affects properties such
as MaxStackSize and MaxHeapSize, while subsequent 32-bit bookkeeping,
such as TCSPolicy, MiscSelect, and MiscMask are unchanged.
Signed-off-by: Warren He <-w@berkeley.edu>
The urts library and the signing tool often shift page counts as
32-bit integers, then passes the result as a 64-bit value. This patch
casts page counts into 64-bit integers first, so that large page
counts don't overflow.
Signed-off-by: Warren He <-w@berkeley.edu>
This release is used in conjunction with the linux-sgx-driver Intial release:
https://github.com/01org/linux-sgx-driver
commit-id: 0e865ce5e6b297a787bcdc12d98bada8174be6d7
Intel-id: 33399
Signed-off-by: Angie Chinchilla <angie.v.chinchilla@intel.com>