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

Re: [PATCH v2.2 07/15] xen: generate hypercall interface related code


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 3 Nov 2021 16:08:39 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=jlns22FJpJ8Br4nqMQDULxkdxmdABL520Ay4nqVaxQg=; b=h+ruAvZRd/PkYuU2MCZbRtjKoQi5sGBhMEAJKZQAwIKNIY5fxPMW+djPxHQL6Xw7OVdtrVqhXLnJ1w42VscRlGB7IAF/CMNco+WlGBpxw1tnwTnMtGCT7DPk3hdnZLQDZ+qVocdoBpWUtao0wouTHVyNsht0YxyBMl6NhpSk6tHUNJ4BHCCH4NUAzcRFGAR5G7vS+UKVvGeoS1DnVjZeDt+iGH28ELcUm2U+xfNIq1fQzwSEjzwwvni1SjYiPqAb/YS+SP0WbIt/youdrL5gzl8u4n89CCIpDZCKltNbQHLGoigtu8rhprOJX1A15WxtNN1HTcdqgjlwJVAexNA10Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iXH5L2JudFlw2ADPR7bSwOXcLC51Au7jjv0Wsg/GveID/ZdvIYOJZCbkQ3gNjyDn7F30Uxc+kYKjPeLDOljXVJo8Cjhk713v3uBlhLFZrmLmdBHemGNRsAVbi9B8bLOjWgnQEsVAv4JWTbkAQLp8X3kezm69s2qi19UVTd0q5iQ85yBCzMZDWcEi2m9yJ6V1qJUH1b2WKTAwZqkRiE4QbWvOXRzmyfOOWb7DYf7J+X4/6GLE3/RluKqJomz66lNsS0ZtBrL94Q28nJ5friM3xsYdKl+VLQkQpIY13VeHfvITJfk38Em4i6hbtrfMuurqzm0Yal2xgiXVSTOKAGl4rw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 03 Nov 2021 15:08:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03.11.2021 11:20, Juergen Gross wrote:
> +# Generate the output
> +END {
> +    # Verbatim generated lines
> +    for (i = 1; i <= e; i++)
> +        printf("%s\n", emit[i]);
> +    printf("\n");
> +    # Generate prototypes
> +    for (i = 1; i <= n; i++) {
> +        for (p = 1; p <= n_pre[i]; p++) {
> +            printf("%s %s_%s(", rettype[pre[i, p]], pre[i, p], fn[i]);
> +            if (n_args[i] == 0)
> +                printf("void");
> +            else
> +                for (j = 1; j <= n_args[i]; j++) {
> +                    if (j > 1)
> +                        printf(", ");
> +                    if (ptr[i, j])
> +                        printf("XEN_GUEST_HANDLE_PARAM(%s)", typ[i, j]);
> +                    else
> +                        printf("%s", typ[i, j]);
> +                    printf(" %s", arg[i, j]);
> +                }
> +            printf(");\n");
> +        }
> +    }
> +    # Generate call sequences and args array contents
> +    for (ca in caller) {
> +        if (caller[ca] != 1)
> +            continue;
> +        need_mask = 0;
> +        for (pl = 1; pl <= n_prios[ca]; pl++) {
> +            for (pll = pl; pll > 1; pll--) {
> +                if (prio_list[ca, pl] > p_list[pll - 1])
> +                    break;
> +                else
> +                    p_list[pll] = p_list[pll - 1];
> +            }
> +            p_list[pll] = prio_list[ca, pl];
> +            # If any prio but the default one has more than 1 entry we need 
> "mask"
> +            if (p_list[pll] != 100 && prios[ca, p_list[pll]] > 1)
> +                need_mask = 1;
> +        }
> +        printf("\n");
> +        printf("#define call_handlers_%s(num, ret, a1, a2, a3, a4, a5) 
> \\\n", ca);
> +        printf("{ \\\n");

In order to require a semicolon at the use site(s) of the macro I think
you want "({ \\\n" here. Everything else looks good to me so far, but
I'd really like to take a look at the generated output: Would you happen
to have available an instance, to supply in reply?

Thanks, Jan




 


Rackspace

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