From patchwork Mon Oct 21 15:57:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11202569 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 69C1113BD for ; Mon, 21 Oct 2019 15:58:47 +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 44A022084B for ; Mon, 21 Oct 2019 15:58:47 +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="cOCott3I" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 44A022084B 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 1iMa3w-0008C4-Dz; Mon, 21 Oct 2019 15:57:40 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iMa3u-0008Bp-S9 for xen-devel@lists.xenproject.org; Mon, 21 Oct 2019 15:57:38 +0000 X-Inumbo-ID: 796c0786-f41b-11e9-a531-bc764e2007e4 Received: from mail-wm1-x342.google.com (unknown [2a00:1450:4864:20::342]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 796c0786-f41b-11e9-a531-bc764e2007e4; Mon, 21 Oct 2019 15:57:25 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id g24so4755669wmh.5 for ; Mon, 21 Oct 2019 08:57:25 -0700 (PDT) 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=LzVJRQ/OrflFRie8Ab9jbbnlLHJRH6wdZOJqJE01vJw=; b=cOCott3IlMS4VPQuhS1A9bXCgJ36PqouveqzFIX/xALcgYgN2ITLVknLZ6IskZ3A1O yiBDInlLLyUoJ//cZ3Y17Rv6Y/dsgUJBYGGcG5+jH0OsklmFsXHsHJra/aZJmEPuH/Yt 7KsBkyJrorniwucdYZ6jaEX6f8w3ZY/nzKMUERXaYSFK3lbSKNJDvDcdXC6dAlDjNhXL sED7oYncDzZ/kqqkmZRf7Nt536krxYzr25iNpQw7YOVVqgSt0JM0ulMHsxzch2l9sVpQ 7s7EONkXTZ//Az7AVvirNb0bLL52Ntg4Z2X0EcYKrPjYCChBfxvdvlLLAxV+ZumB2oR0 c7Zg== 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=LzVJRQ/OrflFRie8Ab9jbbnlLHJRH6wdZOJqJE01vJw=; b=a9dVQjvjQKSvQ+YBbEHD7+PKvLeHynlm3BI5360MqvC3/HssDpqG6/RYZYVq4lhHib OZrXl00KEKlQtKb3YYvkMbxpoE3VpWR1zDddw94VFm5NBKtWTjSlnWOW7QB63ZlOWZYJ 8eZlpemBXRjDefBwBdUThIAuoGS0C8Y9uLZKmmYtyjr6TzFXJxe218FGNERaGq6y3drp mH3aj2ZLU8/yCfo33YZUI7y3hN4WnpmDJ5qud5MZCIAtH0UY6vmkSGNC4w//ZiawPSDB qPVUPT/y2815HIH0EVxFaWuDz2tx0D5wuV7PeXlIGWPSskbMbmHwXqSvgBO+w9gyFaa3 eNRQ== X-Gm-Message-State: APjAAAUAdDWRHGTeYTcCvLE89lq8SLztkDyRdVzc3lzjrEO+OJcxaU9/ YdCMPAQ52x24nC6USq7Vh9pFdoMu7EU= X-Google-Smtp-Source: APXvYqzz/Kta5VBd7jInxuR3R8kaAQZgp7VU60sA8hcqypb8SutSv4zTfLJHuzmPKcpvp74dnssEqA== X-Received: by 2002:a7b:cb54:: with SMTP id v20mr18859985wmj.119.1571673444539; Mon, 21 Oct 2019 08:57:24 -0700 (PDT) Received: from debian.mshome.net (54.163.200.146.dyn.plus.net. [146.200.163.54]) by smtp.gmail.com with ESMTPSA id x12sm5667410wru.93.2019.10.21.08.57.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 08:57:24 -0700 (PDT) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Mon, 21 Oct 2019 16:57:12 +0100 Message-Id: <20191021155718.28653-4-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191021155718.28653-1-liuwe@microsoft.com> References: <20191021155718.28653-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH for-next v3 3/9] 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. 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 7b7a5badab..78fc603996 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; +__read_mostly uint32_t xen_cpuid_base; extern char hypercall_page[]; static struct rangeset *mem; @@ -301,11 +301,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 5edbcd9ac5..5441e89de2 100644 --- a/xen/arch/x86/pv/shim.c +++ b/xen/arch/x86/pv/shim.c @@ -990,7 +990,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);