Skip to contentSkip to conversation

udp_tunnel: drop packets when hibernating

PATCH In review Jason A. Donenfeld 5 participants 12 messages Oct 8 – Oct 11

Subsystems (8)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 udp_tunnel: drop packets when hibernating

The kernel's various networking applications keep churning away after userspace is frozen during hibernation, even as a memory snapshot is being made. This can lead many network applications to an inconsistent state, replaying packets and cryptographic state changes. For example, on wireguard, there's the possibility of this sequence:

1) hibernating begins
2) handshake state cleared
3) keypairs cleared
4) new handshake round trip completes
5) machine memory is snapshotted
6) packet is sent using new keypair
7) machine is restored to state (5)
8) packet is sent using new keypair

The idea is to prevent (6) from happening, especially if (6) and (8) contain different data, but the same key and nonce. Presumably the same issue applies to other users of udp_tunnel too.

Fix this by just dropping sending and receiving packets during the hibernation sequence.

---
I wrote this patch in response to the issue Jérémy raised, but I'm not actually super familiar with all of the hibernation mechanics. If somebody working on PM would think about this matter too, I'd be much obliged.

 include/linux/freezer.h    | 1 +
 net/ipv4/udp.c             | 5 +++++
 net/ipv4/udp_tunnel_core.c | 5 +++++
 net/ipv6/ip6_udp_tunnel.c  | 5 +++++
 net/ipv6/udp.c             | 5 +++++
 5 files changed, 21 insertions(+)
include/linux/freezer.h +1 -0
index 0a8c6c4d1a82..21d708dc4092 100644
@@ -76,6 +76,7 @@ static inline bool cgroup1_freezing(struct task_struct *task)
 #endif /* !CONFIG_CGROUP_FREEZER */
 
 #else /* !CONFIG_FREEZER */
+#define pm_freezing (false)
 static inline bool frozen(struct task_struct *p) { return false; }
 static inline bool freezing(struct task_struct *p) { return false; }
 static inline void __thaw_task(struct task_struct *t) {}
net/ipv4/udp.c +5 -0
index b090bd1f59e8..5021932ad9f1 100644
@@ -95,6 +95,7 @@
 #include <linux/netdevice.h>
 #include <linux/slab.h>
 #include <linux/sock_diag.h>
+#include <linux/freezer.h>
 #include <net/tcp_states.h>
 #include <linux/skbuff.h>
 #include <linux/proc_fs.h>
@@ -2425,6 +2426,10 @@ static int udp_queue_rcv_one_skb(struct sock *sk, struct sk_buff *skb)
 		if (encap_rcv) {
 			int ret;
 
+			/* Drop if we're hibernating */
+			if (unlikely(pm_freezing))
+				goto drop;
+
 			/* Verify checksum before giving to encap */
 			if (udp_lib_checksum_complete(skb))
 				goto csum_error;
net/ipv4/udp_tunnel_core.c +5 -0
index a128fe85620d..e3666ed96af7 100644
@@ -3,6 +3,7 @@
 #include <linux/errno.h>
 #include <linux/socket.h>
 #include <linux/kernel.h>
+#include <linux/freezer.h>
 #include <net/dst_metadata.h>
 #include <net/flow.h>
 #include <net/udp.h>
@@ -172,6 +173,10 @@ void udp_tunnel_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *skb
 {
 	struct udphdr *uh;
 
+	/* Drop if we're hibernating */
+	if (unlikely(pm_freezing))
+		return;
+
 	__skb_push(skb, sizeof(*uh));
 	skb_reset_transport_header(skb);
 	uh = udp_hdr(skb);
net/ipv6/ip6_udp_tunnel.c +5 -0
index 32525a051a6f..4a31e8cc8887 100644
@@ -7,6 +7,7 @@
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/in6.h>
+#include <linux/freezer.h>
 #include <net/udp.h>
 #include <net/udp_tunnel.h>
 #include <net/net_namespace.h>
@@ -86,6 +87,10 @@ void udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk,
 	struct udphdr *uh;
 	struct ipv6hdr *ip6h;
 
+	/* Drop if we're hibernating */
+	if (unlikely(pm_freezing))
+		return;
+
 	__skb_push(skb, sizeof(*uh));
 	skb_reset_transport_header(skb);
 	uh = udp_hdr(skb);
net/ipv6/udp.c +5 -0
index 93478d1ad576..db9c2050887d 100644
@@ -34,6 +34,7 @@
 #include <linux/slab.h>
 #include <linux/uaccess.h>
 #include <linux/indirect_call_wrapper.h>
+#include <linux/freezer.h>
 #include <trace/events/udp.h>
 
 #include <net/addrconf.h>
@@ -848,6 +849,10 @@ static int udpv6_queue_rcv_one_skb(struct sock *sk, struct sk_buff *skb)
 		if (encap_rcv) {
 			int ret;
 
+			/* Drop if we're hibernating */
+			if (unlikely(pm_freezing))
+				goto drop;
+
 			/* Verify checksum before giving to encap */
 			if (udp_lib_checksum_complete(skb))
 				goto csum_error;
Signature · 1 line
2.56.0
#1 lore raw
This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information:

Hi!

This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information:

- Whether the issue was actually triggered, or is only theoretical (e.g. found by code inspection). If it was triggered please include the symptoms, like the stack trace or error messages.

Please do not repost the series just to address the above. Instead, reply to this email with the missing information, so that reviewers can take it into account. If the series needs another revision for other reasons, please include the information in the commit messages then.

The evaluation is done by an LLM so it may be wrong, if you think that is the case please reply and explain.

#2 lore raw
Quoted 6 lines · On Thu, Oct 8, 2026 at 2:46 PM <[email protected]> wrote:

This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information:

- Whether the issue was actually triggered, or is only theoretical (e.g. found by code inspection). If it was triggered please include the symptoms, like the stack trace or error messages.

Yea, I really have no idea. That's for Jérémy to elucidate.

Jason

#3 lore raw
Quoted 11 lines · Jason A. Donenfeld
Quoted 6 lines · On Thu, Oct 8, 2026 at 2:46 PM <[email protected]> wrote:

This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information:

- Whether the issue was actually triggered, or is only theoretical (e.g. found by code inspection). If it was triggered please include the symptoms, like the stack trace or error messages.

Yea, I really have no idea. That's for Jérémy to elucidate.

Jason

Yes, the bug was actually triggered.
It was found by code inspection with help from a LLM.

Jérémy

maintainer
#4 lore raw
In reply to Jason A. Donenfeld
Quoted 15 lines · Jason A. Donenfeld

The kernel's various networking applications keep churning away after userspace is frozen during hibernation, even as a memory snapshot is being made. This can lead many network applications to an inconsistent state, replaying packets and cryptographic state changes. For example, on wireguard, there's the possibility of this sequence:

1) hibernating begins
2) handshake state cleared
3) keypairs cleared
4) new handshake round trip completes
5) machine memory is snapshotted
6) packet is sent using new keypair
7) machine is restored to state (5)
8) packet is sent using new keypair

Quoted 6 lines

The idea is to prevent (6) from happening, especially if (6) and (8) contain different data, but the same key and nonce. Presumably the same issue applies to other users of udp_tunnel too.

Fix this by just dropping sending and receiving packets during the hibernation sequence.

A few high level questions:

If the issue is reuse of key + nonce during send, why include receive side functions? Specifically tunnel (encap_rcv) functions.

Is this a problem specific to UDP tunnels?

Quoted 123 lines

---
I wrote this patch in response to the issue Jérémy raised, but I'm not actually super familiar with all of the hibernation mechanics. If somebody working on PM would think about this matter too, I'd be much obliged.

 include/linux/freezer.h    | 1 +
 net/ipv4/udp.c             | 5 +++++
 net/ipv4/udp_tunnel_core.c | 5 +++++
 net/ipv6/ip6_udp_tunnel.c  | 5 +++++
 net/ipv6/udp.c             | 5 +++++
 5 files changed, 21 insertions(+)
include/linux/freezer.h +1 -0
index 0a8c6c4d1a82..21d708dc4092 100644
@@ -76,6 +76,7 @@ static inline bool cgroup1_freezing(struct task_struct *task)
 #endif /* !CONFIG_CGROUP_FREEZER */
 
 #else /* !CONFIG_FREEZER */
+#define pm_freezing (false)
 static inline bool frozen(struct task_struct *p) { return false; }
 static inline bool freezing(struct task_struct *p) { return false; }
 static inline void __thaw_task(struct task_struct *t) {}
net/ipv4/udp.c +5 -0
index b090bd1f59e8..5021932ad9f1 100644
@@ -95,6 +95,7 @@
 #include <linux/netdevice.h>
 #include <linux/slab.h>
 #include <linux/sock_diag.h>
+#include <linux/freezer.h>
 #include <net/tcp_states.h>
 #include <linux/skbuff.h>
 #include <linux/proc_fs.h>
@@ -2425,6 +2426,10 @@ static int udp_queue_rcv_one_skb(struct sock *sk, struct sk_buff *skb)
 		if (encap_rcv) {
 			int ret;
 
+			/* Drop if we're hibernating */
+			if (unlikely(pm_freezing))
+				goto drop;
+
 			/* Verify checksum before giving to encap */
 			if (udp_lib_checksum_complete(skb))
 				goto csum_error;
net/ipv4/udp_tunnel_core.c +5 -0
index a128fe85620d..e3666ed96af7 100644
@@ -3,6 +3,7 @@
 #include <linux/errno.h>
 #include <linux/socket.h>
 #include <linux/kernel.h>
+#include <linux/freezer.h>
 #include <net/dst_metadata.h>
 #include <net/flow.h>
 #include <net/udp.h>
@@ -172,6 +173,10 @@ void udp_tunnel_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *skb
 {
 	struct udphdr *uh;
 
+	/* Drop if we're hibernating */
+	if (unlikely(pm_freezing))
+		return;
+
 	__skb_push(skb, sizeof(*uh));
 	skb_reset_transport_header(skb);
 	uh = udp_hdr(skb);
net/ipv6/ip6_udp_tunnel.c +5 -0
index 32525a051a6f..4a31e8cc8887 100644
@@ -7,6 +7,7 @@
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/in6.h>
+#include <linux/freezer.h>
 #include <net/udp.h>
 #include <net/udp_tunnel.h>
 #include <net/net_namespace.h>
@@ -86,6 +87,10 @@ void udp_tunnel6_xmit_skb(struct dst_entry *dst, struct sock *sk,
 	struct udphdr *uh;
 	struct ipv6hdr *ip6h;
 
+	/* Drop if we're hibernating */
+	if (unlikely(pm_freezing))
+		return;
+
 	__skb_push(skb, sizeof(*uh));
 	skb_reset_transport_header(skb);
 	uh = udp_hdr(skb);
net/ipv6/udp.c +5 -0
index 93478d1ad576..db9c2050887d 100644
@@ -34,6 +34,7 @@
 #include <linux/slab.h>
 #include <linux/uaccess.h>
 #include <linux/indirect_call_wrapper.h>
+#include <linux/freezer.h>
 #include <trace/events/udp.h>
 
 #include <net/addrconf.h>
@@ -848,6 +849,10 @@ static int udpv6_queue_rcv_one_skb(struct sock *sk, struct sk_buff *skb)
 		if (encap_rcv) {
 			int ret;
 
+			/* Drop if we're hibernating */
+			if (unlikely(pm_freezing))
+				goto drop;
+
 			/* Verify checksum before giving to encap */
 			if (udp_lib_checksum_complete(skb))
 				goto csum_error;
Signature · 1 line
2.56.0
#5 lore raw

Hi Willem,

Quoted 20 lines · Willem de Bruijn
Quoted 19 lines · Jason A. Donenfeld

The kernel's various networking applications keep churning away after userspace is frozen during hibernation, even as a memory snapshot is being made. This can lead many network applications to an inconsistent state, replaying packets and cryptographic state changes. For example, on wireguard, there's the possibility of this sequence:

1) hibernating begins
2) handshake state cleared
3) keypairs cleared
4) new handshake round trip completes
5) machine memory is snapshotted
6) packet is sent using new keypair
7) machine is restored to state (5)
8) packet is sent using new keypair

The idea is to prevent (6) from happening, especially if (6) and (8) contain different data, but the same key and nonce. Presumably the same issue applies to other users of udp_tunnel too.

Quoted 7 lines
Quoted 2 lines

Fix this by just dropping sending and receiving packets during the hibernation sequence.

A few high level questions:

If the issue is reuse of key + nonce during send, why include receive side functions? Specifically tunnel (encap_rcv) functions.

Because I suppose (4) probably shouldn't be possible after (1). I explicitly clear the result of (4) in a PM notifier. It seems wrong for that to then be violated after. Similarly, userspace doesn't get packets after that point either.

Quoted 1 line

Is this a problem specific to UDP tunnels?

The stateless nature makes it more poignant there.

maintainer
#6 lore raw
Quoted 30 lines · Jason A. Donenfeld

Hi Willem,

Quoted 25 lines · Willem de Bruijn
Quoted 15 lines · Jason A. Donenfeld

The kernel's various networking applications keep churning away after userspace is frozen during hibernation, even as a memory snapshot is being made. This can lead many network applications to an inconsistent state, replaying packets and cryptographic state changes. For example, on wireguard, there's the possibility of this sequence:

1) hibernating begins
2) handshake state cleared
3) keypairs cleared
4) new handshake round trip completes
5) machine memory is snapshotted
6) packet is sent using new keypair
7) machine is restored to state (5)
8) packet is sent using new keypair

Quoted 6 lines

The idea is to prevent (6) from happening, especially if (6) and (8) contain different data, but the same key and nonce. Presumably the same issue applies to other users of udp_tunnel too.

Fix this by just dropping sending and receiving packets during the hibernation sequence.

A few high level questions:

Quoted 7 lines
Quoted 2 lines

If the issue is reuse of key + nonce during send, why include receive side functions? Specifically tunnel (encap_rcv) functions.

Because I suppose (4) probably shouldn't be possible after (1). I explicitly clear the result of (4) in a PM notifier. It seems wrong for that to then be violated after. Similarly, userspace doesn't get packets after that point either.

Since this is an issue specific with security protocols and reuse of their state across freeze and restore, is that the more suitable location for this check? Drop transmit of packets with that risk (unique for that connection nonce) only, if freezing.

Quoted 3 lines
Quoted 1 line

Is this a problem specific to UDP tunnels?

The stateless nature makes it more poignant there.

udp_queue_rcv_one_skb is the UDP hot path. Since it touches all packets, the last resort for adding checks that are relevant too only a small subset of packets.

#7 lore raw
Quoted 4 lines · Willem de Bruijn

Since this is an issue specific with security protocols and reuse of their state across freeze and restore, is that the more suitable location for this check? Drop transmit of packets with that risk (unique for that connection nonce) only, if freezing.

I was thinking this is a pretty common problem to UDP apps in general, and it's confusing to have these sorts of replays due to hibernation that userspace doesn't have. It's an odd problem to expect every in-kernel user to fix independently, so maybe it'd be more clever to do this all in one place. I can put it in only wireguard, instead, if you feel really strongly about it. But I was thinking this just seemed like an odd behavior difference that could be easily fixed for everyone.

Quoted 3 lines

udp_queue_rcv_one_skb is the UDP hot path. Since it touches all packets, the last resort for adding checks that are relevant too only a small subset of packets.

Is there another way you'd suggest doing this? Some other trick for disabling the socket? I also am not keen on adding branches to hot paths.

Jason

maintainer
#8 lore raw
Quoted 7 lines · Jason A. Donenfeld
Quoted 4 lines · Willem de Bruijn

Since this is an issue specific with security protocols and reuse of their state across freeze and restore, is that the more suitable location for this check? Drop transmit of packets with that risk (unique for that connection nonce) only, if freezing.

Quoted 8 lines

I was thinking this is a pretty common problem to UDP apps in general, and it's confusing to have these sorts of replays due to hibernation that userspace doesn't have. It's an odd problem to expect every in-kernel user to fix independently, so maybe it'd be more clever to do this all in one place. I can put it in only wireguard, instead, if you feel really strongly about it. But I was thinking this just seemed like an odd behavior difference that could be easily fixed for everyone.

When it comes to security protocols, this does not cover many of them, such as IPSec, MACSec, kTLS or PSP.

Independent of security protocols, is there a replay on thaw issue? Your example points out that 6 and 8 can have different data, so this is not a replay because of thaw, but a second transmission by the security protocol, correct? If so, then other UDP protocols are not necessarily affected: only the nonce reuse is the problematic aspect.

To avoid across UDP, udp_tunnel_xmit_skb would also be too narrow, capturing only tunnel packets. Blocking transmission post snapshot entirely may require quiescing at the device layer, something like QUEUE_STATE_STACK_XOFF (if that isn't done yet, I don't know this freeze process well).

Quoted 7 lines
Quoted 3 lines

udp_queue_rcv_one_skb is the UDP hot path. Since it touches all packets, the last resort for adding checks that are relevant too only a small subset of packets.

Is there another way you'd suggest doing this? Some other trick for disabling the socket? I also am not keen on adding branches to hot paths.

At this layer or another, making pm_freezing a static_branch toggled by freeze_processes() / thaw_processes() would make the branch a NOOP in het hot path.

So far, most promising I see is blocking the new handshake in Wireguard itself to avoid this from being possible. But that would indeed require all other protocols to be warned and review for individual fixes. A single choke point would be preferable, but I do not think they share a single such code path.

#9 lore raw
In reply to Jason A. Donenfeld
kernel test robot noticed the following build errors:

Hi Jason,

kernel test robot noticed the following build errors:

[auto build test ERROR on net/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Jason-A-Donenfeld/udp_tunnel-drop-packets-when-hibernating/20261008-144021
base:   net/main
patch link:    https://lore.kernel.org/r/20261008124106.665014-1-Jason%40zx2c4.com
patch subject: [PATCH net] udp_tunnel: drop packets when hibernating
config: parisc-randconfig-1000-20261009 (https://download.01.org/0day-ci/archive/20261009/[email protected]/config)
compiler: hppa-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261009/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

In file included from include/linux/list.h:11,
from include/linux/kobject.h:19, from include/linux/cdev.h:5,
from drivers/char/virtio_console.c:7:
drivers/char/virtio_console.c: In function '__send_to_port':

>> include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   arch/parisc/include/asm/barrier.h:66:18: note: in definition of macro '__smp_load_acquire'
     union { typeof(*p) __val; char __c[1]; } __u;   \
                     ^
   drivers/char/virtio_console.c:636:6: note: in expansion of macro 'smp_load_acquire'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:33: note: in expansion of macro 'pm_freezing'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
>> include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   arch/parisc/include/asm/barrier.h:67:9: note: in definition of macro '__smp_load_acquire'
     typeof(p) __p = (p);      \
            ^
   drivers/char/virtio_console.c:636:6: note: in expansion of macro 'smp_load_acquire'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:33: note: in expansion of macro 'pm_freezing'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
>> include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   arch/parisc/include/asm/barrier.h:67:19: note: in definition of macro '__smp_load_acquire'
     typeof(p) __p = (p);      \
                      ^
   drivers/char/virtio_console.c:636:6: note: in expansion of macro 'smp_load_acquire'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:33: note: in expansion of macro 'pm_freezing'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
   In file included from <command-line>:
>> include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   include/linux/compiler_types.h:682:9: note: in definition of macro '__compiletime_assert'
      if (!(condition))     \
            ^~~~~~~~~
   include/linux/compiler_types.h:702:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:2: note: in expansion of macro 'compiletime_assert'
     compiletime_assert(__native_word(t),    \
     ^~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:21: note: in expansion of macro '__native_word'
     compiletime_assert(__native_word(t),    \
                        ^~~~~~~~~~~~~
   arch/parisc/include/asm/barrier.h:68:2: note: in expansion of macro 'compiletime_assert_atomic_type'
     compiletime_assert_atomic_type(*p);    \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:6: note: in expansion of macro 'smp_load_acquire'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:33: note: in expansion of macro 'pm_freezing'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
>> include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   include/linux/compiler_types.h:682:9: note: in definition of macro '__compiletime_assert'
      if (!(condition))     \
            ^~~~~~~~~
   include/linux/compiler_types.h:702:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:2: note: in expansion of macro 'compiletime_assert'
     compiletime_assert(__native_word(t),    \
     ^~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:21: note: in expansion of macro '__native_word'
     compiletime_assert(__native_word(t),    \
                        ^~~~~~~~~~~~~
   arch/parisc/include/asm/barrier.h:68:2: note: in expansion of macro 'compiletime_assert_atomic_type'
     compiletime_assert_atomic_type(*p);    \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:6: note: in expansion of macro 'smp_load_acquire'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:33: note: in expansion of macro 'pm_freezing'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
>> include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   include/linux/compiler_types.h:682:9: note: in definition of macro '__compiletime_assert'
      if (!(condition))     \
            ^~~~~~~~~
   include/linux/compiler_types.h:702:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:2: note: in expansion of macro 'compiletime_assert'
     compiletime_assert(__native_word(t),    \
     ^~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:21: note: in expansion of macro '__native_word'
     compiletime_assert(__native_word(t),    \
                        ^~~~~~~~~~~~~
   arch/parisc/include/asm/barrier.h:68:2: note: in expansion of macro 'compiletime_assert_atomic_type'
     compiletime_assert_atomic_type(*p);    \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:6: note: in expansion of macro 'smp_load_acquire'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:33: note: in expansion of macro 'pm_freezing'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
>> include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   include/linux/compiler_types.h:682:9: note: in definition of macro '__compiletime_assert'
      if (!(condition))     \
            ^~~~~~~~~
   include/linux/compiler_types.h:702:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:2: note: in expansion of macro 'compiletime_assert'
     compiletime_assert(__native_word(t),    \
     ^~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:21: note: in expansion of macro '__native_word'
     compiletime_assert(__native_word(t),    \
                        ^~~~~~~~~~~~~
   arch/parisc/include/asm/barrier.h:68:2: note: in expansion of macro 'compiletime_assert_atomic_type'
     compiletime_assert_atomic_type(*p);    \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:6: note: in expansion of macro 'smp_load_acquire'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:33: note: in expansion of macro 'pm_freezing'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
   In file included from include/linux/list.h:11,
                    from include/linux/kobject.h:19,
                    from include/linux/cdev.h:5,
                    from drivers/char/virtio_console.c:7:
>> include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   arch/parisc/include/asm/barrier.h:69:18: note: in definition of macro '__smp_load_acquire'
     switch (sizeof(*p)) {      \
                     ^
   drivers/char/virtio_console.c:636:6: note: in expansion of macro 'smp_load_acquire'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:33: note: in expansion of macro 'pm_freezing'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
   drivers/char/virtio_console.c: In function 'put_chars':
>> include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   arch/parisc/include/asm/barrier.h:66:18: note: in definition of macro '__smp_load_acquire'
     union { typeof(*p) __val; char __c[1]; } __u;   \
                     ^
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:33: note: in expansion of macro 'pm_freezing'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
>> include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   arch/parisc/include/asm/barrier.h:67:9: note: in definition of macro '__smp_load_acquire'
     typeof(p) __p = (p);      \
            ^
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:33: note: in expansion of macro 'pm_freezing'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
>> include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   arch/parisc/include/asm/barrier.h:67:19: note: in definition of macro '__smp_load_acquire'
     typeof(p) __p = (p);      \
                      ^
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:33: note: in expansion of macro 'pm_freezing'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
   In file included from <command-line>:
>> include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   include/linux/compiler_types.h:682:9: note: in definition of macro '__compiletime_assert'
      if (!(condition))     \
            ^~~~~~~~~
   include/linux/compiler_types.h:702:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:2: note: in expansion of macro 'compiletime_assert'
     compiletime_assert(__native_word(t),    \
     ^~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:21: note: in expansion of macro '__native_word'
     compiletime_assert(__native_word(t),    \
                        ^~~~~~~~~~~~~
   arch/parisc/include/asm/barrier.h:68:2: note: in expansion of macro 'compiletime_assert_atomic_type'
     compiletime_assert_atomic_type(*p);    \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:33: note: in expansion of macro 'pm_freezing'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
>> include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   include/linux/compiler_types.h:682:9: note: in definition of macro '__compiletime_assert'
      if (!(condition))     \
            ^~~~~~~~~
   include/linux/compiler_types.h:702:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:2: note: in expansion of macro 'compiletime_assert'
     compiletime_assert(__native_word(t),    \
     ^~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:21: note: in expansion of macro '__native_word'
     compiletime_assert(__native_word(t),    \
                        ^~~~~~~~~~~~~
   arch/parisc/include/asm/barrier.h:68:2: note: in expansion of macro 'compiletime_assert_atomic_type'
     compiletime_assert_atomic_type(*p);    \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:33: note: in expansion of macro 'pm_freezing'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
>> include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   include/linux/compiler_types.h:682:9: note: in definition of macro '__compiletime_assert'
      if (!(condition))     \
            ^~~~~~~~~
   include/linux/compiler_types.h:702:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:2: note: in expansion of macro 'compiletime_assert'
     compiletime_assert(__native_word(t),    \
     ^~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:21: note: in expansion of macro '__native_word'
     compiletime_assert(__native_word(t),    \
                        ^~~~~~~~~~~~~
   arch/parisc/include/asm/barrier.h:68:2: note: in expansion of macro 'compiletime_assert_atomic_type'
     compiletime_assert_atomic_type(*p);    \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:33: note: in expansion of macro 'pm_freezing'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
>> include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   include/linux/compiler_types.h:682:9: note: in definition of macro '__compiletime_assert'
      if (!(condition))     \
            ^~~~~~~~~
   include/linux/compiler_types.h:702:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:2: note: in expansion of macro 'compiletime_assert'
     compiletime_assert(__native_word(t),    \
     ^~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:21: note: in expansion of macro '__native_word'
     compiletime_assert(__native_word(t),    \
                        ^~~~~~~~~~~~~
   arch/parisc/include/asm/barrier.h:68:2: note: in expansion of macro 'compiletime_assert_atomic_type'
     compiletime_assert_atomic_type(*p);    \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:33: note: in expansion of macro 'pm_freezing'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
   In file included from include/linux/list.h:11,
                    from include/linux/kobject.h:19,
                    from include/linux/cdev.h:5,
                    from drivers/char/virtio_console.c:7:
>> include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   arch/parisc/include/asm/barrier.h:69:18: note: in definition of macro '__smp_load_acquire'
     switch (sizeof(*p)) {      \
                     ^
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:33: note: in expansion of macro 'pm_freezing'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
   In file included from drivers/char/virtio_console.c:12:
   drivers/char/virtio_console.c: In function 'virtcons_probe':
>> include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   drivers/char/virtio_console.c:2071:11: note: in expansion of macro 'pm_freezing'
     portdev->pm_freezing = false;
              ^~~~~~~~~~~

vim +79 include/linux/freezer.h

    77	
    78	#else /* !CONFIG_FREEZER */
  > 79	#define pm_freezing (false)
    80	static inline bool frozen(struct task_struct *p) { return false; }
    81	static inline bool freezing(struct task_struct *p) { return false; }
    82	static inline void __thaw_task(struct task_struct *t) {}
    83	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

#10 lore raw
In reply to Jason A. Donenfeld
kernel test robot noticed the following build errors:

Hi Jason,

kernel test robot noticed the following build errors:

[auto build test ERROR on net/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Jason-A-Donenfeld/udp_tunnel-drop-packets-when-hibernating/20261008-144021
base:   net/main
patch link:    https://lore.kernel.org/r/20261008124106.665014-1-Jason%40zx2c4.com
patch subject: [PATCH net] udp_tunnel: drop packets when hibernating
config: s390-randconfig-1000-20261009 (https://download.01.org/0day-ci/archive/20261009/[email protected]/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261009/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> drivers/char/virtio_console.c:636:33: error: expected identifier
     636 |         if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         |                                        ^
   include/linux/freezer.h:79:21: note: expanded from macro 'pm_freezing'
      79 | #define pm_freezing (false)
         |                     ^
>> drivers/char/virtio_console.c:636:33: error: expected identifier
   include/linux/freezer.h:79:21: note: expanded from macro 'pm_freezing'
      79 | #define pm_freezing (false)
         |                     ^
>> drivers/char/virtio_console.c:636:33: error: expected identifier
   include/linux/freezer.h:79:21: note: expanded from macro 'pm_freezing'
      79 | #define pm_freezing (false)
         |                     ^
>> drivers/char/virtio_console.c:636:33: error: expected identifier
   include/linux/freezer.h:79:21: note: expanded from macro 'pm_freezing'
      79 | #define pm_freezing (false)
         |                     ^
>> drivers/char/virtio_console.c:636:33: error: expected identifier
   include/linux/freezer.h:79:21: note: expanded from macro 'pm_freezing'
      79 | #define pm_freezing (false)
         |                     ^
>> drivers/char/virtio_console.c:636:33: error: expected identifier
   include/linux/freezer.h:79:21: note: expanded from macro 'pm_freezing'
      79 | #define pm_freezing (false)
         |                     ^
>> drivers/char/virtio_console.c:636:33: error: expected identifier
   include/linux/freezer.h:79:21: note: expanded from macro 'pm_freezing'
      79 | #define pm_freezing (false)
         |                     ^
>> drivers/char/virtio_console.c:636:33: error: expected identifier
   include/linux/freezer.h:79:21: note: expanded from macro 'pm_freezing'
      79 | #define pm_freezing (false)
         |                     ^
>> drivers/char/virtio_console.c:636:33: error: expected identifier
   include/linux/freezer.h:79:21: note: expanded from macro 'pm_freezing'
      79 | #define pm_freezing (false)
         |                     ^
>> drivers/char/virtio_console.c:636:33: error: expected identifier
   include/linux/freezer.h:79:21: note: expanded from macro 'pm_freezing'
      79 | #define pm_freezing (false)
         |                     ^
>> drivers/char/virtio_console.c:636:33: error: expected identifier
   include/linux/freezer.h:79:21: note: expanded from macro 'pm_freezing'
      79 | #define pm_freezing (false)
         |                     ^
>> drivers/char/virtio_console.c:636:33: error: expected identifier
   include/linux/freezer.h:79:21: note: expanded from macro 'pm_freezing'
      79 | #define pm_freezing (false)
         |                     ^
   drivers/char/virtio_console.c:1173:33: error: expected identifier
    1173 |             smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         |                                        ^

include/linux/freezer.h:79:21: note: expanded from macro 'pm_freezing'
79 | #define pm_freezing (false)
| ^
drivers/char/virtio_console.c:1173:33: error: expected identifier include/linux/freezer.h:79:21: note: expanded from macro 'pm_freezing'
79 | #define pm_freezing (false)
| ^
drivers/char/virtio_console.c:1173:33: error: expected identifier include/linux/freezer.h:79:21: note: expanded from macro 'pm_freezing'
79 | #define pm_freezing (false)
| ^
drivers/char/virtio_console.c:1173:33: error: expected identifier include/linux/freezer.h:79:21: note: expanded from macro 'pm_freezing'
79 | #define pm_freezing (false)
| ^
drivers/char/virtio_console.c:1173:33: error: expected identifier include/linux/freezer.h:79:21: note: expanded from macro 'pm_freezing'
79 | #define pm_freezing (false)
| ^
drivers/char/virtio_console.c:1173:33: error: expected identifier include/linux/freezer.h:79:21: note: expanded from macro 'pm_freezing'
79 | #define pm_freezing (false)
| ^
drivers/char/virtio_console.c:1173:33: error: expected identifier include/linux/freezer.h:79:21: note: expanded from macro 'pm_freezing'
79 | #define pm_freezing (false)
| ^
fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated.

vim +636 drivers/char/virtio_console.c

cdfadfc1adb87fc Amit Shah          2010-05-19  608  
eb5e89fc70bb3f1 Masami Hiramatsu   2012-08-09  609  static ssize_t __send_to_port(struct port *port, struct scatterlist *sg,
eb5e89fc70bb3f1 Masami Hiramatsu   2012-08-09  610  			      int nents, size_t in_count,
fc220d6be3c7e48 Sungho Bae         2026-06-04  611  			      struct port_buffer *buf, bool nonblock)
f997f00bf8c3ddf Amit Shah          2009-12-21  612  {
f997f00bf8c3ddf Amit Shah          2009-12-21  613  	struct virtqueue *out_vq;
589575a23562b58 Rusty Russell      2012-10-16  614  	int err;
cdfadfc1adb87fc Amit Shah          2010-05-19  615  	unsigned long flags;
f997f00bf8c3ddf Amit Shah          2009-12-21  616  	unsigned int len;
a616ad344d9f7fe Sungho Bae         2026-06-04  617  	struct ports_device *portdev;
f997f00bf8c3ddf Amit Shah          2009-12-21  618  
cdfadfc1adb87fc Amit Shah          2010-05-19  619  	spin_lock_irqsave(&port->outvq_lock, flags);
cdfadfc1adb87fc Amit Shah          2010-05-19  620  
a616ad344d9f7fe Sungho Bae         2026-06-04  621  	portdev = READ_ONCE(port->portdev);
a616ad344d9f7fe Sungho Bae         2026-06-04  622  
a616ad344d9f7fe Sungho Bae         2026-06-04  623  	if (!portdev) {
a616ad344d9f7fe Sungho Bae         2026-06-04  624  		in_count = 0;
a616ad344d9f7fe Sungho Bae         2026-06-04  625  		goto free_and_done;
a616ad344d9f7fe Sungho Bae         2026-06-04  626  	}
a616ad344d9f7fe Sungho Bae         2026-06-04  627  
b187532ac6dba56 Sungho Bae         2026-06-04  628  	/*
b187532ac6dba56 Sungho Bae         2026-06-04  629  	 * Check freeze flag under the lock so that the flag check and
b187532ac6dba56 Sungho Bae         2026-06-04  630  	 * virtqueue_add_outbuf() are atomic with respect to
b187532ac6dba56 Sungho Bae         2026-06-04  631  	 * remove_port_data() which also takes outvq_lock.  This
b187532ac6dba56 Sungho Bae         2026-06-04  632  	 * guarantees that once remove_port_data() returns, no new
b187532ac6dba56 Sungho Bae         2026-06-04  633  	 * buffers can be added before remove_vqs() tears down the vq.
b187532ac6dba56 Sungho Bae         2026-06-04  634  	 * Pairs with smp_store_release() in virtcons_freeze/restore.
b187532ac6dba56 Sungho Bae         2026-06-04  635  	 */
b187532ac6dba56 Sungho Bae         2026-06-04 @636  	if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
b187532ac6dba56 Sungho Bae         2026-06-04  637  		goto free_and_done;
b187532ac6dba56 Sungho Bae         2026-06-04  638  
a616ad344d9f7fe Sungho Bae         2026-06-04  639  	out_vq = port->out_vq;
a616ad344d9f7fe Sungho Bae         2026-06-04  640  
cdfadfc1adb87fc Amit Shah          2010-05-19  641  	reclaim_consumed_buffers(port);
cdfadfc1adb87fc Amit Shah          2010-05-19  642  
fc220d6be3c7e48 Sungho Bae         2026-06-04  643  	err = virtqueue_add_outbuf(out_vq, sg, nents, buf, GFP_ATOMIC);
f997f00bf8c3ddf Amit Shah          2009-12-21  644  
f997f00bf8c3ddf Amit Shah          2009-12-21  645  	/* Tell Host to go! */
505b0451c47699c Michael S. Tsirkin 2010-04-12  646  	virtqueue_kick(out_vq);
f997f00bf8c3ddf Amit Shah          2009-12-21  647  
589575a23562b58 Rusty Russell      2012-10-16  648  	if (err) {
9ff4cfab82d27e9 Rusty Russell      2010-04-08  649  		in_count = 0;
fc220d6be3c7e48 Sungho Bae         2026-06-04  650  		goto free_and_done;
f997f00bf8c3ddf Amit Shah          2009-12-21  651  	}
f997f00bf8c3ddf Amit Shah          2009-12-21  652  
589575a23562b58 Rusty Russell      2012-10-16  653  	if (out_vq->num_free == 0)
cdfadfc1adb87fc Amit Shah          2010-05-19  654  		port->outvq_full = true;
cdfadfc1adb87fc Amit Shah          2010-05-19  655  
cdfadfc1adb87fc Amit Shah          2010-05-19  656  	if (nonblock)
cdfadfc1adb87fc Amit Shah          2010-05-19  657  		goto done;
cdfadfc1adb87fc Amit Shah          2010-05-19  658  
cdfadfc1adb87fc Amit Shah          2010-05-19  659  	/*
cdfadfc1adb87fc Amit Shah          2010-05-19  660  	 * Wait till the host acknowledges it pushed out the data we
531295e63be8c2b Amit Shah          2010-10-20  661  	 * sent.  This is done for data from the hvc_console; the tty
531295e63be8c2b Amit Shah          2010-10-20  662  	 * operations are performed with spinlocks held so we can't
531295e63be8c2b Amit Shah          2010-10-20  663  	 * sleep here.  An alternative would be to copy the data to a
531295e63be8c2b Amit Shah          2010-10-20  664  	 * buffer and relax the spinning requirement.  The downside is
531295e63be8c2b Amit Shah          2010-10-20  665  	 * we need to kmalloc a GFP_ATOMIC buffer each time the
531295e63be8c2b Amit Shah          2010-10-20  666  	 * console driver writes something out.
fc220d6be3c7e48 Sungho Bae         2026-06-04  667  	 *
fc220d6be3c7e48 Sungho Bae         2026-06-04  668  	 * Spin until host returns the buffer.
fc220d6be3c7e48 Sungho Bae         2026-06-04  669  	 * Capture the returned buf so we can free it.
fc220d6be3c7e48 Sungho Bae         2026-06-04  670  	 * If broken, buf == NULL and buf stays in the vq;
fc220d6be3c7e48 Sungho Bae         2026-06-04  671  	 * remove_vqs() will call virtqueue_detach_unused_buf() -> free_buf().
cdfadfc1adb87fc Amit Shah          2010-05-19  672  	 */
fc220d6be3c7e48 Sungho Bae         2026-06-04  673  	while (!(buf = virtqueue_get_buf(out_vq, &len))
40e4dc530118dbb Heinz Graalfs      2013-10-29  674  		&& !virtqueue_is_broken(out_vq))
f997f00bf8c3ddf Amit Shah          2009-12-21  675  		cpu_relax();
fc220d6be3c7e48 Sungho Bae         2026-06-04  676  
fc220d6be3c7e48 Sungho Bae         2026-06-04  677  free_and_done:
fc220d6be3c7e48 Sungho Bae         2026-06-04  678  	if (buf)
fc220d6be3c7e48 Sungho Bae         2026-06-04  679  		free_buf(buf, false);
cdfadfc1adb87fc Amit Shah          2010-05-19  680  done:
cdfadfc1adb87fc Amit Shah          2010-05-19  681  	spin_unlock_irqrestore(&port->outvq_lock, flags);
17e5b4f20adbe28 Amit Shah          2011-09-14  682  
17e5b4f20adbe28 Amit Shah          2011-09-14  683  	port->stats.bytes_sent += in_count;
cdfadfc1adb87fc Amit Shah          2010-05-19  684  	/*
cdfadfc1adb87fc Amit Shah          2010-05-19  685  	 * We're expected to return the amount of data we wrote -- all
cdfadfc1adb87fc Amit Shah          2010-05-19  686  	 * of it
cdfadfc1adb87fc Amit Shah          2010-05-19  687  	 */
9ff4cfab82d27e9 Rusty Russell      2010-04-08  688  	return in_count;
f997f00bf8c3ddf Amit Shah          2009-12-21  689  }
f997f00bf8c3ddf Amit Shah          2009-12-21  690  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

#11 lore raw
In reply to Jason A. Donenfeld
kernel test robot noticed the following build warnings:

Hi Jason,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Jason-A-Donenfeld/udp_tunnel-drop-packets-when-hibernating/20261008-144021
base:   net/main
patch link:    https://lore.kernel.org/r/20261008124106.665014-1-Jason%40zx2c4.com
patch subject: [PATCH net] udp_tunnel: drop packets when hibernating
config: arm64-randconfig-1000-20261010 (https://download.01.org/0day-ci/archive/20261010/[email protected]/config)
compiler: aarch64-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261010/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

drivers/char/virtio_console.c:636:33: note: in expansion of macro 'pm_freezing'

     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
   include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   include/linux/compiler_types.h:682:9: note: in definition of macro '__compiletime_assert'
      if (!(condition))     \
            ^~~~~~~~~
   include/linux/compiler_types.h:702:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:2: note: in expansion of macro 'compiletime_assert'
     compiletime_assert(__native_word(t),    \
     ^~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:21: note: in expansion of macro '__native_word'
     compiletime_assert(__native_word(t),    \
                        ^~~~~~~~~~~~~
   arch/arm64/include/asm/barrier.h:169:2: note: in expansion of macro 'compiletime_assert_atomic_type'
     compiletime_assert_atomic_type(*p);    \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:6: note: in expansion of macro 'smp_load_acquire'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:33: note: in expansion of macro 'pm_freezing'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
   include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   include/linux/compiler_types.h:682:9: note: in definition of macro '__compiletime_assert'
      if (!(condition))     \
            ^~~~~~~~~
   include/linux/compiler_types.h:702:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:2: note: in expansion of macro 'compiletime_assert'
     compiletime_assert(__native_word(t),    \
     ^~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:21: note: in expansion of macro '__native_word'
     compiletime_assert(__native_word(t),    \
                        ^~~~~~~~~~~~~
   arch/arm64/include/asm/barrier.h:169:2: note: in expansion of macro 'compiletime_assert_atomic_type'
     compiletime_assert_atomic_type(*p);    \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:6: note: in expansion of macro 'smp_load_acquire'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:33: note: in expansion of macro 'pm_freezing'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
   include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   include/linux/compiler_types.h:682:9: note: in definition of macro '__compiletime_assert'
      if (!(condition))     \
            ^~~~~~~~~
   include/linux/compiler_types.h:702:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:2: note: in expansion of macro 'compiletime_assert'
     compiletime_assert(__native_word(t),    \
     ^~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:21: note: in expansion of macro '__native_word'
     compiletime_assert(__native_word(t),    \
                        ^~~~~~~~~~~~~
   arch/arm64/include/asm/barrier.h:169:2: note: in expansion of macro 'compiletime_assert_atomic_type'
     compiletime_assert_atomic_type(*p);    \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:6: note: in expansion of macro 'smp_load_acquire'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:33: note: in expansion of macro 'pm_freezing'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
   In file included from include/linux/list.h:11,
                    from include/linux/kobject.h:19,
                    from include/linux/cdev.h:5,
                    from drivers/char/virtio_console.c:7:
   include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   arch/arm64/include/asm/barrier.h:170:32: note: in definition of macro '__smp_load_acquire'
     kasan_check_read(__p, sizeof(*p));    \
                                   ^
   drivers/char/virtio_console.c:636:6: note: in expansion of macro 'smp_load_acquire'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:33: note: in expansion of macro 'pm_freezing'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
>> arch/arm64/include/asm/barrier.h:170:19: warning: passing argument 1 of 'kasan_check_read' makes pointer from integer without a cast [-Wint-conversion]
     kasan_check_read(__p, sizeof(*p));    \
                      ^~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:6: note: in expansion of macro 'smp_load_acquire'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   In file included from include/asm-generic/rwonce.h:26,
                    from arch/arm64/include/asm/rwonce.h:81,
                    from include/linux/compiler.h:369,
                    from include/linux/build_bug.h:5,
                    from include/linux/container_of.h:5,
                    from include/linux/list.h:5,
                    from include/linux/kobject.h:19,
                    from include/linux/cdev.h:5,
                    from drivers/char/virtio_console.c:7:
   include/linux/kasan-checks.h:40:58: note: expected 'const volatile void *' but argument is of type 'int'
    static inline bool kasan_check_read(const volatile void *p, unsigned int size)
                                        ~~~~~~~~~~~~~~~~~~~~~^
   In file included from include/linux/list.h:11,
                    from include/linux/kobject.h:19,
                    from include/linux/cdev.h:5,
                    from drivers/char/virtio_console.c:7:
   include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   arch/arm64/include/asm/barrier.h:171:18: note: in definition of macro '__smp_load_acquire'
     switch (sizeof(*p)) {      \
                     ^
   drivers/char/virtio_console.c:636:6: note: in expansion of macro 'smp_load_acquire'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:33: note: in expansion of macro 'pm_freezing'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
   arch/arm64/include/asm/barrier.h:175:11: error: invalid type argument of unary '*' (have 'int')
       : "Q" (*__p) : "memory");   \
              ^~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:6: note: in expansion of macro 'smp_load_acquire'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   arch/arm64/include/asm/barrier.h:180:11: error: invalid type argument of unary '*' (have 'int')
       : "Q" (*__p) : "memory");   \
              ^~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:6: note: in expansion of macro 'smp_load_acquire'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   arch/arm64/include/asm/barrier.h:185:11: error: invalid type argument of unary '*' (have 'int')
       : "Q" (*__p) : "memory");   \
              ^~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:6: note: in expansion of macro 'smp_load_acquire'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   arch/arm64/include/asm/barrier.h:190:11: error: invalid type argument of unary '*' (have 'int')
       : "Q" (*__p) : "memory");   \
              ^~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:6: note: in expansion of macro 'smp_load_acquire'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   arch/arm64/include/asm/barrier.h:193:11: note: in definition of macro '__smp_load_acquire'
     (typeof(*p))__u.__val;      \
              ^
   drivers/char/virtio_console.c:636:6: note: in expansion of macro 'smp_load_acquire'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:636:33: note: in expansion of macro 'pm_freezing'
     if (smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
   In file included from <command-line>:
   drivers/char/virtio_console.c: In function 'put_chars':
   include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   include/linux/compiler_types.h:626:13: note: in definition of macro '__unqual_scalar_typeof'
      _Generic((x),      \
                ^
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:33: note: in expansion of macro 'pm_freezing'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
--
   drivers/char/virtio_console.c:1173:33: note: in expansion of macro 'pm_freezing'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
   include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   include/linux/compiler_types.h:682:9: note: in definition of macro '__compiletime_assert'
      if (!(condition))     \
            ^~~~~~~~~
   include/linux/compiler_types.h:702:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:2: note: in expansion of macro 'compiletime_assert'
     compiletime_assert(__native_word(t),    \
     ^~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:21: note: in expansion of macro '__native_word'
     compiletime_assert(__native_word(t),    \
                        ^~~~~~~~~~~~~
   arch/arm64/include/asm/barrier.h:169:2: note: in expansion of macro 'compiletime_assert_atomic_type'
     compiletime_assert_atomic_type(*p);    \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:33: note: in expansion of macro 'pm_freezing'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
   include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   include/linux/compiler_types.h:682:9: note: in definition of macro '__compiletime_assert'
      if (!(condition))     \
            ^~~~~~~~~
   include/linux/compiler_types.h:702:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:2: note: in expansion of macro 'compiletime_assert'
     compiletime_assert(__native_word(t),    \
     ^~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:21: note: in expansion of macro '__native_word'
     compiletime_assert(__native_word(t),    \
                        ^~~~~~~~~~~~~
   arch/arm64/include/asm/barrier.h:169:2: note: in expansion of macro 'compiletime_assert_atomic_type'
     compiletime_assert_atomic_type(*p);    \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:33: note: in expansion of macro 'pm_freezing'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
   include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   include/linux/compiler_types.h:682:9: note: in definition of macro '__compiletime_assert'
      if (!(condition))     \
            ^~~~~~~~~
   include/linux/compiler_types.h:702:2: note: in expansion of macro '_compiletime_assert'
     _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
     ^~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:2: note: in expansion of macro 'compiletime_assert'
     compiletime_assert(__native_word(t),    \
     ^~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:705:21: note: in expansion of macro '__native_word'
     compiletime_assert(__native_word(t),    \
                        ^~~~~~~~~~~~~
   arch/arm64/include/asm/barrier.h:169:2: note: in expansion of macro 'compiletime_assert_atomic_type'
     compiletime_assert_atomic_type(*p);    \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:33: note: in expansion of macro 'pm_freezing'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
   In file included from include/linux/list.h:11,
                    from include/linux/kobject.h:19,
                    from include/linux/cdev.h:5,
                    from drivers/char/virtio_console.c:7:
   include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   arch/arm64/include/asm/barrier.h:170:32: note: in definition of macro '__smp_load_acquire'
     kasan_check_read(__p, sizeof(*p));    \
                                   ^
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:33: note: in expansion of macro 'pm_freezing'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
>> arch/arm64/include/asm/barrier.h:170:19: warning: passing argument 1 of 'kasan_check_read' makes pointer from integer without a cast [-Wint-conversion]
     kasan_check_read(__p, sizeof(*p));    \
                      ^~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   In file included from include/asm-generic/rwonce.h:26,
                    from arch/arm64/include/asm/rwonce.h:81,
                    from include/linux/compiler.h:369,
                    from include/linux/build_bug.h:5,
                    from include/linux/container_of.h:5,
                    from include/linux/list.h:5,
                    from include/linux/kobject.h:19,
                    from include/linux/cdev.h:5,
                    from drivers/char/virtio_console.c:7:
   include/linux/kasan-checks.h:40:58: note: expected 'const volatile void *' but argument is of type 'int'
    static inline bool kasan_check_read(const volatile void *p, unsigned int size)
                                        ~~~~~~~~~~~~~~~~~~~~~^
   In file included from include/linux/list.h:11,
                    from include/linux/kobject.h:19,
                    from include/linux/cdev.h:5,
                    from drivers/char/virtio_console.c:7:
   include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   arch/arm64/include/asm/barrier.h:171:18: note: in definition of macro '__smp_load_acquire'
     switch (sizeof(*p)) {      \
                     ^
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:33: note: in expansion of macro 'pm_freezing'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
   arch/arm64/include/asm/barrier.h:175:11: error: invalid type argument of unary '*' (have 'int')
       : "Q" (*__p) : "memory");   \
              ^~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   arch/arm64/include/asm/barrier.h:180:11: error: invalid type argument of unary '*' (have 'int')
       : "Q" (*__p) : "memory");   \
              ^~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   arch/arm64/include/asm/barrier.h:185:11: error: invalid type argument of unary '*' (have 'int')
       : "Q" (*__p) : "memory");   \
              ^~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   arch/arm64/include/asm/barrier.h:190:11: error: invalid type argument of unary '*' (have 'int')
       : "Q" (*__p) : "memory");   \
              ^~~~
   include/asm-generic/barrier.h:176:29: note: in expansion of macro '__smp_load_acquire'
    #define smp_load_acquire(p) __smp_load_acquire(p)
                                ^~~~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   arch/arm64/include/asm/barrier.h:193:11: note: in definition of macro '__smp_load_acquire'
     (typeof(*p))__u.__val;      \
              ^
   drivers/char/virtio_console.c:1173:6: note: in expansion of macro 'smp_load_acquire'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
         ^~~~~~~~~~~~~~~~
   drivers/char/virtio_console.c:1173:33: note: in expansion of macro 'pm_freezing'
         smp_load_acquire(&portdev->pm_freezing)) /* pairs with freeze/restore */
                                    ^~~~~~~~~~~
   In file included from drivers/char/virtio_console.c:12:
   drivers/char/virtio_console.c: In function 'virtcons_probe':
   include/linux/freezer.h:79:21: error: expected identifier before '(' token
    #define pm_freezing (false)
                        ^
   drivers/char/virtio_console.c:2071:11: note: in expansion of macro 'pm_freezing'
     portdev->pm_freezing = false;
              ^~~~~~~~~~~

vim +/kasan_check_read +170 arch/arm64/include/asm/barrier.h

47933ad41a86a4 Peter Zijlstra     2013-11-06  164  
fd072df850e536 Michael S. Tsirkin 2015-12-27  165  #define __smp_load_acquire(p)						\
47933ad41a86a4 Peter Zijlstra     2013-11-06  166  ({									\
10223c5286f738 Will Deacon        2019-12-19  167  	union { __unqual_scalar_typeof(*p) __val; char __c[1]; } __u;	\
131e135f7fd14b Mark Rutland       2019-04-09  168  	typeof(p) __p = (p);						\
47933ad41a86a4 Peter Zijlstra     2013-11-06  169  	compiletime_assert_atomic_type(*p);				\
131e135f7fd14b Mark Rutland       2019-04-09 @170  	kasan_check_read(__p, sizeof(*p));				\
47933ad41a86a4 Peter Zijlstra     2013-11-06  171  	switch (sizeof(*p)) {						\
878a84d5a8a18a Andre Przywara     2015-04-20  172  	case 1:								\
878a84d5a8a18a Andre Przywara     2015-04-20  173  		asm volatile ("ldarb %w0, %1"				\
c139aa60c10074 Will Deacon        2015-11-18  174  			: "=r" (*(__u8 *)__u.__c)			\
131e135f7fd14b Mark Rutland       2019-04-09  175  			: "Q" (*__p) : "memory");			\
878a84d5a8a18a Andre Przywara     2015-04-20  176  		break;							\
878a84d5a8a18a Andre Przywara     2015-04-20  177  	case 2:								\
878a84d5a8a18a Andre Przywara     2015-04-20  178  		asm volatile ("ldarh %w0, %1"				\
c139aa60c10074 Will Deacon        2015-11-18  179  			: "=r" (*(__u16 *)__u.__c)			\
131e135f7fd14b Mark Rutland       2019-04-09  180  			: "Q" (*__p) : "memory");			\
878a84d5a8a18a Andre Przywara     2015-04-20  181  		break;							\
47933ad41a86a4 Peter Zijlstra     2013-11-06  182  	case 4:								\
47933ad41a86a4 Peter Zijlstra     2013-11-06  183  		asm volatile ("ldar %w0, %1"				\
c139aa60c10074 Will Deacon        2015-11-18  184  			: "=r" (*(__u32 *)__u.__c)			\
131e135f7fd14b Mark Rutland       2019-04-09  185  			: "Q" (*__p) : "memory");			\
47933ad41a86a4 Peter Zijlstra     2013-11-06  186  		break;							\
47933ad41a86a4 Peter Zijlstra     2013-11-06  187  	case 8:								\
47933ad41a86a4 Peter Zijlstra     2013-11-06  188  		asm volatile ("ldar %0, %1"				\
c139aa60c10074 Will Deacon        2015-11-18  189  			: "=r" (*(__u64 *)__u.__c)			\
131e135f7fd14b Mark Rutland       2019-04-09  190  			: "Q" (*__p) : "memory");			\
47933ad41a86a4 Peter Zijlstra     2013-11-06  191  		break;							\
47933ad41a86a4 Peter Zijlstra     2013-11-06  192  	}								\
10223c5286f738 Will Deacon        2019-12-19  193  	(typeof(*p))__u.__val;						\
47933ad41a86a4 Peter Zijlstra     2013-11-06  194  })
47933ad41a86a4 Peter Zijlstra     2013-11-06  195  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki