@@ -59,6 +59,22 @@ int sbi_covh_create_tvm_vcpu(unsigned long tvmid, unsigned long tvm_vcpuid,
int sbi_covh_run_tvm_vcpu(unsigned long tvmid, unsigned long tvm_vcpuid);
+int sbi_covh_tvm_invalidate_pages(unsigned long tvmid,
+ unsigned long tvm_base_page_addr,
+ unsigned long len);
+int sbi_covh_tvm_validate_pages(unsigned long tvmid,
+ unsigned long tvm_base_page_addr,
+ unsigned long len);
+int sbi_covh_tvm_promote_page(unsigned long tvmid,
+ unsigned long tvm_base_page_addr,
+ enum sbi_cove_page_type ptype);
+int sbi_covh_tvm_demote_page(unsigned long tvmid,
+ unsigned long tvm_base_page_addr,
+ enum sbi_cove_page_type ptype);
+int sbi_covh_tvm_remove_pages(unsigned long tvmid,
+ unsigned long tvm_base_page_addr,
+ unsigned long len);
+
/* Functions related to CoVE Interrupt Management(COVI) Extension */
int sbi_covi_tvm_aia_init(unsigned long tvm_gid, struct sbi_cove_tvm_aia_params *tvm_aia_params);
int sbi_covi_set_vcpu_imsic_addr(unsigned long tvm_gid, unsigned long vcpu_id,
@@ -369,6 +369,11 @@ enum sbi_ext_covh_fid {
SBI_EXT_COVH_TVM_CREATE_VCPU,
SBI_EXT_COVH_TVM_VCPU_RUN,
SBI_EXT_COVH_TVM_INITIATE_FENCE,
+ SBI_EXT_COVH_TVM_INVALIDATE_PAGES,
+ SBI_EXT_COVH_TVM_VALIDATE_PAGES,
+ SBI_EXT_COVH_TVM_PROMOTE_PAGE,
+ SBI_EXT_COVH_TVM_DEMOTE_PAGE,
+ SBI_EXT_COVH_TVM_REMOVE_PAGES,
};
enum sbi_ext_covi_fid {
@@ -405,3 +405,68 @@ int sbi_covh_run_tvm_vcpu(unsigned long tvmid, unsigned long vcpuid)
return 0;
}
+
+int sbi_covh_tvm_invalidate_pages(unsigned long tvmid,
+ unsigned long tvm_base_page_addr,
+ unsigned long len)
+{
+ struct sbiret ret = sbi_ecall(SBI_EXT_COVH,
+ SBI_EXT_COVH_TVM_INVALIDATE_PAGES, tvmid,
+ tvm_base_page_addr, len, 0, 0, 0);
+ if (ret.error)
+ return sbi_err_map_linux_errno(ret.error);
+
+ return 0;
+}
+
+int sbi_covh_tvm_validate_pages(unsigned long tvmid,
+ unsigned long tvm_base_page_addr,
+ unsigned long len)
+{
+ struct sbiret ret = sbi_ecall(SBI_EXT_COVH,
+ SBI_EXT_COVH_TVM_VALIDATE_PAGES, tvmid,
+ tvm_base_page_addr, len, 0, 0, 0);
+ if (ret.error)
+ return sbi_err_map_linux_errno(ret.error);
+
+ return 0;
+}
+
+int sbi_covh_tvm_promote_page(unsigned long tvmid,
+ unsigned long tvm_base_page_addr,
+ enum sbi_cove_page_type ptype)
+{
+ struct sbiret ret = sbi_ecall(SBI_EXT_COVH,
+ SBI_EXT_COVH_TVM_PROMOTE_PAGE, tvmid,
+ tvm_base_page_addr, ptype, 0, 0, 0);
+ if (ret.error)
+ return sbi_err_map_linux_errno(ret.error);
+
+ return 0;
+}
+
+int sbi_covh_tvm_demote_page(unsigned long tvmid,
+ unsigned long tvm_base_page_addr,
+ enum sbi_cove_page_type ptype)
+{
+ struct sbiret ret = sbi_ecall(SBI_EXT_COVH,
+ SBI_EXT_COVH_TVM_DEMOTE_PAGE, tvmid,
+ tvm_base_page_addr, ptype, 0, 0, 0);
+ if (ret.error)
+ return sbi_err_map_linux_errno(ret.error);
+
+ return 0;
+}
+
+int sbi_covh_tvm_remove_pages(unsigned long tvmid,
+ unsigned long tvm_base_page_addr,
+ unsigned long len)
+{
+ struct sbiret ret = sbi_ecall(SBI_EXT_COVH,
+ SBI_EXT_COVH_TVM_REMOVE_PAGES, tvmid,
+ tvm_base_page_addr, len, 0, 0, 0);
+ if (ret.error)
+ return sbi_err_map_linux_errno(ret.error);
+
+ return 0;
+}