Tofu: support for barrier gate, kmalloc cache

Change-Id: I6f4cfec2ec404efd03b332fc3f449a775816230e
This commit is contained in:
Balazs Gerofi
2020-09-06 12:07:51 +09:00
committed by Masamichi Takagi
parent 5d784f3ea4
commit 1918df7765
13 changed files with 946 additions and 87 deletions

View File

@ -1874,10 +1874,18 @@ void __return_syscall(ihk_os_t os, struct ikc_scd_packet *packet,
res->stid = stid;
#ifdef ENABLE_TOFU
/* Record PDE_DATA after ioctl() calls for Tofu driver */
if (packet->req.number == __NR_ioctl && ret == 0) {
/* Record PDE_DATA after open()/ioctl() calls for Tofu driver */
if ((packet->req.number == __NR_ioctl && ret == 0) ||
(packet->req.number == __NR_openat && ret > 1)) {
char *pathbuf, *fullpath;
struct fd f = fdget(packet->req.args[0]);
struct fd f;
if (packet->req.number == __NR_ioctl) {
f = fdget(packet->req.args[0]);
}
else if (packet->req.number == __NR_openat) {
f = fdget(ret);
}
if (!f.file) {
goto out_notify;
@ -1895,18 +1903,19 @@ void __return_syscall(ihk_os_t os, struct ikc_scd_packet *packet,
if (!strncmp("/proc/tofu/dev/", fullpath, 15)) {
res->pde_data = PDE_DATA(file_inode(f.file));
printk("%s: fd: %ld, path: %s, PDE_DATA: 0x%lx\n",
dprintk("%s: %s(): fd: %ld, path: %s, PDE_DATA: 0x%lx\n",
__func__,
packet->req.number == __NR_ioctl ? "ioctl" : "openat",
packet->req.args[0],
fullpath,
(unsigned long)res->pde_data);
printk("%s: pgd_index: %ld, pmd_index: %ld, pte_index: %ld\n",
dprintk("%s: pgd_index: %ld, pmd_index: %ld, pte_index: %ld\n",
__func__,
pgd_index((unsigned long)res->pde_data),
pmd_index((unsigned long)res->pde_data),
pte_index((unsigned long)res->pde_data));
#ifdef CONFIG_ARM64
printk("CONFIG_ARM64_VA_BITS: %d, PGDIR_SHIFT: %d\n",
dprintk("CONFIG_ARM64_VA_BITS: %d, PGDIR_SHIFT: %d\n",
CONFIG_ARM64_VA_BITS, PGDIR_SHIFT);
#endif
}