Thread (6 messages) 6 messages, 4 authors, 2017-03-29

Re: [PATCH] kvm: powerpc: book3s: Disable preemption while accessing paca xics_phys filed

From: Denis Kirjanov <kirjanov@gmail.com>
Date: 2017-03-29 09:45:18

On Wednesday, March 29, 2017, Paul Mackerras [off-list ref] wrote:
On Wed, Mar 29, 2017 at 12:07:03PM +1100, Michael Ellerman wrote:
quoted
Denis Kirjanov <kda@linux-powerpc.org <javascript:;>> writes:
[...]
quoted
quoted
@@ -3930,7 +3934,11 @@ static int kvmppc_book3s_init_hv(void)
     * indirectly, via OPAL.
     */
 #ifdef CONFIG_SMP
-   if (!get_paca()->kvm_hstate.xics_phys) {
+   preempt_disable();
+   xics_phys = get_paca()->kvm_hstate.xics_phys;
+   preempt_enable();
+
+   if (!xics_phys) {
            struct device_node *np;
Can you tell me what actual problem (other than the warning) this is
fixing?
If paca->kvm_hstate.xics_phys is non-zero on one cpu, it will be
non-zero on them all.  Therefore this is not fixing any actual
problem, just the warning.

By the way, the #ifdefs are ugly, and could be removed.  (Yes I know
it was me that put the first #ifdef in that function.)

Paul.
Then we can replace get_paca with local_paca to avoid the warning, right?


-- 
Regards / Mit besten Grüßen,
Denis
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help