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

Re: [Xen-devel] [PATCH 3/5] xen/domain: Audit config->max_vcpus during {, arch_}check_domain_config()



Hi,

On 11/9/18 6:43 PM, Andrew Cooper wrote:
On 09/10/18 12:23, Julien Grall wrote:
On 05/10/2018 15:54, Andrew Cooper wrote:
---
   xen/arch/arm/domain.c | 18 ++++++++++++++++++
   xen/arch/x86/domain.c |  6 ++++++
   xen/common/domain.c   |  3 +++
   3 files changed, 27 insertions(+)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 43593a4..9676893 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -601,6 +601,8 @@ void vcpu_switch_to_aarch64_mode(struct vcpu *v)
     int arch_check_domain_config(struct xen_domctl_createdomain *config)
   {
+    unsigned int max_vcpus = 0;
+
       /* Fill in the native GIC version, passed back to the
toolstack. */
       if ( config->arch.gic_version == XEN_DOMCTL_CONFIG_GIC_NATIVE )
       {
@@ -619,6 +621,22 @@ int arch_check_domain_config(struct
xen_domctl_createdomain *config)
           }
       }
   +    /* Calculate the maximum number of vcpus from the selected GIC
version... */
+    switch ( config->arch.gic_version )
+    {
+    case GIC_V2: max_vcpus = 8;   break;
+    case GIC_V3: max_vcpus = 255; break;
+
+    default:
+        return -EOPNOTSUPP;
+    }

I would prefer to keep those values in a separate helper implemented
by each vGIC.

How do you intend that working?  The values can't be hooked off a GIC
object, because we don't have one yet.

Sorry for the confusion. By each vGIC I meant implementation. I would rework vgic_max_vcpus to take the GIC version in parameter and rather number of vCPUs supported.

Cheers,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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