From b9c4bedd334a53c04c399367d97a4d65dc267121 Mon Sep 17 00:00:00 2001 From: caojinhuahw Date: Mon, 10 Nov 2025 15:16:31 +0800 Subject: [PATCH] ub: support enable or disable ub feature support enable or disable ub feature by --enable-ub/--diable-ub Signed-off-by: caojinhuahw --- Kconfig.host | 3 +++ hw/Kconfig | 1 + hw/meson.build | 1 + hw/ub/Kconfig | 3 +++ hw/ub/hisi/meson.build | 0 hw/ub/hisi/trace-events | 0 hw/ub/meson.build | 5 +++++ hw/ub/trace-events | 0 meson.build | 10 ++++++++++ meson_options.txt | 3 +++ scripts/meson-buildoptions.sh | 5 +++++ 11 files changed, 31 insertions(+) create mode 100644 hw/ub/Kconfig create mode 100644 hw/ub/hisi/meson.build create mode 100644 hw/ub/hisi/trace-events create mode 100644 hw/ub/meson.build create mode 100644 hw/ub/trace-events diff --git a/Kconfig.host b/Kconfig.host index faf58d9af51..e124f33231c 100644 --- a/Kconfig.host +++ b/Kconfig.host @@ -53,3 +53,6 @@ config VFIO_USER_SERVER_ALLOWED config HV_BALLOON_POSSIBLE bool + +config UB + bool diff --git a/hw/Kconfig b/hw/Kconfig index 9ca7b38c31f..c91c0ba0cc0 100644 --- a/hw/Kconfig +++ b/hw/Kconfig @@ -44,6 +44,7 @@ source virtio/Kconfig source vfio/Kconfig source xen/Kconfig source watchdog/Kconfig +source ub/Kconfig # arch Kconfig source arm/Kconfig diff --git a/hw/meson.build b/hw/meson.build index f01fac4617c..51857f5613b 100644 --- a/hw/meson.build +++ b/hw/meson.build @@ -67,3 +67,4 @@ subdir('sparc') subdir('sparc64') subdir('tricore') subdir('xtensa') +subdir('ub') diff --git a/hw/ub/Kconfig b/hw/ub/Kconfig new file mode 100644 index 00000000000..df08fc61afe --- /dev/null +++ b/hw/ub/Kconfig @@ -0,0 +1,3 @@ +config HW_UB + bool + default y if UB diff --git a/hw/ub/hisi/meson.build b/hw/ub/hisi/meson.build new file mode 100644 index 00000000000..e69de29bb2d diff --git a/hw/ub/hisi/trace-events b/hw/ub/hisi/trace-events new file mode 100644 index 00000000000..e69de29bb2d diff --git a/hw/ub/meson.build b/hw/ub/meson.build new file mode 100644 index 00000000000..21c3f0ea6c2 --- /dev/null +++ b/hw/ub/meson.build @@ -0,0 +1,5 @@ +ub_ss = ss.source_set() +ub_ss.add(files( +)) +system_ss.add_all(when: 'CONFIG_HW_UB', if_true: ub_ss) +subdir('hisi') diff --git a/hw/ub/trace-events b/hw/ub/trace-events new file mode 100644 index 00000000000..e69de29bb2d diff --git a/meson.build b/meson.build index d379a719273..1dcfb794fa7 100644 --- a/meson.build +++ b/meson.build @@ -580,6 +580,11 @@ have_hugepage_pod = get_option('hugepage_pod') \ config_host_data.set('CONFIG_HUGEPAGE_POD', have_hugepage_pod) +# ub +have_ub = get_option('ub') \ + .require(targetos == 'linux', error_message: 'UB is supported only on Linux') \ + .allowed() + # vhost have_vhost_user = get_option('vhost_user') \ .disable_auto_if(targetos != 'linux') \ @@ -2287,6 +2292,7 @@ config_host_data.set('CONFIG_VHOST_NET_VDPA', have_vhost_net_vdpa) config_host_data.set('CONFIG_VHOST_KERNEL', have_vhost_kernel) config_host_data.set('CONFIG_VHOST_USER', have_vhost_user) config_host_data.set('CONFIG_VHOST_CRYPTO', have_vhost_user_crypto) +config_host_data.set('CONFIG_UB', have_ub) config_host_data.set('CONFIG_VHOST_VDPA', have_vhost_vdpa) config_host_data.set('CONFIG_VMNET', vmnet.found()) config_host_data.set('CONFIG_VHOST_USER_BLK_SERVER', have_vhost_user_blk_server) @@ -2999,6 +3005,7 @@ host_kconfig = \ (have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \ (opengl.found() ? ['CONFIG_OPENGL=y'] : []) + \ (x11.found() ? ['CONFIG_X11=y'] : []) + \ + (have_ub ? ['CONFIG_UB=y'] : []) + \ (have_vhost_user ? ['CONFIG_VHOST_USER=y'] : []) + \ (have_vhost_vdpa ? ['CONFIG_VHOST_VDPA=y'] : []) + \ (have_vhost_kernel ? ['CONFIG_VHOST_KERNEL=y'] : []) + \ @@ -3454,6 +3461,8 @@ if have_system 'system', 'ui', 'hw/remote', + 'hw/ub', + 'hw/ub/hisi' ] endif if have_system or have_user @@ -4226,6 +4235,7 @@ endif summary_info += {'D-Bus display': dbus_display} summary_info += {'QOM debugging': get_option('qom_cast_debug')} summary_info += {'Relocatable install': get_option('relocatable')} +summary_info += {'ub support': have_ub} summary_info += {'vhost-kernel support': have_vhost_kernel} summary_info += {'vhost-net support': have_vhost_net} summary_info += {'vhost-user support': have_vhost_user} diff --git a/meson_options.txt b/meson_options.txt index f446612ff6d..6152543e5d3 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -291,6 +291,9 @@ option('pipewire', type: 'feature', value: 'auto', option('sndio', type: 'feature', value: 'auto', description: 'sndio sound support') +option('ub', type: 'feature', value: 'auto', + description: 'unify bus support') + option('vhost_kernel', type: 'feature', value: 'auto', description: 'vhost kernel backend support') option('vhost_net', type: 'feature', value: 'auto', diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 06f4f803c90..7f8f043039e 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -52,6 +52,8 @@ meson_options_help() { printf "%s\n" ' Set available tracing backends [log] (choices:' printf "%s\n" ' dtrace/ftrace/log/nop/simple/syslog/ust)' printf "%s\n" ' --enable-tsan enable thread sanitizer' + printf "%s\n" ' --enable-ub enable unify bus' + printf "%s\n" ' --disable-ub disable unify bus' printf "%s\n" ' --firmwarepath=VALUES search PATH for firmware files [share/qemu-' printf "%s\n" ' firmware]' printf "%s\n" ' --iasl=VALUE Path to ACPI disassembler' @@ -189,6 +191,7 @@ meson_options_help() { printf "%s\n" ' tools build support utilities that come with QEMU' printf "%s\n" ' tpm TPM support' printf "%s\n" ' u2f U2F emulation support' + printf "%s\n" ' ub unify bus support' printf "%s\n" ' usb-redir libusbredir support' printf "%s\n" ' vde vde network backend support' printf "%s\n" ' vdi vdi image format support' @@ -513,6 +516,8 @@ _meson_option_parse() { --disable-tsan) printf "%s" -Dtsan=false ;; --enable-u2f) printf "%s" -Du2f=enabled ;; --disable-u2f) printf "%s" -Du2f=disabled ;; + --enable-ub) printf "%s" -Dub=enabled ;; + --disable-ub) printf "%s" -Dub=disabled ;; --enable-usb-redir) printf "%s" -Dusb_redir=enabled ;; --disable-usb-redir) printf "%s" -Dusb_redir=disabled ;; --enable-vde) printf "%s" -Dvde=enabled ;; -- Gitee