public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: "Gabriel L. Somlo" <gsomlo@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, kvm@vger.kernel.org
Subject: Re: kvm-kmod and kernels 3.11.*
Date: Fri, 13 Dec 2013 17:26:56 +0100	[thread overview]
Message-ID: <52AB3550.10500@siemens.com> (raw)
In-Reply-To: <20131213161859.GB14762@ERROL.INI.CMU.EDU>

On 2013-12-13 17:19, Gabriel L. Somlo wrote:
> On Fri, Dec 13, 2013 at 04:36:07PM +0100, Jan Kiszka wrote:
>> On 2013-12-13 16:12, Paolo Bonzini wrote:
>>> I think the relevance of releases is ~zero.  kvm-kmod still remains
>>> extremely useful IMHO as a hacking tool.
>>
>> Exactly.
> 
> I agree. No idea how "Real KVM Hackers (tm)" do it, but this wannabe
> amateur KVM hacker couldn't pull it off without the safety blanket of
> his stock distro kernel (and kvm-kmod) :) So thanks again for
> maintaining it !
> 
>>> Agreed on this as well.  Personally I would be fine even with only 3-4
>>> releases backwards compatibility (e.g. 3.8) right now.
> 
> Same here. I tend to run up-to-date stock Fedoras that are still
> maintained (which right now means as old as F18, with its current
> kernel (which is 3.11.10). What's important to me is the ability
> to track the latest-and-greatest KVM master, but compile it against
> such a distro kernel. I've never had a need to use the releases.
> 
> Paolo, thanks for pointing out the "next" branch of kvm-kmod.
> 
> Using that, I still got an error when building against the latest KVM
> (commit 2e7babfa892a55588467ef03b545002e32f31528):
> 
>   CC [M]  /home/somlo/KVM-OSX/SCRATCH/kvm-kmod/x86/x86.o
> /home/somlo/KVM-OSX/SCRATCH/kvm-kmod/x86/x86.c: In function 'vcpu_enter_guest':
> /home/somlo/KVM-OSX/SCRATCH/kvm-kmod/x86/x86.c:6042:2: error: implicit declaration of function 'smp_mb__after_srcu_read_unlock' [-Werror=implicit-function-declaration]
> 
> 
> Adding the following string (cut'n'paste from kvm's srchu.h):
> 
> static inline void smp_mb__after_srcu_read_unlock(void) {}
> 
> to include-compat/linux/srcu.h didn't work, as apparently
> x86/x86.c doesn't want to include *our* srcu.h :(
> 
> So I tried to mimic the existing "sed" functionality of the "sync"
> script, and was was left deciding between excising the call to         smp_mb__after_srcu_read_unlock() from line 6009 of x86.c (since it's
> defined as a no-op in the header), or sed-ing in the declaration from
> the kvm srcu.h via the sync script. I think the latter is slightly less
> cheesy, but I'm really curious what you think would have been the
> "canonical" way to do this :)

In this case it is rather via external-module-compat-comm.h. I already
had a patch for this here, will now push it very soon.

sync is already pretty slow, we need to keep it short, possibly even
clean it up in the light of the new entry level (3.0).

Jan

> 
> With the patch below, kvm-kmod:next can build kvm modules from the
> latest/current kvm tree. I don't know if/how I can "update source link"
> by way of a patch, but 2e7babfa892a55588467ef03b545002e32f31528 works
> fine after applying the enclosed fix.
> 
> Thanks again,
> --Gabriel
> 
> 
> diff --git a/sync b/sync
> index c22ee9a..1a941b6 100755
> --- a/sync
> +++ b/sync
> @@ -337,6 +337,12 @@ def hack_content(fname, data):
>              w('\t.shrink = mmu_shrink,')
>              line = '#else'
>  
> +        if line == 'static int vcpu_enter_guest(struct kvm_vcpu *vcpu)':
> +            w('#if LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)')
> +            w('static inline void smp_mb__after_srcu_read_unlock(void) {}')
> +            w('#endif')
> +            w('')
> +
>          w(line)
>  
>          if line == '\t.scan_objects = mmu_shrink_scan,':
> 

-- 
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux

      parent reply	other threads:[~2013-12-13 16:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-12 21:27 kvm-kmod and kernels 3.11.* Gabriel L. Somlo
2013-12-12 21:59 ` Paolo Bonzini
2013-12-13 15:04   ` Jan Kiszka
2013-12-13 15:12     ` Paolo Bonzini
2013-12-13 15:36       ` Jan Kiszka
2013-12-13 16:19         ` Gabriel L. Somlo
2013-12-13 16:24           ` Paolo Bonzini
2013-12-13 16:26           ` Jan Kiszka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52AB3550.10500@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=gsomlo@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox