From patchwork Thu Sep 25 22:26:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andres Lagar-Cavilla X-Patchwork-Id: 4977771 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 2C9259F40A for ; Thu, 25 Sep 2014 22:27:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5EBAC202A1 for ; Thu, 25 Sep 2014 22:27:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7F3BF2027D for ; Thu, 25 Sep 2014 22:27:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751708AbaIYW1J (ORCPT ); Thu, 25 Sep 2014 18:27:09 -0400 Received: from mail-ob0-f202.google.com ([209.85.214.202]:62612 "EHLO mail-ob0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751568AbaIYW1I (ORCPT ); Thu, 25 Sep 2014 18:27:08 -0400 Received: by mail-ob0-f202.google.com with SMTP id wo20so1644971obc.3 for ; Thu, 25 Sep 2014 15:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=jE4PAwc3G1RLMhGjNP9VmZX5nUXNtZMEWLJfUWZfUsk=; b=RLiwE1ndEhmRjiIH3CMqKFtyeu8VBgnO6+83Hvnm+2TVB2Syz9RprB0B5RnXTaEdlb LgbA5hjEBdmBN67hTdaFBqK5TLSFdczBBUddcupN6++t4WeF1J9HUOvxCKFNQBISoGGX jlwT3cd3X/tZiIgxLQ7E8hyyPc/WdZIUw4tvWds2RhCB82vnR3rEVm5rVQBTWTDWPnb3 GoqFSYvLBS3fkMOkpnNMv20fgsHhYEL1ztbUpuzrCjvbH5iy1FC5WNJhbGg8kc4Xx5rL pPJH3cnznD5XOvvIvzc2m7T5qZC1159HMgBlDsU78S225GJUiem+oU9fmWMwD4qInvIg Ohvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jE4PAwc3G1RLMhGjNP9VmZX5nUXNtZMEWLJfUWZfUsk=; b=SsdKHzyKemkgvYzmHxuDimHcodu0TbHuf1JLrJJZC0znFhZqmN1v16hpF+D2MIxDLU jHK8W7G/OUZwo6RrasdlXuPjdcuZZWE4TPJR6yUVrB0DvQ6GU+bKPMpCSDnPxE6Gl/UI Rf44MpFrwos+lCrM/Wdke7S7TMXY08DSLukamA14xOA7BaQ9ACfg2I4TY/6eJKK0eVyf lmTA4lXcnr9LmoLbdqx/3xLFwXqOHUHDAl+mi8wufbhwzjImpQuebpI04IJy6BljDTiQ Abxun4maaghodSCjz187FzUxMKNYUU+GL+dmcyScUotakK3Q2YPNtr2wtqeLP2gJ5Wep 6R8w== X-Gm-Message-State: ALoCoQmIfZRHNBaiJUM6BCvDW8Et6dAGTuIFRmdZafno6CgF6oAowqOPlC5Fy3fWmI+hN9L2PS4F X-Received: by 10.182.213.105 with SMTP id nr9mr13135949obc.36.1411684027885; Thu, 25 Sep 2014 15:27:07 -0700 (PDT) Received: from corpmail-nozzle1-2.hot.corp.google.com ([100.108.1.103]) by gmr-mx.google.com with ESMTPS id t28si205475yhb.4.2014.09.25.15.27.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Sep 2014 15:27:07 -0700 (PDT) Received: from sigsegv.mtv.corp.google.com ([172.17.131.1]) by corpmail-nozzle1-2.hot.corp.google.com with ESMTP id 9FwKpNfP.1; Thu, 25 Sep 2014 15:27:07 -0700 Received: by sigsegv.mtv.corp.google.com (Postfix, from userid 256548) id EB0C61206E1; Thu, 25 Sep 2014 15:27:06 -0700 (PDT) From: Andres Lagar-Cavilla To: Paolo Bonzini , Andrea Arcangeli , Gleb Natapov , kvm@vger.kernel.org Cc: Andres Lagar-Cavilla Subject: [PATCH] kvm: Fix kvm_get_page_retry_io __gup retval check Date: Thu, 25 Sep 2014 15:26:50 -0700 Message-Id: <1411684010-883-1-git-send-email-andreslc@google.com> X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, 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 Confusion around -EBUSY and zero (inside a BUG_ON no less). Reported-by: AndreA Arcangeli Signed-off-by: Andres Lagar-Cavilla Reviewed-by: Andrea Arcangeli --- virt/kvm/kvm_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 3f16f56..a1cf53e 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1146,7 +1146,7 @@ int kvm_get_user_page_io(struct task_struct *tsk, struct mm_struct *mm, npages = __get_user_pages(tsk, mm, addr, 1, flags, pagep, NULL, &locked); if (!locked) { - VM_BUG_ON(npages != -EBUSY); + VM_BUG_ON(npages); if (!pagep) return 0;