From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [Xen-devel] [PATCH] xen/apic: implement io apic read with hypercall Date: Mon, 23 Apr 2012 11:11:23 -0400 Message-ID: <20120423151123.GC24481@phenom.dumpdata.com> References: <1334913957.2863.1.camel@hp6530s> <4F913340.4000202@citrix.com> <1334920396.2863.16.camel@hp6530s> <1334925508.28331.63.camel@zakaz.uk.xensource.com> <20120420164150.GC31062@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Lin Ming Cc: Ian Campbell , Andrew Cooper , "xen-devel@lists.xensource.com" , "linux-kernel@vger.kernel.org" List-Id: xen-devel@lists.xenproject.org > >> > How about return -1 on error? > >> > The calling function can check -1 for error. > >> > >> Isn't -1 potentially (at least theoretically) a valid value to rea= d from > >> one of these registers? > > > > Yeah, but then we are back to crashing at bootup (with dom0) :-) > > > > Perhaps the fallback is to emulate (so retain some of the original = code) > > as we have been since .. uh 3.0? >=20 > Do you mean the return value of io_apic_read in 3.0? No. I meant that we would continue to emulate. The improvement is that now we do: =A0 =A0 =A0 if (reg =3D=3D 0x1) =A0 =A0 =A0 =A0 =A0 =A0 =A0 return 0x00170020; =A0 =A0 =A0 else if (reg =3D=3D 0x0) =A0 =A0 =A0 =A0 =A0 =A0 =A0 return apic << 24; instead of 0xfdfdfdfd. > It's 0xffffffff. Now it is 0xfdfdfdfd. I am suggesting that instead of BUG_ON(), we fallback to do returning an emulatated IO_APIC values - like the ones that this original patch cooked up..