Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4535478pxb; Tue, 5 Oct 2021 05:18:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx8+s1WrUlN6hxWd9uRfMoN/FQW6vjrcURa1ZFid03oy+r4vqC4kASUKIelaitrAQcy9Y5 X-Received: by 2002:a63:f356:: with SMTP id t22mr15264685pgj.18.1633436339578; Tue, 05 Oct 2021 05:18:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633436339; cv=none; d=google.com; s=arc-20160816; b=er13bVxMygyEZZf2Ze6LcG3qOZw+FBfXAXNprKhmhvoTbUmIVFg5tbPfNzv5xPFOFT HS2hOGjAdaikucyly/1KpQkN8YH1VblQT5g8AEYA3M7v5I6zl6xJ7KsPQybg/hjZzoL7 EOdKfMx0LjNnb+OTipv/BfDdcyBep7y47Kju8b7kzpZWNaWo14hijB2N9OOw8DJ2/0JA xFx4HiFu+vgqBhb7YkoOwAwXj+c/KXO4gcM+5fuAmAcOYQBLAqWfxFSqudz8rScVYG/t hxdwTP9B34Vvk/EYKL+1v43iUQuR6zpY69kAK/hRDVuUaAIt9d8A61ANSoZXqu1AYtUe JwZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eNI9g9wwmQcdN9iXnExKxfHZe2dTuiVg+oq/PzETzdk=; b=v8HK4PbU7Ze3gLtT18tb5hpx9NSstC8XTty+pkmOKVjblqkSikEjivRjcMQOX6Qwss PcEPf8uJqockMYbblo+E6Apvv79O1gLO/F7+q9raZPf8RqqXm2LOcRplDeXUJO6uz6DF 8fvEgG1Jf0i2oQuFbXuVk63KhzqGXiGpeF2oLNRpmSQ4YMk9JPY2oLLlmKMLGBV9JKov o7WhW2+srpEa0e5RQ96c0Y778hpKaIWqlRi3TAQ/XrTHVPCvlfOAoGNrYoxNZCUKCIod QolmKttJ9SlaNTHHNz7Zg7xm1CMuLwt3UIKN3wGAOB2ItUWVMPwRoaxmGtVq49aLGznZ +Qmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UcY48Xgk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k191si24039059pfd.298.2021.10.05.05.18.46; Tue, 05 Oct 2021 05:18:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UcY48Xgk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234675AbhJEMSj (ORCPT + 99 others); Tue, 5 Oct 2021 08:18:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:41677 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234354AbhJEMSi (ORCPT ); Tue, 5 Oct 2021 08:18:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633436207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eNI9g9wwmQcdN9iXnExKxfHZe2dTuiVg+oq/PzETzdk=; b=UcY48XgkpPwIp3OqMCvxJE5kCfDlgHdIpVWKZWLXnbQJfUkh+yJXVXwbH96eU+7HxbnsLI 3QbxSyhKRliGSHRh4dElFbBbrotN2ulxqeELqoOhHaaWFOgB+tI3++qviDU9yweW83ZTm3 eFnAeXatucqIe2VlBn5itqHbZKL47ZY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-100-fIbnxzTSOKeOo2Y7cHkiOw-1; Tue, 05 Oct 2021 08:16:46 -0400 X-MC-Unique: fIbnxzTSOKeOo2Y7cHkiOw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2A66F1084683; Tue, 5 Oct 2021 12:16:44 +0000 (UTC) Received: from t480s.redhat.com (unknown [10.39.193.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id 22A421F436; Tue, 5 Oct 2021 12:16:12 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: David Hildenbrand , Andrew Morton , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , "Michael S. Tsirkin" , Jason Wang , Dave Young , Baoquan He , Vivek Goyal , Michal Hocko , Oscar Salvador , Mike Rapoport , "Rafael J. Wysocki" , x86@kernel.org, xen-devel@lists.xenproject.org, virtualization@lists.linux-foundation.org, kexec@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 3/9] x86/xen: print a warning when HVMOP_get_mem_type fails Date: Tue, 5 Oct 2021 14:14:24 +0200 Message-Id: <20211005121430.30136-4-david@redhat.com> In-Reply-To: <20211005121430.30136-1-david@redhat.com> References: <20211005121430.30136-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org HVMOP_get_mem_type is not expected to fail, "This call failing is indication of something going quite wrong and it would be good to know about this." [1] Let's add a pr_warn_once(). [1] https://lkml.kernel.org/r/3b935aa0-6d85-0bcd-100e-15098add3c4c@oracle.com Suggested-by: Boris Ostrovsky Signed-off-by: David Hildenbrand --- arch/x86/xen/mmu_hvm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/xen/mmu_hvm.c b/arch/x86/xen/mmu_hvm.c index d1b38c77352b..6ba8826dcdcc 100644 --- a/arch/x86/xen/mmu_hvm.c +++ b/arch/x86/xen/mmu_hvm.c @@ -22,8 +22,10 @@ static int xen_oldmem_pfn_is_ram(unsigned long pfn) .pfn = pfn, }; - if (HYPERVISOR_hvm_op(HVMOP_get_mem_type, &a)) + if (HYPERVISOR_hvm_op(HVMOP_get_mem_type, &a)) { + pr_warn_once("Unexpected HVMOP_get_mem_type failure\n"); return -ENXIO; + } return a.mem_type != HVMMEM_mmio_dm; } #endif -- 2.31.1