From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: Re: [PATCH 2/2] kvm tools, vesa: Fix 'ah' access in int10_vesa() Date: Mon, 6 Jun 2011 12:37:07 +0400 Message-ID: <20110606083707.GA21290@sun> References: <1307129824-8396-1-git-send-email-penberg@kernel.org> <1307129824-8396-2-git-send-email-penberg@kernel.org> <4DEC8FC8.8090601@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Pekka Enberg , kvm@vger.kernel.org, Ingo Molnar , John Floren , Sasha Levin To: Avi Kivity Return-path: Received: from mail-bw0-f46.google.com ([209.85.214.46]:54261 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756915Ab1FFIhO (ORCPT ); Mon, 6 Jun 2011 04:37:14 -0400 Received: by bwz15 with SMTP id 15so3108946bwz.19 for ; Mon, 06 Jun 2011 01:37:13 -0700 (PDT) Content-Disposition: inline In-Reply-To: <4DEC8FC8.8090601@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Jun 06, 2011 at 11:28:56AM +0300, Avi Kivity wrote: > On 06/03/2011 10:37 PM, Pekka Enberg wrote: > >This patch fixes access to 'ah' in int10_vesa() by masking the high bits. > > > >@@ -131,7 +131,7 @@ static void int10_vesa(struct int10_args *args) > > { > > u8 al; > > > >- al = args->eax; > >+ al = args->eax& 0xff; > > Isn't this reading %al? And the high bits are masked by the type of > the variable? > Type conversion will do the work but having explicit masking is a way better I believe, at least it makes this code snippet notable. Cyrill