From nobody Fri Oct 18 04:19:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1707501678; cv=none; d=zohomail.com; s=zohoarc; b=W2SpzkTcfleziRWpvxgxXKMCbhiNv51nOCj2JEAMGiqs0rkuag3WTWNba2Rf5tEkZyvsAFpqYrNKN+/H2TUxGFTFV5SsYXTnjWi5f9U371olbhGp8zdKqpuBXIRjoZmTn0JZXu5MhSoyQg+tBSr0KSj7D2oPMkSn8YqxRv646AU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707501678; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dDTJW+iXXU/pmzqRlWGMRI2OkRV6YQ3UWt7y5c2dJ2o=; b=mqhZOJON4YBGZxxrIYnJiHTnPuimMYXYzQuSN1M+CmVbF4zq4fPhA5i8NdS7/qGvb9sj/wG8RpblJBefOx3qegRdKUKqFOXmd2hpUNfAo8tkU38/asBxX8I+swBjMvzSefCoxTboXOono/WnBAfOtLvcBIRhZtJnIQYm1ptNGvs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 170750167850932.28853518543008; Fri, 9 Feb 2024 10:01:18 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.678783.1056318 (Exim 4.92) (envelope-from ) id 1rYVBL-0007hx-SI; Fri, 09 Feb 2024 18:00:59 +0000 Received: by outflank-mailman (output) from mailman id 678783.1056318; Fri, 09 Feb 2024 18:00:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rYVBL-0007h7-Mf; Fri, 09 Feb 2024 18:00:59 +0000 Received: by outflank-mailman (input) for mailman id 678783; Fri, 09 Feb 2024 18:00:58 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rYVBK-0007AX-Nw for xen-devel@lists.xenproject.org; Fri, 09 Feb 2024 18:00:58 +0000 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [2a00:1450:4864:20::231]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2c7e2771-c775-11ee-98f5-efadbce2ee36; Fri, 09 Feb 2024 19:00:56 +0100 (CET) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2d0e20b7375so5703001fa.2 for ; Fri, 09 Feb 2024 10:00:56 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id fd1-20020a056402388100b00561103f29fbsm984503edb.75.2024.02.09.10.00.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 10:00:55 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2c7e2771-c775-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707501656; x=1708106456; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dDTJW+iXXU/pmzqRlWGMRI2OkRV6YQ3UWt7y5c2dJ2o=; b=EIUakyFiLdSVq/sWfKoNBlnT7tFZchSqvfm2C7aEkZm3ki4EpOOlphHBBriNoXU9xq vUeQY21nqMsPeW3ZCSBR+ioBPMaD8jtati7RO1SX98q8DHH3F3nbmBZ43JXgUSHqTdPS A4Js4UHI4BLi0a72hMIze8jPxkFpLbgw3V4Zt+L+phOQKTjO8FE+RH8AiE18sSW061de 3y2UPa43y7dWK8LbNvzsJVeDq4Ye+GCVyRr+UXZO+DwslV3v0qIUhyNPz/ClnN2HXth7 /E2OaspXRfyriZ9O9WKzY3+ga8lfaUvO0ncOFC8CTIY2BENqRSQHQxSWtME9C4f0LJ54 wJ6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707501656; x=1708106456; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dDTJW+iXXU/pmzqRlWGMRI2OkRV6YQ3UWt7y5c2dJ2o=; b=YQMKYpEbLoPMTIB803B0X88CuAQsj6YRCxa0H6iiJ3kXo+Yzx8eISaBwZZi5qOUk3N EY/ecIuK3EYEe5xqJ+83wJRG569ykrqXfjfIklnGBp8VXgF8dPL0/JotA/48YWMu4fCY eprEPt2B8Mal78O6oA6bKAWHqF+KXEv4MbQ7gWijaT6j+QcCbtWh9VVhzfcdol3DRK0t Xi0Aw0sDO7kwaFX0XRi0gSRNBaBNtGcCF4xiqZUoBZCGwTcaRs9qD6835o8hGtVEWbHN 60TN7xhShRhzYd8PRWXWf5Bi0op4UGjb9xbK9YzD880ddTJImzRB9SknyhuE5cygoaIz hN3Q== X-Gm-Message-State: AOJu0YxfHzcGDflwiyXPDefhMDDudITX0agaXmsCVLu0PCqzjaeJkXKM 78thgR7jqiHTQFzQMfvYcjqTYUsi+DH/fPy+QspeBsZtAE5Wf3PPokhi1iBo X-Google-Smtp-Source: AGHT+IGFHZ+cyVVb2L4PXW3RObTBtjdUa76Y9tfpmFyQ15SpxFnJRcY7kMAciBx9g1Gmhpoh26N8PQ== X-Received: by 2002:a2e:9b58:0:b0:2d0:9fac:bdff with SMTP id o24-20020a2e9b58000000b002d09facbdffmr1844374ljj.38.1707501655965; Fri, 09 Feb 2024 10:00:55 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUUH3gne00j+NV48jUiaBFjkD6wtBIFi6UDcL+hC2C9BHR0akOBxRpJk06JaF27iQgDmJYSoKiw271l71n38cPcehtHkDw4GZeN4/o0UZoZgiwYUkuGOc1SUnN3Stf2IaofQtbDzaPYd7Y6ZxGgICYhuMNzD3aaqZunBY9mfvY5oAliHqO16bNb1OPdX+e7TGhlvcPybwopcD4QWABy7Bhpib587TZh5KdDOdHo7SdTczil7JdsBtxzu58zcRsIzI2g5DZ4wsIUkg9MEwRiyRPbMDbRp/gKsuRTF0EMutMoCI6PGIoytQXrveu/NZc+Fle8nnXLnZbXbVJb+8GauwM48vLahZ/f5CmoNpnodJ2mPnnzlgziBc9jr0hYXijxMvOi From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Tamas K Lengyel , Alexandru Isaila , Petre Pircalabu , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Shawn Anastasio , Jan Beulich Subject: [PATCH v8 3/7] xen/asm-generic: introduce stub header monitor.h Date: Fri, 9 Feb 2024 19:00:45 +0100 Message-ID: <84568b0c24a5ec96244f3f34537e9a148367facf.1707499278.git.oleksii.kurochko@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1707501680008100001 Content-Type: text/plain; charset="utf-8" The header is shared between several archs so it is moved to asm-generic. Switch partly Arm and PPC to asm-generic/monitor.h and only arch_monitor_get_capabilities() left in arch-specific/monitor.h. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich Acked-by: Tamas K Lengyel Acked-by: Julien Grall --- Changes in V8: - Add Acked-by: Tamas K Lengyel --- Changes in V7: - Drop definition of arch_monitor_domctl_event for PPC. - define arch_monitor_domctl_event in asm-generic/monitor.h. - add "define HAS_ARCH_MONITOR_DOMCTL_EVENT" in arm/.../monitor.h as it ha= s arch specific implementation. --- Changes in V6: - Rebase only. --- Changes in V5: - Switched partly Arm and PPC to asm-generic monitor.h only arch_monitor_get_capabilities() left in arch-specific/monitor.h. - Updated the commit message. --- Changes in V4: - Removed the double blank line. - Added Acked-by: Jan Beulich . - Update the commit message --- Changes in V3: - Use forward-declaration of struct domain instead of " #include ". - Add ' include ' - Drop PPC's monitor.h. --- Changes in V2: - remove inclusion of "+#include " - add "struct xen_domctl_monitor_op;" - remove one of SPDX tags. --- xen/arch/arm/include/asm/monitor.h | 25 +----------- xen/arch/ppc/include/asm/monitor.h | 28 +------------ xen/arch/ppc/stubs.c | 8 ---- xen/include/asm-generic/monitor.h | 64 ++++++++++++++++++++++++++++++ 4 files changed, 67 insertions(+), 58 deletions(-) create mode 100644 xen/include/asm-generic/monitor.h diff --git a/xen/arch/arm/include/asm/monitor.h b/xen/arch/arm/include/asm/= monitor.h index 7567be66bd..77a3c1a36c 100644 --- a/xen/arch/arm/include/asm/monitor.h +++ b/xen/arch/arm/include/asm/monitor.h @@ -25,34 +25,13 @@ #include #include =20 -static inline -void arch_monitor_allow_userspace(struct domain *d, bool allow_userspace) -{ -} +#define HAS_ARCH_MONITOR_DOMCTL_EVENT =20 -static inline -int arch_monitor_domctl_op(struct domain *d, struct xen_domctl_monitor_op = *mop) -{ - /* No arch-specific monitor ops on ARM. */ - return -EOPNOTSUPP; -} +#include =20 int arch_monitor_domctl_event(struct domain *d, struct xen_domctl_monitor_op *mop); =20 -static inline -int arch_monitor_init_domain(struct domain *d) -{ - /* No arch-specific domain initialization on ARM. */ - return 0; -} - -static inline -void arch_monitor_cleanup_domain(struct domain *d) -{ - /* No arch-specific domain cleanup on ARM. */ -} - static inline uint32_t arch_monitor_get_capabilities(struct domain *d) { uint32_t capabilities =3D 0; diff --git a/xen/arch/ppc/include/asm/monitor.h b/xen/arch/ppc/include/asm/= monitor.h index e5b0282bf1..89000dacc6 100644 --- a/xen/arch/ppc/include/asm/monitor.h +++ b/xen/arch/ppc/include/asm/monitor.h @@ -6,33 +6,7 @@ #include #include =20 -static inline -void arch_monitor_allow_userspace(struct domain *d, bool allow_userspace) -{ -} - -static inline -int arch_monitor_domctl_op(struct domain *d, struct xen_domctl_monitor_op = *mop) -{ - /* No arch-specific monitor ops on PPC. */ - return -EOPNOTSUPP; -} - -int arch_monitor_domctl_event(struct domain *d, - struct xen_domctl_monitor_op *mop); - -static inline -int arch_monitor_init_domain(struct domain *d) -{ - /* No arch-specific domain initialization on PPC. */ - return 0; -} - -static inline -void arch_monitor_cleanup_domain(struct domain *d) -{ - /* No arch-specific domain cleanup on PPC. */ -} +#include =20 static inline uint32_t arch_monitor_get_capabilities(struct domain *d) { diff --git a/xen/arch/ppc/stubs.c b/xen/arch/ppc/stubs.c index a96e45626d..da193839bd 100644 --- a/xen/arch/ppc/stubs.c +++ b/xen/arch/ppc/stubs.c @@ -95,14 +95,6 @@ void arch_get_domain_info(const struct domain *d, BUG_ON("unimplemented"); } =20 -/* monitor.c */ - -int arch_monitor_domctl_event(struct domain *d, - struct xen_domctl_monitor_op *mop) -{ - BUG_ON("unimplemented"); -} - /* smp.c */ =20 void arch_flush_tlb_mask(const cpumask_t *mask) diff --git a/xen/include/asm-generic/monitor.h b/xen/include/asm-generic/mo= nitor.h new file mode 100644 index 0000000000..1ade289099 --- /dev/null +++ b/xen/include/asm-generic/monitor.h @@ -0,0 +1,64 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * include/asm-generic/monitor.h + * + * Arch-specific monitor_op domctl handler. + * + * Copyright (c) 2015 Tamas K Lengyel (tamas@tklengyel.com) + * Copyright (c) 2016, Bitdefender S.R.L. + * + */ + +#ifndef __ASM_GENERIC_MONITOR_H__ +#define __ASM_GENERIC_MONITOR_H__ + +#include +#include + +struct domain; +struct xen_domctl_monitor_op; + +static inline +void arch_monitor_allow_userspace(struct domain *d, bool allow_userspace) +{ +} + +static inline +int arch_monitor_domctl_op(struct domain *d, struct xen_domctl_monitor_op = *mop) +{ + /* No arch-specific monitor ops on GENERIC. */ + return -EOPNOTSUPP; +} + +#ifndef HAS_ARCH_MONITOR_DOMCTL_EVENT +static inline +int arch_monitor_domctl_event(struct domain *d, + struct xen_domctl_monitor_op *mop) +{ + BUG_ON("unimplemented"); +} +#endif + +static inline +int arch_monitor_init_domain(struct domain *d) +{ + /* No arch-specific domain initialization on GENERIC. */ + return 0; +} + +static inline +void arch_monitor_cleanup_domain(struct domain *d) +{ + /* No arch-specific domain cleanup on GENERIC. */ +} + +#endif /* __ASM_GENERIC_MONITOR_H__ */ + +/* + * Local variables: + * mode: C + * c-file-style: BSD + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ --=20 2.43.0