From patchwork Sat Nov 30 11:57:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11267931 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BBA2F112B for ; Sat, 30 Nov 2019 11:58:44 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 96FEF2082E for ; Sat, 30 Nov 2019 11:58:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RYNxlWUU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 96FEF2082E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ib1Nu-0004mR-TS; Sat, 30 Nov 2019 11:57:58 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ib1Nt-0004m2-Jd for xen-devel@lists.xenproject.org; Sat, 30 Nov 2019 11:57:57 +0000 X-Inumbo-ID: 9e753e0a-1368-11ea-a55d-bc764e2007e4 Received: from mail-wm1-x341.google.com (unknown [2a00:1450:4864:20::341]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 9e753e0a-1368-11ea-a55d-bc764e2007e4; Sat, 30 Nov 2019 11:57:44 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id l17so16602693wmh.0 for ; Sat, 30 Nov 2019 03:57:44 -0800 (PST) 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=Lp9dPk3GM26kCtmFBzgGz5LRW9FjTOSuocsi0vK/bvk=; b=RYNxlWUUz22gfLgAPlY295110vUhVh5tiLrKKD6izCBlP4UoZ77TSR2APUYTmN2bnG LQcLFW37JkxETf69TGvr+8o/h94zigGD2rETLaUd6ab0nqdVRXUfnP0RLebdBknosCLN 2i7aoXGWsJ03HCo53oVTReTjPeB5gD/bXhXAY/g3Bfuho3XJh1eIoAPy1Zn8ASYJx3P2 qavoxKLeZgYYmpxN0pNHk8PmmfHWRi4i7XxxFuRhoVm6wLLxvkRZ+0VCNUBrytsmQe3E Ba/eMYr6HT5PjCMge6Vb+F8g//+vjKoFrGYOY0gMU1mbhw+rvs0QA+iJKK1lTrkqZkMd Rs7g== 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=Lp9dPk3GM26kCtmFBzgGz5LRW9FjTOSuocsi0vK/bvk=; b=EJm8v7QUHX4XOpLfy3kkeOfl825wdXInvV6SwiJKV0NYBBnnXhDLKHVVbAEGReEOVm TcXBuIeAckWclSXHXRJD13tF6LGvU+005dBBa024HaHwtUXknehQ58UR9DiebdOfvjg2 KRVJO4+SmAXBsX6VySFYIs4nt+O+1qegu6Z9U1OT2BJDYwqOqGNknn1uIxp/P9fRdIDb miRKymO8Ybg8FEkSlWoLsYP78Uye7KIvp2DaALLwThKOcUg8uc30Rpuzt+VFQwXIcFki fbl6zfXrpf0ArDSiOpZVFhlW4od2SkCWzFqzmC57CnWRSnI4xhZvKKu8Yg+HmWYMGmxn eHcg== X-Gm-Message-State: APjAAAUx6BwgPKOu773nMYv38OiCg636Z2Y/LN30bY3NX+sN6rN/pgzL d5GLq1VRFNU7uEQgOz06Rv4fnFO6J3s= X-Google-Smtp-Source: APXvYqzhg7KT3JYZK7faMWVDwdoxUSEAOV85+oooagilgpLgmT9/f8yYGaKAYnXwHSGGY0fEJWBWSw== X-Received: by 2002:a1c:f210:: with SMTP id s16mr19526949wmc.76.1575115063958; Sat, 30 Nov 2019 03:57:43 -0800 (PST) Received: from debian.mshome.net (122.163.200.146.dyn.plus.net. [146.200.163.122]) by smtp.gmail.com with ESMTPSA id z11sm2227769wrt.82.2019.11.30.03.57.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Nov 2019 03:57:43 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Sat, 30 Nov 2019 11:57:32 +0000 Message-Id: <20191130115737.15752-4-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191130115737.15752-1-liuwe@microsoft.com> References: <20191130115737.15752-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v5 3/8] x86: drop hypervisor_cpuid_base 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_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The only user is Xen specific code in PV shim. We can therefore export the variable directly. Move __read_mostly to its standard place while at it. Signed-off-by: Wei Liu Reviewed-by: Roger Pau Monné Acked-by: Jan Beulich --- xen/arch/x86/guest/xen/xen.c | 7 +------ xen/arch/x86/pv/shim.c | 2 +- xen/include/asm-x86/guest/xen.h | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/guest/xen/xen.c b/xen/arch/x86/guest/xen/xen.c index a329e7c886..1e37086518 100644 --- a/xen/arch/x86/guest/xen/xen.c +++ b/xen/arch/x86/guest/xen/xen.c @@ -37,7 +37,7 @@ bool __read_mostly xen_guest; -static __read_mostly uint32_t xen_cpuid_base; +uint32_t __read_mostly xen_cpuid_base; extern char hypercall_page[]; static struct rangeset *mem; @@ -297,11 +297,6 @@ int hypervisor_free_unused_page(mfn_t mfn) return rangeset_remove_range(mem, mfn_x(mfn), mfn_x(mfn)); } -uint32_t hypervisor_cpuid_base(void) -{ - return xen_cpuid_base; -} - static void ap_resume(void *unused) { map_vcpuinfo(); diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c index 35bf3945ac..351da970ef 100644 --- a/xen/arch/x86/pv/shim.c +++ b/xen/arch/x86/pv/shim.c @@ -995,7 +995,7 @@ domid_t get_initial_domain_id(void) if ( !pv_shim ) return 0; - cpuid(hypervisor_cpuid_base() + 4, &eax, &ebx, &ecx, &edx); + cpuid(xen_cpuid_base + 4, &eax, &ebx, &ecx, &edx); return (eax & XEN_HVM_CPUID_DOMID_PRESENT) ? ecx : 1; } diff --git a/xen/include/asm-x86/guest/xen.h b/xen/include/asm-x86/guest/xen.h index 7e04e4a7ab..b015ed1883 100644 --- a/xen/include/asm-x86/guest/xen.h +++ b/xen/include/asm-x86/guest/xen.h @@ -30,13 +30,13 @@ extern bool xen_guest; extern bool pv_console; +extern uint32_t xen_cpuid_base; void probe_hypervisor(void); void hypervisor_setup(void); void hypervisor_ap_setup(void); int hypervisor_alloc_unused_page(mfn_t *mfn); int hypervisor_free_unused_page(mfn_t mfn); -uint32_t hypervisor_cpuid_base(void); void hypervisor_resume(void); DECLARE_PER_CPU(unsigned int, vcpu_id);