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=1569233458; cv=none; d=zoho.com; s=zohoarc; b=JPHEvL/9YpycnqNH1Zm2FoOO57m++k/JTeVShK/wZkLuE5JFKyw3OceWKdpWf0n9qOjduDTSzJZST8feEFpT9VdvnEuks+y2KtLPHi4p4m5K01vd7BmrC4OzT1FcmzCkGUdZrXRkqPU7M9XZD01lbWh4hnjDbToMNaZj7krYpFE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569233458; 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=SaeFDWmi0SWEuU3XIhJQzXeV319R4DjRPu/3PNV3VxA=; b=VPShP8rGx8ezC7TIOhKYAvz9rfI9wqb1O/W1ynK5JwNzBBbw7h06zOWcPAAKRxDLEFiy5/MAN+0O8DzfTDJwrot7fvLmfsP9JR1iEv+IDdhcL/gugJnHkY7UIojZ93uEHBFB2pJ8W6PO8NTmZNujk7miIcRkXUZt+9ZWair7mKM= 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 1569233458504924.4423188460717; Mon, 23 Sep 2019 03:10:58 -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 1iCLI7-0006sx-Gy; Mon, 23 Sep 2019 10:09:59 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iCLI6-0006sY-9i for xen-devel@lists.xenproject.org; Mon, 23 Sep 2019 10:09:58 +0000 Received: from mail-wm1-x342.google.com (unknown [2a00:1450:4864:20::342]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 417988b8-ddea-11e9-b299-bc764e2007e4; Mon, 23 Sep 2019 10:09:40 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id m18so8619608wmc.1 for ; Mon, 23 Sep 2019 03:09:40 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 03:09:39 -0700 (PDT) X-Inumbo-ID: 417988b8-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=UqfVM3xb9A0eu4hPr4BRnP3HYQakt7P75+x7Ufcd7qY=; b=Ep23HRbzXiZPbX58oxtkUbGl/KV0RWeBVEi+qndp39CTAXj1lvBfYSMNunVqxv0KEm PCz2by9LNNBZAv//itRcF6UZ/9k0vwOCMO7YyfCj88bQZie186pXZaju6TFx2guW4yak vdX3SXi3jS+w7PWOxVAEilBCMWGRiqYQH29oedGmRgzdgrJOaVscmo8L8I2G53AH5fPz U8OkzV0YmlDfgcAymkaomlA0MWzj3uatTrIqQJaG3TONHdu3N6iqcAZLX4EFCaewDkbA uTWB3Euto6x2oG3W67m/6d2sfYkWv3IjYiM78wxvDDB84t1/WermbPf9D8uGxTT7RI+l 0bgA== 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=UqfVM3xb9A0eu4hPr4BRnP3HYQakt7P75+x7Ufcd7qY=; b=UUicReG+ysM4dhmCNNHNAwOPweDEqzV671mI7X7BJ45JJgNy115rQd4fbhgd5x1JBJ 8rYNb1vKunYvAhbiDKT2FkEywATazlbUB2+b1q7qdVQJiwedt5a6pcJ6yiWAiPccae82 VsRg5lK2yWibcQ/JADrAllkaWhnH24AReu6PetwPDjs7H6JYGo9s5wjg8X4B/iGpSbwk KET0E733D0bH9iSQXALmuTpOWcg1FHuC2+hWvifZNK69J1KTC5hNTclkqx3JXRv0j7Pc nkATKdrH8uzTyHBPg6gUWDpZrBzrvSQRWvEqse4V0sASZxvQeIUr7+hGB1iEu1gXa7k1 RNEg== X-Gm-Message-State: APjAAAWtcs5UJFaL9a8B0csCI34VPIOXy/snbIAchOfWzjPcTkiY7JsB nrMncRpkMywAh7GektfdpxE9CLZJ X-Google-Smtp-Source: APXvYqwPDn7qWlE5iQ2Ta9VT5C8jG0MlQ/uyJZ0v21SIYsfPL6BHHneQyzJFPwI/nvgyOway1JNbgQ== X-Received: by 2002:a05:600c:c2:: with SMTP id u2mr12218904wmm.37.1569233379730; Mon, 23 Sep 2019 03:09:39 -0700 (PDT) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Mon, 23 Sep 2019 11:09:27 +0100 Message-Id: <20190923100931.29670-5-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 4/8] x86: factor out xen variants for hypervisor setup code 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 will add Hyper-V specific implementations in the future. No functional change. Signed-off-by: Wei Liu --- xen/arch/x86/guest/xen/xen.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/guest/xen/xen.c b/xen/arch/x86/guest/xen/xen.c index 78fc603996..f93c8fbd1c 100644 --- a/xen/arch/x86/guest/xen/xen.c +++ b/xen/arch/x86/guest/xen/xen.c @@ -67,7 +67,7 @@ static void __init find_xen_leaves(void) } } =20 -void __init probe_hypervisor(void) +static void __init probe_xen(void) { if ( xen_guest ) return; @@ -87,6 +87,11 @@ void __init probe_hypervisor(void) xen_guest =3D true; } =20 +void __init probe_hypervisor(void) +{ + probe_xen(); +} + static void map_shared_info(void) { mfn_t mfn; @@ -249,10 +254,8 @@ static void init_evtchn(void) } } =20 -void __init hypervisor_setup(void) +static void __init xen_setup(void) { - init_memmap(); - map_shared_info(); =20 set_vcpu_id(); @@ -277,13 +280,25 @@ void __init hypervisor_setup(void) init_evtchn(); } =20 -void hypervisor_ap_setup(void) +void __init hypervisor_setup(void) +{ + init_memmap(); + + xen_setup(); +} + +static void xen_ap_setup(void) { set_vcpu_id(); map_vcpuinfo(); init_evtchn(); } =20 +void hypervisor_ap_setup(void) +{ + xen_ap_setup(); +} + int hypervisor_alloc_unused_page(mfn_t *mfn) { unsigned long m; @@ -307,7 +322,7 @@ static void ap_resume(void *unused) init_evtchn(); } =20 -void hypervisor_resume(void) +static void xen_resume(void) { /* Reset shared info page. */ map_shared_info(); @@ -330,6 +345,11 @@ void hypervisor_resume(void) pv_console_init(); } =20 +void hypervisor_resume(void) +{ + xen_resume(); +} + /* * Local variables: * mode: C --=20 2.20.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel