History log of /openbmc/qemu/rust/qemu-api/ (Results 76 – 100 of 181)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
4551f34212-Feb-2025 Paolo Bonzini <pbonzini@redhat.com>

rust: qom: add ObjectImpl::CLASS_INIT

As shown in the PL011 device, the orphan rules required a manual
implementation of ClassInitImpl for anything not in the qemu_api crate;
this gets in the way of

rust: qom: add ObjectImpl::CLASS_INIT

As shown in the PL011 device, the orphan rules required a manual
implementation of ClassInitImpl for anything not in the qemu_api crate;
this gets in the way of moving system emulation-specific code (including
DeviceClass, which as a blanket ClassInitImpl<DeviceClass> implementation)
into its own crate.

Make ClassInitImpl optional, at the cost of having to specify the CLASS_INIT
member by hand in every implementation of ObjectImpl. The next commits will
get rid of it, replacing all the "impl<T> ClassInitImpl<Class> for T" blocks
with a generic class_init<T> method on Class.

Right now the definition is always the same, but do not provide a default
as that will not be true once ClassInitImpl goes away.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...

3212da0012-Feb-2025 Paolo Bonzini <pbonzini@redhat.com>

rust: add SysBusDeviceImpl

The only function, right now, is to ensure that anything with a
SysBusDeviceClass class is a SysBusDevice.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paol

rust: add SysBusDeviceImpl

The only function, right now, is to ensure that anything with a
SysBusDeviceClass class is a SysBusDevice.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...

ac5699c512-Feb-2025 Paolo Bonzini <pbonzini@redhat.com>

rust: add IsA bounds to QOM implementation traits

Check that the right bounds are provided to the qom_isa! macro
whenever the class is defined to implement a certain class.
This removes the need to

rust: add IsA bounds to QOM implementation traits

Check that the right bounds are provided to the qom_isa! macro
whenever the class is defined to implement a certain class.
This removes the need to add IsA<> bounds together with the
*Impl trait bounds.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...

c48700e818-Feb-2025 Zhao Liu <zhao1.liu@intel.com>

rust: prefer importing std::ptr over core::ptr

The std::ptr is same as core::ptr, but std has already been used in many
cases and there's no need to choose non-std library.

So, use std::ptr directl

rust: prefer importing std::ptr over core::ptr

The std::ptr is same as core::ptr, but std has already been used in many
cases and there's no need to choose non-std library.

So, use std::ptr directly to make the used ptr library as consistent as
possible.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250218080835.3341082-1-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...

4cb7040d14-Feb-2025 Paolo Bonzini <pbonzini@redhat.com>

rust: tests: do not import bindings::*

Similar to the devices, spell the exact set of C functions that are
called directly.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

8a420dd114-Nov-2024 Paolo Bonzini <pbonzini@redhat.com>

rust: add module to convert between success/-errno and io::Result

It is a common convention in QEMU to return a positive value in case of
success, and a negated errno value in case of error. Unfort

rust: add module to convert between success/-errno and io::Result

It is a common convention in QEMU to return a positive value in case of
success, and a negated errno value in case of error. Unfortunately,
using errno portably in Rust is a bit complicated; on Unix the errno
values are supported natively by io::Error, but on Windows they are not;
so, use the libc crate.

This is a set of utility functions that are used by both chardev and
block layer bindings.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...

4cfe9edb16-Dec-2024 Paolo Bonzini <pbonzini@redhat.com>

rust: subprojects: add libc crate

This allows access to errno values.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


/openbmc/qemu/MAINTAINERS
/openbmc/qemu/accel/kvm/kvm-all.c
/openbmc/qemu/accel/tcg/cputlb.c
/openbmc/qemu/accel/tcg/tcg-all.c
/openbmc/qemu/backends/cryptodev-vhost.c
/openbmc/qemu/backends/tpm/tpm_util.c
/openbmc/qemu/configs/devices/aarch64-softmmu/default.mak
/openbmc/qemu/crypto/hash-afalg.c
/openbmc/qemu/crypto/tlssession.c
/openbmc/qemu/docs/about/deprecated.rst
/openbmc/qemu/docs/about/removed-features.rst
/openbmc/qemu/docs/devel/multi-thread-tcg.rst
/openbmc/qemu/docs/devel/reset.rst
/openbmc/qemu/docs/devel/tcg-ops.rst
/openbmc/qemu/docs/pcie_sriov.txt
/openbmc/qemu/docs/system/arm/nuvoton.rst
/openbmc/qemu/hw/arm/Kconfig
/openbmc/qemu/hw/arm/allwinner-a10.c
/openbmc/qemu/hw/arm/allwinner-h3.c
/openbmc/qemu/hw/arm/allwinner-r40.c
/openbmc/qemu/hw/arm/aspeed.c
/openbmc/qemu/hw/arm/bananapi_m2u.c
/openbmc/qemu/hw/arm/cubieboard.c
/openbmc/qemu/hw/arm/exynos4210.c
/openbmc/qemu/hw/arm/exynos4_boards.c
/openbmc/qemu/hw/arm/fby35.c
/openbmc/qemu/hw/arm/highbank.c
/openbmc/qemu/hw/arm/imx25_pdk.c
/openbmc/qemu/hw/arm/integratorcp.c
/openbmc/qemu/hw/arm/mcimx6ul-evk.c
/openbmc/qemu/hw/arm/mcimx7d-sabre.c
/openbmc/qemu/hw/arm/meson.build
/openbmc/qemu/hw/arm/npcm7xx.c
/openbmc/qemu/hw/arm/npcm7xx_boards.c
/openbmc/qemu/hw/arm/npcm8xx.c
/openbmc/qemu/hw/arm/npcm8xx_boards.c
/openbmc/qemu/hw/arm/omap_sx1.c
/openbmc/qemu/hw/arm/orangepi.c
/openbmc/qemu/hw/arm/raspi.c
/openbmc/qemu/hw/arm/raspi4b.c
/openbmc/qemu/hw/arm/realview.c
/openbmc/qemu/hw/arm/sabrelite.c
/openbmc/qemu/hw/arm/smmu-common.c
/openbmc/qemu/hw/arm/smmuv3.c
/openbmc/qemu/hw/arm/stellaris.c
/openbmc/qemu/hw/arm/trace-events
/openbmc/qemu/hw/arm/versatilepb.c
/openbmc/qemu/hw/arm/vexpress.c
/openbmc/qemu/hw/arm/xilinx_zynq.c
/openbmc/qemu/hw/arm/xlnx-versal-virt.c
/openbmc/qemu/hw/arm/xlnx-zcu102.c
/openbmc/qemu/hw/arm/xlnx-zynqmp.c
/openbmc/qemu/hw/char/xilinx_uartlite.c
/openbmc/qemu/hw/core/cpu-system.c
/openbmc/qemu/hw/core/loader.c
/openbmc/qemu/hw/core/machine-smp.c
/openbmc/qemu/hw/core/machine.c
/openbmc/qemu/hw/core/null-machine.c
/openbmc/qemu/hw/core/qdev-properties-system.c
/openbmc/qemu/hw/core/sysbus.c
/openbmc/qemu/hw/cpu/a15mpcore.c
/openbmc/qemu/hw/cpu/a9mpcore.c
/openbmc/qemu/hw/cxl/cxl-component-utils.c
/openbmc/qemu/hw/cxl/cxl-device-utils.c
/openbmc/qemu/hw/cxl/switch-mailbox-cci.c
/openbmc/qemu/hw/display/apple-gfx.m
/openbmc/qemu/hw/display/ramfb-standalone.c
/openbmc/qemu/hw/i2c/allwinner-i2c.c
/openbmc/qemu/hw/i386/amd_iommu.c
/openbmc/qemu/hw/i386/amd_iommu.h
/openbmc/qemu/hw/i386/intel_iommu.c
/openbmc/qemu/hw/i386/microvm.c
/openbmc/qemu/hw/i386/pc.c
/openbmc/qemu/hw/i386/trace-events
/openbmc/qemu/hw/i386/x86-iommu.c
/openbmc/qemu/hw/intc/allwinner-a10-pic.c
/openbmc/qemu/hw/intc/apic.c
/openbmc/qemu/hw/intc/arm_gicv3_cpuif.c
/openbmc/qemu/hw/intc/xilinx_intc.c
/openbmc/qemu/hw/isa/vt82c686.c
/openbmc/qemu/hw/mem/cxl_type3.c
/openbmc/qemu/hw/microblaze/petalogix_ml605_mmu.c
/openbmc/qemu/hw/microblaze/petalogix_s3adsp1800_mmu.c
/openbmc/qemu/hw/mips/boston.c
/openbmc/qemu/hw/mips/loongson3_virt.c
/openbmc/qemu/hw/misc/allwinner-a10-ccm.c
/openbmc/qemu/hw/misc/allwinner-a10-dramc.c
/openbmc/qemu/hw/misc/allwinner-cpucfg.c
/openbmc/qemu/hw/misc/allwinner-h3-ccu.c
/openbmc/qemu/hw/misc/allwinner-h3-dramc.c
/openbmc/qemu/hw/misc/allwinner-h3-sysctrl.c
/openbmc/qemu/hw/misc/allwinner-r40-ccu.c
/openbmc/qemu/hw/misc/allwinner-r40-dramc.c
/openbmc/qemu/hw/misc/allwinner-sid.c
/openbmc/qemu/hw/misc/allwinner-sramc.c
/openbmc/qemu/hw/misc/meson.build
/openbmc/qemu/hw/misc/npcm_clk.c
/openbmc/qemu/hw/misc/npcm_gcr.c
/openbmc/qemu/hw/misc/trace-events
/openbmc/qemu/hw/net/allwinner-sun8i-emac.c
/openbmc/qemu/hw/net/allwinner_emac.c
/openbmc/qemu/hw/net/fsl_etsec/etsec.c
/openbmc/qemu/hw/net/igb.c
/openbmc/qemu/hw/net/meson.build
/openbmc/qemu/hw/net/npcm_pcs.c
/openbmc/qemu/hw/net/smc91c111.c
/openbmc/qemu/hw/net/trace-events
/openbmc/qemu/hw/net/virtio-net.c
/openbmc/qemu/hw/net/xilinx_ethlite.c
/openbmc/qemu/hw/nvme/ctrl.c
/openbmc/qemu/hw/pci-host/versatile.c
/openbmc/qemu/hw/pci/msix.c
/openbmc/qemu/hw/pci/pci.c
/openbmc/qemu/hw/pci/pcie_sriov.c
/openbmc/qemu/hw/pci/trace-events
/openbmc/qemu/hw/ppc/spapr_caps.c
/openbmc/qemu/hw/ppc/spapr_pci.c
/openbmc/qemu/hw/ppc/virtex_ml507.c
/openbmc/qemu/hw/remote/mpqemu-link.c
/openbmc/qemu/hw/remote/vfio-user-obj.c
/openbmc/qemu/hw/riscv/microblaze-v-generic.c
/openbmc/qemu/hw/riscv/microchip_pfsoc.c
/openbmc/qemu/hw/riscv/opentitan.c
/openbmc/qemu/hw/riscv/sifive_u.c
/openbmc/qemu/hw/rtc/allwinner-rtc.c
/openbmc/qemu/hw/rtc/m48t59-isa.c
/openbmc/qemu/hw/rtc/m48t59.c
/openbmc/qemu/hw/rx/rx-gdbsim.c
/openbmc/qemu/hw/s390x/s390-pci-bus.c
/openbmc/qemu/hw/s390x/s390-virtio-ccw.c
/openbmc/qemu/hw/sd/allwinner-sdhost.c
/openbmc/qemu/hw/sd/sdhci-internal.h
/openbmc/qemu/hw/sd/sdhci.c
/openbmc/qemu/hw/sensor/emc141x.c
/openbmc/qemu/hw/sensor/isl_pmbus_vr.c
/openbmc/qemu/hw/sensor/tmp421.c
/openbmc/qemu/hw/ssi/allwinner-a10-spi.c
/openbmc/qemu/hw/ssi/npcm7xx_fiu.c
/openbmc/qemu/hw/ssi/xilinx_spi.c
/openbmc/qemu/hw/timer/allwinner-a10-pit.c
/openbmc/qemu/hw/timer/hpet.c
/openbmc/qemu/hw/timer/xilinx_timer.c
/openbmc/qemu/hw/tpm/tpm_tis_sysbus.c
/openbmc/qemu/hw/ufs/ufs.c
/openbmc/qemu/hw/usb/Kconfig
/openbmc/qemu/hw/usb/hcd-ehci-pci.c
/openbmc/qemu/hw/usb/hcd-uhci.c
/openbmc/qemu/hw/usb/meson.build
/openbmc/qemu/hw/usb/xen-usb.c
/openbmc/qemu/hw/vfio/amd-xgbe.c
/openbmc/qemu/hw/vfio/calxeda-xgmac.c
/openbmc/qemu/hw/vfio/common.c
/openbmc/qemu/hw/vfio/platform.c
/openbmc/qemu/hw/vfio/trace-events
/openbmc/qemu/hw/virtio/trace-events
/openbmc/qemu/hw/virtio/vhost-iova-tree.c
/openbmc/qemu/hw/virtio/vhost-iova-tree.h
/openbmc/qemu/hw/virtio/vhost-shadow-virtqueue.c
/openbmc/qemu/hw/virtio/vhost-shadow-virtqueue.h
/openbmc/qemu/hw/virtio/vhost-user-snd.c
/openbmc/qemu/hw/virtio/vhost-vdpa.c
/openbmc/qemu/hw/virtio/virtio-balloon.c
/openbmc/qemu/hw/virtio/virtio-iommu.c
/openbmc/qemu/hw/virtio/virtio-mem.c
/openbmc/qemu/hw/virtio/virtio-nsm.c
/openbmc/qemu/hw/watchdog/allwinner-wdt.c
/openbmc/qemu/hw/xen/xen-legacy-backend.c
/openbmc/qemu/hw/xen/xen_pvdev.c
/openbmc/qemu/include/crypto/tlssession.h
/openbmc/qemu/include/exec/cpu-common.h
/openbmc/qemu/include/exec/memattrs.h
/openbmc/qemu/include/exec/memory.h
/openbmc/qemu/include/exec/tlb-common.h
/openbmc/qemu/include/exec/vaddr.h
/openbmc/qemu/include/hw/arm/npcm7xx.h
/openbmc/qemu/include/hw/arm/npcm8xx.h
/openbmc/qemu/include/hw/boards.h
/openbmc/qemu/include/hw/cxl/cxl_device.h
/openbmc/qemu/include/hw/misc/npcm_clk.h
/openbmc/qemu/include/hw/misc/npcm_gcr.h
/openbmc/qemu/include/hw/net/npcm_pcs.h
/openbmc/qemu/include/hw/pci/pcie_sriov.h
/openbmc/qemu/include/hw/qdev-properties-system.h
/openbmc/qemu/include/hw/ssi/npcm7xx_fiu.h
/openbmc/qemu/include/hw/sysbus.h
/openbmc/qemu/include/hw/virtio/virtio-balloon.h
/openbmc/qemu/include/hw/xen/xen_pvdev.h
/openbmc/qemu/include/io/channel-tls.h
/openbmc/qemu/include/io/channel.h
/openbmc/qemu/include/qemu/atomic.h
/openbmc/qemu/include/qemu/iova-tree.h
/openbmc/qemu/include/qemu/timer.h
/openbmc/qemu/include/system/os-posix.h
/openbmc/qemu/include/system/os-win32.h
/openbmc/qemu/include/system/system.h
/openbmc/qemu/include/tcg/tcg-opc.h
/openbmc/qemu/include/tcg/tcg.h
/openbmc/qemu/io/channel-tls.c
/openbmc/qemu/io/channel.c
/openbmc/qemu/io/trace-events
/openbmc/qemu/linux-user/aarch64/target_signal.h
/openbmc/qemu/linux-user/arm/target_signal.h
/openbmc/qemu/linux-user/elfload.c
/openbmc/qemu/linux-user/generic/signal.h
/openbmc/qemu/linux-user/i386/target_signal.h
/openbmc/qemu/linux-user/m68k/target_signal.h
/openbmc/qemu/linux-user/microblaze/target_signal.h
/openbmc/qemu/linux-user/ppc/target_signal.h
/openbmc/qemu/linux-user/s390x/target_signal.h
/openbmc/qemu/linux-user/sh4/target_signal.h
/openbmc/qemu/linux-user/x86_64/target_signal.h
/openbmc/qemu/linux-user/xtensa/target_signal.h
/openbmc/qemu/meson.build
/openbmc/qemu/migration/channel.c
/openbmc/qemu/migration/cpr.c
/openbmc/qemu/migration/migration.c
/openbmc/qemu/migration/migration.h
/openbmc/qemu/migration/multifd.c
/openbmc/qemu/migration/multifd.h
/openbmc/qemu/migration/options.c
/openbmc/qemu/migration/postcopy-ram.c
/openbmc/qemu/migration/ram.c
/openbmc/qemu/migration/rdma.c
/openbmc/qemu/migration/savevm.c
/openbmc/qemu/migration/tls.c
/openbmc/qemu/migration/tls.h
/openbmc/qemu/migration/trace-events
/openbmc/qemu/monitor/hmp-cmds-target.c
/openbmc/qemu/net/vhost-user.c
/openbmc/qemu/net/vhost-vdpa.c
/openbmc/qemu/os-posix.c
/openbmc/qemu/pc-bios/README
/openbmc/qemu/pc-bios/meson.build
/openbmc/qemu/pc-bios/npcm7xx_bootrom.bin
/openbmc/qemu/pc-bios/npcm8xx_bootrom.bin
/openbmc/qemu/plugins/api.c
/openbmc/qemu/plugins/loader.c
/openbmc/qemu/qapi/common.json
/openbmc/qemu/qapi/migration.json
/openbmc/qemu/qapi/net.json
/openbmc/qemu/qemu-options.hx
/openbmc/qemu/qom/object_interfaces.c
/openbmc/qemu/roms/Makefile
/openbmc/qemu/roms/vbootrom
/openbmc/qemu/rust/Cargo.lock
/openbmc/qemu/rust/hw/timer/Kconfig
Cargo.toml
/openbmc/qemu/scripts/archive-source.sh
/openbmc/qemu/scripts/make-release
/openbmc/qemu/scripts/qemu-trace-stap
/openbmc/qemu/subprojects/.gitignore
/openbmc/qemu/subprojects/libc-0.2-rs.wrap
/openbmc/qemu/subprojects/packagefiles/libc-0.2-rs/meson.build
/openbmc/qemu/system/globals.c
/openbmc/qemu/system/memory_ldst.c.inc
/openbmc/qemu/system/physmem.c
/openbmc/qemu/system/vl.c
/openbmc/qemu/target/arm/cpregs.h
/openbmc/qemu/target/arm/cpu.h
/openbmc/qemu/target/arm/debug_helper.c
/openbmc/qemu/target/arm/helper.c
/openbmc/qemu/target/arm/ptw.c
/openbmc/qemu/target/arm/tcg/op_helper.c
/openbmc/qemu/target/arm/tcg/translate.c
/openbmc/qemu/target/i386/cpu.c
/openbmc/qemu/target/loongarch/tcg/insn_trans/trans_atomic.c.inc
/openbmc/qemu/target/loongarch/tcg/translate.c
/openbmc/qemu/target/mips/tcg/octeon_translate.c
/openbmc/qemu/target/riscv/cpu.c
/openbmc/qemu/target/riscv/cpu_helper.c
/openbmc/qemu/target/sparc/gdbstub.c
/openbmc/qemu/target/sparc/insns.decode
/openbmc/qemu/target/sparc/translate.c
/openbmc/qemu/tcg/aarch64/tcg-target-con-set.h
/openbmc/qemu/tcg/aarch64/tcg-target.c.inc
/openbmc/qemu/tcg/aarch64/tcg-target.h
/openbmc/qemu/tcg/arm/tcg-target.c.inc
/openbmc/qemu/tcg/i386/tcg-target.c.inc
/openbmc/qemu/tcg/loongarch64/tcg-target-con-set.h
/openbmc/qemu/tcg/loongarch64/tcg-target-con-str.h
/openbmc/qemu/tcg/loongarch64/tcg-target-has.h
/openbmc/qemu/tcg/loongarch64/tcg-target.c.inc
/openbmc/qemu/tcg/loongarch64/tcg-target.h
/openbmc/qemu/tcg/mips/tcg-target-con-set.h
/openbmc/qemu/tcg/mips/tcg-target-con-str.h
/openbmc/qemu/tcg/mips/tcg-target.c.inc
/openbmc/qemu/tcg/mips/tcg-target.h
/openbmc/qemu/tcg/optimize.c
/openbmc/qemu/tcg/ppc/tcg-target.c.inc
/openbmc/qemu/tcg/riscv/tcg-target-con-set.h
/openbmc/qemu/tcg/riscv/tcg-target-con-str.h
/openbmc/qemu/tcg/riscv/tcg-target-has.h
/openbmc/qemu/tcg/riscv/tcg-target.c.inc
/openbmc/qemu/tcg/riscv/tcg-target.h
/openbmc/qemu/tcg/s390x/tcg-target.c.inc
/openbmc/qemu/tcg/sparc64/tcg-target-con-set.h
/openbmc/qemu/tcg/sparc64/tcg-target-con-str.h
/openbmc/qemu/tcg/sparc64/tcg-target.c.inc
/openbmc/qemu/tcg/sparc64/tcg-target.h
/openbmc/qemu/tcg/tcg-op-ldst.c
/openbmc/qemu/tcg/tcg.c
/openbmc/qemu/tcg/tci.c
/openbmc/qemu/tcg/tci/tcg-target.c.inc
/openbmc/qemu/tcg/tci/tcg-target.h
/openbmc/qemu/tests/functional/meson.build
/openbmc/qemu/tests/functional/test_microblaze_s3adsp1800.py
/openbmc/qemu/tests/functional/test_microblazeel_s3adsp1800.py
/openbmc/qemu/tests/functional/test_virtio_balloon.py
/openbmc/qemu/tests/migration-stress/guestperf/comparison.py
/openbmc/qemu/tests/migration-stress/guestperf/engine.py
/openbmc/qemu/tests/migration-stress/guestperf/report.py
/openbmc/qemu/tests/migration-stress/guestperf/scenario.py
/openbmc/qemu/tests/migration-stress/guestperf/shell.py
/openbmc/qemu/tests/qemu-iotests/172.out
/openbmc/qemu/tests/qtest/libqos/pci.c
/openbmc/qemu/tests/qtest/migration/migration-util.c
/openbmc/qemu/tests/qtest/migration/migration-util.h
/openbmc/qemu/tests/qtest/migration/precopy-tests.c
/openbmc/qemu/tests/qtest/ufs-test.c
/openbmc/qemu/tests/unit/test-crypto-tlssession.c
/openbmc/qemu/trace/simple.c
/openbmc/qemu/ui/console.c
/openbmc/qemu/ui/gtk.c
/openbmc/qemu/ui/meson.build
/openbmc/qemu/ui/sdl2.c
/openbmc/qemu/util/iova-tree.c
/openbmc/qemu/util/module.c
16534af511-Feb-2025 Paolo Bonzini <pbonzini@redhat.com>

rust: fix doctests

Doctests were not being run by CI, and have broken. Fix them.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

ee7d3aec30-Jan-2025 Paolo Bonzini <pbonzini@redhat.com>

rust: vmstate: remove redundant link targets

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

ebacd14a30-Jan-2025 Paolo Bonzini <pbonzini@redhat.com>

rust: qemu_api: add a documentation header for all modules

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

0534248a09-Feb-2025 Zhao Liu <zhao1.liu@intel.com>

rust/timer/hpet: define hpet_fw_cfg

Define HPETFwEntry structure with the same memory layout as
hpet_fw_entry in C.

Further, define the global hpet_cfg variable in Rust which is the
same as the C v

rust/timer/hpet: define hpet_fw_cfg

Define HPETFwEntry structure with the same memory layout as
hpet_fw_entry in C.

Further, define the global hpet_cfg variable in Rust which is the
same as the C version. This hpet_cfg variable in Rust will replace
the C version one and allows both Rust code and C code to access it.

The Rust version of hpet_cfg is self-contained, avoiding unsafe
access to C code.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250210030051.2562726-8-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...

eadb83f909-Feb-2025 Zhao Liu <zhao1.liu@intel.com>

rust: add bindings for timer

Add timer bindings to help handle idiomatic Rust callbacks.

Additionally, wrap QEMUClockType in ClockType binding to avoid unsafe
calls in device code.

Signed-off-by:

rust: add bindings for timer

Add timer bindings to help handle idiomatic Rust callbacks.

Additionally, wrap QEMUClockType in ClockType binding to avoid unsafe
calls in device code.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250210030051.2562726-7-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...

d015d4cb25-Jan-2025 Zhao Liu <zhao1.liu@intel.com>

rust: add bindings for memattrs

The MemTxAttrs structure contains bitfield members, and bindgen is
unable to generate an equivalent macro definition for
MEMTXATTRS_UNSPECIFIED.

Therefore, manually

rust: add bindings for memattrs

The MemTxAttrs structure contains bitfield members, and bindgen is
unable to generate an equivalent macro definition for
MEMTXATTRS_UNSPECIFIED.

Therefore, manually define a global constant variable
MEMTXATTRS_UNSPECIFIED to support calls from Rust code.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250125125137.1223277-6-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...

9a96d41009-Feb-2025 Zhao Liu <zhao1.liu@intel.com>

rust: add bindings for gpio_{in|out} initialization

Wrap qdev_init_gpio_{in|out} as methods in DeviceMethods. And for
qdev_init_gpio_in, based on FnCall, it can support idiomatic Rust
callback witho

rust: add bindings for gpio_{in|out} initialization

Wrap qdev_init_gpio_{in|out} as methods in DeviceMethods. And for
qdev_init_gpio_in, based on FnCall, it can support idiomatic Rust
callback without the need for C style wrapper.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250210030051.2562726-5-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...

e6f1195f09-Feb-2025 Zhao Liu <zhao1.liu@intel.com>

rust/irq: Add a helper to convert [InterruptSource] to pointer

This is useful when taking an InterruptSource slice and passing it to C
function.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Si

rust/irq: Add a helper to convert [InterruptSource] to pointer

This is useful when taking an InterruptSource slice and passing it to C
function.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250210030051.2562726-4-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...

7f2d418109-Feb-2025 Zhao Liu <zhao1.liu@intel.com>

rust/qdev: add the macro to define bit property

HPET device (Rust device) needs to define the bit type property.

Add a variant of define_property macro to define bit type property.

Signed-off-by:

rust/qdev: add the macro to define bit property

HPET device (Rust device) needs to define the bit type property.

Add a variant of define_property macro to define bit type property.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Link: https://lore.kernel.org/r/20250210030051.2562726-3-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...

7630ca2a10-Feb-2025 Paolo Bonzini <pbonzini@redhat.com>

rust: pl011: convert pl011_create to safe Rust

Not a major change but, as a small but significant step in creating
qdev bindings, show how pl011_create can be written without "unsafe"
calls (apart f

rust: pl011: convert pl011_create to safe Rust

Not a major change but, as a small but significant step in creating
qdev bindings, show how pl011_create can be written without "unsafe"
calls (apart from converting pointers to references).

This also provides a starting point for creating Error** bindings.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...

a22bd55f03-Feb-2025 Paolo Bonzini <pbonzini@redhat.com>

rust: chardev, qdev: add bindings to qdev_prop_set_chr

Because the argument to the function is an Owned<Chardev>, this also
adds an ObjectType implementation to Chardev.

Reviewed-by: Zhao Liu <zhao

rust: chardev, qdev: add bindings to qdev_prop_set_chr

Because the argument to the function is an Owned<Chardev>, this also
adds an ObjectType implementation to Chardev.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...

61faf6ac03-Feb-2025 Paolo Bonzini <pbonzini@redhat.com>

rust: irq: define ObjectType for IRQState

This is a small preparation in order to use an Owned<IRQState> for the argument
to sysbus_connect_irq.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

590faa0317-Jan-2025 Paolo Bonzini <pbonzini@redhat.com>

rust: bindings for MemoryRegionOps

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

d449d29a13-Dec-2024 Paolo Bonzini <pbonzini@redhat.com>

rust: bindings: add Send and Sync markers for types that have bindings

This is needed for the MemoryRegionOps<T> to be declared as static;
Rust requires static elements to be Sync.

Reviewed-by: Zha

rust: bindings: add Send and Sync markers for types that have bindings

This is needed for the MemoryRegionOps<T> to be declared as static;
Rust requires static elements to be Sync.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...

5472a38c17-Jan-2025 Paolo Bonzini <pbonzini@redhat.com>

rust: qdev: switch from legacy reset to Resettable

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

68da540207-Jan-2025 Paolo Bonzini <pbonzini@redhat.com>

rust: qdev: make ObjectImpl a supertrait of DeviceImpl

In practice it has to be implemented always in order to access an
implementation of ClassInitImpl<ObjectClass>. Make the relationship
explicit

rust: qdev: make ObjectImpl a supertrait of DeviceImpl

In practice it has to be implemented always in order to access an
implementation of ClassInitImpl<ObjectClass>. Make the relationship
explicit in the code.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...

688c674117-Jan-2025 Paolo Bonzini <pbonzini@redhat.com>

rust: qom: allow initializing interface vtables

Unlike regular classes, interface vtables can only be obtained via
object_class_dynamic_cast. Provide a wrapper that allows accessing
the vtable and

rust: qom: allow initializing interface vtables

Unlike regular classes, interface vtables can only be obtained via
object_class_dynamic_cast. Provide a wrapper that allows accessing
the vtable and pass it to a ClassInitImpl implementation, for example
ClassInitImpl<ResettableClass>.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...

201ef00117-Jan-2025 Paolo Bonzini <pbonzini@redhat.com>

rust: qdev: add clock creation

Add a Rust version of qdev_init_clock_in, which can be used in
instance_init. There are a couple differences with the C
version:

- in Rust the object keeps its own r

rust: qdev: add clock creation

Add a Rust version of qdev_init_clock_in, which can be used in
instance_init. There are a couple differences with the C
version:

- in Rust the object keeps its own reference to the clock (in addition to
the one embedded in the NamedClockList), and the reference is dropped
automatically by instance_finalize(); this is encoded in the signature
of DeviceClassMethods::init_clock_in, which makes the lifetime of the
clock independent of that of the object it holds. This goes unnoticed
in the C version and is due to the existence of aliases.

- also, anything that happens during instance_init uses the pinned_init
framework to operate on a partially initialized object, and is done
through class methods (i.e. through DeviceClassMethods rather than
DeviceMethods) because the device does not exist yet. Therefore, Rust
code *must* create clocks from instance_init, which is stricter than C.

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

show more ...

12345678