ACK: [PATCH] cpu: virt: fix the assumption that fwts_cpu_readmsr returns 0 = FWTS_OK
Colin Ian King
colin.king at canonical.com
Fri Jul 15 15:42:35 UTC 2016
On 15/07/16 16:39, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung at canonical.com>
> ---
> src/cpu/virt/virt_svm.c | 2 +-
> src/cpu/virt/virt_vmx.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/cpu/virt/virt_svm.c b/src/cpu/virt/virt_svm.c
> index 7843428..a81877f 100644
> --- a/src/cpu/virt/virt_svm.c
> +++ b/src/cpu/virt/virt_svm.c
> @@ -59,7 +59,7 @@ static int vt_locked_by_bios(void)
> if (!can_lock_with_msr())
> return 0;
>
> - if (fwts_cpu_readmsr(0, MSR_FEATURE_CONTROL, &msr))
> + if (fwts_cpu_readmsr(0, MSR_FEATURE_CONTROL, &msr) != FWTS_OK)
> return -1;
>
> return ((msr & 0x1000) == 0x1000); /* SVM capable but locked by bios*/
> diff --git a/src/cpu/virt/virt_vmx.c b/src/cpu/virt/virt_vmx.c
> index 58b952f..29612f5 100644
> --- a/src/cpu/virt/virt_vmx.c
> +++ b/src/cpu/virt/virt_vmx.c
> @@ -59,7 +59,7 @@ static int vt_locked_by_bios(void)
> {
> uint64_t msr;
>
> - if (fwts_cpu_readmsr(0, MSR_FEATURE_CONTROL, &msr))
> + if (fwts_cpu_readmsr(0, MSR_FEATURE_CONTROL, &msr) != FWTS_OK)
> return -1;
>
> return (msr & 5) == 1; /* VT capable but locked by bios*/
>
Thanks for spotting these and fixing them up Alex.
Acked-by: Colin Ian King <colin.king at canonical.com>
More information about the fwts-devel
mailing list