From nobody Tue Nov 11 08:47:04 2025 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1569233467; cv=none; d=zoho.com; s=zohoarc; b=MTNY4b0N0GXLPeJM1bnAQuz9GRKzLCskG422qk2OwoaIzP3CIailQFzzhPOO5xvPr8JwxJqiou1z4ElBghKXtKE8cHvEPk0A9P0BOzMt6yOi2QMfT9HO6JBZPLnE4qHch23fFz8+VnYGmE+u4flnVsKpr2HNKBvKJXwhZCVlkpk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569233467; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ZQwbgDFJ8exzktmcZAA/c7NW4IVAFM9RumfdGN7dguo=; b=BATueRoT1kGrOoHZbWXRYkL8kfaeOePo/8EZGJkNwEfIPtxT0q2cJHUXkVqndIRwAlbOGPIG1cjQlF2FpGR/7ayXLeLjO+ZYFuJsDmSH6M/qE272fznb2RtWGPwyMeczqsrAlTLaEXAV8w7krF3rQbqRrDW6QuHyd59o1nrkUNY= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1569233467429506.58314128226687; Mon, 23 Sep 2019 03:11:07 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iCLII-0007Wb-5T; Mon, 23 Sep 2019 10:10:10 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iCLIG-0007Tw-8z for xen-devel@lists.xenproject.org; Mon, 23 Sep 2019 10:10:08 +0000 Received: from mail-wm1-x344.google.com (unknown [2a00:1450:4864:20::344]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 4264c094-ddea-11e9-b299-bc764e2007e4; Mon, 23 Sep 2019 10:09:42 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id m18so8619705wmc.1 for ; Mon, 23 Sep 2019 03:09:42 -0700 (PDT) Received: from debian.mshome.net (207.148.159.143.dyn.plus.net. [143.159.148.207]) by smtp.gmail.com with ESMTPSA id s10sm18241662wmf.48.2019.09.23.03.09.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 03:09:40 -0700 (PDT) X-Inumbo-ID: 4264c094-ddea-11e9-b299-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J0gWUg2h7tpdgfhePN1rbGU9ftmJv074Q5+IRkBqTX8=; b=PGil4XhYR6v62HYFcwiaSCYPWEF6MEg6hCwXjZuKaP4Aj7i5WKq/QH3zUtclD5scVt sESn8KrxnsfFTdchYW5vLvkzkaxVL2FBxZUCLfStN1jAW8LSDfo9R5oY0tylhwGpILiL U7oIqNWN5XQkozkg8kEeqQwxPBgx3doqx0t5pPjkwR2DSkT+PbPjZ3BxnrH0JcietLgQ GANPJpCPusX5YsA4qIJ2sEZxMLar/UUmLClL8J9c01F5z7xTpwULjPKK9mNX6A5KuDYW j0uCizKYM7w8YoURYr3pTyJzBJZMbT75DM0DcLa3lQBzOWYO53ehnwVfccMUKOB1GxR4 YaCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=J0gWUg2h7tpdgfhePN1rbGU9ftmJv074Q5+IRkBqTX8=; b=Z1zcjDSvz9rd7HYrEg7ceVLffOPXiVZAg/cJmiFB4xMljCMlYlDxMynrhylZAp6/BE uXMQh90FI2Sk2/6VLW/ZjaORxaFmDTEeGVqEGz+WJHH75QMLFhNsGZiW3gfmjqtEFp7m qs2FAqpabsrGc0dUObh1PPs5juHV1zVD9UIiWe3jOiS/rBgnCSGdZ+06QI6PsYFMwf3X tbBte0v+3/rDXGepBugQtbuTBsgOYVnyJKyA44nFyLEn+WTl3fgXqtCHenGLXKtIZRfd SCaP+aZ7PDZixT5M5/X+wun6aIb558y5OrlxZb9ZHI5rU1cwc4ErQOrQLu0qxjeGFf/F UKCA== X-Gm-Message-State: APjAAAW8hTGuzeY6dshjwhOKtLzkyfFWxkwiT8uyXwE/pt2m5CB4iQkh p1jfs+01w+YfOhEOwAEl0nd0Tz9k X-Google-Smtp-Source: APXvYqx7BqyC5ozDISUKqL4kgTWqLV6+d4HNGBkzXibQ1XS4BtpTE5Yi//FfuOXbkSgclyjdgBGuFA== X-Received: by 2002:a7b:c757:: with SMTP id w23mr12824379wmk.31.1569233381352; Mon, 23 Sep 2019 03:09:41 -0700 (PDT) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Mon, 23 Sep 2019 11:09:29 +0100 Message-Id: <20190923100931.29670-7-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190923100931.29670-1-liuwe@microsoft.com> References: <20190923100931.29670-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH for-next RFC 6/8] x86: make probe_xen return boolean value X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Wei Liu , Andrew Cooper , Michael Kelley , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) We need indication whether it has succeeded or not. Signed-off-by: Wei Liu --- xen/arch/x86/guest/hypervisor.c | 5 ++++- xen/arch/x86/guest/xen/xen.c | 7 ++++--- xen/include/asm-x86/guest/xen.h | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/guest/hypervisor.c b/xen/arch/x86/guest/hyperviso= r.c index b0a724bf13..fb572b0402 100644 --- a/xen/arch/x86/guest/hypervisor.c +++ b/xen/arch/x86/guest/hypervisor.c @@ -34,7 +34,10 @@ void __init probe_hypervisor(void) if ( !(cpuid_ecx(1) & cpufeat_mask(X86_FEATURE_HYPERVISOR)) ) return; =20 - probe_xen(); + if ( probe_xen() ) + return; + + /* Hyper-V probing to follow. */ } =20 static void __init init_memmap(void) diff --git a/xen/arch/x86/guest/xen/xen.c b/xen/arch/x86/guest/xen/xen.c index a730e6ad1b..8390b045f0 100644 --- a/xen/arch/x86/guest/xen/xen.c +++ b/xen/arch/x86/guest/xen/xen.c @@ -66,20 +66,21 @@ static void __init find_xen_leaves(void) } } =20 -void __init probe_xen(void) +bool __init probe_xen(void) { if ( xen_guest ) - return; + return true; =20 find_xen_leaves(); =20 if ( !xen_cpuid_base ) - return; + return false; =20 /* Fill the hypercall page. */ wrmsrl(cpuid_ebx(xen_cpuid_base + 2), __pa(hypercall_page)); =20 xen_guest =3D true; + return true; } =20 static void map_shared_info(void) diff --git a/xen/include/asm-x86/guest/xen.h b/xen/include/asm-x86/guest/xe= n.h index d031f1f70d..7eda3d4956 100644 --- a/xen/include/asm-x86/guest/xen.h +++ b/xen/include/asm-x86/guest/xen.h @@ -32,7 +32,7 @@ extern bool xen_guest; extern bool pv_console; extern uint32_t xen_cpuid_base; =20 -void probe_xen(void); +bool probe_xen(void); void xen_setup(void); void xen_ap_setup(void); void xen_resume(void); @@ -45,7 +45,7 @@ DECLARE_PER_CPU(struct vcpu_info *, vcpu_info); #define xen_guest 0 #define pv_console 0 =20 -static inline void probe_xen(void) {} +static inline bool probe_xen(void) { return false; } =20 #endif /* CONFIG_XEN_GUEST */ #endif /* __X86_GUEST_XEN_H__ */ --=20 2.20.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel