Skip to content
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

Rounding fix #1519

Merged
merged 2 commits into from
May 11, 2017
Merged

Rounding fix #1519

merged 2 commits into from
May 11, 2017

Conversation

jenswi-linaro
Copy link
Contributor

Fixes problem with upper 32-bit of a 64-bit address being zeroed out when rounding the address.

@etienne-lms
Copy link
Contributor

Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>

@jenswi-linaro
Copy link
Contributor Author

@zhizhouzh is it OK if I add:

Reported-by: Zhizhou Zhang <zhizhouzhang@asrmicro.com>
Tested-by: Zhizhou Zhang <zhizhouzhang@asrmicro.com>

to the commits?

@zhizhouzh
Copy link
Contributor

@jenswi-linaro Sure, no problem.

Fixes the ROUNDUP()/ROUNDDOWN() macros to mask internally with a bitmask
that is of the same size as the value that is to be rounded. Without
this patch the mask uses the size of the type of the @SiZe parameter,
which can differ and give wrong result.

Reported-by: Zhizhou Zhang <zhizhouzhang@asrmicro.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
map_pa2va() and core_va2pa_helper() has an over complex way of
calculating the translated address which gives a faulty result if the
upper 32-bits are used in a 64-bit address. This patch fixes the error
by simplifying the calculation.

Reported-by: Zhizhou Zhang <zhizhouzhang@asrmicro.com>
Tested-by: Zhizhou Zhang <zhizhouzhang@asrmicro.com>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (FVP AArch64)
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU v7 & v8)
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
@jenswi-linaro
Copy link
Contributor Author

Rebased tags applied.

@jforissier jforissier merged commit 05173e9 into OP-TEE:master May 11, 2017
@jenswi-linaro jenswi-linaro deleted the round_fix branch May 11, 2017 06: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.

4 participants