Lines Matching refs:gpi_info
59 static void shatter_2mb(uintptr_t base, const gpi_info_t *gpi_info,
61 static void shatter_32mb(uintptr_t base, const gpi_info_t *gpi_info,
63 static void shatter_512mb(uintptr_t base, const gpi_info_t *gpi_info,
153 #define GPT_LOCK bit_lock(gpi_info.lock, gpi_info.mask)
154 #define GPT_UNLOCK bit_unlock(gpi_info.lock, gpi_info.mask)
193 static void shatter_2mb(uintptr_t base, const gpi_info_t *gpi_info, in shatter_2mb() argument
202 fill_desc(&gpi_info->gpt_l1_addr[idx], l1_desc, L1_QWORDS_2MB); in shatter_2mb()
205 static void shatter_32mb(uintptr_t base, const gpi_info_t *gpi_info, in shatter_32mb() argument
209 const uint64_t *l1_gran = &gpi_info->gpt_l1_addr[idx]; in shatter_32mb()
218 l1 = &gpi_info->gpt_l1_addr[idx]; in shatter_32mb()
229 static void shatter_512mb(uintptr_t base, const gpi_info_t *gpi_info, in shatter_512mb() argument
233 const uint64_t *l1_32mb = &gpi_info->gpt_l1_addr[idx]; in shatter_512mb()
242 l1 = &gpi_info->gpt_l1_addr[idx]; in shatter_512mb()
248 shatter_32mb(base, gpi_info, l1_desc); in shatter_512mb()
1365 static int get_gpi_params(uint64_t base, gpi_info_t *gpi_info) in get_gpi_params() argument
1379 gpi_info->gpt_l1_addr = GPT_L0_TBLD_ADDR(gpt_l0_desc); in get_gpi_params()
1380 gpi_info->idx = (unsigned int)GPT_L1_INDEX(base); in get_gpi_params()
1381 gpi_info->gpi_shift = GPT_L1_GPI_IDX(gpt_config.p, base) << 2; in get_gpi_params()
1388 gpi_info->lock = &gpt_bitlock[block_idx / LOCK_BITS]; in get_gpi_params()
1389 gpi_info->mask = 1U << (block_idx & (LOCK_BITS - 1U)); in get_gpi_params()
1398 static void read_gpi(gpi_info_t *gpi_info) in read_gpi() argument
1400 gpi_info->gpt_l1_desc = (gpi_info->gpt_l1_addr)[gpi_info->idx]; in read_gpi()
1402 if ((gpi_info->gpt_l1_desc & GPT_L1_TYPE_CONT_DESC_MASK) == in read_gpi()
1405 gpi_info->gpi = (unsigned int)GPT_L1_CONT_GPI(gpi_info->gpt_l1_desc); in read_gpi()
1408 gpi_info->gpi = (unsigned int)((gpi_info->gpt_l1_desc >> gpi_info->gpi_shift) & in read_gpi()
1437 __unused static bool check_fuse_2mb(uint64_t base, const gpi_info_t *gpi_info, in check_fuse_2mb() argument
1452 if (gpi_info->gpt_l1_addr[idx--] != l1_desc) { in check_fuse_2mb()
1461 __unused static void fuse_2mb(uint64_t base, const gpi_info_t *gpi_info, in fuse_2mb() argument
1472 fill_desc(&gpi_info->gpt_l1_addr[idx_2], l1_cont_desc, L1_QWORDS_2MB); in fuse_2mb()
1487 __unused static bool check_fuse_32mb(uint64_t base, const gpi_info_t *gpi_info, in check_fuse_32mb() argument
1501 gpi_info->gpt_l1_addr[GPT_L1_INDEX(ALIGN_2MB(base))] = l1_cont_desc; in check_fuse_32mb()
1509 if (gpi_info->gpt_l1_addr[idx] != l1_cont_desc) { in check_fuse_32mb()
1519 __unused static void fuse_32mb(uint64_t base, const gpi_info_t *gpi_info, in fuse_32mb() argument
1530 fill_desc(&gpi_info->gpt_l1_addr[idx_32], l1_cont_desc, L1_QWORDS_32MB); in fuse_32mb()
1545 __unused static bool check_fuse_512mb(uint64_t base, const gpi_info_t *gpi_info, in check_fuse_512mb() argument
1559 gpi_info->gpt_l1_addr[GPT_L1_INDEX(ALIGN_32MB(base))] = l1_cont_desc; in check_fuse_512mb()
1567 if (gpi_info->gpt_l1_addr[idx] != l1_cont_desc) { in check_fuse_512mb()
1577 __unused static void fuse_512mb(uint64_t base, const gpi_info_t *gpi_info, in fuse_512mb() argument
1588 fill_desc(&gpi_info->gpt_l1_addr[idx_512], l1_cont_desc, L1_QWORDS_512MB); in fuse_512mb()
1601 __unused static void fuse_block(uint64_t base, const gpi_info_t *gpi_info, in fuse_block() argument
1605 if (!check_fuse_2mb(base, gpi_info, l1_desc)) { in fuse_block()
1611 fuse_2mb(base, gpi_info, l1_desc); in fuse_block()
1614 if (!check_fuse_32mb(base, gpi_info, l1_desc)) { in fuse_block()
1616 fuse_2mb(base, gpi_info, l1_desc); in fuse_block()
1621 fuse_32mb(base, gpi_info, l1_desc); in fuse_block()
1624 if (!check_fuse_512mb(base, gpi_info, l1_desc)) { in fuse_block()
1626 fuse_32mb(base, gpi_info, l1_desc); in fuse_block()
1631 fuse_512mb(base, gpi_info, l1_desc); in fuse_block()
1648 __unused static void shatter_block(uint64_t base, gpi_info_t *gpi_info, in shatter_block() argument
1666 unsigned long level = GPT_L1_CONT_CONTIG(gpi_info->gpt_l1_desc) - 1UL; in shatter_block()
1669 gpt_shatter_lookup[level](base, gpi_info, l1_desc); in shatter_block()
1678 gpi_info->gpt_l1_desc = l1_desc; in shatter_block()
1700 gpi_info_t gpi_info; in gpt_delegate_pas() local
1753 res = get_gpi_params(base, &gpi_info); in gpt_delegate_pas()
1763 read_gpi(&gpi_info); in gpt_delegate_pas()
1766 if (gpi_info.gpi != GPT_GPI_NS) { in gpt_delegate_pas()
1769 gpi_info.gpi); in gpt_delegate_pas()
1776 if ((gpi_info.gpt_l1_desc & GPT_L1_TYPE_CONT_DESC_MASK) == in gpt_delegate_pas()
1778 shatter_block(base, &gpi_info, GPT_L1_NS_DESC); in gpt_delegate_pas()
1789 write_gpt(&gpi_info.gpt_l1_desc, gpi_info.gpt_l1_addr, in gpt_delegate_pas()
1790 gpi_info.gpi_shift, gpi_info.idx, target_pas); in gpt_delegate_pas()
1801 if (gpi_info.gpt_l1_desc == l1_desc) { in gpt_delegate_pas()
1803 fuse_block(base, &gpi_info, l1_desc); in gpt_delegate_pas()
1815 base, gpi_info.gpi, target_pas); in gpt_delegate_pas()
1839 gpi_info_t gpi_info; in gpt_undelegate_pas() local
1873 res = get_gpi_params(base, &gpi_info); in gpt_undelegate_pas()
1883 read_gpi(&gpi_info); in gpt_undelegate_pas()
1887 (gpi_info.gpi == GPT_GPI_REALM)) { in gpt_undelegate_pas()
1891 (gpi_info.gpi == GPT_GPI_SECURE)) { in gpt_undelegate_pas()
1897 gpi_info.gpi); in gpt_undelegate_pas()
1904 if ((gpi_info.gpt_l1_desc & GPT_L1_TYPE_CONT_DESC_MASK) == in gpt_undelegate_pas()
1906 shatter_block(base, &gpi_info, l1_desc); in gpt_undelegate_pas()
1915 write_gpt(&gpi_info.gpt_l1_desc, gpi_info.gpt_l1_addr, in gpt_undelegate_pas()
1916 gpi_info.gpi_shift, gpi_info.idx, GPT_GPI_NO_ACCESS); in gpt_undelegate_pas()
1933 write_gpt(&gpi_info.gpt_l1_desc, gpi_info.gpt_l1_addr, in gpt_undelegate_pas()
1934 gpi_info.gpi_shift, gpi_info.idx, GPT_GPI_NS); in gpt_undelegate_pas()
1940 if (gpi_info.gpt_l1_desc == GPT_L1_NS_DESC) { in gpt_undelegate_pas()
1942 fuse_block(base, &gpi_info, GPT_L1_NS_DESC); in gpt_undelegate_pas()
1953 base, gpi_info.gpi, GPT_GPI_NS); in gpt_undelegate_pas()