[PATCH 0/3] xen/treewide: Remove NDEBUG

Andrew Cooper posted 3 patches 6 days, 10 hours ago
xen/arch/arm/gic-vgic.c                |  2 +-
xen/arch/arm/include/asm/grant_table.h |  2 +-
xen/arch/arm/irq.c                     |  2 +-
xen/arch/arm/mmu/domain_page.c         |  2 +-
xen/arch/arm/mmu/pt.c                  | 10 +++++-----
xen/arch/arm/traps.c                   |  8 ++++----
xen/arch/x86/acpi/cpufreq/amd-cppc.c   |  2 +-
xen/arch/x86/domain_page.c             |  6 +++---
xen/arch/x86/hvm/emulate.c             |  6 +++---
xen/arch/x86/hvm/irq.c                 |  2 +-
xen/arch/x86/hvm/svm/emulate.c         |  4 ++--
xen/arch/x86/hvm/vmx/intr.c            |  2 +-
xen/arch/x86/include/asm/asm_defns.h   |  4 ++--
xen/arch/x86/include/asm/hvm/hvm.h     |  2 +-
xen/arch/x86/include/asm/hvm/support.h |  2 +-
xen/arch/x86/include/asm/hypercall.h   |  4 ++--
xen/arch/x86/include/asm/mem_sharing.h |  2 +-
xen/arch/x86/include/asm/mm.h          |  2 +-
xen/arch/x86/include/asm/p2m.h         |  2 +-
xen/arch/x86/include/asm/page.h        |  3 ++-
xen/arch/x86/include/asm/setup.h       |  6 +++---
xen/arch/x86/mm.c                      | 12 ++++++------
xen/arch/x86/mm/p2m-pod.c              |  2 +-
xen/arch/x86/mm/shadow/common.c        |  4 ++--
xen/arch/x86/mm/shadow/hvm.c           |  2 +-
xen/arch/x86/mm/shadow/multi.c         |  2 +-
xen/arch/x86/mm/shadow/private.h       |  8 ++++----
xen/arch/x86/pv/dom0_build.c           |  6 +++---
xen/arch/x86/pv/emulate.c              |  2 +-
xen/arch/x86/pv/mm.h                   |  2 +-
xen/arch/x86/setup.c                   |  2 +-
xen/arch/x86/traps.c                   |  6 +++---
xen/arch/x86/x86_64/compat/entry.S     |  2 +-
xen/arch/x86/x86_64/entry.S            |  2 +-
xen/arch/x86/x86_emulate/decode.c      |  2 +-
xen/arch/x86/x86_emulate/private.h     |  4 ++--
xen/arch/x86/x86_emulate/util-xen.c    |  2 +-
xen/arch/x86/x86_emulate/x86_emulate.c |  6 +++---
xen/arch/x86/x86_emulate/x86_emulate.h |  4 ++--
xen/arch/x86/xstate.c                  |  2 +-
xen/common/event_channel.c             |  4 ++--
xen/common/grant_table.c               |  8 ++++----
xen/common/multicall.c                 |  2 +-
xen/common/page_alloc.c                |  4 ++--
xen/common/preempt.c                   |  2 +-
xen/drivers/char/console.c             | 12 ++++++------
xen/include/xen/bug.h                  |  2 +-
xen/include/xen/config.h               |  4 ----
xen/include/xen/lib.h                  | 18 +++++++++---------
xen/include/xen/pci.h                  |  2 +-
xen/include/xen/preempt.h              |  2 +-
xen/include/xen/rwlock.h               |  4 ++--
xen/include/xen/sched.h                |  2 +-
xen/include/xen/typesafe.h             |  2 +-
54 files changed, 106 insertions(+), 109 deletions(-)
[PATCH 0/3] xen/treewide: Remove NDEBUG
Posted by Andrew Cooper 6 days, 10 hours ago
We have two ways of spelling debug build in Xen.  Reduce this down to just one
way.

Andrew Cooper (3):
  xen/treewide: Convert all #ifndef NDEBUG to CONFIG_DEBUG
  xen/treewide: Convert all #ifdef NDEBUG to CONFIG_DEBUG
  xen/config: Drop NDEBUG

 xen/arch/arm/gic-vgic.c                |  2 +-
 xen/arch/arm/include/asm/grant_table.h |  2 +-
 xen/arch/arm/irq.c                     |  2 +-
 xen/arch/arm/mmu/domain_page.c         |  2 +-
 xen/arch/arm/mmu/pt.c                  | 10 +++++-----
 xen/arch/arm/traps.c                   |  8 ++++----
 xen/arch/x86/acpi/cpufreq/amd-cppc.c   |  2 +-
 xen/arch/x86/domain_page.c             |  6 +++---
 xen/arch/x86/hvm/emulate.c             |  6 +++---
 xen/arch/x86/hvm/irq.c                 |  2 +-
 xen/arch/x86/hvm/svm/emulate.c         |  4 ++--
 xen/arch/x86/hvm/vmx/intr.c            |  2 +-
 xen/arch/x86/include/asm/asm_defns.h   |  4 ++--
 xen/arch/x86/include/asm/hvm/hvm.h     |  2 +-
 xen/arch/x86/include/asm/hvm/support.h |  2 +-
 xen/arch/x86/include/asm/hypercall.h   |  4 ++--
 xen/arch/x86/include/asm/mem_sharing.h |  2 +-
 xen/arch/x86/include/asm/mm.h          |  2 +-
 xen/arch/x86/include/asm/p2m.h         |  2 +-
 xen/arch/x86/include/asm/page.h        |  3 ++-
 xen/arch/x86/include/asm/setup.h       |  6 +++---
 xen/arch/x86/mm.c                      | 12 ++++++------
 xen/arch/x86/mm/p2m-pod.c              |  2 +-
 xen/arch/x86/mm/shadow/common.c        |  4 ++--
 xen/arch/x86/mm/shadow/hvm.c           |  2 +-
 xen/arch/x86/mm/shadow/multi.c         |  2 +-
 xen/arch/x86/mm/shadow/private.h       |  8 ++++----
 xen/arch/x86/pv/dom0_build.c           |  6 +++---
 xen/arch/x86/pv/emulate.c              |  2 +-
 xen/arch/x86/pv/mm.h                   |  2 +-
 xen/arch/x86/setup.c                   |  2 +-
 xen/arch/x86/traps.c                   |  6 +++---
 xen/arch/x86/x86_64/compat/entry.S     |  2 +-
 xen/arch/x86/x86_64/entry.S            |  2 +-
 xen/arch/x86/x86_emulate/decode.c      |  2 +-
 xen/arch/x86/x86_emulate/private.h     |  4 ++--
 xen/arch/x86/x86_emulate/util-xen.c    |  2 +-
 xen/arch/x86/x86_emulate/x86_emulate.c |  6 +++---
 xen/arch/x86/x86_emulate/x86_emulate.h |  4 ++--
 xen/arch/x86/xstate.c                  |  2 +-
 xen/common/event_channel.c             |  4 ++--
 xen/common/grant_table.c               |  8 ++++----
 xen/common/multicall.c                 |  2 +-
 xen/common/page_alloc.c                |  4 ++--
 xen/common/preempt.c                   |  2 +-
 xen/drivers/char/console.c             | 12 ++++++------
 xen/include/xen/bug.h                  |  2 +-
 xen/include/xen/config.h               |  4 ----
 xen/include/xen/lib.h                  | 18 +++++++++---------
 xen/include/xen/pci.h                  |  2 +-
 xen/include/xen/preempt.h              |  2 +-
 xen/include/xen/rwlock.h               |  4 ++--
 xen/include/xen/sched.h                |  2 +-
 xen/include/xen/typesafe.h             |  2 +-
 54 files changed, 106 insertions(+), 109 deletions(-)


base-commit: aa6070d2c840301bceae28763d20a32c48f0d3e4
-- 
2.39.5
Re: [PATCH 0/3] xen/treewide: Remove NDEBUG
Posted by Jan Beulich 6 days, 9 hours ago
On 17.11.2026 12:55, Andrew Cooper wrote:
> We have two ways of spelling debug build in Xen.  Reduce this down to just one
> way.
> 
> Andrew Cooper (3):
>   xen/treewide: Convert all #ifndef NDEBUG to CONFIG_DEBUG
>   xen/treewide: Convert all #ifdef NDEBUG to CONFIG_DEBUG
>   xen/config: Drop NDEBUG

While the ASSERT() related distinction was helpful imo, I don't mind the
folding:
Acked-by: Jan Beulich <jbeulich@suse.com>

I wonder whether in x86_emulate/ keeping constructs like

#if defined(__XEN__) && defined(CONFIG_DEBUG)

is actually necessary: CONFIG_DEBUG shouldn't be defined in the test or
fuzzing harnesses.

Jan
Re: [PATCH 0/3] xen/treewide: Remove NDEBUG
Posted by Andrew Cooper 6 days, 3 hours ago
On 17/11/2026 12:43 pm, Jan Beulich wrote:
> On 17.11.2026 12:55, Andrew Cooper wrote:
>> We have two ways of spelling debug build in Xen.  Reduce this down to just one
>> way.
>>
>> Andrew Cooper (3):
>>   xen/treewide: Convert all #ifndef NDEBUG to CONFIG_DEBUG
>>   xen/treewide: Convert all #ifdef NDEBUG to CONFIG_DEBUG
>>   xen/config: Drop NDEBUG
> While the ASSERT() related distinction was helpful imo, I don't mind the
> folding:
> Acked-by: Jan Beulich <jbeulich@suse.com>

Thanks.

I'm open to the idea of having CONFIG_ASSERTS separate from
CONFIG_DEBUG, but if we're going to do that, it should be a separate change.

The problem is a) having two different ways of identifying general
debug-ness, and b) them having different polarities.

>
> I wonder whether in x86_emulate/ keeping constructs like
>
> #if defined(__XEN__) && defined(CONFIG_DEBUG)
>
> is actually necessary: CONFIG_DEBUG shouldn't be defined in the test or
> fuzzing harnesses.

In this case I think the __XEN__ is helpful context when reading.

~Andrew
Re: [PATCH 0/3] xen/treewide: Remove NDEBUG
Posted by Jan Beulich 5 days, 14 hours ago
On 17.11.2026 19:28, Andrew Cooper wrote:
> On 17/11/2026 12:43 pm, Jan Beulich wrote:
>> On 17.11.2026 12:55, Andrew Cooper wrote:
>>> We have two ways of spelling debug build in Xen.  Reduce this down to just one
>>> way.
>>>
>>> Andrew Cooper (3):
>>>   xen/treewide: Convert all #ifndef NDEBUG to CONFIG_DEBUG
>>>   xen/treewide: Convert all #ifdef NDEBUG to CONFIG_DEBUG
>>>   xen/config: Drop NDEBUG
>> While the ASSERT() related distinction was helpful imo, I don't mind the
>> folding:
>> Acked-by: Jan Beulich <jbeulich@suse.com>
> 
> Thanks.
> 
> I'm open to the idea of having CONFIG_ASSERTS separate from
> CONFIG_DEBUG, but if we're going to do that, it should be a separate change.

Just to confirm - yes, doing that separately (if at all) is what I, too, would
have expected here.

Jan