lib: sbi_tlb: Fix remote TLB HFENCE VVMA implementation

The HFENCE VVMA instructions flushes TLB based on the VMID
present in HGATP CSR. To handle this, we get the current
VMID for SBI HFENCE VVMA call and we use this current VMID
to do remote TLB HFENCE VVMA on desired set of HARTs.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
Anup Patel authored and Anup Patel committed 2020-05-07 08:55:38 +05:30
1 parent 7993ca2c8e
commit 5338679ff0
5 files changed
+69 -22

No files matched your search

+8 -6
View File
@@ -38,17 +38,19 @@ struct sbi_tlb_info {
unsigned long start;
unsigned long size;
unsigned long asid;
unsigned long vmid;
unsigned long type;
struct sbi_hartmask smask;
};
#define SBI_TLB_INFO_INIT(__ptr, __start, __size, __asid, __type, __src_hart) \
#define SBI_TLB_INFO_INIT(__p, __start, __size, __asid, __vmid, __type, __src) \
do { \
(__ptr)->start = (__start); \
(__ptr)->size = (__size); \
(__ptr)->asid = (__asid); \
(__ptr)->type = (__type); \
SBI_HARTMASK_INIT_EXCEPT(&(__ptr)->smask, (__src_hart)); \
(__p)->start = (__start); \
(__p)->size = (__size); \
(__p)->asid = (__asid); \
(__p)->vmid = (__vmid); \
(__p)->type = (__type); \
SBI_HARTMASK_INIT_EXCEPT(&(__p)->smask, (__src)); \
} while (0)
#define SBI_TLB_INFO_SIZE sizeof(struct sbi_tlb_info)