add PTATTR_FOR_USER flag to enum ihk_mc_ap_flag

This commit is contained in:
Tomoki Shirasawa
2013-06-02 13:57:44 +09:00
parent 5d9efa7241
commit 2627d4df55
3 changed files with 9 additions and 7 deletions

View File

@@ -91,6 +91,7 @@ enum ihk_mc_pt_attribute {
PTATTR_USER = 0x04,
PTATTR_LARGEPAGE = 0x80,
PTATTR_UNCACHABLE = 0x10000,
PTATTR_FOR_USER = 0x20000,
};
typedef unsigned long pte_t;

View File

@@ -302,7 +302,8 @@ static int __set_pt_page(struct page_table *pt, void *virt, unsigned long phys,
struct page_table *newpt;
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) {
pt = init_pt;

View File

@@ -53,7 +53,7 @@ static int process_msg_prepare_process(unsigned long rphys)
npages = ((rphys + sz - 1) >> PAGE_SHIFT) - (rphys >> PAGE_SHIFT) + 1;
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);
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);
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,
PTATTR_WRITABLE)) == NULL){
PTATTR_WRITABLE | PTATTR_FOR_USER)) == NULL){
goto err;
}
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);
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,
PTATTR_WRITABLE)) == NULL){
PTATTR_WRITABLE | PTATTR_FOR_USER)) == NULL){
goto err;
}
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);
if((lparam->request_va = ihk_mc_map_virtual(lparam->request_pa,
REQUEST_PAGE_COUNT,
PTATTR_WRITABLE)) == NULL){
PTATTR_WRITABLE | PTATTR_FOR_USER)) == NULL){
// TODO:
panic("ENOMEM");
}
@@ -360,7 +360,7 @@ static void process_msg_init_acked(unsigned long pphys)
PAGE_SIZE);
if((lparam->doorbell_va = ihk_mc_map_virtual(lparam->doorbell_pa,
DOORBELL_PAGE_COUNT,
PTATTR_WRITABLE)) == NULL){
PTATTR_WRITABLE | PTATTR_FOR_USER)) == NULL){
// TODO:
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,
PAGE_SIZE);
if((lparam->post_va = ihk_mc_map_virtual(lparam->post_pa, 1,
PTATTR_WRITABLE)) == NULL){
PTATTR_WRITABLE | PTATTR_FOR_USER)) == NULL){
// TODO:
panic("ENOMEM");
}