Message ID | 1489489722-935-2-git-send-email-clombard@linux.vnet.ibm.com (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show |
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> On 14/03/17 22:08, Christophe Lombard wrote: > The two fields pid and tid of the structure cxl_irq_info are only used > in the guest environment. To avoid confusion, it's not necessary > to fill the fields in the bare-metal environment. > The PSL Process and Thread Identification Register is only used when > attaching a dedicated process for PSL8 only. > > Signed-off-by: Christophe Lombard <clombard@linux.vnet.ibm.com> > --- > drivers/misc/cxl/native.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c > index 7ae7105..7257e8b 100644 > --- a/drivers/misc/cxl/native.c > +++ b/drivers/misc/cxl/native.c > @@ -859,8 +859,6 @@ static int native_detach_process(struct cxl_context *ctx) > > static int native_get_irq_info(struct cxl_afu *afu, struct cxl_irq_info *info) > { > - u64 pidtid; > - > /* If the adapter has gone away, we can't get any meaningful > * information. > */ > @@ -870,9 +868,6 @@ static int native_get_irq_info(struct cxl_afu *afu, struct cxl_irq_info *info) > info->dsisr = cxl_p2n_read(afu, CXL_PSL_DSISR_An); > info->dar = cxl_p2n_read(afu, CXL_PSL_DAR_An); > info->dsr = cxl_p2n_read(afu, CXL_PSL_DSR_An); > - pidtid = cxl_p2n_read(afu, CXL_PSL_PID_TID_An); > - info->pid = pidtid >> 32; > - info->tid = pidtid & 0xffffffff; > info->afu_err = cxl_p2n_read(afu, CXL_AFU_ERR_An); > info->errstat = cxl_p2n_read(afu, CXL_PSL_ErrStat_An); > info->proc_handle = 0; >
Le 14/03/2017 à 12:08, Christophe Lombard a écrit : > The two fields pid and tid of the structure cxl_irq_info are only used > in the guest environment. To avoid confusion, it's not necessary > to fill the fields in the bare-metal environment. > The PSL Process and Thread Identification Register is only used when > attaching a dedicated process for PSL8 only. > > Signed-off-by: Christophe Lombard <clombard@linux.vnet.ibm.com> > --- > drivers/misc/cxl/native.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c > index 7ae7105..7257e8b 100644 > --- a/drivers/misc/cxl/native.c > +++ b/drivers/misc/cxl/native.c > @@ -859,8 +859,6 @@ static int native_detach_process(struct cxl_context *ctx) > > static int native_get_irq_info(struct cxl_afu *afu, struct cxl_irq_info *info) > { > - u64 pidtid; > - > /* If the adapter has gone away, we can't get any meaningful > * information. > */ > @@ -870,9 +868,6 @@ static int native_get_irq_info(struct cxl_afu *afu, struct cxl_irq_info *info) > info->dsisr = cxl_p2n_read(afu, CXL_PSL_DSISR_An); > info->dar = cxl_p2n_read(afu, CXL_PSL_DAR_An); > info->dsr = cxl_p2n_read(afu, CXL_PSL_DSR_An); > - pidtid = cxl_p2n_read(afu, CXL_PSL_PID_TID_An); > - info->pid = pidtid >> 32; > - info->tid = pidtid & 0xffffffff; > info->afu_err = cxl_p2n_read(afu, CXL_AFU_ERR_An); > info->errstat = cxl_p2n_read(afu, CXL_PSL_ErrStat_An); > info->proc_handle = 0; > Can we rename pid and tid to "reserved" in the struct cxl_irq_info? By keeping them, they may be used in common code (bare-metal and guest), which will lead to undefined behavior on bare-metal. Since the structure matches what is passed in a hcall, we can't get rid of them, but renaming would be safer. Fred
Le 14/03/2017 à 12:08, Christophe Lombard a écrit : > The two fields pid and tid of the structure cxl_irq_info are only used > in the guest environment. To avoid confusion, it's not necessary > to fill the fields in the bare-metal environment. > The PSL Process and Thread Identification Register is only used when > attaching a dedicated process for PSL8 only. I forgot to mention: we should probably say in the commit message that the code change is justified because the CXL_PSL_PID_TID_An register goes away in CAIA2 and cxl was not really using it. Fred > > Signed-off-by: Christophe Lombard <clombard@linux.vnet.ibm.com> > --- > drivers/misc/cxl/native.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c > index 7ae7105..7257e8b 100644 > --- a/drivers/misc/cxl/native.c > +++ b/drivers/misc/cxl/native.c > @@ -859,8 +859,6 @@ static int native_detach_process(struct cxl_context *ctx) > > static int native_get_irq_info(struct cxl_afu *afu, struct cxl_irq_info *info) > { > - u64 pidtid; > - > /* If the adapter has gone away, we can't get any meaningful > * information. > */ > @@ -870,9 +868,6 @@ static int native_get_irq_info(struct cxl_afu *afu, struct cxl_irq_info *info) > info->dsisr = cxl_p2n_read(afu, CXL_PSL_DSISR_An); > info->dar = cxl_p2n_read(afu, CXL_PSL_DAR_An); > info->dsr = cxl_p2n_read(afu, CXL_PSL_DSR_An); > - pidtid = cxl_p2n_read(afu, CXL_PSL_PID_TID_An); > - info->pid = pidtid >> 32; > - info->tid = pidtid & 0xffffffff; > info->afu_err = cxl_p2n_read(afu, CXL_AFU_ERR_An); > info->errstat = cxl_p2n_read(afu, CXL_PSL_ErrStat_An); > info->proc_handle = 0; >
diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c index 7ae7105..7257e8b 100644 --- a/drivers/misc/cxl/native.c +++ b/drivers/misc/cxl/native.c @@ -859,8 +859,6 @@ static int native_detach_process(struct cxl_context *ctx) static int native_get_irq_info(struct cxl_afu *afu, struct cxl_irq_info *info) { - u64 pidtid; - /* If the adapter has gone away, we can't get any meaningful * information. */ @@ -870,9 +868,6 @@ static int native_get_irq_info(struct cxl_afu *afu, struct cxl_irq_info *info) info->dsisr = cxl_p2n_read(afu, CXL_PSL_DSISR_An); info->dar = cxl_p2n_read(afu, CXL_PSL_DAR_An); info->dsr = cxl_p2n_read(afu, CXL_PSL_DSR_An); - pidtid = cxl_p2n_read(afu, CXL_PSL_PID_TID_An); - info->pid = pidtid >> 32; - info->tid = pidtid & 0xffffffff; info->afu_err = cxl_p2n_read(afu, CXL_AFU_ERR_An); info->errstat = cxl_p2n_read(afu, CXL_PSL_ErrStat_An); info->proc_handle = 0;
The two fields pid and tid of the structure cxl_irq_info are only used in the guest environment. To avoid confusion, it's not necessary to fill the fields in the bare-metal environment. The PSL Process and Thread Identification Register is only used when attaching a dedicated process for PSL8 only. Signed-off-by: Christophe Lombard <clombard@linux.vnet.ibm.com> --- drivers/misc/cxl/native.c | 5 ----- 1 file changed, 5 deletions(-)