ACK: [PATCH] cpu: virt: correctly return true if SVM is enabled

Alex Hung alex.hung at canonical.com
Thu May 9 05:38:56 UTC 2013


On 05/07/2013 04:52 PM, Colin King 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)
>
Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list