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

Re: [XEN v4 2/3] xen/arm: arm64: Add emulation of Debug Data Transfer Registers


  • To: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Wed, 31 Jan 2024 13:58:20 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=SOs0RA9iZStVkQsMH3cUqJBay5MIUiLHOpqUtU7/R1A=; b=MoFpIrc3n9FBd0i023wva6oNMC9VJRt8h5iEw/uopChQ1yLlTrC4irIkbp92XNGSTiUfW2Cx9vThD9wXdwknFBOU9piCEiFApChrFkjO1Zj4NcZlwZUAmDBS0p4uC6dI7rDqhcCwB4pBPMcf1ODDyyCz7eqpV9i4/tjiLSSgFTC+5JS+P0dKLvPb5ZhISESYiH6PiXMbCXH1i1wzqS/GekQHVV9N+61pLQ0YxH9HvbW6Vnm9o9chKlYgamZRGkeWU5+WlHtIalU/dAihryGKbOQYuO44oTaoZKskF6CP5sfgiuxuUocza5+dUSMwtY7kOeVczkZq9BKlvOWbu770cA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QFfKNLm+vdK0t7k/CRKEfuwuwLMcHXbOjDpfx5xSbch7Cq49BJfYsH6Tw4OFkGPOayeOcV/5Ym/B3WjGbdWAuJTUPKkGV4rfxzRfJX+yy3uPAsyidmv1CIWQxFxtgmcwxWqjVL9YFiXnrFOxkHOprC4WBtNx3gu3gojcShIrokyLuf/fxebardp8yAHHiA9F3EzFgjCo7H1X7HyG1b2Z4ydtRSB4NUc0KA6xgX85rX5paeSe7B4JQZAUavQAmAogmfWqbn36nORinaEh2/a0Fu2987Fl3H65iaex8n3ftMJ9O2wQ0vsIYy77w/6w4wpYF//sQ/BetYCm4OlpsI6FgA==
  • Cc: <sstabellini@xxxxxxxxxx>, <stefano.stabellini@xxxxxxx>, <julien@xxxxxxx>, <Volodymyr_Babchuk@xxxxxxxx>, <bertrand.marquis@xxxxxxx>, <luca.fancellu@xxxxxxx>
  • Delivery-date: Wed, 31 Jan 2024 12:58:48 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Ayan,

On 31/01/2024 13:10, Ayan Kumar Halder wrote:
> From: Michal Orzel <michal.orzel@xxxxxxx>
> 
> Currently, if user enables HVC_DCC config option in Linux, it invokes access
> to debug data transfer registers (i.e. DBGDTRTX_EL0 on arm64, DBGDTRTXINT on
> arm32). As these registers are not emulated, Xen injects an undefined
> exception to the guest and Linux crashes.
> 
> To prevent this crash, introduce a partial emulation of DBGDTR[TR]X_EL0
> (these registers share the same encoding) as RAZ/WI and MDCCSR_EL0 as TXfull.
> 
> Refer ARM DDI 0487J.a ID042523, D19.3.8, DBGDTRTX_EL0
> "If TXfull is set to 1, set DTRRX and DTRTX to UNKNOWN".
> 
> Thus, any OS is expected to read MDCCSR_EL0 and check for TXfull before
> using DBGDTRTX_EL0. Linux does it via hvc_dcc_init() ---> hvc_dcc_check(),
> and returns -ENODEV in case TXfull bit is still set after writing a test
> character. This way we prevent the guest from making use of HVC DCC as a
> console.
> 
> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>

~Michal




 


Rackspace

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