<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 22-Jul-2020, at 10:07 AM, Michael Ellerman <<a href="mailto:mpe@ellerman.id.au" class="">mpe@ellerman.id.au</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Athira Rajeev <</span><a href="mailto:atrajeev@linux.vnet.ibm.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">atrajeev@linux.vnet.ibm.com</a><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">> writes:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" class="">On 21-Jul-2020, at 9:24 AM, Paul Mackerras <<a href="mailto:paulus@ozlabs.org" class="">paulus@ozlabs.org</a>> wrote:<br class="">On Fri, Jul 17, 2020 at 10:38:14AM -0400, Athira Rajeev wrote:<br class=""><blockquote type="cite" class="">Currently `kvm_vcpu_arch` stores all Monitor Mode Control registers<br class="">in a flat array in order: mmcr0, mmcr1, mmcra, mmcr2, mmcrs<br class="">Split this to give mmcra and mmcrs its own entries in vcpu and<br class="">use a flat array for mmcr0 to mmcr2. This patch implements this<br class="">cleanup to make code easier to read.<br class=""></blockquote><br class="">Changing the way KVM stores these values internally is fine, but<br class="">changing the user ABI is not.  This part:<br class=""><br class=""><blockquote type="cite" class="">diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h<br class="">index 264e266..e55d847 100644<br class="">--- a/arch/powerpc/include/uapi/asm/kvm.h<br class="">+++ b/arch/powerpc/include/uapi/asm/kvm.h<br class="">@@ -510,8 +510,8 @@ struct kvm_ppc_cpu_char {<br class=""><br class="">#define KVM_REG_PPC_MMCR0<span class="Apple-tab-span" style="white-space: pre;">      </span>(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x10)<br class="">#define KVM_REG_PPC_MMCR1<span class="Apple-tab-span" style="white-space: pre;">     </span>(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x11)<br class="">-#define KVM_REG_PPC_MMCRA<span class="Apple-tab-span" style="white-space: pre;">    </span>(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x12)<br class="">-#define KVM_REG_PPC_MMCR2<span class="Apple-tab-span" style="white-space: pre;">    </span>(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x13)<br class="">+#define KVM_REG_PPC_MMCR2<span class="Apple-tab-span" style="white-space: pre;">    </span>(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x12)<br class="">+#define KVM_REG_PPC_MMCRA<span class="Apple-tab-span" style="white-space: pre;">    </span>(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x13)<br class=""></blockquote><br class="">means that existing userspace programs that used to work would now be<br class="">broken.  That is not acceptable (breaking the user ABI is only ever<br class="">acceptable with a very compelling reason).  So NAK to this part of the<br class="">patch.<br class=""></blockquote><br class="">Hi Paul<br class=""><br class="">Thanks for checking the patch. I understood your point on user ABI breakage that this particular change can cause.<br class="">I will retain original KVM_REG_PPC_MMCRA and KVM_REG_PPC_MMCR2 order in `kvm.h`<br class="">And with that, additionally I will need below change ( on top of current patch ) for my clean up updates for kvm cpu MMCR to work,<br class="">Because now mmcra and mmcrs will have its own entries in vcpu and is not part of the mmcr[] array<br class="">Please suggest if this looks good<br class=""></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">I did the same patch I think in my testing branch, it's here:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="https://github.com/linuxppc/linux/commit/daea78154eff1b7e2f36be05a8f95feb5a588912" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://github.com/linuxppc/linux/commit/daea78154eff1b7e2f36be05a8f95feb5a588912</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Can you please check that matches what you sent.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""></div></blockquote><div><br class=""></div>Hi Michael,</div><div><br class=""></div><div>Yes, it matches. Thanks for making this change.</div><div><br class=""><blockquote type="cite" class=""><div class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">cheers</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c<br class="">index 3f90eee261fc..b10bb404f0d5 100644<br class="">--- a/arch/powerpc/kvm/book3s_hv.c<br class="">+++ b/arch/powerpc/kvm/book3s_hv.c<br class="">@@ -1679,10 +1679,13 @@ static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,<br class="">       case KVM_REG_PPC_UAMOR:<br class="">               *val = get_reg_val(id, vcpu->arch.uamor);<br class="">               break;<br class="">-       case KVM_REG_PPC_MMCR0 ... KVM_REG_PPC_MMCR2:<br class="">+       case KVM_REG_PPC_MMCR0 ... KVM_REG_PPC_MMCR1:<br class="">               i = id - KVM_REG_PPC_MMCR0;<br class="">               *val = get_reg_val(id, vcpu->arch.mmcr[i]);<br class="">               break;<br class="">+       case KVM_REG_PPC_MMCR2:<br class="">+               *val = get_reg_val(id, vcpu->arch.mmcr[2]);<br class="">+               break;<br class="">       case KVM_REG_PPC_MMCRA:<br class="">               *val = get_reg_val(id, vcpu->arch.mmcra);<br class="">               break;<br class="">@@ -1906,10 +1909,13 @@ static int kvmppc_set_one_reg_hv(struct kvm_vcpu *vcpu, u64 id,<br class="">       case KVM_REG_PPC_UAMOR:<br class="">               vcpu->arch.uamor = set_reg_val(id, *val);<br class="">               break;<br class="">-       case KVM_REG_PPC_MMCR0 ... KVM_REG_PPC_MMCR2:<br class="">+       case KVM_REG_PPC_MMCR0 ... KVM_REG_PPC_MMCR1:<br class="">               i = id - KVM_REG_PPC_MMCR0;<br class="">               vcpu->arch.mmcr[i] = set_reg_val(id, *val);<br class="">               break;<br class="">+       case KVM_REG_PPC_MMCR2:<br class="">+               vcpu->arch.mmcr[2] = set_reg_val(id, *val);<br class="">+               break;<br class="">       case KVM_REG_PPC_MMCRA:<br class="">               vcpu->arch.mmcra = set_reg_val(id, *val);<br class="">               break;<br class="">—<br class=""><br class=""><br class=""><blockquote type="cite" class=""><br class="">Regards,<br class="">Paul.</blockquote></blockquote></div></blockquote></div><br class=""></body></html>