|
|
|
@@ -180,17 +180,16 @@ int sbi_ecall_rfence_handler(struct sbi_scratch *scratch, unsigned long funcid,
|
|
|
|
tlb_info.size = 0;
|
|
|
|
tlb_info.size = 0;
|
|
|
|
tlb_info.type = SBI_ITLB_FLUSH;
|
|
|
|
tlb_info.type = SBI_ITLB_FLUSH;
|
|
|
|
tlb_info.shart_mask = 1UL << source_hart;
|
|
|
|
tlb_info.shart_mask = 1UL << source_hart;
|
|
|
|
ret = sbi_ipi_send_many(scratch, args[0], args[1],
|
|
|
|
ret = sbi_tlb_fifo_request(scratch, args[0], args[1],
|
|
|
|
SBI_IPI_EVENT_FENCE, &tlb_info);
|
|
|
|
&tlb_info);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA:
|
|
|
|
case SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA:
|
|
|
|
tlb_info.start = (unsigned long)args[2];
|
|
|
|
tlb_info.start = (unsigned long)args[2];
|
|
|
|
tlb_info.size = (unsigned long)args[3];
|
|
|
|
tlb_info.size = (unsigned long)args[3];
|
|
|
|
tlb_info.type = SBI_TLB_FLUSH_GVMA;
|
|
|
|
tlb_info.type = SBI_TLB_FLUSH_GVMA;
|
|
|
|
tlb_info.shart_mask = 1UL << source_hart;
|
|
|
|
tlb_info.shart_mask = 1UL << source_hart;
|
|
|
|
|
|
|
|
ret = sbi_tlb_fifo_request(scratch, args[0], args[1],
|
|
|
|
ret = sbi_ipi_send_many(scratch, args[0], args[1],
|
|
|
|
&tlb_info);
|
|
|
|
SBI_IPI_EVENT_FENCE, &tlb_info);
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID:
|
|
|
|
case SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID:
|
|
|
|
tlb_info.start = (unsigned long)args[2];
|
|
|
|
tlb_info.start = (unsigned long)args[2];
|
|
|
|
@@ -198,9 +197,7 @@ int sbi_ecall_rfence_handler(struct sbi_scratch *scratch, unsigned long funcid,
|
|
|
|
tlb_info.asid = (unsigned long)args[4];
|
|
|
|
tlb_info.asid = (unsigned long)args[4];
|
|
|
|
tlb_info.type = SBI_TLB_FLUSH_GVMA_VMID;
|
|
|
|
tlb_info.type = SBI_TLB_FLUSH_GVMA_VMID;
|
|
|
|
tlb_info.shart_mask = 1UL << source_hart;
|
|
|
|
tlb_info.shart_mask = 1UL << source_hart;
|
|
|
|
|
|
|
|
ret = sbi_tlb_fifo_request(scratch, args[0], args[1],
|
|
|
|
ret = sbi_ipi_send_many(scratch, args[0], args[1],
|
|
|
|
|
|
|
|
SBI_IPI_EVENT_FENCE,
|
|
|
|
|
|
|
|
&tlb_info);
|
|
|
|
&tlb_info);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA:
|
|
|
|
case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA:
|
|
|
|
@@ -208,9 +205,8 @@ int sbi_ecall_rfence_handler(struct sbi_scratch *scratch, unsigned long funcid,
|
|
|
|
tlb_info.size = (unsigned long)args[3];
|
|
|
|
tlb_info.size = (unsigned long)args[3];
|
|
|
|
tlb_info.type = SBI_TLB_FLUSH_VVMA;
|
|
|
|
tlb_info.type = SBI_TLB_FLUSH_VVMA;
|
|
|
|
tlb_info.shart_mask = 1UL << source_hart;
|
|
|
|
tlb_info.shart_mask = 1UL << source_hart;
|
|
|
|
|
|
|
|
ret = sbi_tlb_fifo_request(scratch, args[0], args[1],
|
|
|
|
ret = sbi_ipi_send_many(scratch, args[0], args[1],
|
|
|
|
&tlb_info);
|
|
|
|
SBI_IPI_EVENT_FENCE, &tlb_info);
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID:
|
|
|
|
case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID:
|
|
|
|
tlb_info.start = (unsigned long)args[2];
|
|
|
|
tlb_info.start = (unsigned long)args[2];
|
|
|
|
@@ -218,9 +214,7 @@ int sbi_ecall_rfence_handler(struct sbi_scratch *scratch, unsigned long funcid,
|
|
|
|
tlb_info.asid = (unsigned long)args[4];
|
|
|
|
tlb_info.asid = (unsigned long)args[4];
|
|
|
|
tlb_info.type = SBI_TLB_FLUSH_VVMA_ASID;
|
|
|
|
tlb_info.type = SBI_TLB_FLUSH_VVMA_ASID;
|
|
|
|
tlb_info.shart_mask = 1UL << source_hart;
|
|
|
|
tlb_info.shart_mask = 1UL << source_hart;
|
|
|
|
|
|
|
|
ret = sbi_tlb_fifo_request(scratch, args[0], args[1],
|
|
|
|
ret = sbi_ipi_send_many(scratch, args[0], args[1],
|
|
|
|
|
|
|
|
SBI_IPI_EVENT_FENCE,
|
|
|
|
|
|
|
|
&tlb_info);
|
|
|
|
&tlb_info);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case SBI_EXT_RFENCE_REMOTE_SFENCE_VMA:
|
|
|
|
case SBI_EXT_RFENCE_REMOTE_SFENCE_VMA:
|
|
|
|
@@ -228,9 +222,8 @@ int sbi_ecall_rfence_handler(struct sbi_scratch *scratch, unsigned long funcid,
|
|
|
|
tlb_info.size = (unsigned long)args[3];
|
|
|
|
tlb_info.size = (unsigned long)args[3];
|
|
|
|
tlb_info.type = SBI_TLB_FLUSH_VMA;
|
|
|
|
tlb_info.type = SBI_TLB_FLUSH_VMA;
|
|
|
|
tlb_info.shart_mask = 1UL << source_hart;
|
|
|
|
tlb_info.shart_mask = 1UL << source_hart;
|
|
|
|
|
|
|
|
ret = sbi_tlb_fifo_request(scratch, args[0], args[1],
|
|
|
|
ret = sbi_ipi_send_many(scratch, args[0], args[1],
|
|
|
|
&tlb_info);
|
|
|
|
SBI_IPI_EVENT_FENCE, &tlb_info);
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID:
|
|
|
|
case SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID:
|
|
|
|
tlb_info.start = (unsigned long)args[2];
|
|
|
|
tlb_info.start = (unsigned long)args[2];
|
|
|
|
@@ -238,9 +231,7 @@ int sbi_ecall_rfence_handler(struct sbi_scratch *scratch, unsigned long funcid,
|
|
|
|
tlb_info.asid = (unsigned long)args[4];
|
|
|
|
tlb_info.asid = (unsigned long)args[4];
|
|
|
|
tlb_info.type = SBI_TLB_FLUSH_VMA_ASID;
|
|
|
|
tlb_info.type = SBI_TLB_FLUSH_VMA_ASID;
|
|
|
|
tlb_info.shart_mask = 1UL << source_hart;
|
|
|
|
tlb_info.shart_mask = 1UL << source_hart;
|
|
|
|
|
|
|
|
ret = sbi_tlb_fifo_request(scratch, args[0], args[1],
|
|
|
|
ret = sbi_ipi_send_many(scratch, args[0], args[1],
|
|
|
|
|
|
|
|
SBI_IPI_EVENT_FENCE,
|
|
|
|
|
|
|
|
&tlb_info);
|
|
|
|
&tlb_info);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -291,8 +282,7 @@ int sbi_ecall_0_1_handler(struct sbi_scratch *scratch, unsigned long extid,
|
|
|
|
ret = sbi_load_hart_mask_unpriv(scratch, (ulong *)args[0],
|
|
|
|
ret = sbi_load_hart_mask_unpriv(scratch, (ulong *)args[0],
|
|
|
|
&hmask, out_trap);
|
|
|
|
&hmask, out_trap);
|
|
|
|
if (ret != SBI_ETRAP)
|
|
|
|
if (ret != SBI_ETRAP)
|
|
|
|
ret = sbi_ipi_send_many(scratch, hmask, 0,
|
|
|
|
ret = sbi_tlb_fifo_request(scratch, hmask, 0,
|
|
|
|
SBI_IPI_EVENT_FENCE,
|
|
|
|
|
|
|
|
&tlb_info);
|
|
|
|
&tlb_info);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case SBI_EXT_0_1_REMOTE_SFENCE_VMA:
|
|
|
|
case SBI_EXT_0_1_REMOTE_SFENCE_VMA:
|
|
|
|
@@ -303,8 +293,7 @@ int sbi_ecall_0_1_handler(struct sbi_scratch *scratch, unsigned long extid,
|
|
|
|
ret = sbi_load_hart_mask_unpriv(scratch, (ulong *)args[0],
|
|
|
|
ret = sbi_load_hart_mask_unpriv(scratch, (ulong *)args[0],
|
|
|
|
&hmask, out_trap);
|
|
|
|
&hmask, out_trap);
|
|
|
|
if (ret != SBI_ETRAP)
|
|
|
|
if (ret != SBI_ETRAP)
|
|
|
|
ret = sbi_ipi_send_many(scratch, hmask, 0,
|
|
|
|
ret = sbi_tlb_fifo_request(scratch, hmask, 0,
|
|
|
|
SBI_IPI_EVENT_FENCE,
|
|
|
|
|
|
|
|
&tlb_info);
|
|
|
|
&tlb_info);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID:
|
|
|
|
case SBI_EXT_0_1_REMOTE_SFENCE_VMA_ASID:
|
|
|
|
@@ -313,12 +302,10 @@ int sbi_ecall_0_1_handler(struct sbi_scratch *scratch, unsigned long extid,
|
|
|
|
tlb_info.asid = (unsigned long)args[3];
|
|
|
|
tlb_info.asid = (unsigned long)args[3];
|
|
|
|
tlb_info.type = SBI_TLB_FLUSH_VMA_ASID;
|
|
|
|
tlb_info.type = SBI_TLB_FLUSH_VMA_ASID;
|
|
|
|
tlb_info.shart_mask = 1UL << source_hart;
|
|
|
|
tlb_info.shart_mask = 1UL << source_hart;
|
|
|
|
|
|
|
|
|
|
|
|
ret = sbi_load_hart_mask_unpriv(scratch, (ulong *)args[0],
|
|
|
|
ret = sbi_load_hart_mask_unpriv(scratch, (ulong *)args[0],
|
|
|
|
&hmask, out_trap);
|
|
|
|
&hmask, out_trap);
|
|
|
|
if (ret != SBI_ETRAP)
|
|
|
|
if (ret != SBI_ETRAP)
|
|
|
|
ret = sbi_ipi_send_many(scratch, hmask, 0,
|
|
|
|
ret = sbi_tlb_fifo_request(scratch, hmask, 0,
|
|
|
|
SBI_IPI_EVENT_FENCE,
|
|
|
|
|
|
|
|
&tlb_info);
|
|
|
|
&tlb_info);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case SBI_EXT_0_1_SHUTDOWN:
|
|
|
|
case SBI_EXT_0_1_SHUTDOWN:
|
|
|
|
|