From nobody Fri Apr 14 14:01:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PydQX25Nnz45JN4; Fri, 14 Apr 2023 14:01:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PydQW5chCz3KbV; Fri, 14 Apr 2023 14:01:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681480867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DDMbokyMfxMr6107JD0K7YLabg9Oq5ht843G9X4tli0=; b=sNLU8shtZi3p/Kxno4HSdc93sDnkuvOsITsLmPe4iL9fzBCYg2myW6lFJkBkdEZ0J5fLsg PaU0ideRHJkj0krW+QkSC4KPd/x58zRCqrmD1JB0ZNHbFP1xwfCm4ItfEeh3gDnCSkZeQf wPGTVon2W7WiJ2N/CItxsHHTHRB5hnp3RJUA4yxaV29LenCQ+cnEWgvk1+CKM9ZZk/O/Ur E7K3DzDN5Q+li4RxQxbjDtB2Icgtxa3xoe86g+qvb5UXXfwUM9OgFCbfV/3JS4uPxQt7zx FvhV0oI5/ulCtF9JhG8pa1BURLTPoct0fDg6lEPJl46PxiHMoSjWA0hA+KmEOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681480867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DDMbokyMfxMr6107JD0K7YLabg9Oq5ht843G9X4tli0=; b=lAMsGaxJT9Pql+VClq7Pg+EmrJdpdPax7P/l3kMsYc4ji4OR/NZx5bp83HSTPnZ91yFnXT wGtBCEhArmFwzpZGwreyG3rbWJUJGsrwhOMtmX+bkMjvtukbUTl9r7ks4LKOyF1sYPwK9z peiAOmdjUVfCWlUflBf8dmmHZy1IWpFSYx6d1jT8s3D6X7TGSH4PRPM4SDR8YzsZdj8UL8 f8fNZv1a1/jCllF66iX8YnUmBSz+ZG3LfTDrtT/ExFQmzi7FaTbxd/WMv+bHf6iYDIQldL kYL/iG98hE1AshHcnK1ediOGU9EOZdAd6Zaf6UMVyKECTYY7+exGIi1fjfF24w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681480867; a=rsa-sha256; cv=none; b=WQsoPkBECZ5J2DuMKpOepYavEfzijWaYq9h4t4iI5R/ziSeKLzR3Uds9M+U2iCONpPePEw n/AUyLu+LWC9KDRo8hGojYewWbnx+bX6Ic/6ealoGix+AGe5+gYukOQqhNbz3zGBt4Q/FN a7wumDi8Yw9Pd/Z1tJ8QkgmGbGV+CAy77Hfkw7JMQQbNfups/rxCkmgU0ft8iLGqLkdf5P rEx0N6hYyn5yo60/TfBwYEcyC85qUF0ch1qBgl8LJQ9HYD+KZkPxMLJ9iP8+5WP9WMjTKN Fzp8eR3ZdqOmrMntbZhWKHq6WuQjZsFh203Dsti+W+GgRLkpffKfqGC6gnIu3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PydQW4j2nzQcS; Fri, 14 Apr 2023 14:01:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33EE17vL084985; Fri, 14 Apr 2023 14:01:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33EE1761084984; Fri, 14 Apr 2023 14:01:07 GMT (envelope-from git) Date: Fri, 14 Apr 2023 14:01:07 GMT Message-Id: <202304141401.33EE1761084984@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Roger=20Pau=20Monn=C3=A9?= Subject: git: 6d765bff6f73 - main - xen: move common variables off of sys/x86/xen/hvm.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d765bff6f739f4b9cb2c1463325395d9746d23c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=6d765bff6f739f4b9cb2c1463325395d9746d23c commit 6d765bff6f739f4b9cb2c1463325395d9746d23c Author: Elliott Mitchell AuthorDate: 2021-02-16 03:06:59 +0000 Commit: Roger Pau Monné CommitDate: 2023-04-14 13:59:11 +0000 xen: move common variables off of sys/x86/xen/hvm.c The xen_domain_type and HYPERVISOR_shared_info variables are shared by all Xen architectures, so they should be in common rather than reimplemented by each architecture. hvm_start_flags is used by xen_initial_domain() and so needs to be in common. Reviewed by: royger Differential Revision: https://reviews.freebsd.org/D28982 --- sys/conf/files | 1 + sys/x86/xen/hvm.c | 11 ----------- sys/xen/xen_common.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 11 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 6c7c6520d72a..4e981a135b0c 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -5205,6 +5205,7 @@ vm/vm_swapout_dummy.c optional NO_SWAPPING vm/vm_unix.c standard vm/vnode_pager.c standard xen/features.c optional xenhvm +xen/xen_common.c optional xenhvm xen/xenbus/xenbus_if.m optional xenhvm xen/xenbus/xenbus.c optional xenhvm xen/xenbus/xenbusb_if.m optional xenhvm diff --git a/sys/x86/xen/hvm.c b/sys/x86/xen/hvm.c index 8edbda445dd5..a41c9ebdf745 100644 --- a/sys/x86/xen/hvm.c +++ b/sys/x86/xen/hvm.c @@ -66,8 +66,6 @@ __FBSDID("$FreeBSD$"); static void xen_hvm_cpu_init(void); /*-------------------------------- Global Data -------------------------------*/ -enum xen_domain_type xen_domain_type = XEN_NATIVE; - #ifdef SMP struct cpu_ops xen_hvm_cpu_ops = { .cpu_init = xen_hvm_cpu_init, @@ -83,12 +81,6 @@ static MALLOC_DEFINE(M_XENHVM, "xen_hvm", "Xen HVM PV Support"); */ int xen_vector_callback_enabled; -/** - * Start info flags. ATM this only used to store the initial domain flag for - * PVHv2, and it's always empty for HVM guests. - */ -uint32_t hvm_start_flags; - /** * Signal whether the vector injected for the event channel upcall requires to * be EOI'ed on the local APIC. @@ -99,9 +91,6 @@ bool xen_evtchn_needs_ack; DPCPU_DEFINE(struct vcpu_info, vcpu_local_info); DPCPU_DEFINE(struct vcpu_info *, vcpu_info); -/*------------------ Hypervisor Access Shared Memory Regions -----------------*/ -shared_info_t *HYPERVISOR_shared_info; - /*------------------------------ Sysctl tunables -----------------------------*/ int xen_disable_pv_disks = 0; int xen_disable_pv_nics = 0; diff --git a/sys/xen/xen_common.c b/sys/xen/xen_common.c new file mode 100644 index 000000000000..586cc8bcf821 --- /dev/null +++ b/sys/xen/xen_common.c @@ -0,0 +1,51 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright © 2008, 2013 Citrix Systems, Inc. + * Copyright © 2012 Spectra Logic Corporation + * Copyright © 2021 Elliott Mitchell + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include /* required by xen/xen-os.h */ + +#include /* required by xen/xen-os.h */ + +#include +#include + +/*-------------------------------- Global Data -------------------------------*/ +enum xen_domain_type xen_domain_type = XEN_NATIVE; + +/** + * Start info flags. ATM this only used to store the initial domain flag for + * PVHv2, and it's always empty for HVM guests. + */ +uint32_t hvm_start_flags; + +/*------------------ Hypervisor Access Shared Memory Regions -----------------*/ +shared_info_t *HYPERVISOR_shared_info;