[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-4.21] x86/hvm: fix reading from 0xe9 IO port if port E9 hack is active


  • To: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 2 Oct 2025 16:17:09 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9GlJZgu1I08gU3lyyayPdY1D5LMp4kTrrPWL1agCM30=; b=UH5asstDnHaBO/ZRSJAnQBqJYsrWKhMWURfv5udGn6kOemIrgTJfllkWD10wwAAK6cdZySs5SrbQvpw1jGYxZktOr8F7pKWyT34MpI1REG3l6yAOdcNlwDvWFNiNHu1l7Z4YQQbOdxzLp9UzL5InGiE0LIFmY64TIRwxURmcrs36Oo2gy5VntUlBxe7lG6XQUhDj5kxhRVM7lLiaLPDME7vBIiHgwUXuPIhbmXr/av+QN/ov2VqABPBhmgvbIZnIPK3ohUWN94yxJcGQCd+C64211tAonq3CDs5SUTp1rxbnZnvB0LMd/kIBRsixDu36LO6qiSV59EJioaSTZlsT9Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IPSSk3BNZMTeVPblVZwb3QDi/aVyhufcWitiOpUKPhK+sAckCkBjrhqpKErQiI+Jrt1PWseqCA3M4YgnYLuyfwejnecXVzM4j2PpKtVl8jIf/DwYmqBabXkitCGYrkQI8z7dusSO2d70oTP0XG23lrpLLVA66wL5KFsTTjMbspf+xDy59h5bC7GWDDovG+JPcfhBHzQagdVoOebtMIdABcSW00GMruECguuVMYam+5LsP3c7Vq8yk9kTbZGTuwHpoA2JSEFNXY/cCokY2AjSclAFIiTz7952XyiQX/VzukgpKyTHJ6b+32IaZkFsBDhQf50fvNXw2C06MUIZ5U3SQg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Xen-devel <xen-devel-bounces@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 02 Oct 2025 14:17:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Oct 02, 2025 at 04:02:00PM +0200, Alejandro Vallejo wrote:
> On Thu Oct 2, 2025 at 3:38 PM CEST, Roger Pau Monné wrote:
> > On Thu, Oct 02, 2025 at 11:37:36AM +0100, Andrew Cooper wrote:
> >> On 02/10/2025 11:22 am, Roger Pau Monne wrote:
> >> > Reading from the E9 port if the emergency console is active should return
> >> > 0xe9 according to the documentation from Bochs:
> >> >
> >> > https://bochs.sourceforge.io/doc/docbook/user/bochsrc.html
> >> >
> >> > See `port_e9_hack` section description.
> >> >
> >> > Fix Xen so it also returns the port address.  OSes can use it to detect
> >> > whether the emergency console is available or not.
> >> >
> >> > Fixes: d1bd157fbc9b ("Big merge the HVM full-virtualisation 
> >> > abstractions.")
> >> > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> >> 
> >> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> >> 
> >> That's been wrong for rather a long time.  How did you find it?
> >
> > I came across the documentation above and I didn't remember Xen
> > returning any value for reads, which sadly was indeed true.
> >
> > This was because I had the intention to suggest Alejandro to (also?) use
> > the port 0xe9 hack for printing from XTF, which should work for both
> > Xen and QEMU.
> 
> QEMU doesn't support 0xE9 though?

AFAICT it does:

https://wiki.osdev.org/QEMU#The_debug_console

However when running QEMU on Xen as a device model writes to 0xe9 are
handled in the hypervisor, and never forwarded to any device model.

Regards, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.