From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH for 4.5 v2 2/2] x86/hvm: Improve "Emulation failed @" error messages Date: Mon, 29 Sep 2014 10:23:36 +0100 Message-ID: <54292518.9070609@citrix.com> References: <1411748677-21069-1-git-send-email-andrew.cooper3@citrix.com> <1411748677-21069-3-git-send-email-andrew.cooper3@citrix.com> <542935B0020000780003A467@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <542935B0020000780003A467@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Keir Fraser , Kevin Tian , EddieDong , Jun Nakajima , Xen-devel List-Id: xen-devel@lists.xenproject.org On 29/09/14 09:34, Jan Beulich wrote: >>>> On 26.09.14 at 18:24, wrote: >> @@ -1449,6 +1441,30 @@ struct segment_register *hvmemul_get_seg_reg( >> return &hvmemul_ctxt->seg_reg[seg]; >> } >> >> +static const char *guest_x86_mode_to_str(int mode) >> +{ >> + switch ( mode ) >> + { >> + case 0 ... 2: return "16bit"; > I don't really follow why you dropped the real and vm86 mode > special casing here (nor do I think ???_guest_x86_mode() is > producing insufficient detail for the purposes here or elsewhere). > > Jan > I specifically want to avoid having specifics like "Real" and "v86" along side more generic terms such as "16bit", because I can see even myself as the author getting confused in the future. One option would be to borrow the terminology from http://sandpile.org/x86/mode.htm which is unambiguous, and provides rather more information than just how to decode the instructions. Unfortunately, ???_guest_x86_mode() is insufficiently expressive to express this complete set. Therefore, I opted for the other extreme to avoid having a mix of information returned from guest_x86_mode_to_str(). ~Andrew