Lines Matching refs:tx

574 	const struct pkvm_mem_transition	tx;  member
579 const struct pkvm_mem_transition tx; member
639 const struct pkvm_mem_transition *tx) in host_request_owned_transition() argument
641 u64 size = tx->nr_pages * PAGE_SIZE; in host_request_owned_transition()
642 u64 addr = tx->initiator.addr; in host_request_owned_transition()
644 *completer_addr = tx->initiator.host.completer_addr; in host_request_owned_transition()
649 const struct pkvm_mem_transition *tx) in host_request_unshare() argument
651 u64 size = tx->nr_pages * PAGE_SIZE; in host_request_unshare()
652 u64 addr = tx->initiator.addr; in host_request_unshare()
654 *completer_addr = tx->initiator.host.completer_addr; in host_request_unshare()
659 const struct pkvm_mem_transition *tx) in host_initiate_share() argument
661 u64 size = tx->nr_pages * PAGE_SIZE; in host_initiate_share()
662 u64 addr = tx->initiator.addr; in host_initiate_share()
664 *completer_addr = tx->initiator.host.completer_addr; in host_initiate_share()
669 const struct pkvm_mem_transition *tx) in host_initiate_unshare() argument
671 u64 size = tx->nr_pages * PAGE_SIZE; in host_initiate_unshare()
672 u64 addr = tx->initiator.addr; in host_initiate_unshare()
674 *completer_addr = tx->initiator.host.completer_addr; in host_initiate_unshare()
679 const struct pkvm_mem_transition *tx) in host_initiate_donation() argument
681 u8 owner_id = tx->completer.id; in host_initiate_donation()
682 u64 size = tx->nr_pages * PAGE_SIZE; in host_initiate_donation()
684 *completer_addr = tx->initiator.host.completer_addr; in host_initiate_donation()
685 return host_stage2_set_owner_locked(tx->initiator.addr, size, owner_id); in host_initiate_donation()
688 static bool __host_ack_skip_pgtable_check(const struct pkvm_mem_transition *tx) in __host_ack_skip_pgtable_check() argument
691 tx->initiator.id != PKVM_ID_HYP); in __host_ack_skip_pgtable_check()
694 static int __host_ack_transition(u64 addr, const struct pkvm_mem_transition *tx, in __host_ack_transition() argument
697 u64 size = tx->nr_pages * PAGE_SIZE; in __host_ack_transition()
699 if (__host_ack_skip_pgtable_check(tx)) in __host_ack_transition()
705 static int host_ack_donation(u64 addr, const struct pkvm_mem_transition *tx) in host_ack_donation() argument
707 return __host_ack_transition(addr, tx, PKVM_NOPAGE); in host_ack_donation()
710 static int host_complete_donation(u64 addr, const struct pkvm_mem_transition *tx) in host_complete_donation() argument
712 u64 size = tx->nr_pages * PAGE_SIZE; in host_complete_donation()
713 u8 host_id = tx->completer.id; in host_complete_donation()
739 const struct pkvm_mem_transition *tx) in hyp_request_donation() argument
741 u64 size = tx->nr_pages * PAGE_SIZE; in hyp_request_donation()
742 u64 addr = tx->initiator.addr; in hyp_request_donation()
744 *completer_addr = tx->initiator.hyp.completer_addr; in hyp_request_donation()
749 const struct pkvm_mem_transition *tx) in hyp_initiate_donation() argument
751 u64 size = tx->nr_pages * PAGE_SIZE; in hyp_initiate_donation()
754 *completer_addr = tx->initiator.hyp.completer_addr; in hyp_initiate_donation()
755 ret = kvm_pgtable_hyp_unmap(&pkvm_pgtable, tx->initiator.addr, size); in hyp_initiate_donation()
759 static bool __hyp_ack_skip_pgtable_check(const struct pkvm_mem_transition *tx) in __hyp_ack_skip_pgtable_check() argument
762 tx->initiator.id != PKVM_ID_HOST); in __hyp_ack_skip_pgtable_check()
765 static int hyp_ack_share(u64 addr, const struct pkvm_mem_transition *tx, in hyp_ack_share() argument
768 u64 size = tx->nr_pages * PAGE_SIZE; in hyp_ack_share()
773 if (__hyp_ack_skip_pgtable_check(tx)) in hyp_ack_share()
779 static int hyp_ack_unshare(u64 addr, const struct pkvm_mem_transition *tx) in hyp_ack_unshare() argument
781 u64 size = tx->nr_pages * PAGE_SIZE; in hyp_ack_unshare()
783 if (tx->initiator.id == PKVM_ID_HOST && hyp_page_count((void *)addr)) in hyp_ack_unshare()
786 if (__hyp_ack_skip_pgtable_check(tx)) in hyp_ack_unshare()
793 static int hyp_ack_donation(u64 addr, const struct pkvm_mem_transition *tx) in hyp_ack_donation() argument
795 u64 size = tx->nr_pages * PAGE_SIZE; in hyp_ack_donation()
797 if (__hyp_ack_skip_pgtable_check(tx)) in hyp_ack_donation()
803 static int hyp_complete_share(u64 addr, const struct pkvm_mem_transition *tx, in hyp_complete_share() argument
806 void *start = (void *)addr, *end = start + (tx->nr_pages * PAGE_SIZE); in hyp_complete_share()
813 static int hyp_complete_unshare(u64 addr, const struct pkvm_mem_transition *tx) in hyp_complete_unshare() argument
815 u64 size = tx->nr_pages * PAGE_SIZE; in hyp_complete_unshare()
822 const struct pkvm_mem_transition *tx) in hyp_complete_donation() argument
824 void *start = (void *)addr, *end = start + (tx->nr_pages * PAGE_SIZE); in hyp_complete_donation()
832 const struct pkvm_mem_transition *tx = &share->tx; in check_share() local
836 switch (tx->initiator.id) { in check_share()
838 ret = host_request_owned_transition(&completer_addr, tx); in check_share()
847 switch (tx->completer.id) { in check_share()
849 ret = hyp_ack_share(completer_addr, tx, share->completer_prot); in check_share()
867 const struct pkvm_mem_transition *tx = &share->tx; in __do_share() local
871 switch (tx->initiator.id) { in __do_share()
873 ret = host_initiate_share(&completer_addr, tx); in __do_share()
882 switch (tx->completer.id) { in __do_share()
884 ret = hyp_complete_share(completer_addr, tx, share->completer_prot); in __do_share()
922 const struct pkvm_mem_transition *tx = &share->tx; in check_unshare() local
926 switch (tx->initiator.id) { in check_unshare()
928 ret = host_request_unshare(&completer_addr, tx); in check_unshare()
937 switch (tx->completer.id) { in check_unshare()
939 ret = hyp_ack_unshare(completer_addr, tx); in check_unshare()
954 const struct pkvm_mem_transition *tx = &share->tx; in __do_unshare() local
958 switch (tx->initiator.id) { in __do_unshare()
960 ret = host_initiate_unshare(&completer_addr, tx); in __do_unshare()
969 switch (tx->completer.id) { in __do_unshare()
971 ret = hyp_complete_unshare(completer_addr, tx); in __do_unshare()
1006 const struct pkvm_mem_transition *tx = &donation->tx; in check_donation() local
1010 switch (tx->initiator.id) { in check_donation()
1012 ret = host_request_owned_transition(&completer_addr, tx); in check_donation()
1015 ret = hyp_request_donation(&completer_addr, tx); in check_donation()
1024 switch (tx->completer.id) { in check_donation()
1026 ret = host_ack_donation(completer_addr, tx); in check_donation()
1029 ret = hyp_ack_donation(completer_addr, tx); in check_donation()
1040 const struct pkvm_mem_transition *tx = &donation->tx; in __do_donate() local
1044 switch (tx->initiator.id) { in __do_donate()
1046 ret = host_initiate_donation(&completer_addr, tx); in __do_donate()
1049 ret = hyp_initiate_donation(&completer_addr, tx); in __do_donate()
1058 switch (tx->completer.id) { in __do_donate()
1060 ret = host_complete_donation(completer_addr, tx); in __do_donate()
1063 ret = hyp_complete_donation(completer_addr, tx); in __do_donate()
1098 .tx = { in __pkvm_host_share_hyp()
1131 .tx = { in __pkvm_host_unshare_hyp()
1164 .tx = { in __pkvm_host_donate_hyp()
1196 .tx = { in __pkvm_hyp_donate_host()
1271 .tx = { in __pkvm_host_share_ffa()
1294 .tx = { in __pkvm_host_unshare_ffa()