cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

mmu_general.h (1108B)


      1/* SPDX-License-Identifier: GPL-2.0
      2 *
      3 * Copyright 2016-2020 HabanaLabs, Ltd.
      4 * All Rights Reserved.
      5 *
      6 */
      7
      8#ifndef INCLUDE_MMU_GENERAL_H_
      9#define INCLUDE_MMU_GENERAL_H_
     10
     11#define PAGE_SHIFT_4KB			12
     12#define PAGE_SHIFT_2MB			21
     13#define PAGE_SIZE_2MB			(_AC(1, UL) << PAGE_SHIFT_2MB)
     14#define PAGE_SIZE_4KB			(_AC(1, UL) << PAGE_SHIFT_4KB)
     15
     16#define PAGE_PRESENT_MASK		0x0000000000001ull
     17#define SWAP_OUT_MASK			0x0000000000004ull
     18#define LAST_MASK			0x0000000000800ull
     19#define FLAGS_MASK			0x0000000000FFFull
     20
     21#define MMU_ARCH_5_HOPS			5
     22
     23#define HOP_PHYS_ADDR_MASK		(~FLAGS_MASK)
     24
     25#define HL_PTE_SIZE			sizeof(u64)
     26
     27/* definitions for HOP with 512 PTE entries */
     28#define HOP_PTE_ENTRIES_512		512
     29#define HOP_TABLE_SIZE_512_PTE		(HOP_PTE_ENTRIES_512 * HL_PTE_SIZE)
     30#define HOP0_512_PTE_TABLES_TOTAL_SIZE	(HOP_TABLE_SIZE_512_PTE * MAX_ASID)
     31
     32#define MMU_HOP0_PA43_12_SHIFT		12
     33#define MMU_HOP0_PA49_44_SHIFT		(12 + 32)
     34
     35#define MMU_CONFIG_TIMEOUT_USEC		2000 /* 2 ms */
     36
     37enum mmu_hop_num {
     38	MMU_HOP0,
     39	MMU_HOP1,
     40	MMU_HOP2,
     41	MMU_HOP3,
     42	MMU_HOP4,
     43	MMU_HOP5,
     44	MMU_HOP_MAX,
     45};
     46
     47#endif /* INCLUDE_MMU_GENERAL_H_ */