add PTATTR_FOR_USER flag to enum ihk_mc_ap_flag
This commit is contained in:
@@ -91,6 +91,7 @@ enum ihk_mc_pt_attribute {
|
|||||||
PTATTR_USER = 0x04,
|
PTATTR_USER = 0x04,
|
||||||
PTATTR_LARGEPAGE = 0x80,
|
PTATTR_LARGEPAGE = 0x80,
|
||||||
PTATTR_UNCACHABLE = 0x10000,
|
PTATTR_UNCACHABLE = 0x10000,
|
||||||
|
PTATTR_FOR_USER = 0x20000,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef unsigned long pte_t;
|
typedef unsigned long pte_t;
|
||||||
|
|||||||
@@ -302,7 +302,8 @@ static int __set_pt_page(struct page_table *pt, void *virt, unsigned long phys,
|
|||||||
struct page_table *newpt;
|
struct page_table *newpt;
|
||||||
enum ihk_mc_ap_flag ap_flag;
|
enum ihk_mc_ap_flag ap_flag;
|
||||||
|
|
||||||
ap_flag = attr & PTATTR_USER? IHK_MC_AP_NOWAIT: IHK_MC_AP_CRITICAL;
|
ap_flag = (attr & (PTATTR_USER | PTATTR_FOR_USER)) ?
|
||||||
|
IHK_MC_AP_NOWAIT: IHK_MC_AP_CRITICAL;
|
||||||
|
|
||||||
if (!pt) {
|
if (!pt) {
|
||||||
pt = init_pt;
|
pt = init_pt;
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ static int process_msg_prepare_process(unsigned long rphys)
|
|||||||
npages = ((rphys + sz - 1) >> PAGE_SHIFT) - (rphys >> PAGE_SHIFT) + 1;
|
npages = ((rphys + sz - 1) >> PAGE_SHIFT) - (rphys >> PAGE_SHIFT) + 1;
|
||||||
|
|
||||||
phys = ihk_mc_map_memory(NULL, rphys, sz);
|
phys = ihk_mc_map_memory(NULL, rphys, sz);
|
||||||
if((p = ihk_mc_map_virtual(phys, npages, PTATTR_WRITABLE)) == NULL){
|
if((p = ihk_mc_map_virtual(phys, npages, PTATTR_WRITABLE | PTATTR_FOR_USER)) == NULL){
|
||||||
ihk_mc_unmap_memory(NULL, phys, sz);
|
ihk_mc_unmap_memory(NULL, phys, sz);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
@@ -243,7 +243,7 @@ static int process_msg_prepare_process(unsigned long rphys)
|
|||||||
args_envs_rp = ihk_mc_map_memory(NULL, (unsigned long)p->args, p->args_len);
|
args_envs_rp = ihk_mc_map_memory(NULL, (unsigned long)p->args, p->args_len);
|
||||||
dkprintf("args_envs_rp: 0x%lX\n", args_envs_rp);
|
dkprintf("args_envs_rp: 0x%lX\n", args_envs_rp);
|
||||||
if((args_envs_r = (char *)ihk_mc_map_virtual(args_envs_rp, args_envs_npages,
|
if((args_envs_r = (char *)ihk_mc_map_virtual(args_envs_rp, args_envs_npages,
|
||||||
PTATTR_WRITABLE)) == NULL){
|
PTATTR_WRITABLE | PTATTR_FOR_USER)) == NULL){
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
dkprintf("args_envs_r: 0x%lX\n", args_envs_r);
|
dkprintf("args_envs_r: 0x%lX\n", args_envs_r);
|
||||||
@@ -263,7 +263,7 @@ static int process_msg_prepare_process(unsigned long rphys)
|
|||||||
args_envs_rp = ihk_mc_map_memory(NULL, (unsigned long)p->envs, p->envs_len);
|
args_envs_rp = ihk_mc_map_memory(NULL, (unsigned long)p->envs, p->envs_len);
|
||||||
dkprintf("args_envs_rp: 0x%lX\n", args_envs_rp);
|
dkprintf("args_envs_rp: 0x%lX\n", args_envs_rp);
|
||||||
if((args_envs_r = (char *)ihk_mc_map_virtual(args_envs_rp, args_envs_npages,
|
if((args_envs_r = (char *)ihk_mc_map_virtual(args_envs_rp, args_envs_npages,
|
||||||
PTATTR_WRITABLE)) == NULL){
|
PTATTR_WRITABLE | PTATTR_FOR_USER)) == NULL){
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
dkprintf("args_envs_r: 0x%lX\n", args_envs_r);
|
dkprintf("args_envs_r: 0x%lX\n", args_envs_r);
|
||||||
@@ -349,7 +349,7 @@ static void process_msg_init_acked(unsigned long pphys)
|
|||||||
REQUEST_PAGE_COUNT * PAGE_SIZE);
|
REQUEST_PAGE_COUNT * PAGE_SIZE);
|
||||||
if((lparam->request_va = ihk_mc_map_virtual(lparam->request_pa,
|
if((lparam->request_va = ihk_mc_map_virtual(lparam->request_pa,
|
||||||
REQUEST_PAGE_COUNT,
|
REQUEST_PAGE_COUNT,
|
||||||
PTATTR_WRITABLE)) == NULL){
|
PTATTR_WRITABLE | PTATTR_FOR_USER)) == NULL){
|
||||||
// TODO:
|
// TODO:
|
||||||
panic("ENOMEM");
|
panic("ENOMEM");
|
||||||
}
|
}
|
||||||
@@ -360,7 +360,7 @@ static void process_msg_init_acked(unsigned long pphys)
|
|||||||
PAGE_SIZE);
|
PAGE_SIZE);
|
||||||
if((lparam->doorbell_va = ihk_mc_map_virtual(lparam->doorbell_pa,
|
if((lparam->doorbell_va = ihk_mc_map_virtual(lparam->doorbell_pa,
|
||||||
DOORBELL_PAGE_COUNT,
|
DOORBELL_PAGE_COUNT,
|
||||||
PTATTR_WRITABLE)) == NULL){
|
PTATTR_WRITABLE | PTATTR_FOR_USER)) == NULL){
|
||||||
// TODO:
|
// TODO:
|
||||||
panic("ENOMEM");
|
panic("ENOMEM");
|
||||||
}
|
}
|
||||||
@@ -369,7 +369,7 @@ static void process_msg_init_acked(unsigned long pphys)
|
|||||||
lparam->post_pa = ihk_mc_map_memory(NULL, param->post_page,
|
lparam->post_pa = ihk_mc_map_memory(NULL, param->post_page,
|
||||||
PAGE_SIZE);
|
PAGE_SIZE);
|
||||||
if((lparam->post_va = ihk_mc_map_virtual(lparam->post_pa, 1,
|
if((lparam->post_va = ihk_mc_map_virtual(lparam->post_pa, 1,
|
||||||
PTATTR_WRITABLE)) == NULL){
|
PTATTR_WRITABLE | PTATTR_FOR_USER)) == NULL){
|
||||||
// TODO:
|
// TODO:
|
||||||
panic("ENOMEM");
|
panic("ENOMEM");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user