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

Re: [PATCH 2/2] xen/riscv: use the SBI SRST extension to reboot in machine_restart()


  • To: Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>
  • From: Anandu Padinhare <Anandu.Padinhare@xxxxxxxxxxxxxx>
  • Date: Tue, 1 Dec 2026 10:56:28 +0000
  • Accept-language: en-IN, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=electrifex.com; dmarc=pass action=none header.from=electrifex.com; dkim=pass header.d=electrifex.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=piRnYsz9EAj8CB/IdXU/6BX1Zp/pBphPuZgpLa1rsLU=; b=RFkEyYxy4K1icJeZXLrOtBnu9+/6nG2t2grNznmYOtNPfT+9IFfNFeixl9szQuVvgsWFkS49zcw6rgGmvtJZGjq8KJ7eLkpe774kdCjAdyBCLpSZUNjoWdJeMOWWL/bbuxwG5fOZSteH/+lBIjpz+NuIfKB1cDlcH6MDtJxPFh6dxWpu5+4FWUtNQlrDp4mtJ9ZCVaCRqcNCY9YO3th1pTnGIcIVAeEra2fYP7MQSKe658V5oqMSjC5b7AVYvDOXc1FKR74+9MiMrOIRFEuQ0uGSdkVtTeHCuudcU+EIMxFblbw5+CXvQobbz3tJMNo5alE7tFAq0i/LjYVwsHX0fw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YIQVM4OIZcWa6RdLrA7WhvhC+NgXSi2jQYgETcvaJkniulcSA/NdhXzATwu4tCw1Usz/UjKsMF1KRCMQsjqeWCE7jpO6skuF7rXvQA3LzEDyMgzEFNKX7siV1Ajcwp6HKmy11D7ItTNUYgovGl1kb58KcNd5Io79jrWUlVmo0HpwsltoHvBLuAkywq/yMuSlf/vT5DLBB6Mp+xq7rpEA5tuXI0twLYmaxMxzOFRu6n3QC8NCE3GsD19rIbP6w7eBFkjX0kNiOXsRBb2rZ5Uv2AyEqA43CXKd6ZLXlSLEOIEu+TMrrX2rE9w1qGolp4m6ujH73wh6G9aFv6yUPHmT8w==
  • Authentication-results: eu.smtp.expurgate.cloud; none
  • Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=electrifex.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, "roger@xxxxxxxxxxxxxx" <roger@xxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Tue, 01 Dec 2026 10:56:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels:
  • Thread-index: AQHdfltgP9/ridJYo0+blCGD9xquebdH/OcAgAALMw0=
  • Thread-topic: [PATCH 2/2] xen/riscv: use the SBI SRST extension to reboot in machine_restart()

On Tue, 01 Dec 2026, Baptiste Le Duc wrote:
> So I would go for something like:
>
> void machine_restart(unsigned int delay_millisecs)
> {
>     /* Flush pending console output and make later printk() synchronous. */
>     console_start_sync();
>
>     mdelay(delay_millisecs);
>
>     /* OpenSBI halts the other harts itself before resetting the system. */
>     sbi_system_reset(SBI_SRST_RESET_TYPE_COLD_REBOOT,
>                      SBI_SRST_RESET_REASON_NONE);
>
>     /* Fall back to halting if SRST isn't supported or failed. */
>     machine_halt();
> }
>
> What do you think?

Agreed, I'll do that in v2. panic() already calls console_start_sync()
before machine_restart(), but other callers such as the 'R' debug key
don't, so it belongs in machine_restart() itself.

v2 will also have the -no-reboot change for the smoke test as patch 3.

Thanks,
Anandu


 


Rackspace

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