Lines Matching refs:cmd_buf
536 static void snp_populate_cmd_buf_desc_list(int cmd, void *cmd_buf, in snp_populate_cmd_buf_desc_list() argument
541 struct sev_data_pdh_cert_export *data = cmd_buf; in snp_populate_cmd_buf_desc_list()
550 struct sev_data_get_id *data = cmd_buf; in snp_populate_cmd_buf_desc_list()
557 struct sev_data_pek_csr *data = cmd_buf; in snp_populate_cmd_buf_desc_list()
564 struct sev_data_launch_update_data *data = cmd_buf; in snp_populate_cmd_buf_desc_list()
572 struct sev_data_launch_update_vmsa *data = cmd_buf; in snp_populate_cmd_buf_desc_list()
580 struct sev_data_launch_measure *data = cmd_buf; in snp_populate_cmd_buf_desc_list()
587 struct sev_data_launch_secret *data = cmd_buf; in snp_populate_cmd_buf_desc_list()
595 struct sev_data_dbg *data = cmd_buf; in snp_populate_cmd_buf_desc_list()
603 struct sev_data_dbg *data = cmd_buf; in snp_populate_cmd_buf_desc_list()
611 struct sev_data_attestation_report *data = cmd_buf; in snp_populate_cmd_buf_desc_list()
618 struct sev_data_send_start *data = cmd_buf; in snp_populate_cmd_buf_desc_list()
625 struct sev_data_send_update_data *data = cmd_buf; in snp_populate_cmd_buf_desc_list()
634 struct sev_data_send_update_vmsa *data = cmd_buf; in snp_populate_cmd_buf_desc_list()
643 struct sev_data_receive_update_data *data = cmd_buf; in snp_populate_cmd_buf_desc_list()
651 struct sev_data_receive_update_vmsa *data = cmd_buf; in snp_populate_cmd_buf_desc_list()
725 static int snp_map_cmd_buf_desc_list(int cmd, void *cmd_buf, struct cmd_buf_desc *desc_list) in snp_map_cmd_buf_desc_list() argument
729 snp_populate_cmd_buf_desc_list(cmd, cmd_buf, desc_list); in snp_map_cmd_buf_desc_list()
796 static int snp_prep_cmd_buf(int cmd, void *cmd_buf, struct cmd_buf_desc *desc_list) in snp_prep_cmd_buf() argument
801 if (snp_map_cmd_buf_desc_list(cmd, cmd_buf, desc_list)) in snp_prep_cmd_buf()
809 if (rmp_mark_pages_firmware(__pa(cmd_buf), 1, true)) in snp_prep_cmd_buf()
816 static int snp_reclaim_cmd_buf(int cmd, void *cmd_buf) in snp_reclaim_cmd_buf() argument
826 if (snp_reclaim_pages(__pa(cmd_buf), 1, true)) in snp_reclaim_cmd_buf()
840 void *cmd_buf; in __sev_do_cmd_locked() local
870 cmd_buf = sev->cmd_buf; in __sev_do_cmd_locked()
873 cmd_buf = sev->cmd_buf_backup; in __sev_do_cmd_locked()
881 memcpy(cmd_buf, data, buf_len); in __sev_do_cmd_locked()
887 ret = snp_prep_cmd_buf(cmd, cmd_buf, desc_list); in __sev_do_cmd_locked()
895 cmd_buf = sev->cmd_buf; in __sev_do_cmd_locked()
899 phys_lsb = data ? lower_32_bits(__psp_pa(cmd_buf)) : 0; in __sev_do_cmd_locked()
900 phys_msb = data ? upper_32_bits(__psp_pa(cmd_buf)) : 0; in __sev_do_cmd_locked()
974 ret_reclaim = snp_reclaim_cmd_buf(cmd, cmd_buf); in __sev_do_cmd_locked()
982 memcpy(data, cmd_buf, buf_len); in __sev_do_cmd_locked()
2251 sev->cmd_buf = (void *)devm_get_free_pages(dev, GFP_KERNEL, 1); in sev_dev_init()
2252 if (!sev->cmd_buf) in sev_dev_init()
2255 sev->cmd_buf_backup = (uint8_t *)sev->cmd_buf + PAGE_SIZE; in sev_dev_init()
2284 devm_free_pages(dev, (unsigned long)sev->cmd_buf); in sev_dev_init()