All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/x86: fix build with CONFIG_HVM=n and -Og
@ 2025-02-13 18:50 Stewart Hildebrand
  2025-02-13 20:17 ` Oleksii Kurochko
  2025-02-14  1:05 ` Andrew Cooper
  0 siblings, 2 replies; 7+ messages in thread
From: Stewart Hildebrand @ 2025-02-13 18:50 UTC (permalink / raw)
  To: xen-devel
  Cc: Stewart Hildebrand, Jan Beulich, Andrew Cooper,
	Roger Pau Monné, Oleksii Kurochko

When building with CONFIG_HVM=n and -Og, we encounter:

prelink.o: in function `pit_set_gate':
xen/xen/arch/x86/emul-i8254.c:195: undefined reference to `destroy_periodic_time'

Add an IS_ENABLED(CONFIG_HVM) check to assist with dead code
elimination.

Fixes: 14f42af3f52d ("x86/vPIT: account for "counter stopped" time")
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 xen/arch/x86/emul-i8254.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/emul-i8254.c b/xen/arch/x86/emul-i8254.c
index 144aa168a3f0..7bc4b31b2894 100644
--- a/xen/arch/x86/emul-i8254.c
+++ b/xen/arch/x86/emul-i8254.c
@@ -191,7 +191,7 @@ static void pit_set_gate(PITState *pit, int channel, int val)
         case 3:
         case 4:
             /* Disable counting. */
-            if ( !channel )
+            if ( IS_ENABLED(CONFIG_HVM) && !channel )
                 destroy_periodic_time(&pit->pt0);
             pit->count_stop_time[channel] = get_guest_time(v);
             break;

base-commit: b5b2f9877a8777af6b78944407527e0a450389a2
-- 
2.48.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-03-03 21:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-13 18:50 [PATCH] xen/x86: fix build with CONFIG_HVM=n and -Og Stewart Hildebrand
2025-02-13 20:17 ` Oleksii Kurochko
2025-02-14  1:05 ` Andrew Cooper
2025-02-14  8:25   ` Jan Beulich
2025-03-03 21:18     ` Stewart Hildebrand
2025-03-03 18:59   ` Stewart Hildebrand
2025-03-03 19:19     ` Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.