<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/scripts/genksyms, branch v6.15</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.15</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.15'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-04-14T07:19:04Z</updated>
<entry>
<title>genksyms: Handle typeof_unqual keyword and __seg_{fs,gs} qualifiers</title>
<updated>2025-04-14T07:19:04Z</updated>
<author>
<name>Uros Bizjak</name>
<email>ubizjak@gmail.com</email>
</author>
<published>2025-04-13T22:07:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1013f5636fd808569c1f4c40a58a4efc70713a28'/>
<id>urn:sha1:1013f5636fd808569c1f4c40a58a4efc70713a28</id>
<content type='text'>
Handle typeof_unqual, __typeof_unqual and __typeof_unqual__ keywords
using TYPEOF_KEYW token in the same way as typeof keyword.

Also ignore x86 __seg_fs and __seg_gs named address space qualifiers
using X86_SEG_KEYW token in the same way as const, volatile or
restrict qualifiers.

Fixes: ac053946f5c4 ("compiler.h: introduce TYPEOF_UNQUAL() macro")
Closes: https://lore.kernel.org/lkml/81a25a60-de78-43fb-b56a-131151e1c035@molgen.mpg.de/
Reported-by: Paul Menzel &lt;pmenzel@molgen.mpg.de&gt;
Signed-off-by: Uros Bizjak &lt;ubizjak@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Masahiro Yamada &lt;yamada.masahiro@socionext.com&gt;
Link: https://lore.kernel.org/r/20250413220749.270704-1-ubizjak@gmail.com
</content>
</entry>
<entry>
<title>genksyms: factor out APP for the ST_NORMAL state</title>
<updated>2025-03-15T12:16:21Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2025-02-05T17:45:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6c3fb0bb4d4f1173f32cc26d077b151d72226a2f'/>
<id>urn:sha1:6c3fb0bb4d4f1173f32cc26d077b151d72226a2f</id>
<content type='text'>
For the ST_NORMAL state, APP is called regardless of the token type.
Factor it out.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>genksyms: fix syntax error for attribute before init-declarator</title>
<updated>2025-01-26T22:44:16Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2025-01-13T15:00:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a23d4c2f5b80a8dc5f1e40658abbe5983af1a0e9'/>
<id>urn:sha1:a23d4c2f5b80a8dc5f1e40658abbe5983af1a0e9</id>
<content type='text'>
A longstanding issue with genksyms is that it has hidden syntax errors.

For example, genksyms fails to parse the following valid code:

    int x, __attribute__((__section__(".init.data")))y;

Here, only 'y' is annotated by the attribute, although I am not aware
of actual uses of this pattern in the kernel tree.

When a syntax error occurs, yyerror() is called. However,
error_with_pos() is a no-op unless the -w option is provided.

You can observe syntax errors by manually passing the -w option.

    $ echo 'int x, __attribute__((__section__(".init.data")))y;' | scripts/genksyms/genksyms -w
    &lt;stdin&gt;:1: syntax error

This commit allows attributes to be placed between a comma and
init_declarator.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Acked-by: Nicolas Schier &lt;n.schier@avm.de&gt;
</content>
</entry>
<entry>
<title>genksyms: fix syntax error for builtin (u)int*x*_t types</title>
<updated>2025-01-26T22:44:16Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2025-01-13T15:00:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c825840527813582385edca3ddeee46886527258'/>
<id>urn:sha1:c825840527813582385edca3ddeee46886527258</id>
<content type='text'>
A longstanding issue with genksyms is that it has hidden syntax errors.

When a syntax error occurs, yyerror() is called. However,
error_with_pos() is a no-op unless the -w option is provided.

You can observe syntax errors by manually passing the -w option.

For example, genksyms fails to parse the following code in
arch/arm64/lib/xor-neon.c:

    static inline uint64x2_t eor3(uint64x2_t p, uint64x2_t q, uint64x2_t r)
    {
            [ snip ]
    }

The syntax error occurs because genksyms does not recognize the
uint64x2_t keyword.

This commit adds support for builtin types described in Arm Neon
Intrinsics Reference.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Acked-by: Nicolas Schier &lt;n.schier@avm.de&gt;
</content>
</entry>
<entry>
<title>genksyms: fix syntax error for attribute after 'union'</title>
<updated>2025-01-26T22:43:21Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2025-01-13T15:00:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6494bd2d05f927fc0395c2ea11461517a9e0bb80'/>
<id>urn:sha1:6494bd2d05f927fc0395c2ea11461517a9e0bb80</id>
<content type='text'>
A longstanding issue with genksyms is that it has hidden syntax errors.

When a syntax error occurs, yyerror() is called. However,
error_with_pos() is a no-op unless the -w option is provided.

You can observe syntax errors by manually passing the -w option.

For example, with CONFIG_MODVERSIONS=y on v6.13-rc1:

    $ make -s KCFLAGS=-D__GENKSYMS__ fs/lockd/svc.i
    $ cat fs/lockd/svc.i | scripts/genksyms/genksyms -w
        [ snip ]
    ./include/net/addrconf.h:35: syntax error

The syntax error occurs in the following code in include/net/addrconf.h:

    union __packed {
            [ snip ]
    };

The issue arises from __packed, which is defined as
__attribute__((__packed__)), immediately after the 'union' keyword.

This commit allows the 'union' keyword to be followed by attributes.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Acked-by: Nicolas Schier &lt;n.schier@avm.de&gt;
</content>
</entry>
<entry>
<title>genksyms: fix syntax error for attribute after 'struct'</title>
<updated>2025-01-18T00:11:47Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2025-01-13T15:00:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=82db1c29103ebf581484c0b30805e68726121dcb'/>
<id>urn:sha1:82db1c29103ebf581484c0b30805e68726121dcb</id>
<content type='text'>
A longstanding issue with genksyms is that it has hidden syntax errors.

When a syntax error occurs, yyerror() is called. However,
error_with_pos() is a no-op unless the -w option is provided.

You can observe syntax errors by manually passing the -w option.

For example, with CONFIG_MODVERSIONS=y on v6.13-rc1:

    $ make -s KCFLAGS=-D__GENKSYMS__ arch/x86/kernel/cpu/mshyperv.i
    $ cat arch/x86/kernel/cpu/mshyperv.i | scripts/genksyms/genksyms -w
        [ snip ]
    ./arch/x86/include/asm/svm.h:122: syntax error

The syntax error occurs in the following code in arch/x86/include/asm/svm.h:

    struct __attribute__ ((__packed__)) vmcb_control_area {
            [ snip ]
    };

The issue arises from __attribute__ immediately after the 'struct'
keyword.

This commit allows the 'struct' keyword to be followed by attributes.

The lexer must be adjusted because dont_want_brace_phase should not be
decremented while processing attributes.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Acked-by: Nicolas Schier &lt;n.schier@avm.de&gt;
</content>
</entry>
<entry>
<title>genksyms: fix syntax error for attribute after abstact_declarator</title>
<updated>2025-01-18T00:11:47Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2025-01-13T15:00:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2ac068cb0b366c61e7aebaccf0240eae8b2c1b43'/>
<id>urn:sha1:2ac068cb0b366c61e7aebaccf0240eae8b2c1b43</id>
<content type='text'>
A longstanding issue with genksyms is that it has hidden syntax errors.

When a syntax error occurs, yyerror() is called. However,
error_with_pos() is a no-op unless the -w option is provided.

You can observe syntax errors by manually passing the -w option.

For example, with CONFIG_MODVERSIONS=y on v6.13-rc1:

    $ make -s KCFLAGS=-D__GENKSYMS__ kernel/module/main.i
    $ cat kernel/module/main.i | scripts/genksyms/genksyms -w
        [ snip ]
    kernel/module/main.c:97: syntax error

The syntax error occurs in the following code in kernel/module/main.c:

    static void __mod_update_bounds(enum mod_mem_type type __maybe_unused, void *base,
                                    unsigned int size, struct mod_tree_root *tree)
    {
            [ snip ]
    }

The issue arises from __maybe_unused, which is defined as
__attribute__((__unused__)).

This commit allows direct_abstract_declarator to be followed with
attributes.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Acked-by: Nicolas Schier &lt;n.schier@avm.de&gt;
</content>
</entry>
<entry>
<title>genksyms: fix syntax error for attribute before nested_declarator</title>
<updated>2025-01-18T00:11:46Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2025-01-13T15:00:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a8b7d066f8626ec847d3e66aef1320968d1fe298'/>
<id>urn:sha1:a8b7d066f8626ec847d3e66aef1320968d1fe298</id>
<content type='text'>
A longstanding issue with genksyms is that it has hidden syntax errors.

When a syntax error occurs, yyerror() is called. However,
error_with_pos() is a no-op unless the -w option is provided.

You can observe syntax errors by manually passing the -w option.

For example, with CONFIG_MODVERSIONS=y on v6.13-rc1:

    $ make -s KCFLAGS=-D__GENKSYMS__ drivers/acpi/prmt.i
    $ cat drivers/acpi/prmt.i | scripts/genksyms/genksyms -w
        [ snip ]
    drivers/acpi/prmt.c:56: syntax error

The syntax error occurs in the following code in drivers/acpi/prmt.c:

    struct prm_handler_info {
            [ snip ]
            efi_status_t (__efiapi *handler_addr)(u64, void *);
            [ snip ]
    };

The issue arises from __efiapi, which is defined as either
__attribute__((ms_abi)) or __attribute__((regparm(0))).

This commit allows nested_declarator to be prefixed with attributes.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Acked-by: Nicolas Schier &lt;n.schier@avm.de&gt;
</content>
</entry>
<entry>
<title>genksyms: fix syntax error for attribute before abstract_declarator</title>
<updated>2025-01-18T00:11:46Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2025-01-13T15:00:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2966b66c94a2b0d897f8626b8f2c50a0fd4878a9'/>
<id>urn:sha1:2966b66c94a2b0d897f8626b8f2c50a0fd4878a9</id>
<content type='text'>
A longstanding issue with genksyms is that it has hidden syntax errors.

When a syntax error occurs, yyerror() is called. However,
error_with_pos() is a no-op unless the -w option is provided.

You can observe syntax errors by manually passing the -w option.

For example, with CONFIG_MODVERSIONS=y on v6.13-rc1:

    $ make -s KCFLAGS=-D__GENKSYMS__ init/main.i
    $ cat init/main.i | scripts/genksyms/genksyms -w
        [ snip ]
    ./include/linux/efi.h:1225: syntax error

The syntax error occurs in the following code in include/linux/efi.h:

    efi_status_t
    efi_call_acpi_prm_handler(efi_status_t (__efiapi *handler_addr)(u64, void *),
                              u64 param_buffer_addr, void *context);

The issue arises from __efiapi, which is defined as either
__attribute__((ms_abi)) or __attribute__((regparm(0))).

This commit allows abstract_declarator to be prefixed with attributes.

To avoid conflicts, I tweaked the rule for decl_specifier_seq. Due to
this change, a standalone attribute cannot become decl_specifier_seq.
Otherwise, I do not know how to resolve the conflicts.

The following code, which was previously accepted by genksyms, will now
result in a syntax error:

    void my_func(__attribute__((unused))x);

I do not think it is a big deal because GCC also fails to parse it.

    $ echo 'void my_func(__attribute__((unused))x);' | gcc -c -x c -
    &lt;stdin&gt;:1:37: error: unknown type name 'x'

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Acked-by: Nicolas Schier &lt;n.schier@avm.de&gt;
</content>
</entry>
<entry>
<title>genksyms: decouple ATTRIBUTE_PHRASE from type-qualifier</title>
<updated>2025-01-18T00:11:46Z</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2025-01-13T15:00:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ec28bfff83c49b65527f0055e313d9d7c8c04a31'/>
<id>urn:sha1:ec28bfff83c49b65527f0055e313d9d7c8c04a31</id>
<content type='text'>
The __attribute__ keyword can appear in more contexts than 'const' or
'volatile'.

To avoid grammatical conflicts with future changes, ATTRIBUTE_PHRASE
should not be reduced into type_qualifier.

No functional changes are intended.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Acked-by: Nicolas Schier &lt;n.schier@avm.de&gt;
</content>
</entry>
</feed>
