Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2337438pxp; Mon, 21 Mar 2022 17:20:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYcmK9C5xiMWhjMTVWAZrMGfkpyBz1SRSIknaAXSOOSmgt/oEwsQD7X7xCFDid3FF4WBc8 X-Received: by 2002:a17:902:7613:b0:151:6e1c:c49c with SMTP id k19-20020a170902761300b001516e1cc49cmr15438783pll.109.1647908446028; Mon, 21 Mar 2022 17:20:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647908446; cv=none; d=google.com; s=arc-20160816; b=AWPBt5l2467r5cYspH6vt21OaiAzyzuYwP5z1eoPvQMwn1hUfnmQVcuuxl2OGk3kGO OElbzKugI1ccMO9tJzCUZHpwhHQzMc+okyV37YY+zeZFbO19m7oXKty+RzHukCHAfZ11 UbK4O9xELtwKjcUtcFI6whJWFUa1zhhxqUM1+eky468AnDHq007+cLXRszmeugx83ftf 1C9yVabNiK4YMSKKa3aRmqqCTqdsb1XM2VkBxIqzGpQ3HM+JBC+8CIzuHmIsyVXLjNKF Kr/Mm1fezpWGI4tb2w3MbZYpvSMCIStAp2BKr3w8I8R4JAC9VnWuUsGXn9FJgSuGHkjW M2+Q== 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=eaMpQz/2+gIGl1l/NaHHR9r8rELtroyMHUNp7EK/mzA=; b=alwbTADw4mDMzaZOE/SFzDG89nnDEsUUU8EYdw+ZQJk7FMpxXYzJEQ6IFZovYQOMip y1pe/GU4x0OOFZwTGGFVVtKpsbjnwvLSXldvb0qZjL1PWAcJbaJrLhbOyz+x/OkIwjFf eOiNTpLM5t4DDUDCmrhDiO5Peqaj0EVWipTnVNd3dNxLf7TCqyk+MhS1RK3FbB+Ex8Yx d7MZDRZImlpyeGRtKxUtOh6YnvlYAKl8RDWUTkEJLqZ61GcbdxIHisEYR5kH/hvM2vKr MdHBQE695ERHdVFBqDwdwqeb4OwmPGhbzl92gR+0e4i4H/5N+NuKmpiqkni4k1WXlo3R uLKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=jZYdyGLD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v12-20020a63bf0c000000b003816043eed4si14497982pgf.201.2022.03.21.17.20.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 17:20:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=jZYdyGLD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D3D3018A3EE; Mon, 21 Mar 2022 16:50:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233670AbiCUXvU (ORCPT + 99 others); Mon, 21 Mar 2022 19:51:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233615AbiCUXvB (ORCPT ); Mon, 21 Mar 2022 19:51:01 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F6091E7462 for ; Mon, 21 Mar 2022 16:49:08 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-2e5a3c1384cso132314827b3.4 for ; Mon, 21 Mar 2022 16:49:07 -0700 (PDT) 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=eaMpQz/2+gIGl1l/NaHHR9r8rELtroyMHUNp7EK/mzA=; b=jZYdyGLDT1rPNya0zYp8WpaU+7kOP6KdfhIGOZTmttYfnyNJYfBrtepboIJ5odwfrw /bkRPaq97VIIspJKNuKc7luPOnIcS0tV9iwcn9xP1ETSpPvv1m3pKyhPJPll3UysqUZy 13apm+c73YOVfmTCZGSkEnIID2JwLpUe3SNPXBTgn+pyLgl9Eo2v4InmS4VI0x5zWsyz S3RmYfjfHpSWZpKQQtm8v9rjfGPox7DtcBK0lvgS2QxrP4hQ19bE/ihH53tNnTy6dhFG jTn/LVRXjSC6RS81tHBse92oanoDwaJuqzH9s5V5nDtWXJvcN6RYPR99KNH4ekdPT98G JDJw== 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=eaMpQz/2+gIGl1l/NaHHR9r8rELtroyMHUNp7EK/mzA=; b=52jIHvMlgYwKQL9KqIJaSABvAhiNx0jchFjcOALYLEd5geLa0+BgGGhpPIDjYd51ML JwnkovNjHN0mr0BMTBlsaL8ReW1p5sK8Kb6kk3uT9fb+NxKKzP4JOV/4nFpv2LJMfsN5 r7golrC1M7sN5ogZaQnsqcYN/XNEFzAbOdJSbSD4XZFlkaxiafHbKafqgApIugDPxkhZ 1Q03cDw2uLFCH/xR/bydz7Ec3QkzhSYnyMLq/p/umq4LftmqycynL9n1zuQsD4kLEBnR Z213w57dTeXqadSFtrZzJvZZFvA45geWgQb8fHQjSTLpdmAMfwfeY0elZCFm8pBnaxXp Pydg== X-Gm-Message-State: AOAM532OUJiTox+Nop0jMOxL+Ersraym6XMwy7ohe31sL8eDOYvcVGk3 ePT1vW0kDhBsqPQWytmx7zvcXNCKek/JosyDS710XsKSRSHZgd6gmJN9Ald/yeGrWpL0s5Bm2Jj sCLymyk9/Cwd2R2y1tp434pbrYspTLVetsNoGx3VRjx77OVRF/+iRslP6d/SOBgAEGpX+BVoP X-Received: from bgardon.sea.corp.google.com ([2620:15c:100:202:b76a:f152:cb5e:5cd2]) (user=bgardon job=sendgmr) by 2002:a05:690c:11b:b0:2e6:529:d6b2 with SMTP id bd27-20020a05690c011b00b002e60529d6b2mr12866359ywb.345.1647906543992; Mon, 21 Mar 2022 16:49:03 -0700 (PDT) Date: Mon, 21 Mar 2022 16:48:38 -0700 In-Reply-To: <20220321234844.1543161-1-bgardon@google.com> Message-Id: <20220321234844.1543161-6-bgardon@google.com> Mime-Version: 1.0 References: <20220321234844.1543161-1-bgardon@google.com> X-Mailer: git-send-email 2.35.1.894.gb6a874cedc-goog Subject: [PATCH v2 05/11] KVM: selftests: 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.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 09742a787546..9d72d1bb34fa 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); + num, paddr_min, vm->page_size, memslot); fputs("---- vm dump ----\n", stderr); vm_dump(stderr, vm, 2); abort(); -- 2.35.1.894.gb6a874cedc-goog