All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cxl: Fix is_page_fault() for POWER9
@ 2017-07-04 15:41 Christophe Lombard
  2017-07-06 11:08 ` Vaibhav Jain
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe Lombard @ 2017-07-04 15:41 UTC (permalink / raw)
  To: linuxppc-dev, fbarrat, vaibhav, andrew.donnellan

From: Christophe Lombard <christophe_lombard@fr.ibm.cm>

The function is_page_fault(), for POWER9, lists the Translation Checkout
Responses where the page fault will be handled by copro_handle_mm_fault().
This list is too restrictive and not necessary.

This patches removes this restriction and all page faults, whatever the
reason, will be handled. In this case, the interruption is always
acknowledged.

Signed-off-by: Christophe Lombard <clombard@linux.vnet.ibm.com>

---
This patch applies on top of this patch:
 https://git.kernel.org/powerpc/c/3ced8d73006321bd2a0412fa0ff4b0
---
 drivers/misc/cxl/fault.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/misc/cxl/fault.c b/drivers/misc/cxl/fault.c
index 6eed7d0..0cf7f4a 100644
--- a/drivers/misc/cxl/fault.c
+++ b/drivers/misc/cxl/fault.c
@@ -204,22 +204,11 @@ static bool cxl_is_segment_miss(struct cxl_context *ctx, u64 dsisr)
 
 static bool cxl_is_page_fault(struct cxl_context *ctx, u64 dsisr)
 {
-	u64 crs; /* Translation Checkout Response Status */
-
 	if ((cxl_is_power8()) && (dsisr & CXL_PSL_DSISR_An_DM))
 		return true;
 
-	if (cxl_is_power9()) {
-		crs = (dsisr & CXL_PSL9_DSISR_An_CO_MASK);
-		if ((crs == CXL_PSL9_DSISR_An_PF_SLR) ||
-		    (crs == CXL_PSL9_DSISR_An_PF_RGC) ||
-		    (crs == CXL_PSL9_DSISR_An_PF_RGP) ||
-		    (crs == CXL_PSL9_DSISR_An_PF_HRH) ||
-		    (crs == CXL_PSL9_DSISR_An_PF_STEG) ||
-		    (crs == CXL_PSL9_DSISR_An_URTCH)) {
-			return true;
-		}
-	}
+	if (cxl_is_power9())
+		return true;
 
 	return false;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cxl: Fix is_page_fault() for POWER9
  2017-07-04 15:41 [PATCH] cxl: Fix is_page_fault() for POWER9 Christophe Lombard
@ 2017-07-06 11:08 ` Vaibhav Jain
  0 siblings, 0 replies; 2+ messages in thread
From: Vaibhav Jain @ 2017-07-06 11:08 UTC (permalink / raw)
  To: Christophe Lombard, linuxppc-dev, fbarrat, andrew.donnellan


Christophe Lombard <clombard@linux.vnet.ibm.com> writes:

> This patches removes this restriction and all page faults, whatever the
> reason, will be handled. In this case, the interruption is always
> acknowledged.

This can also be done with adding call to cxl_ack_ae(ctx) at the end of
cxl_handle_fault().

>  static bool cxl_is_page_fault(struct cxl_context *ctx, u64 dsisr)
>  {
> -	u64 crs; /* Translation Checkout Response Status */
> -
>  	if ((cxl_is_power8()) && (dsisr & CXL_PSL_DSISR_An_DM))
>  		return true;
>
> -	if (cxl_is_power9()) {
> -		crs = (dsisr & CXL_PSL9_DSISR_An_CO_MASK);
> -		if ((crs == CXL_PSL9_DSISR_An_PF_SLR) ||
> -		    (crs == CXL_PSL9_DSISR_An_PF_RGC) ||
> -		    (crs == CXL_PSL9_DSISR_An_PF_RGP) ||
> -		    (crs == CXL_PSL9_DSISR_An_PF_HRH) ||
> -		    (crs == CXL_PSL9_DSISR_An_PF_STEG) ||
> -		    (crs == CXL_PSL9_DSISR_An_URTCH)) {
> -			return true;
> -		}
> -	}
Removing this check will force call to copro_handle_mm_fault even for
nmmu reported errors that only need to be communicated to the AFU and
not handled by mm subsystem as such. 

> +	if (cxl_is_power9())
> +		return true;

Optional: With this change the function has become a good candidate for
being inlined or even converting to a macro.

-- 
Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Linux Technology Center, IBM India Pvt. Ltd.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-06 11:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-04 15:41 [PATCH] cxl: Fix is_page_fault() for POWER9 Christophe Lombard
2017-07-06 11:08 ` Vaibhav Jain

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.