Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2211192pxb; Wed, 30 Mar 2022 19:28:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyK8GXBT75SDMfQ4TqMizCOUmU99jCPasJg7pWEaFF56cs0KZfrUriDf4MLK6luRIGZ0ofz X-Received: by 2002:a17:90b:4b8a:b0:1c7:24c4:e28c with SMTP id lr10-20020a17090b4b8a00b001c724c4e28cmr3419804pjb.39.1648693680661; Wed, 30 Mar 2022 19:28:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648693680; cv=none; d=google.com; s=arc-20160816; b=J+MJTbhh34yn1MZOGWB4fis3tJW63kfvhEy6BaRq45asqmfEBtE+nxWDx4vKoMCIKD /MUB1yRkinKHrEaj++K0BBANOl6RTQPKhLoqK6xXatdC/A7pIh7keU5ABW8y3LQG9sI6 xW5rrasivc8OhB08EUCZod+qJYL56yqeVCNoY44Vdf3Y2StaYPRMxYzwnza4wEoMsc50 7/8R5a8loRYSOYUj8983zZ6MEpyJU6vpS2SiEGkgIs5pVRbY5+aowaQu9E9WaFyi8yML VVjpZjO1qKGXtUQSHvRJ9gsgcVS/cnKYko5y2qMBY5vRH0b3VmC2N5PIUb3yeMXVUe+E Fz4Q== 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=gp5/oqbk2fI6DwAcVjqyKO14WoJq46+G4sTbdYNQ4HM=; b=jpMl6Cdf9WAEnaoCdJAeWIth5s/kSKkpX8sYlAqV4n2CgnFoN1FmoBIBCj/4q+CE35 4a2Zj/oOZCx0pUwKj3PBJ8NmKI4njp15sPFnpAAKZkIxb92YK2Y/k0ATxTOQU9qraGtc AbO1JBnDcGIUGQWwMjRc9qKt0F0YMRjobp3ev7BJzYszqedrpyihE5CN04FZI8njwpuf drsmX0NuYdaLQu8C2acMYOD7BT0KD2+1PMzpgxR715as+3T0wVlr//naySvGUVCt4zfN PdSNOwKprMu+zHqrAfXpz9bIKRMdIF8OokPtoAM/1iRufXWH4VyDUrKe9z+8VRY/1jqx 9ZLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=QOLiRpew; 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 by15-20020a056a00400f00b004fa3a8e003fsi22354071pfb.246.2022.03.30.19.28.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 19:28:00 -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=QOLiRpew; 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 9B0466C951; Wed, 30 Mar 2022 19:26:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349501AbiC3Rsn (ORCPT + 99 others); Wed, 30 Mar 2022 13:48:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349611AbiC3RsV (ORCPT ); Wed, 30 Mar 2022 13:48:21 -0400 Received: from mail-pj1-x104a.google.com (mail-pj1-x104a.google.com [IPv6:2607:f8b0:4864:20::104a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD75D1EB for ; Wed, 30 Mar 2022 10:46:36 -0700 (PDT) Received: by mail-pj1-x104a.google.com with SMTP id e15-20020a17090ab38f00b001c9989ae56cso260029pjr.9 for ; Wed, 30 Mar 2022 10:46:36 -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=gp5/oqbk2fI6DwAcVjqyKO14WoJq46+G4sTbdYNQ4HM=; b=QOLiRpewW+t88OqSkBE63r2/Xntuf79cBo45qAE8JYSTK0gFn6pzIKL1x9gluakFAy fPCYzPwzm2OcKUaY49IZhe79HyD30+YtjVSc316U++wqEoBw5ipIoT8qVtRmIv+f9CGJ Ey41djoQ4ewLWYggnso4f50BhAeBb4vRooLgOM4aaQNuLMVVyAEbE6dOmNJqiROnrONH PwPJeerDRoceKY0rFF/V4yjJtcdzniRUtVff57IhatmV5yHuDCJ5K9BWdsSxNB8JGuWH aOushq/lf3mdpFZFFSQmzEUx5RCnFn07Av4Nv8ANl/gO3JThCAdYl96vwWXZ05p/II6b cNhw== 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=gp5/oqbk2fI6DwAcVjqyKO14WoJq46+G4sTbdYNQ4HM=; b=fk99DUfPPo2mLN8CHJDpCeV+Cut0RkInhpKRCApV8pY4mUFOlkj9ILoN6T+mGaFxDl CEE+pZ56vRy28TcBJTr3ujC4nX5+GM+zkyKUW1EHmyO71Cb9KfHekTgM1TbCrl9UPeFw 6IkQqERp6Hq+qIZkLgoSd+Fo4YmrtQrqSH7rPgOTBTnhxY+KD/q5knnCRis1DGSUe/sl ex7NJt7lerHdu7O+NtFmNiOBWX3m1ikY+MoTrf8uJ8LA+mkcaeuuYjkZ3q6tpnUiBCQQ KixKuuDBJjlhIM/GwWHRDmCYdXmESIAY3KDEt97wfiqAVGRLbP1qJlno93jEO09XlyTU Ty9Q== X-Gm-Message-State: AOAM531kWCdht3BAiTziqxtQrnuxUh5rUAPN1ZiaX6IyfFR805VumQ/d fy4ozqJqzp3Vfd0NVxDrk0OdJTMS8wOh2Ej5Z7uIszp1ZxsMBlEWuuPmsw4+LODP1309/57RRis 4nCx0k5QEa9nsiYsdXTeC+AVbYEXY5oI/duYHVDkysO8sOdXf0AkUkJLCtFWU2DohJjingbQU X-Received: from bgardon.sea.corp.google.com ([2620:15c:100:202:7c53:ec2f:bd26:b69c]) (user=bgardon job=sendgmr) by 2002:a17:90a:858b:b0:1c6:5bc8:781a with SMTP id m11-20020a17090a858b00b001c65bc8781amr110130pjn.0.1648662395639; Wed, 30 Mar 2022 10:46:35 -0700 (PDT) Date: Wed, 30 Mar 2022 10:46:15 -0700 In-Reply-To: <20220330174621.1567317-1-bgardon@google.com> Message-Id: <20220330174621.1567317-6-bgardon@google.com> Mime-Version: 1.0 References: <20220330174621.1567317-1-bgardon@google.com> X-Mailer: git-send-email 2.35.1.1021.g381101b075-goog Subject: [PATCH v3 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.1021.g381101b075-goog