Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1580097

Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a callee-save function

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a callee-save function
Date 2017-02-13 23:00 +0100
Message-ID <tawP8-V7-31@gated-at.bofh.it> (permalink)
References (2 earlier) <t9mRR-6is-25@gated-at.bofh.it> <t9mRQ-6is-23@gated-at.bofh.it> <tammL-2yB-43@gated-at.bofh.it> <tamwq-2Cb-11@gated-at.bofh.it> <tavgm-8uf-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Feb 13, 2017 at 12:06:44PM -0800, hpa@zytor.com wrote:

> >Maybe:
> >
> >movsql %edi, %rax;
> >movq __per_cpu_offset(,%rax,8), %rax;
> >cmpb $0, %[offset](%rax);
> >setne %al;
> >
> >?
> 
> We could kill the zero or sign extend by changing the calling
> interface to pass an unsigned long instead of an int.  It is much more
> likely that a zero extend is free for the caller than a sign extend.

Right, Boris and me talked about that on IRC. I was wondering if the
argument was u32 if we could assume the top 32 bits are 0 and then use
rdi without prior movzx.

That would allow reducing the thing one more instruction.

Also, PVOP_CALL_ARG#() have an (unsigned long) cast in them that doesn't
make sense. That cast ends up resulting in the calling code doing
explicit sign or zero extends into the full 64bit register for no good
reason.

If one removes that cast things still compile, but I worry something
somehow relies on this weird behaviour and will come apart.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a callee-save function Waiman Long <longman@redhat.com> - 2017-02-10 17:00 +0100
  Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a  callee-save function Paolo Bonzini <pbonzini@redhat.com> - 2017-02-10 17:30 +0100
  Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a  callee-save function Peter Zijlstra <peterz@infradead.org> - 2017-02-10 17:30 +0100
    Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a  callee-save function Waiman Long <longman@redhat.com> - 2017-02-10 18:10 +0100
      Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a  callee-save function Peter Zijlstra <peterz@infradead.org> - 2017-02-13 11:50 +0100
        Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a  callee-save function Peter Zijlstra <peterz@infradead.org> - 2017-02-13 12:00 +0100
          Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a  callee-save function Waiman Long <longman@redhat.com> - 2017-02-13 20:50 +0100
            Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a  callee-save function Waiman Long <longman@redhat.com> - 2017-02-13 21:20 +0100
              Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a  callee-save function Peter Zijlstra <peterz@infradead.org> - 2017-02-13 23:00 +0100
                Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a callee-save function hpa@zytor.com - 2017-02-13 23:10 +0100
                Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a callee-save function hpa@zytor.com - 2017-02-13 23:20 +0100
                Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a  callee-save function Waiman Long <longman@redhat.com> - 2017-02-13 23:40 +0100
                Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a callee-save function hpa@zytor.com - 2017-02-13 23:50 +0100
                Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a  callee-save function Peter Zijlstra <peterz@infradead.org> - 2017-02-14 10:50 +0100
                Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a  callee-save function Waiman Long <longman@redhat.com> - 2017-02-14 15:50 +0100
                Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a  callee-save function Peter Zijlstra <peterz@infradead.org> - 2017-02-14 17:10 +0100
                Re: [Xen-devel] [PATCH v2] x86/paravirt: Don't make  vcpu_is_preempted() a callee-save function Andrew Cooper <andrew.cooper3@citrix.com> - 2017-02-14 17:20 +0100
          Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a callee-save function hpa@zytor.com - 2017-02-13 21:20 +0100
            Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a  callee-save function Peter Zijlstra <peterz@infradead.org> - 2017-02-13 23:00 +0100
            Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a  callee-save function Waiman Long <longman@redhat.com> - 2017-02-13 23:30 +0100
              Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a  callee-save function Peter Zijlstra <peterz@infradead.org> - 2017-02-13 23:40 +0100
        Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a  callee-save function Waiman Long <longman@redhat.com> - 2017-02-13 20:50 +0100
    Re: [PATCH v2] x86/paravirt: Don't make vcpu_is_preempted() a  callee-save function Waiman Long <longman@redhat.com> - 2017-02-10 19:10 +0100

csiph-web