Lines Matching +full:cpu +full:- +full:offset
1 // SPDX-License-Identifier: GPL-2.0-only
6 #include <linux/arm-smccc.h>
18 * struct arm_cca_token_info - a descriptor for the token buffer.
22 * @offset: Offset within granule to start of buffer in bytes
29 unsigned long offset; member
39 info->result = rsi_attestation_token_init(info->challenge, in arm_cca_attestation_init()
40 info->challenge_size); in arm_cca_attestation_init()
44 * arm_cca_attestation_continue - Retrieve the attestation token data.
50 * token retrieval operation must be requested on the same CPU on which the
52 * This helper function is therefore scheduled on the same CPU multiple
63 size = RSI_GRANULE_SIZE - info->offset; in arm_cca_attestation_continue()
64 info->result = rsi_attestation_token_continue(info->granule, in arm_cca_attestation_continue()
65 info->offset, size, &len); in arm_cca_attestation_continue()
66 info->offset += len; in arm_cca_attestation_continue()
70 * arm_cca_report_new - Generate a new attestation token.
77 * and schedule calls to retrieve the attestation token on the same CPU
84 * * %0 - Attestation token generated successfully.
85 * * %-EINVAL - A parameter was not valid.
86 * * %-ENOMEM - Out of memory.
87 * * %-EFAULT - Failed to get IPA for memory page(s).
93 int cpu; in arm_cca_report_new() local
99 struct tsm_desc *desc = &report->desc; in arm_cca_report_new()
101 if (desc->inblob_len < 32 || desc->inblob_len > 64) in arm_cca_report_new()
102 return -EINVAL; in arm_cca_report_new()
106 * performed on the same CPU. smp_call_function_single() is used in arm_cca_report_new()
111 cpu = smp_processor_id(); in arm_cca_report_new()
113 info.challenge = desc->inblob; in arm_cca_report_new()
114 info.challenge_size = desc->inblob_len; in arm_cca_report_new()
116 ret = smp_call_function_single(cpu, arm_cca_attestation_init, in arm_cca_report_new()
123 return -EINVAL; in arm_cca_report_new()
128 return -ENOMEM; in arm_cca_report_new()
136 return -ENOMEM; in arm_cca_report_new()
144 info.offset = 0; in arm_cca_report_new()
147 * Schedule a call to retrieve a sub-granule chunk in arm_cca_report_new()
150 ret = smp_call_function_single(cpu, in arm_cca_report_new()
158 info.offset < RSI_GRANULE_SIZE); in arm_cca_report_new()
161 ret = -ENXIO; in arm_cca_report_new()
171 if (WARN_ON(token_size + info.offset > max_size)) in arm_cca_report_new()
173 memcpy(&token[token_size], buf, info.offset); in arm_cca_report_new()
174 token_size += info.offset; in arm_cca_report_new()
177 report->outblob = no_free_ptr(token); in arm_cca_report_new()
179 report->outblob_len = token_size; in arm_cca_report_new()
190 * arm_cca_guest_init - Register with the Trusted Security Module (TSM)
194 * * %0 - Registered successfully with the TSM interface.
195 * * %-ENODEV - The execution context is not an Arm Realm.
196 * * %-EBUSY - Already registered.
203 return -ENODEV; in arm_cca_guest_init()
214 * arm_cca_guest_exit - unregister with the Trusted Security Module (TSM)