[PATCH] cpu: virt: correctly return true if SVM is enabled
Keng-Yu Lin
kengyu at canonical.com
Mon May 20 07:34:37 UTC 2013
On Tue, May 7, 2013 at 4:52 PM, Colin King <colin.king at canonical.com> wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Coverity CID #997308: Operands don't affect result
>
> The test for the SVM bit should be checking to see if the result
> of the mask is set and returning 1 if so. This is a bug inherited
> from the Linux ready firmware kit.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/cpu/virt/virt_svm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/cpu/virt/virt_svm.c b/src/cpu/virt/virt_svm.c
> index ceba8b6..9b618fd 100644
> --- a/src/cpu/virt/virt_svm.c
> +++ b/src/cpu/virt/virt_svm.c
> @@ -61,7 +61,7 @@ static int vt_locked_by_bios(void)
> if (fwts_cpu_readmsr(0, MSR_FEATURE_CONTROL, &msr))
> return -1;
>
> - return ((msr & 0x1000) == 1); /* SVM capable but locked by bios*/
> + return ((msr & 0x1000) == 0x1000); /* SVM capable but locked by bios*/
> }
>
> void virt_check_svm(fwts_framework *fw)
> --
> 1.8.1.2
>
Acked-by: Keng-Yu Lin <kengyu at canonical.com>>
More information about the fwts-devel
mailing list