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

Re: [RISC-V] Switch to H-mode


  • To: "oleksii.kurochko@xxxxxxxxx" <oleksii.kurochko@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Alistair Francis <Alistair.Francis@xxxxxxx>
  • Date: Mon, 23 Jan 2023 22:32:01 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none
  • 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=Zb0cS8TcZWkmVNeyfxolYZIL0x2TrXX0Ywu/3AavAUQ=; b=TXAqlpk7QG4X8zLsAHflm7XAZWciSgjhT8lNeDsTG90fynsyt/Nt2bjlGXAApraJ008Rx1Xy/PEtg5I7mw0gQlCKFSSwGzvLLIRpWjnUJow/p/3u2v6gXtQTn+CdIRXNhAAhk1vdpkxpUTrSbmxT/YLzeTbQQ7qBUwSSzpbHzROu4XcaN8sEXvrmFwP/vKW7fmLj1uqjcY+G7heqFe6UPJ0iEmeYkfGSe/j/nuG5y+E6+n+VBWANe31gn8vWnncjf0QeGDFYnCa4N/m4oGoDvb94BNi0EIGP5mlJukrzFyEy4stzT/ri4A36Ua4c5NQnA42qYWC134q2X9yOKaeWEg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a4zatBljZsRjEmJV2M0R5PO8oJdLHajBHHjvgH3Puod1WjbQq/KzoNIxnVNpQbZ3KzsYFQbRmIyvUS1ZVSvfoOsn7a3xvnOiUIIW7RFDBT+gRhqF4Ix4DebOHDVmQ6xI8iuvmjqU/bfkCUWjJbjAZVsdL+/sPnAfwaeWAIlOj5x8fx+/j8omHO5JBN/wsM1zzJkuPX6ghICzKIIirbPwMK4uRDvdjuO6+KQXFCWcIOrBm44Ft17PIhdhUG8jYIWBmO7gTqeM/FJCAfsoox60Ij4e+s2j0ZcWyjAR9QnwFSt+TK7HxixXt1swlYRcnK6gmiupE45isoCRljR4mTK/Zg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wdc.com;
  • Cc: "bobbyeshleman@xxxxxxxxx" <bobbyeshleman@xxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "gianluca@xxxxxxxxxxxx" <gianluca@xxxxxxxxxxxx>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Mon, 23 Jan 2023 22:32:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHZL0ujmIfMEOwMNEi0n3X25HhaKK6slm0A
  • Thread-topic: [RISC-V] Switch to H-mode
  • Wdcipoutbound: EOP-TRUE

On Mon, 2023-01-23 at 18:56 +0200, Oleksii wrote:
> Hi Alistair and community,
> 
> I am working on RISC-V support upstream for Xen based on your and
> Bobby
> patches.
> 
> Adding the RISC-V support I realized that Xen is ran in S-mode.
> Output
> of OpenSBI:
>     ...
>     Domain0 Next Mode         : S-mode
>     ...
> So the first my question is shouldn't it be in H-mode?

There is no H-mode in RISC-V.

When the Hypervisor extension exists the standard S-mode automatically
becomes HS-mode. The two names can be used interchangeably (although
the spec calls it HS-mode).

In this way Linux (with or without KVM support) and Xen all boot in the
same mode and can choose to use virtulisation if desired.

> 
> If I am right than it looks like we have to do a patch to OpenSBI to
> add support of H-mode as it is not supported now:
> [1]
> https://github.com/riscv-software-src/opensbi/blob/master/lib/sbi/sbi_domain.c#L380
> [2]
> https://github.com/riscv-software-src/opensbi/blob/master/include/sbi/riscv_encoding.h#L110
> Please correct me if I am wrong.
> 
> The other option I see is to switch to H-mode in U-boot as I
> understand
> the classical boot flow is:
>     OpenSBI -> U-boot -> Xen -> Domain{0,...}
> If it is at all possible since U-boot will be in S mode after
> OpenSBI.

S-mode is where you want to be. That's what Xen should start in.

Alistair

> 
> Thanks in advance.
> 
> ~ Oleksii


 


Rackspace

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