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

Re: [PATCH v3 06/24] xen/domain: introduce hardware emulation flags


  • To: <dmukhin@xxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Mon, 27 Jan 2025 18:57:09 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=ford.com 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=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=51YNYtPACKD20etOArML24Odd1c+C2MmKvdCCVrsVvI=; b=HsJ1/3Kp1gZdl2bi6kzm3jcIYjHI1N9/uJYvtTneU4ve8s+Nke3vr8z3xKtHE0Mcz2t7TenwWKfnY2T+rMRcgoVvSUdq+VgYP8watESXpebrJxyQsLwlRBUM7TjBTAidO7VN8xz4rVNN4mN8NQuueWuWmR4EYKJ0s03j1cJ9uiSN587vAD2oNwvhJuPE27sdFA6kqqx00F2dhYwR4TQdPxnXMU79t9uHQbXxx2LkJ3vqaV/QexhfxDav0fK4hIN9/QaXQ4b1UMxuuVhtCAMj/i8VKjVQYkPZHW+ZvX3NN+5y+7J2aQFC51lKZdaQAzNgsDV9g5UtR2cDhXV1xR8m7A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ppn/jytpHTpsSAr+utwlVpsHb9xOm2Jg3Ooz85LSLVb+6n+ZvxaYzcjaUHoqf6n40eGuCZGQ56WGojDmA/Vts2d4Ry1WfvdeCf6chw72yWCGA8WtlpPQqpe7tYLbdcaCj0eVrhekPyE5VCsKuzEdiiDBf6S4HcaffjLgZ/GFOd8RzeOfzYbut4kOmXPj0rLoaGQI6cMGON6QRol1eP6UocxNI4vPiCv7jmDauMi92DRJIIXxs4fzE5xFULBJwnQWY7yXep/OT5CK7/+O+ZL5HwROH0KaUlNR8V4qcJiLnpSToF0ZHZzwPTFD0iCrSPlpL6FD0YpePEDeAkMhAV7CAg==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 28 Jan 2025 00:32:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-01-03 20:58, Denis Mukhin via B4 Relay wrote:
From: Denis Mukhin <dmukhin@xxxxxxxx>

Define an architecture-independent location for describing hardware emulation
flags for configuring in-hypervisor emulators.

I'm not sure about this. It's a lot of churn. The common internal handling makes sense, but specifying in a domain architecture-specific fashion seems okay. Letting ARM specify EMU_VPL011 and x86 EMU_UART better aligns with the rest of the architecture-specific emulation flags.

Print d->arch.emulation_flags from 'q' keyhandler for better traceability while
debugging in-hypervisor hardware emulators.

Also, expanded the error message in arch_domain_create() in x86 case when
user-defined domain emulation_flags are incompatible w/ platform supported
emulation_flags.

These two seem okay, but could be in their own patch.

Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>

diff --git a/xen/include/public/virtdev.h b/xen/include/public/virtdev.h
new file mode 100644
index 
0000000000000000000000000000000000000000..27434377ecacfe069a91dea3768d14b0c14e08b4
--- /dev/null
+++ b/xen/include/public/virtdev.h
@@ -0,0 +1,61 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef XEN__PUBLIC_VIRTDEV_H
+#define XEN__PUBLIC_VIRTDEV_H
+
+/*
+ * Domain hardware emulation flags.
+ */
+enum {
+    VIRTDEV_LAPIC      = 1U << 0,
+    VIRTDEV_HPET       = 1U << 1,
+    VIRTDEV_PM         = 1U << 2,
+    VIRTDEV_RTC        = 1U << 3,
+    VIRTDEV_IOAPIC     = 1U << 4,
+    VIRTDEV_PIC        = 1U << 5,
+    VIRTDEV_VGA        = 1U << 6,
+    VIRTDEV_IOMMU      = 1U << 7,
+    VIRTDEV_PIT        = 1U << 8,
+    VIRTDEV_PIRQ       = 1U << 9,
+    VIRTDEV_PCI        = 1U << 10,
+};

If you do create this new header, I think you'll want to leave these as just bit numbers and shifts. IIRC, the headers strive for greatest compatibility and, enums are less rigorously defined.

Regards,
Jason



 


Rackspace

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