kvm_ipi.h 876 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2024 Loongson Technology Corporation Limited
  4. */
  5. #ifndef __ASM_KVM_IPI_H
  6. #define __ASM_KVM_IPI_H
  7. #include <kvm/iodev.h>
  8. #define LARCH_INT_IPI 12
  9. struct loongarch_ipi {
  10. spinlock_t lock;
  11. struct kvm *kvm;
  12. struct kvm_io_device device;
  13. };
  14. struct ipi_state {
  15. spinlock_t lock;
  16. uint32_t status;
  17. uint32_t en;
  18. uint32_t set;
  19. uint32_t clear;
  20. uint64_t buf[4];
  21. };
  22. #define IOCSR_IPI_BASE 0x1000
  23. #define IOCSR_IPI_SIZE 0x160
  24. #define IOCSR_IPI_STATUS 0x000
  25. #define IOCSR_IPI_EN 0x004
  26. #define IOCSR_IPI_SET 0x008
  27. #define IOCSR_IPI_CLEAR 0x00c
  28. #define IOCSR_IPI_BUF_20 0x020
  29. #define IOCSR_IPI_BUF_28 0x028
  30. #define IOCSR_IPI_BUF_30 0x030
  31. #define IOCSR_IPI_BUF_38 0x038
  32. #define IOCSR_IPI_SEND 0x040
  33. #define IOCSR_MAIL_SEND 0x048
  34. #define IOCSR_ANY_SEND 0x158
  35. int kvm_loongarch_register_ipi_device(void);
  36. #endif