diff for duplicates of <87fu00olaf.fsf@linux.ibm.com> diff --git a/a/1.txt b/N1/1.txt index 87df228..e5ad7e8 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -5,21 +5,18 @@ Michael Ellerman <mpe@ellerman.id.au> writes: > Just one comment below. > > Laurent Dufour <ldufour@linux.vnet.ibm.com> writes: ->> diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platfo= -rms/pseries/lpar.c +>> diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c >> index 96b8cd8a802d..41ed03245eb4 100644 >> --- a/arch/powerpc/platforms/pseries/lpar.c >> +++ b/arch/powerpc/platforms/pseries/lpar.c ->> @@ -418,6 +418,73 @@ static void pSeries_lpar_hpte_invalidate(unsigned l= -ong slot, unsigned long vpn, ->> BUG_ON(lpar_rc !=3D H_SUCCESS); +>> @@ -418,6 +418,73 @@ static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long vpn, +>> BUG_ON(lpar_rc != H_SUCCESS); >> } ->>=20=20 +>> >> + >> +/* >> + * As defined in the PAPR's section 14.5.4.1.8 ->> + * The control mask doesn't include the returned reference and change b= -it from +>> + * The control mask doesn't include the returned reference and change bit from >> + * the processed PTE. >> + */ >> +#define HBLKR_AVPN 0x0100000000000000UL @@ -31,53 +28,49 @@ it from >> +/** >> + * H_BLOCK_REMOVE caller. >> + * @idx should point to the latest @param entry set with a PTEX. ->> + * If PTE cannot be processed because another CPUs has already locked t= -hat +>> + * If PTE cannot be processed because another CPUs has already locked that >> + * group, those entries are put back in @param starting at index 1. ->> + * If entries has to be retried and @retry_busy is set to true, these e= -ntries ->> + * are retried until success. If @retry_busy is set to false, the retur= -ned +>> + * If entries has to be retried and @retry_busy is set to true, these entries +>> + * are retried until success. If @retry_busy is set to false, the returned >> + * is the number of entries yet to process. >> + */ ->> +static unsigned long call_block_remove(unsigned long idx, unsigned long= - *param, +>> +static unsigned long call_block_remove(unsigned long idx, unsigned long *param, >> + bool retry_busy) >> +{ >> + unsigned long i, rc, new_idx; >> + unsigned long retbuf[PLPAR_HCALL9_BUFSIZE]; >> + >> +again: ->> + new_idx =3D 0; +>> + new_idx = 0; >> + BUG_ON((idx < 2) || (idx > PLPAR_HCALL9_BUFSIZE)); > > I count 1 .. > >> + if (idx < PLPAR_HCALL9_BUFSIZE) ->> + param[idx] =3D HBR_END; +>> + param[idx] = HBR_END; >> + ->> + rc =3D plpar_hcall9(H_BLOCK_REMOVE, retbuf, +>> + rc = plpar_hcall9(H_BLOCK_REMOVE, retbuf, >> + param[0], /* AVA */ >> + param[1], param[2], param[3], param[4], /* TS0-7 */ >> + param[5], param[6], param[7], param[8]); ->> + if (rc =3D=3D H_SUCCESS) +>> + if (rc == H_SUCCESS) >> + return 0; >> + ->> + BUG_ON(rc !=3D H_PARTIAL); +>> + BUG_ON(rc != H_PARTIAL); > > 2 ... > >> + /* Check that the unprocessed entries were 'not found' or 'busy' */ ->> + for (i =3D 0; i < idx-1; i++) { ->> + unsigned long ctrl =3D retbuf[i] & HBLKR_CTRL_MASK; +>> + for (i = 0; i < idx-1; i++) { +>> + unsigned long ctrl = retbuf[i] & HBLKR_CTRL_MASK; >> + ->> + if (ctrl =3D=3D HBLKR_CTRL_ERRBUSY) { ->> + param[++new_idx] =3D param[i+1]; +>> + if (ctrl == HBLKR_CTRL_ERRBUSY) { +>> + param[++new_idx] = param[i+1]; >> + continue; >> + } >> + ->> + BUG_ON(ctrl !=3D HBLKR_CTRL_SUCCESS ->> + && ctrl !=3D HBLKR_CTRL_ERRNOTFOUND); +>> + BUG_ON(ctrl != HBLKR_CTRL_SUCCESS +>> + && ctrl != HBLKR_CTRL_ERRNOTFOUND); > > 3 ... > @@ -88,12 +81,12 @@ ned > > Given this is an optimisation it seems like we should be able to fall > back to the existing implementation in the case of error (which will -> probably then BUG_ON() =F0=9F=98=82) +> probably then BUG_ON() 😂) > > If there's some reason we can't then I guess I can live with it. It would be nice to log the error in case we are not expecting the error return. We recently did -https://marc.info/?i=3D20180629083904.29250-1-aneesh.kumar@linux.ibm.com +https://marc.info/?i=20180629083904.29250-1-aneesh.kumar@linux.ibm.com -aneesh diff --git a/a/content_digest b/N1/content_digest index b89d2f9..f054a36 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -20,21 +20,18 @@ "> Just one comment below.\n" ">\n" "> Laurent Dufour <ldufour@linux.vnet.ibm.com> writes:\n" - ">> diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platfo=\n" - "rms/pseries/lpar.c\n" + ">> diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c\n" ">> index 96b8cd8a802d..41ed03245eb4 100644\n" ">> --- a/arch/powerpc/platforms/pseries/lpar.c\n" ">> +++ b/arch/powerpc/platforms/pseries/lpar.c\n" - ">> @@ -418,6 +418,73 @@ static void pSeries_lpar_hpte_invalidate(unsigned l=\n" - "ong slot, unsigned long vpn,\n" - ">> \tBUG_ON(lpar_rc !=3D H_SUCCESS);\n" + ">> @@ -418,6 +418,73 @@ static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long vpn,\n" + ">> \tBUG_ON(lpar_rc != H_SUCCESS);\n" ">> }\n" - ">>=20=20\n" + ">> \n" ">> +\n" ">> +/*\n" ">> + * As defined in the PAPR's section 14.5.4.1.8\n" - ">> + * The control mask doesn't include the returned reference and change b=\n" - "it from\n" + ">> + * The control mask doesn't include the returned reference and change bit from\n" ">> + * the processed PTE.\n" ">> + */\n" ">> +#define HBLKR_AVPN\t\t0x0100000000000000UL\n" @@ -46,53 +43,49 @@ ">> +/**\n" ">> + * H_BLOCK_REMOVE caller.\n" ">> + * @idx should point to the latest @param entry set with a PTEX.\n" - ">> + * If PTE cannot be processed because another CPUs has already locked t=\n" - "hat\n" + ">> + * If PTE cannot be processed because another CPUs has already locked that\n" ">> + * group, those entries are put back in @param starting at index 1.\n" - ">> + * If entries has to be retried and @retry_busy is set to true, these e=\n" - "ntries\n" - ">> + * are retried until success. If @retry_busy is set to false, the retur=\n" - "ned\n" + ">> + * If entries has to be retried and @retry_busy is set to true, these entries\n" + ">> + * are retried until success. If @retry_busy is set to false, the returned\n" ">> + * is the number of entries yet to process.\n" ">> + */\n" - ">> +static unsigned long call_block_remove(unsigned long idx, unsigned long=\n" - " *param,\n" + ">> +static unsigned long call_block_remove(unsigned long idx, unsigned long *param,\n" ">> +\t\t\t\t bool retry_busy)\n" ">> +{\n" ">> +\tunsigned long i, rc, new_idx;\n" ">> +\tunsigned long retbuf[PLPAR_HCALL9_BUFSIZE];\n" ">> +\n" ">> +again:\n" - ">> +\tnew_idx =3D 0;\n" + ">> +\tnew_idx = 0;\n" ">> +\tBUG_ON((idx < 2) || (idx > PLPAR_HCALL9_BUFSIZE));\n" ">\n" "> I count 1 ..\n" ">\n" ">> +\tif (idx < PLPAR_HCALL9_BUFSIZE)\n" - ">> +\t\tparam[idx] =3D HBR_END;\n" + ">> +\t\tparam[idx] = HBR_END;\n" ">> +\n" - ">> +\trc =3D plpar_hcall9(H_BLOCK_REMOVE, retbuf,\n" + ">> +\trc = plpar_hcall9(H_BLOCK_REMOVE, retbuf,\n" ">> +\t\t\t param[0], /* AVA */\n" ">> +\t\t\t param[1], param[2], param[3], param[4], /* TS0-7 */\n" ">> +\t\t\t param[5], param[6], param[7], param[8]);\n" - ">> +\tif (rc =3D=3D H_SUCCESS)\n" + ">> +\tif (rc == H_SUCCESS)\n" ">> +\t\treturn 0;\n" ">> +\n" - ">> +\tBUG_ON(rc !=3D H_PARTIAL);\n" + ">> +\tBUG_ON(rc != H_PARTIAL);\n" ">\n" "> 2 ...\n" ">\n" ">> +\t/* Check that the unprocessed entries were 'not found' or 'busy' */\n" - ">> +\tfor (i =3D 0; i < idx-1; i++) {\n" - ">> +\t\tunsigned long ctrl =3D retbuf[i] & HBLKR_CTRL_MASK;\n" + ">> +\tfor (i = 0; i < idx-1; i++) {\n" + ">> +\t\tunsigned long ctrl = retbuf[i] & HBLKR_CTRL_MASK;\n" ">> +\n" - ">> +\t\tif (ctrl =3D=3D HBLKR_CTRL_ERRBUSY) {\n" - ">> +\t\t\tparam[++new_idx] =3D param[i+1];\n" + ">> +\t\tif (ctrl == HBLKR_CTRL_ERRBUSY) {\n" + ">> +\t\t\tparam[++new_idx] = param[i+1];\n" ">> +\t\t\tcontinue;\n" ">> +\t\t}\n" ">> +\n" - ">> +\t\tBUG_ON(ctrl !=3D HBLKR_CTRL_SUCCESS\n" - ">> +\t\t && ctrl !=3D HBLKR_CTRL_ERRNOTFOUND);\n" + ">> +\t\tBUG_ON(ctrl != HBLKR_CTRL_SUCCESS\n" + ">> +\t\t && ctrl != HBLKR_CTRL_ERRNOTFOUND);\n" ">\n" "> 3 ...\n" ">\n" @@ -103,14 +96,14 @@ ">\n" "> Given this is an optimisation it seems like we should be able to fall\n" "> back to the existing implementation in the case of error (which will\n" - "> probably then BUG_ON() =F0=9F=98=82)\n" + "> probably then BUG_ON() \360\237\230\202)\n" ">\n" "> If there's some reason we can't then I guess I can live with it.\n" "\n" "It would be nice to log the error in case we are not expecting the\n" "error return. We recently did\n" - "https://marc.info/?i=3D20180629083904.29250-1-aneesh.kumar@linux.ibm.com\n" + "https://marc.info/?i=20180629083904.29250-1-aneesh.kumar@linux.ibm.com\n" "\n" -aneesh -09eb16e844d5a742c8a594fdd53ab3eca31d37ec98f7be186b04886b7d8d2213 +6d8b90f4186ac55852d297d497b387323b7cc0b946ec24657ce1dd488dfd0ca6
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.