Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1652875pxp; Thu, 10 Mar 2022 09:24:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3J4JGjWP+7G15o5cR05sLSRnaSa5I+MGS62i04+HJkkq8EfbRHyF8gbN77DGlgxPDn1ld X-Received: by 2002:a17:90b:1652:b0:1bf:32e9:6db3 with SMTP id il18-20020a17090b165200b001bf32e96db3mr6207281pjb.179.1646933087525; Thu, 10 Mar 2022 09:24:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646933087; cv=none; d=google.com; s=arc-20160816; b=riQlF8HsysLoCnRLIqfZG/sX3pvw7HMcpqG5zRywdWdHWfY4BAiYO8JVx+eigToQAc idqK7a1fu6AdwkYNpamvUdej5PtkqkosqksyBcQdZtMl35aswV3wpR5yoBc24UMlwuCS hzW7RW/n2oh+2CrHGeK7EMu5JJca4Wyx2JnvB7qIMu8cE9r+O0G+OO/0jk88RCaPrWEF G1FfzxQ2MNSov887JW/yxz46+AYTicXI0sx6MevA75+GTbGIJA6ztSlxpBkrJWE2BOXz hdwmcU6qPc/qSzeJvs0nD5ODQ1FYRXVs9REu6w5Ka+5r5gVuiGUi8PRpeha9nArmyKCL 1LDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=ZtMt2wyNKjtAiC88Q9bMZ9sXYSFZv/d9rVnBJi58YjE=; b=rQ704EOP7CHffL3q7A4IRDfofHaYwMwWh/6/eS5zPiWUzyyx1B5KdBgq6udIT7gHDK hfJEB4zbrjHb9jtU3xTA/w6qSGiM1N4eMK9n4JvRDu/GCuOwKuXIYukSWo7S7RnGQny6 GZhUs2N4MUarWdG9i/YJuGJpNqASnIu2xemMX+UhlmYJwdY7VkL/bsf74k0m89HJa3CH SzCxs5Xy8/QA54JIm7WFZuBmTR3foepqsDfdd6pVaGBw+Oa9PNvH1PqduymH7lTGOKo5 hIGC4Vu/kl9ICqzRaC+DT2ypjU3Oqjps9SzGWRiekugeM1LTQJX7uWrbO8fYlqqxnEwd doWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=kF1znJ85; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d7-20020a17090a628700b001bd14e0307esi2462929pjj.86.2022.03.10.09.24.31; Thu, 10 Mar 2022 09:24:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=kF1znJ85; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244149AbiCJQrg (ORCPT + 99 others); Thu, 10 Mar 2022 11:47:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238181AbiCJQrM (ORCPT ); Thu, 10 Mar 2022 11:47:12 -0500 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FB0F1688C6 for ; Thu, 10 Mar 2022 08:46:03 -0800 (PST) Received: by mail-pg1-x549.google.com with SMTP id q7-20020a63e207000000b003801b9bb18dso3211515pgh.15 for ; Thu, 10 Mar 2022 08:46:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=ZtMt2wyNKjtAiC88Q9bMZ9sXYSFZv/d9rVnBJi58YjE=; b=kF1znJ85tnfKN1AqdnzwfECAQ2Bujq/sYB5jsXv9223OEp8oLI7a4GjXMMqiXdJKwt XHQV3yyoMv/foJR1ICm6OepAwP6nQRV8LErs/I5gGumDWU9qzwjTbRTW9HCR0PWgqlB6 x8vNVZLqVGy4eHLzBawQNrARD/WxTyRhjgI0bjLQqJrLR6X/F3L+HVwfArLVEC7cniWG 7SH/D9MddLJkIEnASvtVy9Mo6CLqaZoFYjpXIH5hBRa/UrxhjeqnwXd0mw+5K2HBtRrx 7giUtfK0uwxO9EitJUz30MABR9jtP1s0OzhBmWmD+N8hOkBUrnF9WOvqqhVh0Gts5EHk VFbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=ZtMt2wyNKjtAiC88Q9bMZ9sXYSFZv/d9rVnBJi58YjE=; b=2/T+HOm5eSwbBYUH+PnS/Dn1tskh+K+F4ZDbRKihI/pCo7keS67i54m/Mk6D+1YBDe pk1y00MvApiEbMZKjcTgmfG1e2FGhoyUkKyvU1FUJZtowPML0/LEFqiyhkREqnhFzRnC lEzuQbOGtdD0rG8MbIKQzeARzR239F7AvPMD4HDWU0N+ueriI64dPaGF7QHL17zmlSA8 VhpI1xEMrcGoeIWdQzs4vt+9VpNyWipeqDPMZj6XuKh18AIfaqTPsfF9z+rCJ48amDwL 4mRIbA6+bMHyv9oXLVWbH+jFtMnuVFLL23urHxCtHqVN7eocoVYhJtXpD3t6ZPdBDUdG gPiw== X-Gm-Message-State: AOAM533xhHlXEJjZV52g3xTMxi4qKmD/kR9fo6RA63NCzL2fr54ToPxg Y7uVp00XE+ZI31aerdYAvtpGCbpM71+Zq8sV5I9jDXbA8X2T+0hO8MJI+9epAHaWyzXsyIC+NMl OadomHv9BZcnMjvx5S/vTqa2Jx3NtJ5XZHkZWlacgiisF/HJ98bM4KTVKz2/CzOXxNWkfplJD X-Received: from bgardon.sea.corp.google.com ([2620:15c:100:202:2d58:733f:1853:8e86]) (user=bgardon job=sendgmr) by 2002:a05:6a00:2296:b0:4e1:905f:46b6 with SMTP id f22-20020a056a00229600b004e1905f46b6mr5914762pfe.16.1646930762732; Thu, 10 Mar 2022 08:46:02 -0800 (PST) Date: Thu, 10 Mar 2022 08:45:25 -0800 In-Reply-To: <20220310164532.1821490-1-bgardon@google.com> Message-Id: <20220310164532.1821490-7-bgardon@google.com> Mime-Version: 1.0 References: <20220310164532.1821490-1-bgardon@google.com> X-Mailer: git-send-email 2.35.1.616.g0bdcbb4464-goog Subject: [PATCH 06/13] selftests: KVM: Improve error message in vm_phy_pages_alloc From: Ben Gardon To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Paolo Bonzini , Peter Xu , Sean Christopherson , David Matlack , Jim Mattson , David Dunn , Jing Zhang , Junaid Shahid , Ben Gardon Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make an error message in vm_phy_pages_alloc more specific, and log the number of pages requested in the allocation. Signed-off-by: Ben Gardon --- tools/testing/selftests/kvm/lib/kvm_util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c index a10bee651191..f9591dad1010 100644 --- a/tools/testing/selftests/kvm/lib/kvm_util.c +++ b/tools/testing/selftests/kvm/lib/kvm_util.c @@ -2408,9 +2408,10 @@ vm_paddr_t vm_phy_pages_alloc(struct kvm_vm *vm, size_t num, } while (pg && pg != base + num); if (pg == 0) { - fprintf(stderr, "No guest physical page available, " + fprintf(stderr, + "Unable to find %ld contiguous guest physical pages. " "paddr_min: 0x%lx page_size: 0x%x memslot: %u\n", - paddr_min, vm->page_size, memslot.id); + num, paddr_min, vm->page_size, memslot.id); fputs("---- vm dump ----\n", stderr); vm_dump(stderr, vm, 2); abort(); -- 2.35.1.616.g0bdcbb4464-goog