Re: [PATCH] KVM: PPC: Book3S HV: Fix r3 corruption in h_set_dabr()

2019-06-12 Thread Michael Neuling


> > > 3:
> > > /* Emulate H_SET_DABR/X on P8 for the sake of compat mode
> > > guests */
> > > rlwimi  r5, r4, 5, DAWRX_DR | DAWRX_DW
> > > c010b03c:   74 2e 85 50 rlwimi  r5,r4,5,25,26
> > > rlwimi  r5, r4, 2, DAWRX_WT
> > > c010b040:   f6 16 85 50 rlwimi  r5,r4,2,27,27
> > > clrrdi  r4, r4, 3
> > > c010b044:   24 07 84 78 rldicr  r4,r4,0,60
> > > std r4, VCPU_DAWR(r3)
> > > c010b048:   c0 13 83 f8 std r4,5056(r3)
> > > std r5, VCPU_DAWRX(r3)
> > > c010b04c:   c8 13 a3 f8 std r5,5064(r3)
> > > mtspr   SPRN_DAWR, r4
> > > c010b050:   a6 2b 94 7c mtspr   180,r4
> > > mtspr   SPRN_DAWRX, r5
> > > c010b054:   a6 2b bc 7c mtspr   188,r5
> > > li  r3, 0
> > > c010b058:   00 00 60 38 li  r3,0
> > > blr
> > > c010b05c:   20 00 80 4e blr
> > 
> > It's the `mtspr   SPRN_DAWR, r4` as you're HV=0.  I'm not sure how
> > nested works
> > in that regard. Is the level above suppose to trap and emulate
> > that?  
> > 
> 
> Yeah so as a nested hypervisor we need to avoid that call to mtspr
> SPRN_DAWR since it's HV privileged and we run with HV = 0.
> 
> The fix will be to check kvmhv_on_pseries() before doing the write. In
> fact we should avoid the write any time we call the function from _not_
> real mode.
> 
> I'll submit a fix for the KVM side. Doesn't look like this is anything
> to do with Mikey's patch, was always broken as far as I can tell.

Thanks Suraj.

Mikey



Re: [PATCH] KVM: PPC: Book3S HV: Fix r3 corruption in h_set_dabr()

2019-06-12 Thread Suraj Jitindar Singh
On Thu, 2019-06-13 at 10:16 +1000, Michael Neuling wrote:
> On Wed, 2019-06-12 at 09:43 +0200, Cédric Le Goater wrote:
> > On 12/06/2019 09:22, Michael Neuling wrote:
> > > In commit c1fe190c0672 ("powerpc: Add force enable of DAWR on P9
> > > option") I screwed up some assembler and corrupted a pointer in
> > > r3. This resulted in crashes like the below from Cédric:
> > > 
> > >   [   44.374746] BUG: Kernel NULL pointer dereference at
> > > 0x13bf
> > >   [   44.374848] Faulting instruction address: 0xc010b044
> > >   [   44.374906] Oops: Kernel access of bad area, sig: 11 [#1]
> > >   [   44.374951] LE PAGE_SIZE=64K MMU=Radix MMU=Hash SMP
> > > NR_CPUS=2048 NUMA pSeries
> > >   [   44.375018] Modules linked in: vhost_net vhost tap
> > > xt_CHECKSUM iptable_mangle xt_MASQUERADE iptable_nat nf_nat
> > > xt_conntrack nf_conntrack nf_defrag_ipv6 libcrc32c nf_defrag_ipv4
> > > ipt_REJECT nf_reject_ipv4 xt_tcpudp bridge stp llc ebtable_filter
> > > ebtables ip6table_filter ip6_tables iptable_filter bpfilter
> > > vmx_crypto crct10dif_vpmsum crc32c_vpmsum kvm_hv kvm sch_fq_codel
> > > ip_tables x_tables autofs4 virtio_net net_failover virtio_scsi
> > > failover
> > >   [   44.375401] CPU: 8 PID: 1771 Comm: qemu-system-ppc Kdump:
> > > loaded Not tainted 5.2.0-rc4+ #3
> > >   [   44.375500] NIP:  c010b044 LR: c008089dacf4 CTR:
> > > c010aff4
> > >   [   44.375604] REGS: c0179b397710 TRAP: 0300   Not
> > > tainted  (5.2.0-rc4+)
> > >   [   44.375691] MSR:  8280b033
> > >   CR: 42244842  XER: 
> > >   [   44.375815] CFAR: c010aff8 DAR: 13bf
> > > DSISR: 4200 IRQMASK: 0
> > >   [   44.375815] GPR00: c008089dd6bc c0179b3979a0
> > > c00808a04300 
> > >   [   44.375815] GPR04:  0003
> > > 2444b05d c017f11c45d0
> > >   [   44.375815] GPR08: 07803e018dfe 0028
> > > 0001 0075
> > >   [   44.375815] GPR12: c010aff4 c7ff6300
> > >  
> > >   [   44.375815] GPR16:  c017f11d
> > >  c017f11ca7a8
> > >   [   44.375815] GPR20: c017f11c42ec 
> > >  000a
> > >   [   44.375815] GPR24: fffc 
> > > c017f11c c1a77ed8
> > >   [   44.375815] GPR28: c0179af7 fffc
> > > c008089ff170 c0179ae88540
> > >   [   44.376673] NIP [c010b044]
> > > kvmppc_h_set_dabr+0x50/0x68
> > >   [   44.376754] LR [c008089dacf4]
> > > kvmppc_pseries_do_hcall+0xa3c/0xeb0 [kvm_hv]
> > >   [   44.376849] Call Trace:
> > >   [   44.376886] [c0179b3979a0] [c017f11c]
> > > 0xc017f11c (unreliable)
> > >   [   44.376982] [c0179b397a10] [c008089dd6bc]
> > > kvmppc_vcpu_run_hv+0x694/0xec0 [kvm_hv]
> > >   [   44.377084] [c0179b397ae0] [c008093f8bcc]
> > > kvmppc_vcpu_run+0x34/0x48 [kvm]
> > >   [   44.377185] [c0179b397b00] [c008093f522c]
> > > kvm_arch_vcpu_ioctl_run+0x2f4/0x400 [kvm]
> > >   [   44.377286] [c0179b397b90] [c008093e3618]
> > > kvm_vcpu_ioctl+0x460/0x850 [kvm]
> > >   [   44.377384] [c0179b397d00] [c04ba6c4]
> > > do_vfs_ioctl+0xe4/0xb40
> > >   [   44.377464] [c0179b397db0] [c04bb1e4]
> > > ksys_ioctl+0xc4/0x110
> > >   [   44.377547] [c0179b397e00] [c04bb258]
> > > sys_ioctl+0x28/0x80
> > >   [   44.377628] [c0179b397e20] [c000b888]
> > > system_call+0x5c/0x70
> > >   [   44.377712] Instruction dump:
> > >   [   44.377765] 4082fff4 4c00012c 3860 4e800020 e96280c0
> > > 896b 2c2b 3860
> > >   [   44.377862] 4d820020 50852e74 508516f6 78840724 
> > > f8a313c8 7c942ba6 7cbc2ba6
> > > 
> > > This fixes the problem by only changing r3 when we are returning
> > > immediately.
> > > 
> > > Signed-off-by: Michael Neuling 
> > > Reported-by: Cédric Le Goater 
> > 
> > On nested, I still see : 
> > 
> > [   94.609274] Oops: Exception in kernel mode, sig: 4 [#1]
> > [   94.609432] LE PAGE_SIZE=64K MMU=Radix MMU=Hash SMP NR_CPUS=2048
> > NUMA pSeries
> > [   94.609596] Modules linked in: vhost_net vhost tap xt_CHECKSUM
> > iptable_mangle xt_MASQUERADE iptable_nat nf_nat xt_conntrack
> > nf_conntrack nf_defrag_ipv6 libcrc32c nf_defrag_ipv4 ipt_REJECT
> > nf_reject_ipv4 xt_tcpudp bridge stp llc ebtable_filter ebtables
> > ip6table_filter ip6_tables iptable_filter bpfilter vmx_crypto
> > kvm_hv crct10dif_vpmsum crc32c_vpmsum kvm sch_fq_codel ip_tables
> > x_tables autofs4 virtio_net virtio_scsi net_failover failover
> > [   94.610179] CPU: 12 PID: 2026 Comm: qemu-system-ppc Kdump:
> > loaded Not tainted 5.2.0-rc4+ #6
> > [   94.610290] NIP:  c010b050 LR: c00808bbacf4 CTR:
> > c010aff4
> > [   94.610400] REGS: c017913d7710 TRAP: 0700   Not
> > tainted  (5.2.0-rc4+)
> > [   94.610493] MSR:  8284b033
> >   CR: 42224842  

Re: [PATCH] KVM: PPC: Book3S HV: Fix r3 corruption in h_set_dabr()

2019-06-12 Thread Michael Neuling
On Wed, 2019-06-12 at 09:43 +0200, Cédric Le Goater wrote:
> On 12/06/2019 09:22, Michael Neuling wrote:
> > In commit c1fe190c0672 ("powerpc: Add force enable of DAWR on P9
> > option") I screwed up some assembler and corrupted a pointer in
> > r3. This resulted in crashes like the below from Cédric:
> > 
> >   [   44.374746] BUG: Kernel NULL pointer dereference at 0x13bf
> >   [   44.374848] Faulting instruction address: 0xc010b044
> >   [   44.374906] Oops: Kernel access of bad area, sig: 11 [#1]
> >   [   44.374951] LE PAGE_SIZE=64K MMU=Radix MMU=Hash SMP NR_CPUS=2048 NUMA 
> > pSeries
> >   [   44.375018] Modules linked in: vhost_net vhost tap xt_CHECKSUM 
> > iptable_mangle xt_MASQUERADE iptable_nat nf_nat xt_conntrack nf_conntrack 
> > nf_defrag_ipv6 libcrc32c nf_defrag_ipv4 ipt_REJECT nf_reject_ipv4 xt_tcpudp 
> > bridge stp llc ebtable_filter ebtables ip6table_filter ip6_tables 
> > iptable_filter bpfilter vmx_crypto crct10dif_vpmsum crc32c_vpmsum kvm_hv 
> > kvm sch_fq_codel ip_tables x_tables autofs4 virtio_net net_failover 
> > virtio_scsi failover
> >   [   44.375401] CPU: 8 PID: 1771 Comm: qemu-system-ppc Kdump: loaded Not 
> > tainted 5.2.0-rc4+ #3
> >   [   44.375500] NIP:  c010b044 LR: c008089dacf4 CTR: 
> > c010aff4
> >   [   44.375604] REGS: c0179b397710 TRAP: 0300   Not tainted  
> > (5.2.0-rc4+)
> >   [   44.375691] MSR:  8280b033   
> > CR: 42244842  XER: 
> >   [   44.375815] CFAR: c010aff8 DAR: 13bf DSISR: 
> > 4200 IRQMASK: 0
> >   [   44.375815] GPR00: c008089dd6bc c0179b3979a0 c00808a04300 
> > 
> >   [   44.375815] GPR04:  0003 2444b05d 
> > c017f11c45d0
> >   [   44.375815] GPR08: 07803e018dfe 0028 0001 
> > 0075
> >   [   44.375815] GPR12: c010aff4 c7ff6300  
> > 
> >   [   44.375815] GPR16:  c017f11d  
> > c017f11ca7a8
> >   [   44.375815] GPR20: c017f11c42ec   
> > 000a
> >   [   44.375815] GPR24: fffc  c017f11c 
> > c1a77ed8
> >   [   44.375815] GPR28: c0179af7 fffc c008089ff170 
> > c0179ae88540
> >   [   44.376673] NIP [c010b044] kvmppc_h_set_dabr+0x50/0x68
> >   [   44.376754] LR [c008089dacf4] kvmppc_pseries_do_hcall+0xa3c/0xeb0 
> > [kvm_hv]
> >   [   44.376849] Call Trace:
> >   [   44.376886] [c0179b3979a0] [c017f11c] 0xc017f11c 
> > (unreliable)
> >   [   44.376982] [c0179b397a10] [c008089dd6bc] 
> > kvmppc_vcpu_run_hv+0x694/0xec0 [kvm_hv]
> >   [   44.377084] [c0179b397ae0] [c008093f8bcc] 
> > kvmppc_vcpu_run+0x34/0x48 [kvm]
> >   [   44.377185] [c0179b397b00] [c008093f522c] 
> > kvm_arch_vcpu_ioctl_run+0x2f4/0x400 [kvm]
> >   [   44.377286] [c0179b397b90] [c008093e3618] 
> > kvm_vcpu_ioctl+0x460/0x850 [kvm]
> >   [   44.377384] [c0179b397d00] [c04ba6c4] 
> > do_vfs_ioctl+0xe4/0xb40
> >   [   44.377464] [c0179b397db0] [c04bb1e4] ksys_ioctl+0xc4/0x110
> >   [   44.377547] [c0179b397e00] [c04bb258] sys_ioctl+0x28/0x80
> >   [   44.377628] [c0179b397e20] [c000b888] system_call+0x5c/0x70
> >   [   44.377712] Instruction dump:
> >   [   44.377765] 4082fff4 4c00012c 3860 4e800020 e96280c0 896b 
> > 2c2b 3860
> >   [   44.377862] 4d820020 50852e74 508516f6 78840724  f8a313c8 
> > 7c942ba6 7cbc2ba6
> > 
> > This fixes the problem by only changing r3 when we are returning
> > immediately.
> > 
> > Signed-off-by: Michael Neuling 
> > Reported-by: Cédric Le Goater 
> 
> On nested, I still see : 
> 
> [   94.609274] Oops: Exception in kernel mode, sig: 4 [#1]
> [   94.609432] LE PAGE_SIZE=64K MMU=Radix MMU=Hash SMP NR_CPUS=2048 NUMA 
> pSeries
> [   94.609596] Modules linked in: vhost_net vhost tap xt_CHECKSUM 
> iptable_mangle xt_MASQUERADE iptable_nat nf_nat xt_conntrack nf_conntrack 
> nf_defrag_ipv6 libcrc32c nf_defrag_ipv4 ipt_REJECT nf_reject_ipv4 xt_tcpudp 
> bridge stp llc ebtable_filter ebtables ip6table_filter ip6_tables 
> iptable_filter bpfilter vmx_crypto kvm_hv crct10dif_vpmsum crc32c_vpmsum kvm 
> sch_fq_codel ip_tables x_tables autofs4 virtio_net virtio_scsi net_failover 
> failover
> [   94.610179] CPU: 12 PID: 2026 Comm: qemu-system-ppc Kdump: loaded Not 
> tainted 5.2.0-rc4+ #6
> [   94.610290] NIP:  c010b050 LR: c00808bbacf4 CTR: 
> c010aff4
> [   94.610400] REGS: c017913d7710 TRAP: 0700   Not tainted  (5.2.0-rc4+)
> [   94.610493] MSR:  8284b033   CR: 
> 42224842  XER: 
> [   94.610671] CFAR: c010b030 IRQMASK: 0 
> [   94.610671] GPR00: c00808bbd6bc c017913d79a0 c00808be4300 
> c01791376220 
> [   94.610671] GPR04:  0003 f679892e 
> 

Re: [PATCH] KVM: PPC: Book3S HV: Fix r3 corruption in h_set_dabr()

2019-06-12 Thread Christophe Leroy




Le 12/06/2019 à 11:23, Paul Mackerras a écrit :

On Wed, Jun 12, 2019 at 09:42:52AM +0200, Christophe Leroy wrote:



Le 12/06/2019 à 09:22, Michael Neuling a écrit :

In commit c1fe190c0672 ("powerpc: Add force enable of DAWR on P9
option") I screwed up some assembler and corrupted a pointer in
r3. This resulted in crashes like the below from Cédric:


Iaw Documentation/process/submitting-patches.rst:

Describe your changes in imperative mood, e.g. "make xyzzy do frotz"
instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy
to do frotz", as if you are giving orders to the codebase to change
its behaviour.

So you could rephrase as follows for instance:

Commit  ("") screwed up some assembler 


That advice in submitting-patches.rst is certainly appropriate when
talking about the actual change that the patch makes.  However, it is
also appropriate to give descriptive background material that helps
the reader to understand why the change is necessary -- in this case,
where and how the bug was introduced.  So I'm going to support Mikey
as regards his first few paragraphs.


Does it really matter knowing that it is Mikey who screwed up the 
assembler ? For me what's important is to know which commit introduced 
the error, not who made the error, isn't it ?


Christophe



I agree that the last paragraph that says "This fixes the bug by ..."
could be reworded as "Fix the bug by ...".

Paul.



Re: [PATCH] KVM: PPC: Book3S HV: Fix r3 corruption in h_set_dabr()

2019-06-12 Thread Paul Mackerras
On Wed, Jun 12, 2019 at 09:42:52AM +0200, Christophe Leroy wrote:
> 
> 
> Le 12/06/2019 à 09:22, Michael Neuling a écrit :
> >In commit c1fe190c0672 ("powerpc: Add force enable of DAWR on P9
> >option") I screwed up some assembler and corrupted a pointer in
> >r3. This resulted in crashes like the below from Cédric:
> 
> Iaw Documentation/process/submitting-patches.rst:
> 
> Describe your changes in imperative mood, e.g. "make xyzzy do frotz"
> instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy
> to do frotz", as if you are giving orders to the codebase to change
> its behaviour.
> 
> So you could rephrase as follows for instance:
> 
> Commit  ("") screwed up some assembler 

That advice in submitting-patches.rst is certainly appropriate when
talking about the actual change that the patch makes.  However, it is
also appropriate to give descriptive background material that helps
the reader to understand why the change is necessary -- in this case,
where and how the bug was introduced.  So I'm going to support Mikey
as regards his first few paragraphs.

I agree that the last paragraph that says "This fixes the bug by ..."
could be reworded as "Fix the bug by ...".

Paul.


Re: [PATCH] KVM: PPC: Book3S HV: Fix r3 corruption in h_set_dabr()

2019-06-12 Thread Cédric Le Goater
On 12/06/2019 09:22, Michael Neuling wrote:
> In commit c1fe190c0672 ("powerpc: Add force enable of DAWR on P9
> option") I screwed up some assembler and corrupted a pointer in
> r3. This resulted in crashes like the below from Cédric:
> 
>   [   44.374746] BUG: Kernel NULL pointer dereference at 0x13bf
>   [   44.374848] Faulting instruction address: 0xc010b044
>   [   44.374906] Oops: Kernel access of bad area, sig: 11 [#1]
>   [   44.374951] LE PAGE_SIZE=64K MMU=Radix MMU=Hash SMP NR_CPUS=2048 NUMA 
> pSeries
>   [   44.375018] Modules linked in: vhost_net vhost tap xt_CHECKSUM 
> iptable_mangle xt_MASQUERADE iptable_nat nf_nat xt_conntrack nf_conntrack 
> nf_defrag_ipv6 libcrc32c nf_defrag_ipv4 ipt_REJECT nf_reject_ipv4 xt_tcpudp 
> bridge stp llc ebtable_filter ebtables ip6table_filter ip6_tables 
> iptable_filter bpfilter vmx_crypto crct10dif_vpmsum crc32c_vpmsum kvm_hv kvm 
> sch_fq_codel ip_tables x_tables autofs4 virtio_net net_failover virtio_scsi 
> failover
>   [   44.375401] CPU: 8 PID: 1771 Comm: qemu-system-ppc Kdump: loaded Not 
> tainted 5.2.0-rc4+ #3
>   [   44.375500] NIP:  c010b044 LR: c008089dacf4 CTR: 
> c010aff4
>   [   44.375604] REGS: c0179b397710 TRAP: 0300   Not tainted  (5.2.0-rc4+)
>   [   44.375691] MSR:  8280b033   
> CR: 42244842  XER: 
>   [   44.375815] CFAR: c010aff8 DAR: 13bf DSISR: 4200 
> IRQMASK: 0
>   [   44.375815] GPR00: c008089dd6bc c0179b3979a0 c00808a04300 
> 
>   [   44.375815] GPR04:  0003 2444b05d 
> c017f11c45d0
>   [   44.375815] GPR08: 07803e018dfe 0028 0001 
> 0075
>   [   44.375815] GPR12: c010aff4 c7ff6300  
> 
>   [   44.375815] GPR16:  c017f11d  
> c017f11ca7a8
>   [   44.375815] GPR20: c017f11c42ec   
> 000a
>   [   44.375815] GPR24: fffc  c017f11c 
> c1a77ed8
>   [   44.375815] GPR28: c0179af7 fffc c008089ff170 
> c0179ae88540
>   [   44.376673] NIP [c010b044] kvmppc_h_set_dabr+0x50/0x68
>   [   44.376754] LR [c008089dacf4] kvmppc_pseries_do_hcall+0xa3c/0xeb0 
> [kvm_hv]
>   [   44.376849] Call Trace:
>   [   44.376886] [c0179b3979a0] [c017f11c] 0xc017f11c 
> (unreliable)
>   [   44.376982] [c0179b397a10] [c008089dd6bc] 
> kvmppc_vcpu_run_hv+0x694/0xec0 [kvm_hv]
>   [   44.377084] [c0179b397ae0] [c008093f8bcc] 
> kvmppc_vcpu_run+0x34/0x48 [kvm]
>   [   44.377185] [c0179b397b00] [c008093f522c] 
> kvm_arch_vcpu_ioctl_run+0x2f4/0x400 [kvm]
>   [   44.377286] [c0179b397b90] [c008093e3618] 
> kvm_vcpu_ioctl+0x460/0x850 [kvm]
>   [   44.377384] [c0179b397d00] [c04ba6c4] do_vfs_ioctl+0xe4/0xb40
>   [   44.377464] [c0179b397db0] [c04bb1e4] ksys_ioctl+0xc4/0x110
>   [   44.377547] [c0179b397e00] [c04bb258] sys_ioctl+0x28/0x80
>   [   44.377628] [c0179b397e20] [c000b888] system_call+0x5c/0x70
>   [   44.377712] Instruction dump:
>   [   44.377765] 4082fff4 4c00012c 3860 4e800020 e96280c0 896b 
> 2c2b 3860
>   [   44.377862] 4d820020 50852e74 508516f6 78840724  f8a313c8 
> 7c942ba6 7cbc2ba6
> 
> This fixes the problem by only changing r3 when we are returning
> immediately.
> 
> Signed-off-by: Michael Neuling 
> Reported-by: Cédric Le Goater 

On nested, I still see : 

[   94.609274] Oops: Exception in kernel mode, sig: 4 [#1]
[   94.609432] LE PAGE_SIZE=64K MMU=Radix MMU=Hash SMP NR_CPUS=2048 NUMA pSeries
[   94.609596] Modules linked in: vhost_net vhost tap xt_CHECKSUM 
iptable_mangle xt_MASQUERADE iptable_nat nf_nat xt_conntrack nf_conntrack 
nf_defrag_ipv6 libcrc32c nf_defrag_ipv4 ipt_REJECT nf_reject_ipv4 xt_tcpudp 
bridge stp llc ebtable_filter ebtables ip6table_filter ip6_tables 
iptable_filter bpfilter vmx_crypto kvm_hv crct10dif_vpmsum crc32c_vpmsum kvm 
sch_fq_codel ip_tables x_tables autofs4 virtio_net virtio_scsi net_failover 
failover
[   94.610179] CPU: 12 PID: 2026 Comm: qemu-system-ppc Kdump: loaded Not 
tainted 5.2.0-rc4+ #6
[   94.610290] NIP:  c010b050 LR: c00808bbacf4 CTR: c010aff4
[   94.610400] REGS: c017913d7710 TRAP: 0700   Not tainted  (5.2.0-rc4+)
[   94.610493] MSR:  8284b033   CR: 
42224842  XER: 
[   94.610671] CFAR: c010b030 IRQMASK: 0 
[   94.610671] GPR00: c00808bbd6bc c017913d79a0 c00808be4300 
c01791376220 
[   94.610671] GPR04:  0003 f679892e 
c017911045d0 
[   94.610671] GPR08: 07803e018dfe 0028 0001 
0075 
[   94.610671] GPR12: c010aff4 c7ff1300  
 
[   94.610671] GPR16:  c0179111 

Re: [PATCH] KVM: PPC: Book3S HV: Fix r3 corruption in h_set_dabr()

2019-06-12 Thread Christophe Leroy




Le 12/06/2019 à 09:22, Michael Neuling a écrit :

In commit c1fe190c0672 ("powerpc: Add force enable of DAWR on P9
option") I screwed up some assembler and corrupted a pointer in
r3. This resulted in crashes like the below from Cédric:


Iaw Documentation/process/submitting-patches.rst:

Describe your changes in imperative mood, e.g. "make xyzzy do frotz"
instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy
to do frotz", as if you are giving orders to the codebase to change
its behaviour.

So you could rephrase as follows for instance:

Commit  ("") screwed up some assembler 



   [   44.374746] BUG: Kernel NULL pointer dereference at 0x13bf
   [   44.374848] Faulting instruction address: 0xc010b044
   [   44.374906] Oops: Kernel access of bad area, sig: 11 [#1]
   [   44.374951] LE PAGE_SIZE=64K MMU=Radix MMU=Hash SMP NR_CPUS=2048 NUMA 
pSeries
   [   44.375018] Modules linked in: vhost_net vhost tap xt_CHECKSUM 
iptable_mangle xt_MASQUERADE iptable_nat nf_nat xt_conntrack nf_conntrack 
nf_defrag_ipv6 libcrc32c nf_defrag_ipv4 ipt_REJECT nf_reject_ipv4 xt_tcpudp 
bridge stp llc ebtable_filter ebtables ip6table_filter ip6_tables 
iptable_filter bpfilter vmx_crypto crct10dif_vpmsum crc32c_vpmsum kvm_hv kvm 
sch_fq_codel ip_tables x_tables autofs4 virtio_net net_failover virtio_scsi 
failover
   [   44.375401] CPU: 8 PID: 1771 Comm: qemu-system-ppc Kdump: loaded Not 
tainted 5.2.0-rc4+ #3
   [   44.375500] NIP:  c010b044 LR: c008089dacf4 CTR: 
c010aff4
   [   44.375604] REGS: c0179b397710 TRAP: 0300   Not tainted  (5.2.0-rc4+)
   [   44.375691] MSR:  8280b033   CR: 
42244842  XER: 
   [   44.375815] CFAR: c010aff8 DAR: 13bf DSISR: 4200 
IRQMASK: 0
   [   44.375815] GPR00: c008089dd6bc c0179b3979a0 c00808a04300 

   [   44.375815] GPR04:  0003 2444b05d 
c017f11c45d0
   [   44.375815] GPR08: 07803e018dfe 0028 0001 
0075
   [   44.375815] GPR12: c010aff4 c7ff6300  

   [   44.375815] GPR16:  c017f11d  
c017f11ca7a8
   [   44.375815] GPR20: c017f11c42ec   
000a
   [   44.375815] GPR24: fffc  c017f11c 
c1a77ed8
   [   44.375815] GPR28: c0179af7 fffc c008089ff170 
c0179ae88540
   [   44.376673] NIP [c010b044] kvmppc_h_set_dabr+0x50/0x68
   [   44.376754] LR [c008089dacf4] kvmppc_pseries_do_hcall+0xa3c/0xeb0 
[kvm_hv]
   [   44.376849] Call Trace:
   [   44.376886] [c0179b3979a0] [c017f11c] 0xc017f11c 
(unreliable)
   [   44.376982] [c0179b397a10] [c008089dd6bc] 
kvmppc_vcpu_run_hv+0x694/0xec0 [kvm_hv]
   [   44.377084] [c0179b397ae0] [c008093f8bcc] 
kvmppc_vcpu_run+0x34/0x48 [kvm]
   [   44.377185] [c0179b397b00] [c008093f522c] 
kvm_arch_vcpu_ioctl_run+0x2f4/0x400 [kvm]
   [   44.377286] [c0179b397b90] [c008093e3618] 
kvm_vcpu_ioctl+0x460/0x850 [kvm]
   [   44.377384] [c0179b397d00] [c04ba6c4] do_vfs_ioctl+0xe4/0xb40
   [   44.377464] [c0179b397db0] [c04bb1e4] ksys_ioctl+0xc4/0x110
   [   44.377547] [c0179b397e00] [c04bb258] sys_ioctl+0x28/0x80
   [   44.377628] [c0179b397e20] [c000b888] system_call+0x5c/0x70
   [   44.377712] Instruction dump:
   [   44.377765] 4082fff4 4c00012c 3860 4e800020 e96280c0 896b 
2c2b 3860
   [   44.377862] 4d820020 50852e74 508516f6 78840724  f8a313c8 
7c942ba6 7cbc2ba6

This fixes the problem by only changing r3 when we are returning
immediately.

Signed-off-by: Michael Neuling 
Reported-by: Cédric Le Goater 
--
mpe: This is for 5.2 fixes


Then your commit log should include the following:

Fixes: c1fe190c0672 ("powerpc: Add force enable of DAWR on P9 option")

Christophe


---
  arch/powerpc/kvm/book3s_hv_rmhandlers.S | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S 
b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
index 139027c62d..f781ee1458 100644
--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
@@ -2519,8 +2519,10 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
LOAD_REG_ADDR(r11, dawr_force_enable)
lbz r11, 0(r11)
cmpdi   r11, 0
+   bne 3f
li  r3, H_HARDWARE
-   beqlr
+   blr
+3:
/* Emulate H_SET_DABR/X on P8 for the sake of compat mode guests */
rlwimi  r5, r4, 5, DAWRX_DR | DAWRX_DW
rlwimi  r5, r4, 2, DAWRX_WT