From patchwork Fri Dec 13 16:19:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel L. Somlo" X-Patchwork-Id: 3341381 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B44959F243 for ; Fri, 13 Dec 2013 16:19:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0AC7F20790 for ; Fri, 13 Dec 2013 16:19:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D29FC2078F for ; Fri, 13 Dec 2013 16:19:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752721Ab3LMQTJ (ORCPT ); Fri, 13 Dec 2013 11:19:09 -0500 Received: from mail-qc0-f169.google.com ([209.85.216.169]:43760 "EHLO mail-qc0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752252Ab3LMQTI convert rfc822-to-8bit (ORCPT ); Fri, 13 Dec 2013 11:19:08 -0500 Received: by mail-qc0-f169.google.com with SMTP id r5so1696781qcx.0 for ; Fri, 13 Dec 2013 08:19:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=3Y/CAOHfGvRHnPrUkDjlIjgCn5+fq/CM5pmQDEL9SX4=; b=iqkTzA+IOcB2ukO96noWqk3pgH2k8W6JtPnKkv9SXJUsJxAmpO9hhVbCxiGa2MyZHc ueHwZJmiAvFnf6hDt349LWBLCS6JiUipafozgp7qa7mJsDYAPGVLWIbtH7iMB+QlTrxn Q53C2+bI6879/2ee2+4BAiMKa6x7BC45rzknMCpyONyRs7K0Wycl4y1FWz/ABzDeIFbN 4FZt2N9awo/aHZrsHhvbs3jolBgD1edTbZnMD5tOvM0UK5mUxGsANfngMQrYsxO0fs/2 HDzN8t9vbb/RH2qp2Hz4t61NqpxZNwn3FPb7h8kn5BC35YvXfNSwwYE5Erlg+41W76b9 rldQ== X-Received: by 10.49.12.102 with SMTP id x6mr6066819qeb.5.1386951547328; Fri, 13 Dec 2013 08:19:07 -0800 (PST) Received: from ERROL.INI.CMU.EDU (ERROL.INI.CMU.EDU. [128.2.16.43]) by mx.google.com with ESMTPSA id lc1sm7747852qeb.5.2013.12.13.08.19.06 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 13 Dec 2013 08:19:06 -0800 (PST) Date: Fri, 13 Dec 2013 11:19:00 -0500 From: "Gabriel L. Somlo" To: Jan Kiszka Cc: Paolo Bonzini , kvm@vger.kernel.org Subject: Re: kvm-kmod and kernels 3.11.* Message-ID: <20131213161859.GB14762@ERROL.INI.CMU.EDU> References: <20131212212713.GA14762@ERROL.INI.CMU.EDU> <52AA31A8.4010806@redhat.com> <52AB21F2.1030005@siemens.com> <52AB23DF.2000509@redhat.com> <52AB2967.8000207@siemens.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <52AB2967.8000207@siemens.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 :) 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 --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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,':