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

Re: Enabling more than one HVC console on Arm64 platform


  • To: Ayan Kumar Halder <ayankuma@xxxxxxx>, <amit@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, "Stabellini, Stefano" <stefano.stabellini@xxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Wed, 22 Nov 2023 20:23:44 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=qNpYG+a2kMrDUQObCCjTTDBLvgmOmmMMjG0iUbmmIis=; b=HPR7u3s+vyIxfr5uvYJgKJL3Srw6ZvgKztdcucVSgrWuo96sp5Lb0htnsOrA+am/vAs3F6wYq9LFAJP3Y6XJcVsnanRMou5hTBG9wrZ0O5ZSbA3exmC0/ZjKDyyVVjF3STTpP8EIV48rzLACceofr1yshhkIlO3k8V94x5fx9z6aBcfE/j4ENGufv3XYa5ysVYWj6rmtXn/wgmfs8uFKHGv8KeadN+snVWKTy0oBJfxftf45bNI6TqSVtfUZEaevD63RMa8GoA3ij5d+HmEZ6jHo3Dc/JL00WneuOlTaN/ScXCtnjmzMUrPM7LgzYbPSEeQZCrSNmIHRpwpflgPP+w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hg6lLqOu13vJ/QgkURszhT+tty0gMHoBZ3g8SwXW+LNXa3l37dDgfYF8r3sIBnyO2N9/r0opyKfvviApsLMPHKP3kP4rbKpnvkvqC1PsMh4eIn/PG3hvN1b3tZxy7H7vx90gmips49DMsA7KF23iRr0tiajeMOpTIdPxmm0jojpASnDqy/I9VzGsSJIF4wPn7+XF3Go+UjKqW4xy+4s34bnSNhnrhZl2k8bn0yMkZRFW4Q4MiHhyE9fg4Knqb3oM8FUodxDxhjE+cLydFZ5N6lWlaAf+YxsrvaC+5Jq7WTSgD1J+yvf5rO7ijTWnJYUk2LrIg35EcMdeCa8STkjjJw==
  • Cc: <arnd@xxxxxxxx>, <virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 22 Nov 2023 19:23:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Ayan,

On 22/11/2023 20:00, Ayan Kumar Halder wrote:
> Hi Amit/All,
> 
> We came across this scenario and would be helpful if you can provide 
> some pointers
> 
> 
> Linux running as Dom0 on Xen hypervisor with HVC_DCC = y and HVC_XEN = y 
> on Arm64 platform.
> 
> This causes a crash when Dom0 tries to access "DBGDTRTX_EL0" register, 
> it traps to Xen.
> 
> Xen does not emulate this register so it crashes.
> 
> |Logs - https://paste.debian.net/1298983/|
> 
> |
> |
> 
> |My aim is to avoid the crash and let Xen boot Dom0 even though there 
> might not be a debug console available.|
> 
> |So, I am trying to add emulation for |"DBGDTRTX_EL0" register in Xen.
> 
> 
> As a quick trial (may be not the perfect solution), I am trying to 
> emulate this register as "read as zero/write ignore" (similar to KVM).
> 
> However, I could not see logs to the Xen console (ie HVC0).
> 
> 
> So my question is
> 
> 1. Is it possible in Linux to probe more than one HVC console so that 
> Linux can put the same logs in HVC_DCC and HVC_XEN drivers ?
> 
> So that the user can always see the logs in the default Xen console (ie 
> hvc0) even if the debug console is not present.
If you have both HVC DCC and Xen enabled and DCC gets assigned hvc0, just use 
console=hvc1
to see the messages from Xen.
> 
> 
> Another possible alternative I am exploring is to enable trapping for 
> read of MDCCSR_EL0 in Xen, so that Xen returns with MDCCSR_EL0.TXfull 
> set to 1.
> 
> static int hvc_dcc_put_chars(uint32_t vt, const char *buf, int count)
> {
>      int i;
> 
>      for (i = 0; i < count; i++) {
>          while (__dcc_getstatus() & DCC_STATUS_TX)
>              cpu_relax(); <<<<<<<<<<----------- So this will be invoked.
FWICS, this won't be invoked given that in init call hvc_dcc_check() will 
return false
due to condition "if (!(__dcc_getstatus() & DCC_STATUS_TX))" being false. This 
is the whole
point to make Linux return -ENODEV quickly.

~Michal



 


Rackspace

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