Lines Matching refs:tx

568 	const struct pkvm_mem_transition	tx;  member
573 const struct pkvm_mem_transition tx; member
633 const struct pkvm_mem_transition *tx) in host_request_owned_transition() argument
635 u64 size = tx->nr_pages * PAGE_SIZE; in host_request_owned_transition()
636 u64 addr = tx->initiator.addr; in host_request_owned_transition()
638 *completer_addr = tx->initiator.host.completer_addr; in host_request_owned_transition()
643 const struct pkvm_mem_transition *tx) in host_request_unshare() argument
645 u64 size = tx->nr_pages * PAGE_SIZE; in host_request_unshare()
646 u64 addr = tx->initiator.addr; in host_request_unshare()
648 *completer_addr = tx->initiator.host.completer_addr; in host_request_unshare()
653 const struct pkvm_mem_transition *tx) in host_initiate_share() argument
655 u64 size = tx->nr_pages * PAGE_SIZE; in host_initiate_share()
656 u64 addr = tx->initiator.addr; in host_initiate_share()
658 *completer_addr = tx->initiator.host.completer_addr; in host_initiate_share()
663 const struct pkvm_mem_transition *tx) in host_initiate_unshare() argument
665 u64 size = tx->nr_pages * PAGE_SIZE; in host_initiate_unshare()
666 u64 addr = tx->initiator.addr; in host_initiate_unshare()
668 *completer_addr = tx->initiator.host.completer_addr; in host_initiate_unshare()
673 const struct pkvm_mem_transition *tx) in host_initiate_donation() argument
675 u8 owner_id = tx->completer.id; in host_initiate_donation()
676 u64 size = tx->nr_pages * PAGE_SIZE; in host_initiate_donation()
678 *completer_addr = tx->initiator.host.completer_addr; in host_initiate_donation()
679 return host_stage2_set_owner_locked(tx->initiator.addr, size, owner_id); in host_initiate_donation()
682 static bool __host_ack_skip_pgtable_check(const struct pkvm_mem_transition *tx) in __host_ack_skip_pgtable_check() argument
685 tx->initiator.id != PKVM_ID_HYP); in __host_ack_skip_pgtable_check()
688 static int __host_ack_transition(u64 addr, const struct pkvm_mem_transition *tx, in __host_ack_transition() argument
691 u64 size = tx->nr_pages * PAGE_SIZE; in __host_ack_transition()
693 if (__host_ack_skip_pgtable_check(tx)) in __host_ack_transition()
699 static int host_ack_donation(u64 addr, const struct pkvm_mem_transition *tx) in host_ack_donation() argument
701 return __host_ack_transition(addr, tx, PKVM_NOPAGE); in host_ack_donation()
704 static int host_complete_donation(u64 addr, const struct pkvm_mem_transition *tx) in host_complete_donation() argument
706 u64 size = tx->nr_pages * PAGE_SIZE; in host_complete_donation()
707 u8 host_id = tx->completer.id; in host_complete_donation()
733 const struct pkvm_mem_transition *tx) in hyp_request_donation() argument
735 u64 size = tx->nr_pages * PAGE_SIZE; in hyp_request_donation()
736 u64 addr = tx->initiator.addr; in hyp_request_donation()
738 *completer_addr = tx->initiator.hyp.completer_addr; in hyp_request_donation()
743 const struct pkvm_mem_transition *tx) in hyp_initiate_donation() argument
745 u64 size = tx->nr_pages * PAGE_SIZE; in hyp_initiate_donation()
748 *completer_addr = tx->initiator.hyp.completer_addr; in hyp_initiate_donation()
749 ret = kvm_pgtable_hyp_unmap(&pkvm_pgtable, tx->initiator.addr, size); in hyp_initiate_donation()
753 static bool __hyp_ack_skip_pgtable_check(const struct pkvm_mem_transition *tx) in __hyp_ack_skip_pgtable_check() argument
756 tx->initiator.id != PKVM_ID_HOST); in __hyp_ack_skip_pgtable_check()
759 static int hyp_ack_share(u64 addr, const struct pkvm_mem_transition *tx, in hyp_ack_share() argument
762 u64 size = tx->nr_pages * PAGE_SIZE; in hyp_ack_share()
767 if (__hyp_ack_skip_pgtable_check(tx)) in hyp_ack_share()
773 static int hyp_ack_unshare(u64 addr, const struct pkvm_mem_transition *tx) in hyp_ack_unshare() argument
775 u64 size = tx->nr_pages * PAGE_SIZE; in hyp_ack_unshare()
777 if (tx->initiator.id == PKVM_ID_HOST && hyp_page_count((void *)addr)) in hyp_ack_unshare()
780 if (__hyp_ack_skip_pgtable_check(tx)) in hyp_ack_unshare()
787 static int hyp_ack_donation(u64 addr, const struct pkvm_mem_transition *tx) in hyp_ack_donation() argument
789 u64 size = tx->nr_pages * PAGE_SIZE; in hyp_ack_donation()
791 if (__hyp_ack_skip_pgtable_check(tx)) in hyp_ack_donation()
797 static int hyp_complete_share(u64 addr, const struct pkvm_mem_transition *tx, in hyp_complete_share() argument
800 void *start = (void *)addr, *end = start + (tx->nr_pages * PAGE_SIZE); in hyp_complete_share()
807 static int hyp_complete_unshare(u64 addr, const struct pkvm_mem_transition *tx) in hyp_complete_unshare() argument
809 u64 size = tx->nr_pages * PAGE_SIZE; in hyp_complete_unshare()
816 const struct pkvm_mem_transition *tx) in hyp_complete_donation() argument
818 void *start = (void *)addr, *end = start + (tx->nr_pages * PAGE_SIZE); in hyp_complete_donation()
826 const struct pkvm_mem_transition *tx = &share->tx; in check_share() local
830 switch (tx->initiator.id) { in check_share()
832 ret = host_request_owned_transition(&completer_addr, tx); in check_share()
841 switch (tx->completer.id) { in check_share()
843 ret = hyp_ack_share(completer_addr, tx, share->completer_prot); in check_share()
861 const struct pkvm_mem_transition *tx = &share->tx; in __do_share() local
865 switch (tx->initiator.id) { in __do_share()
867 ret = host_initiate_share(&completer_addr, tx); in __do_share()
876 switch (tx->completer.id) { in __do_share()
878 ret = hyp_complete_share(completer_addr, tx, share->completer_prot); in __do_share()
916 const struct pkvm_mem_transition *tx = &share->tx; in check_unshare() local
920 switch (tx->initiator.id) { in check_unshare()
922 ret = host_request_unshare(&completer_addr, tx); in check_unshare()
931 switch (tx->completer.id) { in check_unshare()
933 ret = hyp_ack_unshare(completer_addr, tx); in check_unshare()
948 const struct pkvm_mem_transition *tx = &share->tx; in __do_unshare() local
952 switch (tx->initiator.id) { in __do_unshare()
954 ret = host_initiate_unshare(&completer_addr, tx); in __do_unshare()
963 switch (tx->completer.id) { in __do_unshare()
965 ret = hyp_complete_unshare(completer_addr, tx); in __do_unshare()
1000 const struct pkvm_mem_transition *tx = &donation->tx; in check_donation() local
1004 switch (tx->initiator.id) { in check_donation()
1006 ret = host_request_owned_transition(&completer_addr, tx); in check_donation()
1009 ret = hyp_request_donation(&completer_addr, tx); in check_donation()
1018 switch (tx->completer.id) { in check_donation()
1020 ret = host_ack_donation(completer_addr, tx); in check_donation()
1023 ret = hyp_ack_donation(completer_addr, tx); in check_donation()
1034 const struct pkvm_mem_transition *tx = &donation->tx; in __do_donate() local
1038 switch (tx->initiator.id) { in __do_donate()
1040 ret = host_initiate_donation(&completer_addr, tx); in __do_donate()
1043 ret = hyp_initiate_donation(&completer_addr, tx); in __do_donate()
1052 switch (tx->completer.id) { in __do_donate()
1054 ret = host_complete_donation(completer_addr, tx); in __do_donate()
1057 ret = hyp_complete_donation(completer_addr, tx); in __do_donate()
1092 .tx = { in __pkvm_host_share_hyp()
1125 .tx = { in __pkvm_host_unshare_hyp()
1158 .tx = { in __pkvm_host_donate_hyp()
1190 .tx = { in __pkvm_hyp_donate_host()
1265 .tx = { in __pkvm_host_share_ffa()
1288 .tx = { in __pkvm_host_unshare_ffa()