From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH 4/5] x86/PV: remove the emulated PIT Date: Thu, 14 Jan 2016 05:38:02 -0700 Message-ID: <5697A4BA02000078000C6B78@prv-mh.provo.novell.com> References: <1452688338-70075-1-git-send-email-roger.pau@citrix.com> <1452688338-70075-5-git-send-email-roger.pau@citrix.com> <56968B1802000078000C66BC@prv-mh.provo.novell.com> <56975B96.8050607@citrix.com> <5697745102000078000C6979@prv-mh.provo.novell.com> <56977F9C.6000309@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aJhAD-0005Rv-UA for xen-devel@lists.xenproject.org; Thu, 14 Jan 2016 12:38:06 +0000 In-Reply-To: <56977F9C.6000309@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: =?UTF-8?Q?Roger=20Pau=20Monn=C3=A9?= Cc: Andrew Cooper , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org >>> On 14.01.16 at 11:59, wrote: > El 14/01/16 a les 10.11, Jan Beulich ha escrit: >>>>> On 14.01.16 at 09:25, wrote: >>> El 13/01/16 a les 17.36, Jan Beulich ha escrit: >>>>>>> On 13.01.16 at 13:32, wrote: >>>>> The HVMlite series removed the initialization of the emulated PIT for PV >>>>> guests, but the handler was still reachable, which means a PV guests can >>>>> crash Xen if it pokes at IO ports 0x42, 0x43 or 0x61. Completely remove the >>>>> PV PIT handler and move the PIT initialization to HVM guests only. >>>> >>>> As said on IRC - this is needed for Dom0 to be able to drive the >>>> PC speaker. You'll need to provide a fix for the suppressed >>>> initialization instead, at least for Dom0. (As an aside, your patch >>>> orphans hwdom_pit_access().) >>> >>> Thanks for the clarification. AFAICT I can leave the usage of >>> hwdom_pit_access for Dom0, and completely remove PIT access for DomU, is >>> that right? >> >> I don't think so - see the explanation Tim gave on IRC. Afaict the >> mention of BIOS here isn't related to a virtual BIOS, but to that >> of a passed through graphics card. > > I'm sorry but I still don't fully understand why that's needed, and it > arises a couple of questions. First of all, the only reference that I > can find about BIOS and i8254 usage is regarding VGA BIOS POST [0], > where they mention that the VGA POST method might make use of the i8254. > > This seems reasonable, but I still don't understand why we provide an > emulated i8254 to DomUs. They don't have access to the low 1MB, which is > where the VGA BIOS resides, so there's no way they can call into the VGA > POST at all. All of this arrangement predates me, but see the original change introducing this: "Provide PV guests with emulated PIT", which suggests this wasn't just for Dom0. I'm hesitant to accept removal of code when we don't know exactly by whom and for what purpose it might be used. When I enabled Dom0 speaker control, I intentionally retained the original code for DomU purposes. Jan