From patchwork Sat Dec 17 03:09:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: xinhui X-Patchwork-Id: 9478853 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 835816082E for ; Sat, 17 Dec 2016 03:09:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DAF328638 for ; Sat, 17 Dec 2016 03:09:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F961285F8; Sat, 17 Dec 2016 03:09:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E041285F4 for ; Sat, 17 Dec 2016 03:09:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756119AbcLQDJc (ORCPT ); Fri, 16 Dec 2016 22:09:32 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46588 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750861AbcLQDJa (ORCPT ); Fri, 16 Dec 2016 22:09:30 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uBH37ubu141343 for ; Fri, 16 Dec 2016 22:09:29 -0500 Received: from e28smtp02.in.ibm.com (e28smtp02.in.ibm.com [125.16.236.2]) by mx0a-001b2d01.pphosted.com with ESMTP id 27cw6c02p4-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 16 Dec 2016 22:09:29 -0500 Received: from localhost by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 17 Dec 2016 08:39:25 +0530 Received: from d28dlp03.in.ibm.com (9.184.220.128) by e28smtp02.in.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 17 Dec 2016 08:39:24 +0530 Received: from d28relay07.in.ibm.com (d28relay07.in.ibm.com [9.184.220.158]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id BD512125804F; Sat, 17 Dec 2016 08:40:38 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay07.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uBH38ivw23527464; Sat, 17 Dec 2016 08:38:44 +0530 Received: from d28av04.in.ibm.com (localhost [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uBH39NQi016875; Sat, 17 Dec 2016 08:39:23 +0530 Received: from mmnipxh.local (sig-9-145-180-130.de.ibm.com [9.145.180.130]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id uBH39IQI016702; Sat, 17 Dec 2016 08:39:19 +0530 Subject: Re: [GIT PULL] KVM fixes for 4.10 merge window To: Linus Torvalds , Paolo Bonzini References: <1481907450-11741-1-git-send-email-pbonzini@redhat.com> Cc: Linux Kernel Mailing List , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , KVM list From: Pan Xinhui Date: Sat, 17 Dec 2016 11:09:16 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16121703-0004-0000-0000-00000504A7DC X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16121703-0005-0000-0000-0000128BE843 Message-Id: <0df8ceac-deeb-d3c2-630c-30f84d363873@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-12-17_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1612170055 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 在 2016/12/17 03:42, Linus Torvalds 写道: > On Fri, Dec 16, 2016 at 8:57 AM, Paolo Bonzini wrote: >> >> git://git.kernel.org/pub/scm/virt/kvm/kvm.git tags/for-linus > > This piece-of-shit branch has obviously never been even compile-tested: > > arch/x86/kernel/kvm.c: In function ‘__kvm_vcpu_is_preempted’: > arch/x86/kernel/kvm.c:596:14: error: ‘struct kvm_steal_time’ has no > member named ‘preempted’ > hi, Linus oh, my bad also. I introduce this struct member and use it in same patch. Better to separate tem into two patches. I make one fix patch below. sorry again. Hi, Paolo I have known where is th problem, I think if we can set this ->preempted later after preempted_enable() or just introduce something like write_guest_nosleep (per cpu memory section in guest, so there is no page_fault or any other cannot sleep problems)? thanks xinhui ----------------- From d4fa3ea0b8b6f3e5ff511604a4a6665d1cbb74c3 Mon Sep 17 00:00:00 2001 From: Pan Xinhui Date: Sat, 17 Dec 2016 02:56:33 -0500 Subject: [PATCH] kvm: fix compile issue we revert commit 0b9f6c4615c993d2b552e0d2bd1ade49b56e5beb which calls sleep function while preempt_disable on host part. But we remove struct kvm_steal_time::preempted too. This casues compile problem as both guest and host code use it. Fix it by adding struct kvm_steal_time::preempted back. Signed-off-by: Pan Xinhui --- arch/x86/include/uapi/asm/kvm_para.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/uapi/asm/kvm_para.h b/arch/x86/include/uapi/asm/kvm_para.h index 94dc8ca..1421a65 100644 --- a/arch/x86/include/uapi/asm/kvm_para.h +++ b/arch/x86/include/uapi/asm/kvm_para.h @@ -45,7 +45,9 @@ struct kvm_steal_time { __u64 steal; __u32 version; __u32 flags; - __u32 pad[12]; + __u8 preempted; + __u8 u8_pad[3]; + __u32 pad[11]; }; #define KVM_STEAL_ALIGNMENT_BITS 5