@@ -28,6 +28,22 @@
},
{
"id": "SAF-3-safe",
+ "analyser": {
+ "eclair": "MC3R1.R13.1"
+ },
+ "name": "MC3R1.R13.1: effects for debugging and logging",
+ "text": "Effects for debugging and loggings reasons that crash execution or produce logs are allowed in initializer lists. The evaluation order in abnormal conditions is not relevant."
+ },
+ {
+ "id": "SAF-4-safe",
+ "analyser": {
+ "eclair": "MC3R1.R13.1"
+ },
+ "name": "MC3R1.R13.1: volatile asm statements that do not perform any persistent side effect",
+ "text": "Volatile asm statement in an initializer list that does not perform persistent side effects is safe."
+ },
+ {
+ "id": "SAF-5-safe",
"analyser": {},
"name": "Sentinel",
"text": "Next ID to be used"
@@ -331,6 +331,7 @@ int handle_device(struct domain *d, struct dt_device_node *dev, p2m_type_t p2mt,
.p2mt = p2mt,
.skip_mapping = !own_device ||
(is_pci_passthrough_enabled() &&
+ /* SAF-3-safe effects for debugging/logging reasons are safe */
(device_get_class(dev) == DEVICE_PCI_HOSTBRIDGE)),
.iomem_ranges = iomem_ranges,
.irq_ranges = irq_ranges
@@ -110,26 +110,34 @@ static unsigned long copy_guest(void *buf, uint64_t addr, unsigned int len,
unsigned long raw_copy_to_guest(void *to, const void *from, unsigned int len)
{
return copy_guest((void *)from, (vaddr_t)to, len,
- GVA_INFO(current), COPY_to_guest | COPY_linear);
+ /* SAF-4-safe No persistent side effects */
+ GVA_INFO(current),
+ COPY_to_guest | COPY_linear);
}
unsigned long raw_copy_to_guest_flush_dcache(void *to, const void *from,
unsigned int len)
{
- return copy_guest((void *)from, (vaddr_t)to, len, GVA_INFO(current),
+ return copy_guest((void *)from, (vaddr_t)to, len,
+ /* SAF-4-safe No persistent side effects */
+ GVA_INFO(current),
COPY_to_guest | COPY_flush_dcache | COPY_linear);
}
unsigned long raw_clear_guest(void *to, unsigned int len)
{
- return copy_guest(NULL, (vaddr_t)to, len, GVA_INFO(current),
+ return copy_guest(NULL, (vaddr_t)to, len,
+ /* SAF-4-safe No persistent side effects */
+ GVA_INFO(current),
COPY_to_guest | COPY_linear);
}
unsigned long raw_copy_from_guest(void *to, const void __user *from,
unsigned int len)
{
- return copy_guest(to, (vaddr_t)from, len, GVA_INFO(current),
+ return copy_guest(to, (vaddr_t)from, len,
+ /* SAF-4-safe No persistent side effects */
+ GVA_INFO(current),
COPY_from_guest | COPY_linear);
}
@@ -800,6 +800,7 @@ static int cf_check hvm_save_cpu_ctxt(struct vcpu *v, hvm_domain_context_t *h)
{
struct segment_register seg;
struct hvm_hw_cpu ctxt = {
+ /* SAF-3-safe effects for debugging/logging reasons are safe */
.tsc = hvm_get_guest_tsc_fixed(v, v->domain->arch.hvm.sync_tsc),
.msr_tsc_aux = v->arch.msrs->tsc_aux,
.rax = v->arch.user_regs.rax,
@@ -1521,6 +1521,7 @@ long vcpu_yield(void)
SCHED_STAT_CRANK(vcpu_yield);
+ /* SAF-4-safe No persistent side effects */
TRACE_2D(TRC_SCHED_YIELD, current->domain->domain_id, current->vcpu_id);
raise_softirq(SCHEDULE_SOFTIRQ);
return 0;
@@ -1899,6 +1900,7 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
if ( copy_from_guest(&sched_shutdown, arg, 1) )
break;
+ /* SAF-4-safe No persistent side effects */
TRACE_3D(TRC_SCHED_SHUTDOWN,
current->domain->domain_id, current->vcpu_id,
sched_shutdown.reason);
@@ -1916,6 +1918,7 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
if ( copy_from_guest(&sched_shutdown, arg, 1) )
break;
+ /* SAF-4-safe No persistent side effects */
TRACE_3D(TRC_SCHED_SHUTDOWN_CODE,
d->domain_id, current->vcpu_id, sched_shutdown.reason);